diff --git a/ChangeLog b/ChangeLog index ecb24534..124704ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ - lazy read from tiled tiff from layers other than 0 was broken - optional args to vips_call*() do not work, disabled (fixed correctly in master) +- address calculations in files over 4gb were broken on 32-bit platforms + (broken since March 2011, oops) 12/10/11 started 7.26.6 - NOCACHE was not being set correctly on OS X causing performance diff --git a/libvips/include/vips/image.h b/libvips/include/vips/image.h index ff6b1805..f6087841 100644 --- a/libvips/include/vips/image.h +++ b/libvips/include/vips/image.h @@ -407,7 +407,7 @@ typedef struct _VipsImageClass { GType vips_image_get_type( void ); -extern const size_t vips__image_sizeof_bandformat[]; +extern const guint64 vips__image_sizeof_bandformat[]; /* Pixel address calculation macros. */ diff --git a/libvips/iofuncs/header.c b/libvips/iofuncs/header.c index e8ede8b3..a1003bff 100644 --- a/libvips/iofuncs/header.c +++ b/libvips/iofuncs/header.c @@ -189,8 +189,12 @@ static HeaderField old_double_field[] = { /* This is used by (eg.) VIPS_IMAGE_SIZEOF_ELEMENT() to calculate object * size. + * + * We can't use size_t or off_t because we have to work on some platforms + * which have these as 32-bit and we need to calculate addresses in large + * files. */ -const size_t vips__image_sizeof_bandformat[] = { +const guint64 vips__image_sizeof_bandformat[] = { sizeof( unsigned char ), /* VIPS_FORMAT_UCHAR */ sizeof( signed char ), /* VIPS_FORMAT_CHAR */ sizeof( unsigned short ), /* VIPS_FORMAT_USHORT */