-
-
Notifications
You must be signed in to change notification settings - Fork 921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Support for image compression #120
Comments
Hi @Aarbel, you can already reduce the size of images loaded via e.g. the following exports a JPEG blob with a quality of canvas.toBlob(callback, 'image/jpeg', 0.5); In browsers that support it, you can control the scaling algorithm used by the browser canvas implementation via the imageSmoothingEnabled and imageSmoothingQuality options for The library you linked to seems to use bilinear interpolation implemented in JavaScript for image scaling - as far as I know, browsers already use bilinear interpolation by default in their canvas So altogether I don't see a good reason to not rely on the browser-provided implementations. |
@blueimp thanks a lot for the detailed feedback. Do you think browsers like iOS Safari or Old Edge can support it ? Do i need particular polyfills to make it work ? |
The I'm also maintaining a polyfill for older browsers (e.g. IE) as well: |
Great, i will investigate and compare the two solutions |
With the information provided above, I assume you're fine with closing this? |
Closing as solved. |
@blueimp sorry didn't saw your comments. Possible to re-open this issue ? Standard browser image compression doesn't work well in many environments (WkWebview for example). Still using |
Hi @Aarbel, sorry for the late reply. |
@blueimp thanks a lot for your feedback, do you plan to provide this feature at some point ? Thanks a lot |
Libraries like https://www.npmjs.com/package/browser-image-resizer allow to compress drastically images client side (set maxWidth and maxHeight, but also reducing file size)
Is there a way to achieve that with blueimp-load-image ?
Thanks a for your help !
The text was updated successfully, but these errors were encountered: