Skip to content
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

Not working with png, should allow only jpg #42

Open
tomermes opened this issue Aug 20, 2016 · 4 comments
Open

Not working with png, should allow only jpg #42

tomermes opened this issue Aug 20, 2016 · 4 comments

Comments

@tomermes
Copy link

tomermes commented Aug 20, 2016

The compress function allows choosing mimetype, but when using png the images only get bigger.

@tomermes tomermes changed the title Not working in chrome due to chrome issue Not working with png, should allow only jpg Aug 20, 2016
@liltinkerer
Copy link

Indeed. PNG files just get bigger instead of compression. Tested on Chrome.

@skinTest
Copy link

in the demo page, the 2.7 mb after process will grow to 3.1 mb, which drives me crazy

@TheNicholasNick
Copy link

PNG needs an option to change its kind to PNG-8, usually good enough for screenshots, which is what I wanted to use this library for.

@hishosho
Copy link

canvas.toDataURL(type, encoderOptions): encoderOptions only can used to image/jpeg or image/webp. This is illustrated on the MDN.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants