brunobar79 / J-I-C

J I C is a Javascript Image Compressor using HTML5 Canvas & File API that allows you to compress your jpeg & png images before uploading to the server (100% client-side and no extra libraries required!)
http://makeitsolutions.com/labs/jic/
MIT License
857 stars 196 forks source link

Decleration target_img #44

Closed Isengo1989 closed 1 year ago

Isengo1989 commented 8 years ago

:54 Uncaught SyntaxError: Unexpected token .

target_img.src = jic.compress(file,quality,output_format).src;

brunobar79 commented 8 years ago

@Isengo1989 browser?

Isengo1989 commented 8 years ago

Chrome. But I got it working. My bad.

I got to compress it, but now I want to upload it, but leave that to my Controller in PHP. Can I simply just change the .src ?

brunobar79 commented 8 years ago

I don't understand what are you trying to do. Can you provide an example?

PHP's job is to process your upload. Compression & upload to the server happens on the JS side.

On Thu, Sep 15, 2016 at 6:33 PM, Isengo1989 notifications@github.com wrote:

Chrome. But I got it working. My bad.

I got to compress it, but now I want to upload it, but leave that to my Controller in PHP. Can I simply just change the .src ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brunobar79/J-I-C/issues/44#issuecomment-247473894, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMKWgFQBVEW4wxan6JJoS408XcWQ4wTks5qqce3gaJpZM4J-YtB .

Isengo1989 commented 8 years ago

I am trying to upload the File with the compressed data. I saw you are using upload.php - is it possible without that .php file?

Right now I upload it in my Controller with move_uploaded_file()

Want to use this in Framework and keep this as clean as possible.

brunobar79 commented 8 years ago

That's a server side script to process your upload. I've choosen PHP cause it's simple but you can use whatever you want. You will need some server side lang. to process your upload.

On Fri, Sep 16, 2016 at 1:34 AM, Isengo1989 notifications@github.com wrote:

I am trying to upload the File with the compressed data. I saw you are using upload.php - is it possible without that .php file?

Want to use this in Framework and keep this as clean as possible.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brunobar79/J-I-C/issues/44#issuecomment-247521777, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMKWrsaR4kQm6q20yLNmSRx17T-VYOhks5qqipPgaJpZM4J-YtB .

shahz5678 commented 7 years ago

@Isengo1989 i am getting the same error; :54 Uncaught SyntaxError: Unexpected token . target_img.src = jic.compress(file,quality,output_format).src; Also I am using Chrome. How did you resolve this issue?