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

TypeError: Cannot read property '0' of undefined #34

Open
joshmarinacci opened this issue Nov 16, 2014 · 3 comments
Open

TypeError: Cannot read property '0' of undefined #34

joshmarinacci opened this issue Nov 16, 2014 · 3 comments

Comments

@joshmarinacci
Copy link

I'm getting an error with some JPEGs that I created in Mac OS X Preview. Your test images work fine. The error is:

TypeError: Cannot read property '0' of undefined
at quantizeAndInverse (/Users/josh/projects/node-pureimage/src/jpg.js:367:61)
at buildComponentData (/Users/josh/projects/node-pureimage/src/jpg.js:528:9)
at Object.parse (/Users/josh/projects/node-pureimage/src/jpg.js:790:19)
at Object.decode (/Users/josh/projects/node-pureimage/src/jpg.js:986:11)
at Object. (/Users/josh/projects/node-pureimage/tests/images.js:15:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)

Any idea what would cause this? If I load my image and some test images into Preview I see that my image has a lot more metadata in it, but the basic format seems the same.

bird

@thorikawa
Copy link

I have the same issue. That's happens probably because jpgjs expect 'Start of Frame' section to appear after 'DQT' section in jpeg header, but it's not the case for some jpg files. I will send PR later on.

thorikawa added a commit to thorikawa/jpgjs that referenced this issue Feb 19, 2015
…rt of Frame' section appears before 'DQT' section in the header. notmasteryet#34
thorikawa added a commit to thorikawa/jpgjs that referenced this issue Feb 19, 2015
…rt of Frame' section appears before 'DQT' section in the header. notmasteryet#34
@SantyWang
Copy link

SantyWang commented Jan 15, 2019

@thorikawa Thanks to you, that PR resolves my problem.

@Cryptonewsmedia
Copy link

I'm getting an error with some JPEGs that I created in Mac OS X Preview. Your test images work fine. The error is:

TypeError: Cannot read property '0' of undefined
at quantizeAndInverse (/Users/josh/projects/node-pureimage/src/jpg.js:367:61)
at buildComponentData (/Users/josh/projects/node-pureimage/src/jpg.js:528:9)
at Object.parse (/Users/josh/projects/node-pureimage/src/jpg.js:790:19)
at Object.decode (/Users/josh/projects/node-pureimage/src/jpg.js:986:11)
at Object. (/Users/josh/projects/node-pureimage/tests/images.js:15:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)

Any idea what would cause this? If I load my image and some test images into Preview I see that my image has a lot more metadata in it, but the basic format seems the same.

bird

Not '0', but 'O', as representing circle

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