% July 1992 %
% %
% %
-% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
SetImageColorspace(image,CMYKColorspace,exception);
if (photometric == PHOTOMETRIC_CIELAB)
SetImageColorspace(image,LabColorspace,exception);
+ TIFFGetProfiles(tiff,image,exception);
+ TIFFGetProperties(tiff,image,exception);
+ option=GetImageOption(image_info,"tiff:exif-properties");
+ if (IfMagickTrue(IsStringNotFalse(option))) /* enabled by default */
+ TIFFGetEXIFProperties(tiff,image,exception);
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_SAMPLESPERPIXEL,
&samples_per_pixel);
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_RESOLUTIONUNIT,&units);
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_YRESOLUTION,&y_resolution);
image->resolution.x=x_resolution;
image->resolution.y=y_resolution;
- x_position=(float) MagickEpsilonReciprocal(x_resolution)*image->page.x;
- y_position=(float) MagickEpsilonReciprocal(y_resolution)*image->page.y;
+ x_position=(float) PerceptibleReciprocal(x_resolution)*image->page.x;
+ y_position=(float) PerceptibleReciprocal(y_resolution)*image->page.y;
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_XPOSITION,&x_position);
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_YPOSITION,&y_position);
image->page.x=(ssize_t) ceil(x_position*x_resolution-0.5);
sampling_factor,exception);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
"Sampling Factors: %s",sampling_factor);
- if ((samples_per_pixel > 1) && (photometric == PHOTOMETRIC_YCBCR))
- {
- (void) TIFFSetField(tiff,TIFFTAG_JPEGCOLORMODE,
- JPEGCOLORMODE_RGB);
- photometric=PHOTOMETRIC_RGB;
- }
}
#endif
break;
case COMPRESSION_ADOBE_DEFLATE: image->compression=ZipCompression; break;
default: image->compression=RLECompression; break;
}
- TIFFGetProfiles(tiff,image,exception);
- TIFFGetProperties(tiff,image,exception);
- option=GetImageOption(image_info,"tiff:exif-properties");
- if (IfMagickTrue(IsStringNotFalse(option))) /* enabled by default */
- TIFFGetEXIFProperties(tiff,image,exception);
/*
Allocate memory for the image and pixel buffer.
*/
}
if (image->storage_class == PseudoClass)
image->depth=GetImageDepth(image,exception);
- if ((photometric == PHOTOMETRIC_LOGL) ||
- (photometric == PHOTOMETRIC_MINISBLACK) ||
- (photometric == PHOTOMETRIC_MINISWHITE))
- {
- image->type=GrayscaleType;
- if (bits_per_sample == 1)
- image->type=BilevelType;
- }
/*
Proceed to next image.
*/
(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))
+ if ((image->page.x > 0) && (image->page.y > 0))
{
/*
Set image position.