(void) TIFFSetField(tiff,TIFFTAG_RESOLUTIONUNIT,(uint16) units);
(void) TIFFSetField(tiff,TIFFTAG_XRESOLUTION,image->resolution.x);
(void) TIFFSetField(tiff,TIFFTAG_YRESOLUTION,image->resolution.y);
- if (((image->page.x > 0) && (image->page.y >= 0)) ||
- ((image->page.y > 0) && (image->page.x >= 0)))
+ if ((image->page.x < 0) || (image->page.y < 0))
+ (void) ThrowMagickException(exception,GetMagickModule(),CoderError,
+ "TIFF: negative image positions unsupported","%s",image->filename);
+ if ((image->page.x > 0) && (image->resolution.x > 0.0))
+ {
+ /*
+ Set horizontal image position.
+ */
+ (void) TIFFSetField(tiff,TIFFTAG_XPOSITION,(float) image->page.x/
+ image->resolution.x);
+ }
+ if ((image->page.y > 0) && (image->resolution.y > 0.0))
{
/*
- Set image position.
+ Set vertical image position.
*/
- if (image->resolution.x != 0.0)
- (void) TIFFSetField(tiff,TIFFTAG_XPOSITION,(float) image->page.x/
- image->resolution.x);
- if (image->resolution.y != 0.0)
- (void) TIFFSetField(tiff,TIFFTAG_YPOSITION,(float) image->page.y/
- image->resolution.y);
+ (void) TIFFSetField(tiff,TIFFTAG_YPOSITION,(float) image->page.y/
+ image->resolution.y);
}
}
if (image->chromaticity.white_point.x != 0.0)