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

Crashes when decoding JPGs w/ sRGB IEC61966-2.1 color profile #5

Open
bvandenbos opened this issue Jun 8, 2017 · 7 comments
Open

Comments

@bvandenbos
Copy link

bvandenbos commented Jun 8, 2017

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:
3

@gchudnov
Copy link
Owner

gchudnov commented Jun 8, 2017

got it, thank you for the bug report. I'll look into it.

@dalisoft
Copy link

Same issue here

@gchudnov
Copy link
Owner

@dalisoft
do you have another example for an image?

@dalisoft
Copy link

dalisoft commented Feb 24, 2020

16_out

I used PNG from here

Steps do this:
If you have macOS, then you can do this by:

  1. Open any image with macOS built-in photo viewer
  2. Export image and select JPEG (select quality to High)

If you using Windows:

  1. Open any PNG image with Adobe Photoshop (you can use free trial if haven't purchased)
  2. After opening dialog will be be opened to select which color profile
  3. Select sRGB (... no matter specs number)

@dexo568
Copy link

dexo568 commented Sep 25, 2020

I also ran into this issue.
This was an issue with the underlying jpgJS library: notmasteryet/jpgjs#34
However, they seemed to have fixed it here: notmasteryet/jpgjs#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.

@gchudnov
Copy link
Owner

today started upgrading all underlying libraries, but might take some time..

@gchudnov
Copy link
Owner

gchudnov commented Oct 1, 2020

preliminary fix is here:
#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.

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

4 participants