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

This is a fatal error occured in decoding big image #25

Open
carbon-lab opened this issue Jan 13, 2021 · 10 comments
Open

This is a fatal error occured in decoding big image #25

carbon-lab opened this issue Jan 13, 2021 · 10 comments

Comments

@carbon-lab
Copy link

Error message:
Uncaught TypeError: Cannot read property 'length' of undefined at TIFFDecoder.readStripData (.../node_modules/tiff/lib/tiffDecoder.js:180:42) at TIFFDecoder.decodeImageData (.../node_modules/tiff/lib/tiffDecoder.js:151:22) at TIFFDecoder.decodeIFD (.../node_modules/tiff/lib/tiffDecoder.js:100:18) at TIFFDecoder.decode (.../node_modules/tiff/lib/tiffDecoder.js:54:30) at Object.decodeTIFF [as decode] (.../node_modules/tiff/lib/index.js:10:20)
This error appeared when I decode a very big image (21600 x 21600 px).

@carbon-lab
Copy link
Author

The error message is:
Uncaught TypeError: Cannot read property 'length' of undefined
at TIFFDecoder.readStripData (/root/Pictures/work/node_modules/tiff/lib/tiffDecoder.js:180:42)
at TIFFDecoder.decodeImageData (/root/Pictures/work/node_modules/tiff/lib/tiffDecoder.js:151:22)
at TIFFDecoder.decodeIFD (/root/Pictures/work/node_modules/tiff/lib/tiffDecoder.js:100:18)
at TIFFDecoder.decode (/root/Pictures/work/node_modules/tiff/lib/tiffDecoder.js:54:30)
at Object.decodeTIFF [as decode] (/root/Pictures/work/node_modules/tiff/lib/index.js:10:20)

@targos
Copy link
Member

targos commented Jan 13, 2021

Please provide us an image that triggers this error and we'll look into it.

@carbon-lab
Copy link
Author

I am so sorry about that. The image is not public at first and its size is 300MB+ so how to send it?

@targos
Copy link
Member

targos commented Jan 13, 2021

I'm asking because I tried with a 25000 x 25000 px image created with Photoshop (RGB with a color gradient, compressed with LZW). The image is >300MB and did not generate an error

@carbon-lab
Copy link
Author

Yes, you're right. I also test it by a image created by photoshop (8-bit grey color, uncompressed) and did not generate an error. May be that image file is not standard. But I can use python to open it...

@targos
Copy link
Member

targos commented Jan 13, 2021

If you cannot share it privately with me (my email address is public on my profile if you can send me a link), I can only suggest to try and debug on your side to understand why it errors.

@carbon-lab
Copy link
Author

That's a good idea! Now I have locate the error at tiff/lib/tiffDecoder.js:180:42. The stripOffsets.length is not defined. What is stripOffsets?

@carbon-lab
Copy link
Author

carbon-lab commented Jan 14, 2021

I have upload the image to this link. It's a TIFF file compressed by xz.
[Above link] https://cowtransfer.com/s/e5e04f122e0649

Please download it in 24 hours. Or it will be expired.

@targos
Copy link
Member

targos commented Jan 14, 2021

Thank you. We found why this image doesn't work. It's because the data is stored as tiles instead of strips. I found a small public image that can be used as a test case and will work on it. I cannot guarantee when that will happen though.

@carbon-lab
Copy link
Author

You're welcome! I am very fortunate to be able to help you. If there is any need for further help from me, please contact me. It is very meaningful to develop a convenient graphics library for node.js.

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

2 participants