Beyka / Android-TiffBitmapFactory

MIT License
131 stars 46 forks source link

there is a tif image make this crash #22

Closed y649950268 closed 7 years ago

y649950268 commented 7 years ago

tiffTest111.zip

I dont know why this picture cause crash ! can you give me some suggest?

Beyka commented 7 years ago

Hello. Will investigate this issue. I think that there is some issue in image and library could not handle it. Any way I'll do my best to fix this

Beyka commented 7 years ago

Fixed in version 0.9.7.6. Please use this version. Also, could you tell me what software you have used to create this image?

y649950268 commented 7 years ago

Thank you to fix it ! fax software on the Brother printer create this image! such a small size image. can you explain what happened?

Beyka commented 7 years ago

Your software creating image with COMPRESSION_CCITTRLE(CCITT modified Huffman RLE) compression scheme, but not writing TIFFTAG_BITSPERSAMPLE(bits per sample tif tag). If this tag is not 1, 4, 8 or 16 - library should show error, but for some reason calling of java method from C++ code that should show error in logcat leads to crash. Anyway in TIFF specifications TIFFTAG_BITSPERSAMPLE default is 1, so I just changed default value for this variable and changed showing of error in logcat. I believe that those fixes will help

y649950268 commented 7 years ago

Thank you~