Show HN: JavaScript image compressor
github.com
github.com
https://github.com/xkeshi/image-compressor/blob/master/src/i...
Imho the readme needs to state what the library actually does. E.g.
"This takes a user image from a file input, optionally resizes it, and returns a JPEG, PNG or WebP as a Blob, ready to upload."
<EOF>
(For very naive definitions of "optimal")
name: Fuckscape_d80352_5915762.jpg
type: image/jpeg
size: 19.14 KB
Output (compressed)
name: Fuckscape_d80352_5915762.jpg
type: image/jpeg
size: 20.64 KB (-7.85% off)
So your image-compressor actually adds 7.85% to the filesize? Maybe I don't understand the meaning of compression, but shouldn't it be smaller?
Input (original) name: the-northern-trifid-nebula-8499-1920x1200.jpg type: image/jpeg size: 737.26 KB
Output (compressed) name: the-northern-trifid-nebula-8499-1920x1200.jpg type: image/jpeg size: 263.17 KB (64.30% off)
I guess your original was more optimised than mine.
A tool like this should definitely check to make sure it has actually reduced the file size and, if not, just return the original with a note that it couldn't make any gains.