ImageMagick fails to load TIFF

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
ccampbell
Posts: 4
Joined: 2011-03-16T15:14:07-07:00
Authentication code: 8675308

ImageMagick fails to load TIFF

Post by ccampbell »

Hi all,

There seems to be a bug in the TIFF EXIF handling in ImageMagick 6.7.3-2. The TIFFGetEXIFProperties function holds the offset variable in a uint32, but the TIFF format seems to support up to 64 bits data.

From tiff.c...

Code: Select all

static void TIFFGetEXIFProperties(TIFF *tiff,Image *image)
{
  // ...
  uint32
    offset;
  // ...
  if (TIFFGetField(tiff,TIFFTAG_EXIFIFD,&offset) == 0)
    return;
  // ...
}
Now, where offset actually gets populated in tif_dir.c...

Code: Select all

static int _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
{
  // ...
  switch (fip->field_type) {
    // other cases...
    case TIFF_LONG8:
    case TIFF_IFD8:
      *va_arg(ap, uint64*) =
      *(uint64 *)val;
      ret_val = 1;
      break;
    // other cases...
  }
  // ...
}
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick fails to load TIFF

Post by magick »

BIGTIFF requires 8 bytes, classic TIFF only 4. We'll add a patch to ImageMagick within a day or two. Thanks.
ccampbell
Posts: 4
Joined: 2011-03-16T15:14:07-07:00
Authentication code: 8675308

Re: ImageMagick fails to load TIFF

Post by ccampbell »

Thanks! That fixed my problem.
Post Reply