Convert tiff file failed due to "InsufficientImageDataInFile"

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
long.to
Posts: 7
Joined: 2018-11-01T19:31:14-07:00
Authentication code: 1152

Convert tiff file failed due to "InsufficientImageDataInFile"

Post by long.to » 2018-11-01T20:32:17-07:00

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

User avatar
fmw42
Posts: 25561
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert tiff file failed due to "InsufficientImageDataInFile"

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

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.

long.to
Posts: 7
Joined: 2018-11-01T19:31:14-07:00
Authentication code: 1152

Re: Convert tiff file failed due to "InsufficientImageDataInFile"

Post by long.to » 2018-11-01T23:21:02-07:00

@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.

User avatar
fmw42
Posts: 25561
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert tiff file failed due to "InsufficientImageDataInFile"

Post by fmw42 » 2018-11-02T09:31:42-07:00

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

Post Reply