Page 1 of 1

Convert tiff file failed due to "InsufficientImageDataInFile"

Posted: 2018-11-01T20:32:17-07:00
by long.to
Hi,

I have a tiff file store at google drive: https://drive.google.com/file/d/1TOZu9l ... sp=sharing
I tried to convert this file from "tiff" to "tiff".
And I get the exception: InsufficientImageDataInFile

As I debug, TIFFScanlineSize(tiff) is 213 and GetBlobSize(image) is 186, so it throws the exception:
if(((MagickSizeType)TIFFScanlineSize(tiff)) > GetBlobSize(image))
ThrowTIFFException(CorruptImageError, "InsufficientImageDataInFile");
The problem is I don't understand why this check happens? My file seems fine:
tiffinfo.exe 199712.tiff
TIFF Directory at offset 0x3c (60)
Image Width: 1704 Image Length: 11
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-black
Orientation: row 0 top, col 0 lhs
Rows/Strip: 11
Planar Configuration: single image plane
Thanks

Re: Convert tiff file failed due to "InsufficientImageDataInFile"

Posted: 2018-11-01T22:20:57-07:00
by fmw42

Code: Select all

identify -verbose 199712.tiff
identify: insufficient image data in file `199712.tiff' @ error/tiff.c/ReadTIFFImage/1651.

In Photoshop, your file is type bitmap, which I believe means type bilevel in ImageMagick terms (with Group 4 compression). I changed the format to type grayscale in Photoshop and saved that and it works fine. Also I note a message when I open your file in photoshop "Pixel aspect ratio conversion is for preview purposed only. Turn it off for maximum image quality." So perhaps the pixel aspect ratio is an issue.


But I am not an expert on this situation. So I will defer to the Im developers for further information.

Re: Convert tiff file failed due to "InsufficientImageDataInFile"

Posted: 2018-11-01T23:21:02-07:00
by long.to
@fmw42

Thanks for your response. But when you change the format to grayscale, the size will increase and it will be > TIFFScanlineSize(tiff).
So it will passed.

My concern is what's wrong with my original file that cause the exception?
Please help me check with the developers.
Thanks.

Re: Convert tiff file failed due to "InsufficientImageDataInFile"

Posted: 2018-11-02T09:31:42-07:00
by fmw42
Post a new topic in the bugs forum and link it to this topic. Or post a issue to https://github.com/ImageMagick/ImageMagick/issues