J-I-C icon indicating copy to clipboard operation
J-I-C copied to clipboard

Not working with png, should allow only jpg

Open tomermes opened this issue 9 years ago • 4 comments

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

tomermes avatar Aug 20 '16 20:08 tomermes

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

liltinkerer avatar Oct 05 '16 12:10 liltinkerer

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

skinTest avatar Nov 30 '16 11:11 skinTest

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.

TheNicholasNick avatar Dec 15 '16 11:12 TheNicholasNick

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

hishosho avatar Jan 11 '18 06:01 hishosho