Adjust image quality before upload
I'm tryin开发者_开发知识库g to downsize an image quality before it is sent to the PHP script and uploaded. Is this possible? If so would I be able to do it in Javascript?
It could probably done with the new HTML5 file APIs, but this isn't supported by all browsers (far from it). Using PHP after the upload is the only real way here.
If you want to try doing it with HTML5:
- http://hacks.mozilla.org/2011/01/how-to-develop-a-html5-image-uploader/
- https://developer.mozilla.org/en/Using_files_from_web_applications
- http://www.w3.org/TR/FileAPI/
It could be possible by using the new Javascript function introduced with HTML5, but as HTML5 isn't supported by every browser and it's still under development, there is no way you can do this by using Javascript.
A Java applet could be an option if you can rely on a installed Java runtime on your customers client (intranet, etc.)
精彩评论