Open joshmarinacci opened 9 years ago
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 Thanks to you, that PR resolves my problem.
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.
Not '0', but 'O', as representing circle
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.