fix pixel addressing on 32-bit platforms

there was a size_t where there should have been a guint64, causing
addressing problems on very large images on 32-bit platforms (like
win32)

looks like this had been broken since March 2011
This commit is contained in:
John Cupitt 2011-12-08 21:38:07 +00:00
parent 7adddf7074
commit a43241a4e7
3 changed files with 8 additions and 2 deletions

View File

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

View File

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

View File

@ -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 */