ImageMagick/ImageMagick-6.6.1.0-units.patch

56 lines
1.8 KiB
Diff

Index: ImageMagick-6.6.1-0/magick/image.c
===================================================================
--- ImageMagick-6.6.1-0.orig/magick/image.c
+++ ImageMagick-6.6.1-0/magick/image.c
@@ -3959,6 +3959,9 @@ MagickExport MagickBooleanType SyncImage
MagickStatusType
flags;
+ ResolutionType
+ units;
+
/*
Sync image options.
*/
@@ -4150,16 +4153,18 @@ MagickExport MagickBooleanType SyncImage
option);
option=GetImageOption(image_info,"units");
if (option != (const char *) NULL)
- image->units=(ResolutionType) ParseMagickOption(MagickResolutionOptions,
+ units=(ResolutionType) ParseMagickOption(MagickResolutionOptions,
MagickFalse,option);
- if (image_info->units != UndefinedResolution)
+ else
+ units = image_info->units;
+ if (units != UndefinedResolution)
{
- if (image->units != image_info->units)
+ if (image->units != units)
switch (image->units)
{
case PixelsPerInchResolution:
{
- if (image_info->units == PixelsPerCentimeterResolution)
+ if (units == PixelsPerCentimeterResolution)
{
image->x_resolution/=2.54;
image->y_resolution/=2.54;
@@ -4168,7 +4173,7 @@ MagickExport MagickBooleanType SyncImage
}
case PixelsPerCentimeterResolution:
{
- if (image_info->units == PixelsPerInchResolution)
+ if (units == PixelsPerInchResolution)
{
image->x_resolution*=2.54;
image->y_resolution*=2.54;
@@ -4178,7 +4183,7 @@ MagickExport MagickBooleanType SyncImage
default:
break;
}
- image->units=image_info->units;
+ image->units=units;
}
option=GetImageOption(image_info,"white-point");
if (option != (const char *) NULL)