Uploadify and Image Compression

妖精的绣舞 提交于 2019-11-30 00:37:24

问题


I am using Uploadify on one of my client's web sites to allow them to upload a large amount of pictures at once to their photo gallery.

I am seeing issues lately. They seem to upload large photographs (3 MB and above). I am wondering, is it possible to compress (reduce their size) on the client side, instead of doing it on the server (just like facebook does it). I know I could easily do it on the server, but I am working on another project right now, where I am expecting a large flow of photo uploads. It would require significant amount of CPU time to process them all. So I thought, I'd ask about the client side processing.

Thanks.


回答1:


You won't be able to compress JPG images much using zip or similar algorithms - they are already close to optimum in themselves. You'd have to resize them on client side. For that, see e.g.

  • Image resize before upload

  • jquery + flash: looking for plugin that resize images before upload

  • Image resizing client-side with javascript before upload to the server




回答2:


Image resize is not the same as image compression.

Difference between resize and compression:

When you compress you get an image with same dimensions at lower quality.
When you resize you are getting same quality at different dimensions.


Anyway, I developed a javascript library called JIC to solve that problem. It allows you to compress jpg and png on the client side 100% with javascript and no external libraries required!

You can try the demo here : http://makeitsolutions.com/labs/jic and get the sources here : https://github.com/brunobar79/J-I-C

Hope you like it.




回答3:


Yes is possibly since its FLASH(client side manipulating). Check this post http://perfectwebtutorials.com/2012/image-resize-before-upload-uploadify/



来源:https://stackoverflow.com/questions/4579193/uploadify-and-image-compression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!