inkjet
inkjet copied to clipboard
Crashes when decoding JPGs w/ sRGB IEC61966-2.1 color profile
At least the color profile seems to be the consistent factor. May also be true for other profiles. I can decode JPGs w/out a profile just fine.
Stack trace:
TypeError: Cannot read property '0' of undefined
at quantizeAndInverse (jpg.js:448)
at buildComponentData (jpg.js:586)
at constructor.parse (jpg.js:820)
at JpegImage.parse (jpg.js:68)
Example image:
got it, thank you for the bug report. I'll look into it.
Same issue here
@dalisoft do you have another example for an image?
I used PNG from here
Steps do this: If you have macOS, then you can do this by:
- Open any image with macOS built-in photo viewer
- Export image and select JPEG (select quality to High)
If you using Windows:
- Open any PNG image with Adobe Photoshop (you can use free trial if haven't purchased)
- After opening dialog will be be opened to select which color profile
- Select sRGB (... no matter specs number)
I also ran into this issue. This was an issue with the underlying jpgJS library: https://github.com/notmasteryet/jpgjs/issues/34 However, they seemed to have fixed it here: https://github.com/notmasteryet/jpgjs/pull/36 I solved the problem by just using the current version of jpgjs directly rather than Inkjet, but I suspect this library could be fixed by simply updating the jpg.js file to a more current version.
today started upgrading all underlying libraries, but might take some time..
preliminary fix is here:
https://github.com/gchudnov/inkjet/pull/7
released as 3.0.0-rc0
.
if used in node.js:
require('inkjet').default
should be used. will revert back to require('inkjet')
in rc1.