Page 1 of 1

ImageMagick fails to load TIFF

Posted: 2011-10-28T16:27:29-07:00
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...
  }
  // ...
}

Re: ImageMagick fails to load TIFF

Posted: 2011-10-28T17:02:34-07:00
by magick
BIGTIFF requires 8 bytes, classic TIFF only 4. We'll add a patch to ImageMagick within a day or two. Thanks.

Re: ImageMagick fails to load TIFF

Posted: 2011-11-07T08:15:53-07:00
by ccampbell
Thanks! That fixed my problem.