diff --git a/coders/bmp.c b/coders/bmp.c
index 509738c..65cc810 100644
--- a/coders/bmp.c
+++ b/coders/bmp.c
@@ -929,8 +929,8 @@
/*
Initialize image structure.
*/
- image->x_resolution=(double) bmp_info.x_pixels/100.0;
- image->y_resolution=(double) bmp_info.y_pixels/100.0;
+ image->resolution.x=(double) bmp_info.x_pixels/100.0;
+ image->resolution.y=(double) bmp_info.y_pixels/100.0;
image->units=PixelsPerCentimeterResolution;
/*
Convert BMP raster image to pixel packets.
@@ -1611,14 +1611,14 @@
case UndefinedResolution:
case PixelsPerInchResolution:
{
- bmp_info.x_pixels=(unsigned int) (100.0*image->x_resolution/2.54);
- bmp_info.y_pixels=(unsigned int) (100.0*image->y_resolution/2.54);
+ bmp_info.x_pixels=(unsigned int) (100.0*image->resolution.x/2.54);
+ bmp_info.y_pixels=(unsigned int) (100.0*image->resolution.y/2.54);
break;
}
case PixelsPerCentimeterResolution:
{
- bmp_info.x_pixels=(unsigned int) (100.0*image->x_resolution);
- bmp_info.y_pixels=(unsigned int) (100.0*image->y_resolution);
+ bmp_info.x_pixels=(unsigned int) (100.0*image->resolution.x);
+ bmp_info.y_pixels=(unsigned int) (100.0*image->resolution.y);
break;
}
}
diff --git a/coders/dib.c b/coders/dib.c
index 9c6ca4c..55bbe67 100644
--- a/coders/dib.c
+++ b/coders/dib.c
@@ -632,8 +632,8 @@
Initialize image structure.
*/
image->units=PixelsPerCentimeterResolution;
- image->x_resolution=(double) dib_info.x_pixels/100.0;
- image->y_resolution=(double) dib_info.y_pixels/100.0;
+ image->resolution.x=(double) dib_info.x_pixels/100.0;
+ image->resolution.y=(double) dib_info.y_pixels/100.0;
/*
Convert DIB raster image to pixel packets.
*/
@@ -1048,14 +1048,14 @@
case UndefinedResolution:
case PixelsPerInchResolution:
{
- dib_info.x_pixels=(size_t) (100.0*image->x_resolution/2.54);
- dib_info.y_pixels=(size_t) (100.0*image->y_resolution/2.54);
+ dib_info.x_pixels=(size_t) (100.0*image->resolution.x/2.54);
+ dib_info.y_pixels=(size_t) (100.0*image->resolution.y/2.54);
break;
}
case PixelsPerCentimeterResolution:
{
- dib_info.x_pixels=(size_t) (100.0*image->x_resolution);
- dib_info.y_pixels=(size_t) (100.0*image->y_resolution);
+ dib_info.x_pixels=(size_t) (100.0*image->resolution.x);
+ dib_info.y_pixels=(size_t) (100.0*image->resolution.y);
break;
}
}
diff --git a/coders/djvu.c b/coders/djvu.c
index 34f6aef..3971b9f 100644
--- a/coders/djvu.c
+++ b/coders/djvu.c
@@ -613,8 +613,8 @@
ddjvu_document_get_pageinfo(lc->document, pagenum, &info);
- image->x_resolution = (float) info.dpi;
- image->y_resolution =(float) info.dpi;
+ image->resolution.x = (float) info.dpi;
+ image->resolution.y =(float) info.dpi;
if (image_info->density != (char *) NULL)
{
int
@@ -627,13 +627,13 @@
Set rendering resolution.
*/
flags=ParseGeometry(image_info->density,&geometry_info);
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- image->y_resolution=image->x_resolution;
- info.width*=image->x_resolution/info.dpi;
- info.height*=image->y_resolution/info.dpi;
- info.dpi=(ssize_t) MagickMax(image->x_resolution,image->y_resolution);
+ image->resolution.y=image->resolution.x;
+ info.width*=image->resolution.x/info.dpi;
+ info.height*=image->resolution.y/info.dpi;
+ info.dpi=(ssize_t) MagickMax(image->resolution.x,image->resolution.y);
}
type = ddjvu_page_get_type(lc->page);
diff --git a/coders/dps.c b/coders/dps.c
index ce11ba0..ce6e2fa 100644
--- a/coders/dps.c
+++ b/coders/dps.c
@@ -218,8 +218,8 @@
*/
screen=ScreenOfDisplay(display,visual_info->screen);
pixels_per_point=XDPSPixelsPerPoint(screen);
- if ((image->x_resolution != 0.0) && (image->y_resolution != 0.0))
- pixels_per_point=MagickMin(image->x_resolution,image->y_resolution)/
+ if ((image->resolution.x != 0.0) && (image->resolution.y != 0.0))
+ pixels_per_point=MagickMin(image->resolution.x,image->resolution.y)/
DefaultResolution;
status=XDPSCreatePixmapForEPSF((DPSContext) NULL,screen,
GetBlobFileHandle(image),visual_info->depth,pixels_per_point,&pixmap,
diff --git a/coders/emf.c b/coders/emf.c
index 70fb875..e2a6bec 100644
--- a/coders/emf.c
+++ b/coders/emf.c
@@ -479,15 +479,15 @@
y_resolution=DefaultResolution;
x_resolution=DefaultResolution;
- if (image->y_resolution > 0)
+ if (image->resolution.y > 0)
{
- y_resolution=image->y_resolution;
+ y_resolution=image->resolution.y;
if (image->units == PixelsPerCentimeterResolution)
y_resolution*=CENTIMETERS_INCH;
}
- if (image->x_resolution > 0)
+ if (image->resolution.x > 0)
{
- x_resolution=image->x_resolution;
+ x_resolution=image->resolution.x;
if (image->units == PixelsPerCentimeterResolution)
x_resolution*=CENTIMETERS_INCH;
}
@@ -526,22 +526,22 @@
{
flags=ParseMetaGeometry(geometry,&sans,&sans,&image->columns,
&image->rows);
- if (image->x_resolution != 0.0)
- image->columns=(size_t) floor((image->columns*image->x_resolution)+
+ if (image->resolution.x != 0.0)
+ image->columns=(size_t) floor((image->columns*image->resolution.x)+
0.5);
- if (image->y_resolution != 0.0)
- image->rows=(size_t) floor((image->rows*image->y_resolution)+0.5);
+ if (image->resolution.y != 0.0)
+ image->rows=(size_t) floor((image->rows*image->resolution.y)+0.5);
}
else
{
*p='\0';
flags=ParseMetaGeometry(geometry,&sans,&sans,&image->columns,
&image->rows);
- if (image->x_resolution != 0.0)
- image->columns=(size_t) floor(((image->columns*image->x_resolution)/
+ if (image->resolution.x != 0.0)
+ image->columns=(size_t) floor(((image->columns*image->resolution.x)/
DefaultResolution)+0.5);
- if (image->y_resolution != 0.0)
- image->rows=(size_t) floor(((image->rows*image->y_resolution)/
+ if (image->resolution.y != 0.0)
+ image->rows=(size_t) floor(((image->rows*image->resolution.y)/
DefaultResolution)+0.5);
}
geometry=DestroyString(geometry);
diff --git a/coders/icon.c b/coders/icon.c
index 98de3b7..82006cb 100644
--- a/coders/icon.c
+++ b/coders/icon.c
@@ -976,14 +976,14 @@
case UndefinedResolution:
case PixelsPerInchResolution:
{
- icon_info.x_pixels=(size_t) (100.0*next->x_resolution/2.54);
- icon_info.y_pixels=(size_t) (100.0*next->y_resolution/2.54);
+ icon_info.x_pixels=(size_t) (100.0*next->resolution.x/2.54);
+ icon_info.y_pixels=(size_t) (100.0*next->resolution.y/2.54);
break;
}
case PixelsPerCentimeterResolution:
{
- icon_info.x_pixels=(size_t) (100.0*next->x_resolution);
- icon_info.y_pixels=(size_t) (100.0*next->y_resolution);
+ icon_info.x_pixels=(size_t) (100.0*next->resolution.x);
+ icon_info.y_pixels=(size_t) (100.0*next->resolution.y);
break;
}
}
diff --git a/coders/ipl.c b/coders/ipl.c
index 5a78283..d143841 100644
--- a/coders/ipl.c
+++ b/coders/ipl.c
@@ -165,8 +165,8 @@
image->columns = ipl->width;
image->rows = ipl->height;
image->depth = ipl->depth;
- image->x_resolution = 1;
- image->y_resolution = 1;
+ image->resolution.x = 1;
+ image->resolution.y = 1;
}
diff --git a/coders/jbig.c b/coders/jbig.c
index 4faf712..751a6f1 100644
--- a/coders/jbig.c
+++ b/coders/jbig.c
@@ -206,8 +206,8 @@
image->colormap[1].red=QuantumRange;
image->colormap[1].green=QuantumRange;
image->colormap[1].blue=QuantumRange;
- image->x_resolution=300;
- image->y_resolution=300;
+ image->resolution.x=300;
+ image->resolution.y=300;
if (image_info->ping != MagickFalse)
{
(void) CloseBlob(image);
diff --git a/coders/jpeg.c b/coders/jpeg.c
index 5489429..ece1a9a 100644
--- a/coders/jpeg.c
+++ b/coders/jpeg.c
@@ -1059,8 +1059,8 @@
if ((jpeg_info.saw_JFIF_marker != 0) && (jpeg_info.X_density != 1) &&
(jpeg_info.Y_density != 1))
{
- image->x_resolution=(double) jpeg_info.X_density;
- image->y_resolution=(double) jpeg_info.Y_density;
+ image->resolution.x=(double) jpeg_info.X_density;
+ image->resolution.y=(double) jpeg_info.Y_density;
units=(size_t) jpeg_info.density_unit;
}
if (units == 1)
@@ -1879,16 +1879,16 @@
jpeg_info.density_unit=(UINT8) 1;
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- "Image resolution: %.20g,%.20g",floor(image->x_resolution+0.5),
- floor(image->y_resolution+0.5));
- if ((image->x_resolution != 0.0) && (image->y_resolution != 0.0))
+ "Image resolution: %.20g,%.20g",floor(image->resolution.x+0.5),
+ floor(image->resolution.y+0.5));
+ if ((image->resolution.x != 0.0) && (image->resolution.y != 0.0))
{
/*
Set image resolution.
*/
jpeg_info.write_JFIF_header=MagickTrue;
- jpeg_info.X_density=(UINT16) floor(image->x_resolution+0.5);
- jpeg_info.Y_density=(UINT16) floor(image->y_resolution+0.5);
+ jpeg_info.X_density=(UINT16) floor(image->resolution.x+0.5);
+ jpeg_info.Y_density=(UINT16) floor(image->resolution.y+0.5);
if (image->units == PixelsPerInchResolution)
jpeg_info.density_unit=(UINT8) 1;
if (image->units == PixelsPerCentimeterResolution)
diff --git a/coders/miff.c b/coders/miff.c
index 6e4a2a1..d0f4ed2 100644
--- a/coders/miff.c
+++ b/coders/miff.c
@@ -925,10 +925,10 @@
if (LocaleCompare(keyword,"resolution") == 0)
{
flags=ParseGeometry(options,&geometry_info);
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- image->y_resolution=image->x_resolution;
+ image->resolution.y=image->resolution.x;
break;
}
if (LocaleCompare(keyword,"rows") == 0)
@@ -1988,10 +1988,10 @@
CommandOptionToMnemonic(MagickResolutionOptions,image->units));
(void) WriteBlobString(image,buffer);
}
- if ((image->x_resolution != 0) || (image->y_resolution != 0))
+ if ((image->resolution.x != 0) || (image->resolution.y != 0))
{
(void) FormatLocaleString(buffer,MaxTextExtent,
- "resolution=%gx%g\n",image->x_resolution,image->y_resolution);
+ "resolution=%gx%g\n",image->resolution.x,image->resolution.y);
(void) WriteBlobString(image,buffer);
}
if ((image->page.width != 0) || (image->page.height != 0))
diff --git a/coders/mpc.c b/coders/mpc.c
index 6cbf2ce..628eb5f 100644
--- a/coders/mpc.c
+++ b/coders/mpc.c
@@ -633,10 +633,10 @@
if (LocaleCompare(keyword,"resolution") == 0)
{
flags=ParseGeometry(options,&geometry_info);
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- image->y_resolution=image->x_resolution;
+ image->resolution.y=image->resolution.x;
break;
}
if (LocaleCompare(keyword,"rows") == 0)
@@ -1128,10 +1128,10 @@
CommandOptionToMnemonic(MagickResolutionOptions,image->units));
(void) WriteBlobString(image,buffer);
}
- if ((image->x_resolution != 0) || (image->y_resolution != 0))
+ if ((image->resolution.x != 0) || (image->resolution.y != 0))
{
(void) FormatLocaleString(buffer,MaxTextExtent,
- "resolution=%gx%g\n",image->x_resolution,image->y_resolution);
+ "resolution=%gx%g\n",image->resolution.x,image->resolution.y);
(void) WriteBlobString(image,buffer);
}
if ((image->page.width != 0) || (image->page.height != 0))
diff --git a/coders/msl.c b/coders/msl.c
index c5baf69..c540367 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -5351,11 +5351,11 @@
if (msl_info->image[n]->units == PixelsPerCentimeterResolution)
factor=2.54;
width=(size_t) (x_resolution*msl_info->image[n]->columns/
- (factor*(msl_info->image[n]->x_resolution == 0.0 ? DefaultResolution :
- msl_info->image[n]->x_resolution))+0.5);
+ (factor*(msl_info->image[n]->resolution.x == 0.0 ? DefaultResolution :
+ msl_info->image[n]->resolution.x))+0.5);
height=(size_t) (y_resolution*msl_info->image[n]->rows/
- (factor*(msl_info->image[n]->y_resolution == 0.0 ? DefaultResolution :
- msl_info->image[n]->y_resolution))+0.5);
+ (factor*(msl_info->image[n]->resolution.y == 0.0 ? DefaultResolution :
+ msl_info->image[n]->resolution.y))+0.5);
resample_image=ResizeImage(msl_info->image[n],width,height,
msl_info->image[n]->filter,msl_info->image[n]->blur,
msl_info->exception);
@@ -6094,11 +6094,11 @@
if (LocaleCompare(keyword,"density") == 0)
{
flags=ParseGeometry(value,&geometry_info);
- msl_info->image[n]->x_resolution=geometry_info.rho;
- msl_info->image[n]->y_resolution=geometry_info.sigma;
+ msl_info->image[n]->resolution.x=geometry_info.rho;
+ msl_info->image[n]->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- msl_info->image[n]->y_resolution=
- msl_info->image[n]->x_resolution;
+ msl_info->image[n]->resolution.y=
+ msl_info->image[n]->resolution.x;
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
diff --git a/coders/mvg.c b/coders/mvg.c
index dcf27c3..cf0263c 100644
--- a/coders/mvg.c
+++ b/coders/mvg.c
@@ -183,9 +183,9 @@
if ((image->columns == 0) || (image->rows == 0))
ThrowReaderException(OptionError,"MustSpecifyImageSize");
draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
- draw_info->affine.sx=image->x_resolution == 0.0 ? 1.0 : image->x_resolution/
+ draw_info->affine.sx=image->resolution.x == 0.0 ? 1.0 : image->resolution.x/
DefaultResolution;
- draw_info->affine.sy=image->y_resolution == 0.0 ? 1.0 : image->y_resolution/
+ draw_info->affine.sy=image->resolution.y == 0.0 ? 1.0 : image->resolution.y/
DefaultResolution;
image->columns=(size_t) (draw_info->affine.sx*image->columns);
image->rows=(size_t) (draw_info->affine.sy*image->rows);
diff --git a/coders/pango.c b/coders/pango.c
index 506fd84..87fc6c1 100644
--- a/coders/pango.c
+++ b/coders/pango.c
@@ -107,9 +107,6 @@
Image
*image;
- MagickBooleanType
- status;
-
PangoContext
*context;
@@ -154,7 +151,7 @@
*/
fontmap=(PangoFontMap *) pango_ft2_font_map_new();
pango_ft2_font_map_set_resolution((PangoFT2FontMap *) fontmap,
- image->x_resolution,image->y_resolution);
+ image->resolution.x,image->resolution.y);
pango_ft2_font_map_set_default_substitute((PangoFT2FontMap *) fontmap,NULL,
NULL,NULL);
context=pango_font_map_create_context(fontmap);
@@ -162,7 +159,11 @@
Render caption.
*/
layout=pango_layout_new(context);
- description=pango_font_description_from_string("Arial,20");
+ draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
+ description=pango_font_description_from_string(draw_info->font ==
+ (char *) NULL ? "helvetica" : draw_info->font);
+ pango_font_description_set_size(description,PANGO_SCALE*
+ draw_info->pointsize);
pango_layout_set_font_description(layout,description);
pango_font_description_free(description);
property=InterpretImageProperties(image_info,image,image_info->filename,
@@ -172,12 +173,18 @@
caption=ConstantString(GetImageProperty(image,"caption",exception));
pango_layout_set_text(layout,caption,-1);
pango_layout_context_changed(layout);
- if (image->columns == 0)
+ if (image->columns != 0)
+ pango_layout_set_width(layout,(PANGO_SCALE*image->columns*
+ image->resolution.x+36.0)/72.0);
+ else
{
pango_layout_get_pixel_extents(layout,NULL,&extent);
image->columns=extent.x+extent.width;
}
- if (image->rows == 0)
+ if (image->rows != 0)
+ pango_layout_set_height(layout,(PANGO_SCALE*image->columns*
+ image->resolution.x+36.0)/72.0);
+ else
{
pango_layout_get_pixel_extents(layout,NULL,&extent);
image->rows=extent.y+extent.height;
@@ -187,7 +194,10 @@
*/
canvas=(FT_Bitmap *) AcquireMagickMemory(sizeof(*canvas));
if (canvas == (FT_Bitmap *) NULL)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ draw_info=DestroyDrawInfo(draw_info);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
canvas->width=image->columns;
canvas->pitch=(canvas->width+3) & ~3;
canvas->rows=image->rows;
@@ -195,26 +205,26 @@
canvas->rows*sizeof(*canvas->buffer));
if (canvas->buffer == (unsigned char *) NULL)
{
+ draw_info=DestroyDrawInfo(draw_info);
canvas=(FT_Bitmap *) RelinquishMagickMemory(canvas);
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
canvas->num_grays=256;
canvas->pixel_mode=ft_pixel_mode_grays;
ResetMagickMemory(canvas->buffer,0x00,canvas->pitch*canvas->rows);
- /* wrapping: pango_layout_set_width(layout,72*image->columns); */
pango_ft2_render_layout(canvas,layout,0,0);
/*
Convert caption to image.
*/
if (SetImageBackgroundColor(image,exception) == MagickFalse)
{
+ draw_info=DestroyDrawInfo(draw_info);
canvas->buffer=(unsigned char *) RelinquishMagickMemory(canvas->buffer);
canvas=(FT_Bitmap *) RelinquishMagickMemory(canvas);
caption=DestroyString(caption);
image=DestroyImageList(image);
return((Image *) NULL);
}
- draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
GetPixelInfo(image,&fill_color);
p=canvas->buffer;
for (y=0; y < (ssize_t) image->rows; y++)
diff --git a/coders/pcl.c b/coders/pcl.c
index 6a36b2b..7d4f602 100644
--- a/coders/pcl.c
+++ b/coders/pcl.c
@@ -227,7 +227,7 @@
*/
delta.x=DefaultResolution;
delta.y=DefaultResolution;
- if ((image->x_resolution == 0.0) || (image->y_resolution == 0.0))
+ if ((image->resolution.x == 0.0) || (image->resolution.y == 0.0))
{
GeometryInfo
geometry_info;
@@ -236,10 +236,10 @@
flags;
flags=ParseGeometry(PSDensityGeometry,&geometry_info);
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- image->y_resolution=image->x_resolution;
+ image->resolution.y=image->resolution.x;
}
/*
Determine page geometry from the PCL media box.
@@ -328,9 +328,9 @@
if (image_info->page != (char *) NULL)
(void) ParseAbsoluteGeometry(image_info->page,&page);
(void) FormatLocaleString(density,MaxTextExtent,"%gx%g",
- image->x_resolution,image->y_resolution);
- page.width=(size_t) floor(page.width*image->x_resolution/delta.x+0.5);
- page.height=(size_t) floor(page.height*image->y_resolution/delta.y+
+ image->resolution.x,image->resolution.y);
+ page.width=(size_t) floor(page.width*image->resolution.x/delta.x+0.5);
+ page.height=(size_t) floor(page.height*image->resolution.y/delta.y+
0.5);
(void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
page.width,(double) page.height);
diff --git a/coders/pcx.c b/coders/pcx.c
index 712d9e0..b6f7eeb 100644
--- a/coders/pcx.c
+++ b/coders/pcx.c
@@ -347,8 +347,8 @@
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
image->depth=pcx_info.bits_per_pixel <= 8 ? 8U : MAGICKCORE_QUANTUM_DEPTH;
image->units=PixelsPerInchResolution;
- image->x_resolution=(double) pcx_info.horizontal_resolution;
- image->y_resolution=(double) pcx_info.vertical_resolution;
+ image->resolution.x=(double) pcx_info.horizontal_resolution;
+ image->resolution.y=(double) pcx_info.vertical_resolution;
image->colors=16;
pcx_colormap=(unsigned char *) AcquireQuantumMemory(256UL,
3*sizeof(*pcx_colormap));
@@ -922,16 +922,16 @@
case PixelsPerInchResolution:
default:
{
- pcx_info.horizontal_resolution=(unsigned short) image->x_resolution;
- pcx_info.vertical_resolution=(unsigned short) image->y_resolution;
+ pcx_info.horizontal_resolution=(unsigned short) image->resolution.x;
+ pcx_info.vertical_resolution=(unsigned short) image->resolution.y;
break;
}
case PixelsPerCentimeterResolution:
{
pcx_info.horizontal_resolution=(unsigned short)
- (2.54*image->x_resolution+0.5);
+ (2.54*image->resolution.x+0.5);
pcx_info.vertical_resolution=(unsigned short)
- (2.54*image->y_resolution+0.5);
+ (2.54*image->resolution.y+0.5);
break;
}
}
diff --git a/coders/pdf.c b/coders/pdf.c
index d14ea54..435a525 100644
--- a/coders/pdf.c
+++ b/coders/pdf.c
@@ -397,13 +397,13 @@
*/
delta.x=DefaultResolution;
delta.y=DefaultResolution;
- if ((image->x_resolution == 0.0) || (image->y_resolution == 0.0))
+ if ((image->resolution.x == 0.0) || (image->resolution.y == 0.0))
{
flags=ParseGeometry(PSDensityGeometry,&geometry_info);
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- image->y_resolution=image->x_resolution;
+ image->resolution.y=image->resolution.x;
}
/*
Determine page geometry from the PDF media box.
@@ -585,19 +585,19 @@
if (image_info->density != (char *) NULL)
{
flags=ParseGeometry(image_info->density,&geometry_info);
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- image->y_resolution=image->x_resolution;
+ image->resolution.y=image->resolution.x;
}
- (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",image->x_resolution,
- image->y_resolution);
+ (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",image->resolution.x,
+ image->resolution.y);
if (image_info->page != (char *) NULL)
{
(void) ParseAbsoluteGeometry(image_info->page,&page);
- page.width=(size_t) floor((double) (page.width*image->x_resolution/
+ page.width=(size_t) floor((double) (page.width*image->resolution.x/
delta.x)+0.5);
- page.height=(size_t) floor((double) (page.height*image->y_resolution/
+ page.height=(size_t) floor((double) (page.height*image->resolution.y/
delta.y)+0.5);
(void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
page.width,(double) page.height);
@@ -1263,8 +1263,8 @@
*/
delta.x=DefaultResolution;
delta.y=DefaultResolution;
- resolution.x=image->x_resolution;
- resolution.y=image->y_resolution;
+ resolution.x=image->resolution.x;
+ resolution.y=image->resolution.y;
if ((resolution.x == 0.0) || (resolution.y == 0.0))
{
flags=ParseGeometry(PSDensityGeometry,&geometry_info);
diff --git a/coders/pict.c b/coders/pict.c
index 95c2f1c..8276928 100644
--- a/coders/pict.c
+++ b/coders/pict.c
@@ -886,8 +886,8 @@
flags=0;
image->columns=1UL*(frame.right-frame.left);
image->rows=1UL*(frame.bottom-frame.top);
- image->x_resolution=DefaultResolution;
- image->y_resolution=DefaultResolution;
+ image->resolution.x=DefaultResolution;
+ image->resolution.y=DefaultResolution;
image->units=UndefinedResolution;
/*
Interpret PICT opcodes.
@@ -963,8 +963,8 @@
ReadRectangle(image,frame);
ReadPixmap(pixmap);
image->depth=1UL*pixmap.component_size;
- image->x_resolution=1.0*pixmap.horizontal_resolution;
- image->y_resolution=1.0*pixmap.vertical_resolution;
+ image->resolution.x=1.0*pixmap.horizontal_resolution;
+ image->resolution.y=1.0*pixmap.vertical_resolution;
image->units=PixelsPerInchResolution;
(void) ReadBlobMSBLong(image);
flags=1L*ReadBlobMSBShort(image);
@@ -1077,8 +1077,8 @@
tile_image->depth=1UL*pixmap.component_size;
tile_image->matte=pixmap.component_count == 4 ?
MagickTrue : MagickFalse;
- tile_image->x_resolution=(double) pixmap.horizontal_resolution;
- tile_image->y_resolution=(double) pixmap.vertical_resolution;
+ tile_image->resolution.x=(double) pixmap.horizontal_resolution;
+ tile_image->resolution.y=(double) pixmap.vertical_resolution;
tile_image->units=PixelsPerInchResolution;
if (tile_image->matte != MagickFalse)
image->matte=tile_image->matte;
@@ -1633,9 +1633,9 @@
pixmap.table=0;
pixmap.reserved=0;
transfer_mode=0;
- x_resolution=image->x_resolution != 0.0 ? image->x_resolution :
+ x_resolution=image->resolution.x != 0.0 ? image->resolution.x :
DefaultResolution;
- y_resolution=image->y_resolution != 0.0 ? image->y_resolution :
+ y_resolution=image->resolution.y != 0.0 ? image->resolution.y :
DefaultResolution;
storage_class=image->storage_class;
if (image_info->compression == JPEGCompression)
diff --git a/coders/png.c b/coders/png.c
index 1dfb11c..cc10247 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -2443,14 +2443,14 @@
*/
(void) png_get_pHYs(ping,ping_info,&x_resolution,&y_resolution,
&unit_type);
- image->x_resolution=(double) x_resolution;
- image->y_resolution=(double) y_resolution;
+ image->resolution.x=(double) x_resolution;
+ image->resolution.y=(double) y_resolution;
if (unit_type == PNG_RESOLUTION_METER)
{
image->units=PixelsPerCentimeterResolution;
- image->x_resolution=(double) x_resolution/100.0;
- image->y_resolution=(double) y_resolution/100.0;
+ image->resolution.x=(double) x_resolution/100.0;
+ image->resolution.y=(double) y_resolution/100.0;
}
if (logging != MagickFalse)
@@ -4274,13 +4274,13 @@
{
if (length > 8)
{
- image->x_resolution=(double) mng_get_long(p);
- image->y_resolution=(double) mng_get_long(&p[4]);
+ image->resolution.x=(double) mng_get_long(p);
+ image->resolution.y=(double) mng_get_long(&p[4]);
if ((int) p[8] == PNG_RESOLUTION_METER)
{
image->units=PixelsPerCentimeterResolution;
- image->x_resolution=image->x_resolution/100.0f;
- image->y_resolution=image->y_resolution/100.0f;
+ image->resolution.x=image->resolution.x/100.0f;
+ image->resolution.y=image->resolution.y/100.0f;
}
}
@@ -8990,7 +8990,7 @@
#if defined(PNG_pHYs_SUPPORTED)
if (ping_exclude_pHYs == MagickFalse)
{
- if ((image->x_resolution != 0) && (image->y_resolution != 0) &&
+ if ((image->resolution.x != 0) && (image->resolution.y != 0) &&
(!mng_info->write_mng || !mng_info->equal_physs))
{
if (logging != MagickFalse)
@@ -9001,23 +9001,23 @@
{
ping_pHYs_unit_type=PNG_RESOLUTION_METER;
ping_pHYs_x_resolution=
- (png_uint_32) ((100.0*image->x_resolution+0.5)/2.54);
+ (png_uint_32) ((100.0*image->resolution.x+0.5)/2.54);
ping_pHYs_y_resolution=
- (png_uint_32) ((100.0*image->y_resolution+0.5)/2.54);
+ (png_uint_32) ((100.0*image->resolution.y+0.5)/2.54);
}
else if (image->units == PixelsPerCentimeterResolution)
{
ping_pHYs_unit_type=PNG_RESOLUTION_METER;
- ping_pHYs_x_resolution=(png_uint_32) (100.0*image->x_resolution+0.5);
- ping_pHYs_y_resolution=(png_uint_32) (100.0*image->y_resolution+0.5);
+ ping_pHYs_x_resolution=(png_uint_32) (100.0*image->resolution.x+0.5);
+ ping_pHYs_y_resolution=(png_uint_32) (100.0*image->resolution.y+0.5);
}
else
{
ping_pHYs_unit_type=PNG_RESOLUTION_UNKNOWN;
- ping_pHYs_x_resolution=(png_uint_32) image->x_resolution;
- ping_pHYs_y_resolution=(png_uint_32) image->y_resolution;
+ ping_pHYs_x_resolution=(png_uint_32) image->resolution.x;
+ ping_pHYs_y_resolution=(png_uint_32) image->resolution.y;
}
if (logging != MagickFalse)
@@ -11926,7 +11926,7 @@
}
}
- if (image->x_resolution && image->y_resolution && !mng_info->equal_physs)
+ if (image->resolution.x && image->resolution.y && !mng_info->equal_physs)
{
/*
Write JNG pHYs chunk
@@ -11937,10 +11937,10 @@
if (image->units == PixelsPerInchResolution)
{
PNGLong(chunk+4,(png_uint_32)
- (image->x_resolution*100.0/2.54+0.5));
+ (image->resolution.x*100.0/2.54+0.5));
PNGLong(chunk+8,(png_uint_32)
- (image->y_resolution*100.0/2.54+0.5));
+ (image->resolution.y*100.0/2.54+0.5));
chunk[12]=1;
}
@@ -11950,18 +11950,18 @@
if (image->units == PixelsPerCentimeterResolution)
{
PNGLong(chunk+4,(png_uint_32)
- (image->x_resolution*100.0+0.5));
+ (image->resolution.x*100.0+0.5));
PNGLong(chunk+8,(png_uint_32)
- (image->y_resolution*100.0+0.5));
+ (image->resolution.y*100.0+0.5));
chunk[12]=1;
}
else
{
- PNGLong(chunk+4,(png_uint_32) (image->x_resolution+0.5));
- PNGLong(chunk+8,(png_uint_32) (image->y_resolution+0.5));
+ PNGLong(chunk+4,(png_uint_32) (image->resolution.x+0.5));
+ PNGLong(chunk+8,(png_uint_32) (image->resolution.y+0.5));
chunk[12]=0;
}
}
@@ -12500,8 +12500,8 @@
mng_info->equal_srgbs=MagickFalse;
if ((next_image->units != next_image->next->units) ||
- (next_image->x_resolution != next_image->next->x_resolution) ||
- (next_image->y_resolution != next_image->next->y_resolution))
+ (next_image->resolution.x != next_image->next->resolution.x) ||
+ (next_image->resolution.y != next_image->next->resolution.y))
mng_info->equal_physs=MagickFalse;
if (mng_info->equal_chrms)
@@ -12775,7 +12775,7 @@
mng_info->have_write_global_chrm=MagickTrue;
}
}
- if (image->x_resolution && image->y_resolution && mng_info->equal_physs)
+ if (image->resolution.x && image->resolution.y && mng_info->equal_physs)
{
/*
Write MNG pHYs chunk
@@ -12787,10 +12787,10 @@
if (image->units == PixelsPerInchResolution)
{
PNGLong(chunk+4,(png_uint_32)
- (image->x_resolution*100.0/2.54+0.5));
+ (image->resolution.x*100.0/2.54+0.5));
PNGLong(chunk+8,(png_uint_32)
- (image->y_resolution*100.0/2.54+0.5));
+ (image->resolution.y*100.0/2.54+0.5));
chunk[12]=1;
}
@@ -12800,18 +12800,18 @@
if (image->units == PixelsPerCentimeterResolution)
{
PNGLong(chunk+4,(png_uint_32)
- (image->x_resolution*100.0+0.5));
+ (image->resolution.x*100.0+0.5));
PNGLong(chunk+8,(png_uint_32)
- (image->y_resolution*100.0+0.5));
+ (image->resolution.y*100.0+0.5));
chunk[12]=1;
}
else
{
- PNGLong(chunk+4,(png_uint_32) (image->x_resolution+0.5));
- PNGLong(chunk+8,(png_uint_32) (image->y_resolution+0.5));
+ PNGLong(chunk+4,(png_uint_32) (image->resolution.x+0.5));
+ PNGLong(chunk+8,(png_uint_32) (image->resolution.y+0.5));
chunk[12]=0;
}
}
diff --git a/coders/ps.c b/coders/ps.c
index 8267d4f..52d8f3c 100644
--- a/coders/ps.c
+++ b/coders/ps.c
@@ -468,13 +468,13 @@
*/
delta.x=DefaultResolution;
delta.y=DefaultResolution;
- if ((image->x_resolution == 0.0) || (image->y_resolution == 0.0))
+ if ((image->resolution.x == 0.0) || (image->resolution.y == 0.0))
{
flags=ParseGeometry(PSDensityGeometry,&geometry_info);
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- image->y_resolution=image->x_resolution;
+ image->resolution.y=image->resolution.x;
}
/*
Determine page geometry from the Postscript bounding box.
@@ -724,18 +724,18 @@
if (image_info->density != (char *) NULL)
{
flags=ParseGeometry(image_info->density,&geometry_info);
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- image->y_resolution=image->x_resolution;
+ image->resolution.y=image->resolution.x;
}
(void) FormatLocaleString(density,MaxTextExtent,"%gx%g",
- image->x_resolution,image->y_resolution);
+ image->resolution.x,image->resolution.y);
if (image_info->page != (char *) NULL)
(void) ParseAbsoluteGeometry(image_info->page,&page);
- page.width=(size_t) floor((double) (page.width*image->x_resolution/delta.x)+
+ page.width=(size_t) floor((double) (page.width*image->resolution.x/delta.x)+
0.5);
- page.height=(size_t) floor((double) (page.height*image->y_resolution/delta.y)+
+ page.height=(size_t) floor((double) (page.height*image->resolution.y/delta.y)+
0.5);
(void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
page.width,(double) page.height);
@@ -1430,8 +1430,8 @@
(void) TransformImageColorspace(image,RGBColorspace,exception);
delta.x=DefaultResolution;
delta.y=DefaultResolution;
- resolution.x=image->x_resolution;
- resolution.y=image->y_resolution;
+ resolution.x=image->resolution.x;
+ resolution.y=image->resolution.y;
if ((resolution.x == 0.0) || (resolution.y == 0.0))
{
flags=ParseGeometry(PSDensityGeometry,&geometry_info);
diff --git a/coders/ps2.c b/coders/ps2.c
index 79c2dd5..6044307 100644
--- a/coders/ps2.c
+++ b/coders/ps2.c
@@ -494,8 +494,8 @@
*/
delta.x=DefaultResolution;
delta.y=DefaultResolution;
- resolution.x=image->x_resolution;
- resolution.y=image->y_resolution;
+ resolution.x=image->resolution.x;
+ resolution.y=image->resolution.y;
if ((resolution.x == 0.0) || (resolution.y == 0.0))
{
flags=ParseGeometry(PSDensityGeometry,&geometry_info);
diff --git a/coders/ps3.c b/coders/ps3.c
index 8df9d62..aeb5d85 100644
--- a/coders/ps3.c
+++ b/coders/ps3.c
@@ -926,8 +926,8 @@
*/
delta.x=DefaultResolution;
delta.y=DefaultResolution;
- resolution.x=image->x_resolution;
- resolution.y=image->y_resolution;
+ resolution.x=image->resolution.x;
+ resolution.y=image->resolution.y;
if ((resolution.x == 0.0) || (resolution.y == 0.0))
{
flags=ParseGeometry(PSDensityGeometry,&geometry_info);
diff --git a/coders/psd.c b/coders/psd.c
index c1fa4b8..2daa586 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -450,15 +450,15 @@
Resolution info.
*/
p=PushShortPixel(MSBEndian,p,&resolution);
- image->x_resolution=(double) resolution;
- (void) FormatLocaleString(value,MaxTextExtent,"%g",image->x_resolution);
+ image->resolution.x=(double) resolution;
+ (void) FormatLocaleString(value,MaxTextExtent,"%g",image->resolution.x);
(void) SetImageProperty(image,"tiff:XResolution",value,exception);
p=PushShortPixel(MSBEndian,p,&short_sans);
p=PushShortPixel(MSBEndian,p,&short_sans);
p=PushShortPixel(MSBEndian,p,&short_sans);
p=PushShortPixel(MSBEndian,p,&resolution);
- image->y_resolution=(double) resolution;
- (void) FormatLocaleString(value,MaxTextExtent,"%g",image->y_resolution);
+ image->resolution.y=(double) resolution;
+ (void) FormatLocaleString(value,MaxTextExtent,"%g",image->resolution.y);
(void) SetImageProperty(image,"tiff:YResolution",value,exception);
p=PushShortPixel(MSBEndian,p,&short_sans);
p=PushShortPixel(MSBEndian,p,&short_sans);
@@ -1929,13 +1929,13 @@
unsigned short
units;
- x_resolution=65536.0*image->x_resolution+0.5;
- y_resolution=65536.0*image->y_resolution+0.5;
+ x_resolution=65536.0*image->resolution.x+0.5;
+ y_resolution=65536.0*image->resolution.y+0.5;
units=1;
if (image->units == PixelsPerCentimeterResolution)
{
- x_resolution=2.54*65536.0*image->x_resolution*0.5;
- y_resolution=2.54*65536.0*image->y_resolution+0.5;
+ x_resolution=2.54*65536.0*image->resolution.x*0.5;
+ y_resolution=2.54*65536.0*image->resolution.y+0.5;
units=2;
}
(void) WriteBlob(image,4,(const unsigned char *) "8BIM");
diff --git a/coders/sct.c b/coders/sct.c
index 0f1b411..2bba145 100644
--- a/coders/sct.c
+++ b/coders/sct.c
@@ -214,8 +214,8 @@
count=ReadBlob(image,768,buffer);
if (separations_mask == 0x0f)
image->colorspace=CMYKColorspace;
- image->x_resolution=1.0*image->columns/width;
- image->y_resolution=1.0*image->rows/height;
+ image->resolution.x=1.0*image->columns/width;
+ image->resolution.y=1.0*image->rows/height;
if (image_info->ping != MagickFalse)
{
(void) CloseBlob(image);
diff --git a/coders/svg.c b/coders/svg.c
index 17adda7..97dd237 100644
--- a/coders/svg.c
+++ b/coders/svg.c
@@ -2729,8 +2729,8 @@
*image;
image=(Image *) context;
- *width=(int) (*width*image->x_resolution/72.0);
- *height=(int) (*height*image->y_resolution/72.0);
+ *width=(int) (*width*image->resolution.x/72.0);
+ *height=(int) (*height*image->resolution.y/72.0);
}
#endif
@@ -2836,9 +2836,9 @@
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
rsvg_handle_set_base_uri(svg_handle,image_info->filename);
rsvg_handle_set_size_callback(svg_handle,SVGSetImageSize,image,NULL);
- if ((image->x_resolution != 72.0) && (image->y_resolution != 72.0))
- rsvg_handle_set_dpi_x_y(svg_handle,image->x_resolution,
- image->y_resolution);
+ if ((image->resolution.x != 72.0) && (image->resolution.y != 72.0))
+ rsvg_handle_set_dpi_x_y(svg_handle,image->resolution.x,
+ image->resolution.y);
while ((n=ReadBlob(image,MaxTextExtent,message)) != 0)
{
error=(GError *) NULL;
diff --git a/coders/tiff.c b/coders/tiff.c
index c02fc04..f74f16d 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -366,7 +366,7 @@
length=WriteLSBLong(file,(size_t) (strip_offset-8));
length=fwrite("\050\001\003\000\001\000\000\000\002\000\000\000",1,12,file);
length=fwrite("\000\000\000\000",1,4,file);
- length=WriteLSBLong(file,(long) image->x_resolution);
+ length=WriteLSBLong(file,(long) image->resolution.x);
length=WriteLSBLong(file,1);
for (length=0; (c=ReadBlobByte(image)) != EOF; length++)
(void) fputc(c,file);
@@ -1001,12 +1001,12 @@
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_SAMPLESPERPIXEL,
&samples_per_pixel);
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_RESOLUTIONUNIT,&units);
- x_resolution=(float) image->x_resolution;
- y_resolution=(float) image->y_resolution;
+ x_resolution=(float) image->resolution.x;
+ y_resolution=(float) image->resolution.y;
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_XRESOLUTION,&x_resolution);
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_YRESOLUTION,&y_resolution);
- image->x_resolution=x_resolution;
- image->y_resolution=y_resolution;
+ image->resolution.x=x_resolution;
+ image->resolution.y=y_resolution;
x_position=(float) image->page.x/x_resolution;
y_position=(float) image->page.y/y_resolution;
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_XPOSITION,&x_position);
@@ -3006,7 +3006,7 @@
option=GetImageOption(image_info,"tiff:tile-geometry");
if (option == (const char *) NULL)
(void) TIFFSetField(tiff,TIFFTAG_ROWSPERSTRIP,rows_per_strip);
- if ((image->x_resolution != 0.0) && (image->y_resolution != 0.0))
+ if ((image->resolution.x != 0.0) && (image->resolution.y != 0.0))
{
unsigned short
units;
@@ -3020,17 +3020,17 @@
if (image->units == PixelsPerCentimeterResolution)
units=RESUNIT_CENTIMETER;
(void) TIFFSetField(tiff,TIFFTAG_RESOLUTIONUNIT,(uint16) units);
- (void) TIFFSetField(tiff,TIFFTAG_XRESOLUTION,image->x_resolution);
- (void) TIFFSetField(tiff,TIFFTAG_YRESOLUTION,image->y_resolution);
+ (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))
{
/*
Set image position.
*/
(void) TIFFSetField(tiff,TIFFTAG_XPOSITION,(float) image->page.x/
- image->x_resolution);
+ image->resolution.x);
(void) TIFFSetField(tiff,TIFFTAG_YPOSITION,(float) image->page.y/
- image->y_resolution);
+ image->resolution.y);
}
}
if (image->chromaticity.white_point.x != 0.0)
diff --git a/coders/txt.c b/coders/txt.c
index b001c70..412a30c 100644
--- a/coders/txt.c
+++ b/coders/txt.c
@@ -200,7 +200,7 @@
*/
delta.x=DefaultResolution;
delta.y=DefaultResolution;
- if ((image->x_resolution == 0.0) || (image->y_resolution == 0.0))
+ if ((image->resolution.x == 0.0) || (image->resolution.y == 0.0))
{
GeometryInfo
geometry_info;
@@ -209,10 +209,10 @@
flags;
flags=ParseGeometry(PSDensityGeometry,&geometry_info);
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- image->y_resolution=image->x_resolution;
+ image->resolution.y=image->resolution.x;
}
page.width=612;
page.height=792;
@@ -223,9 +223,9 @@
/*
Initialize Image structure.
*/
- image->columns=(size_t) floor((((double) page.width*image->x_resolution)/
+ image->columns=(size_t) floor((((double) page.width*image->resolution.x)/
delta.x)+0.5);
- image->rows=(size_t) floor((((double) page.height*image->y_resolution)/
+ image->rows=(size_t) floor((((double) page.height*image->resolution.y)/
delta.y)+0.5);
image->page.x=0;
image->page.y=0;
diff --git a/coders/wpg.c b/coders/wpg.c
index 257c5e8..0e1b8ec 100644
--- a/coders/wpg.c
+++ b/coders/wpg.c
@@ -1021,8 +1021,8 @@
if(BitmapHeader1.HorzRes && BitmapHeader1.VertRes)
{
image->units=PixelsPerCentimeterResolution;
- image->x_resolution=BitmapHeader1.HorzRes/470.0;
- image->y_resolution=BitmapHeader1.VertRes/470.0;
+ image->resolution.x=BitmapHeader1.HorzRes/470.0;
+ image->resolution.y=BitmapHeader1.VertRes/470.0;
}
image->columns=BitmapHeader1.Width;
image->rows=BitmapHeader1.Heigth;
@@ -1077,8 +1077,8 @@
image->page.y=(int) (BitmapHeader2.LowLeftX/470.0);
if(BitmapHeader2.HorzRes && BitmapHeader2.VertRes)
{
- image->x_resolution=BitmapHeader2.HorzRes/470.0;
- image->y_resolution=BitmapHeader2.VertRes/470.0;
+ image->resolution.x=BitmapHeader2.HorzRes/470.0;
+ image->resolution.y=BitmapHeader2.VertRes/470.0;
}
image->columns=BitmapHeader2.Width;
image->rows=BitmapHeader2.Heigth;
diff --git a/coders/xcf.c b/coders/xcf.c
index 2109f86..96242eb 100644
--- a/coders/xcf.c
+++ b/coders/xcf.c
@@ -1134,8 +1134,8 @@
/* BOGUS: we don't write these yet because we aren't
reading them properly yet :(
- image->x_resolution = xres;
- image->y_resolution = yres;
+ image->resolution.x = xres;
+ image->resolution.y = yres;
*/
}
break;
diff --git a/coders/xps.c b/coders/xps.c
index 8e8c9d5..f4dd9c3 100644
--- a/coders/xps.c
+++ b/coders/xps.c
@@ -181,7 +181,7 @@
*/
delta.x=DefaultResolution;
delta.y=DefaultResolution;
- if ((image->x_resolution == 0.0) || (image->y_resolution == 0.0))
+ if ((image->resolution.x == 0.0) || (image->resolution.y == 0.0))
{
GeometryInfo
geometry_info;
@@ -190,13 +190,13 @@
flags;
flags=ParseGeometry(PSDensityGeometry,&geometry_info);
- image->x_resolution=geometry_info.rho;
- image->y_resolution=geometry_info.sigma;
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- image->y_resolution=image->x_resolution;
+ image->resolution.y=image->resolution.x;
}
(void) FormatLocaleString(density,MaxTextExtent,"%gx%g",
- image->x_resolution,image->y_resolution);
+ image->resolution.x,image->resolution.y);
/*
Determine page geometry from the XPS media box.
*/
@@ -283,8 +283,8 @@
(void) ParseAbsoluteGeometry(PSPageGeometry,&page);
if (image_info->page != (char *) NULL)
(void) ParseAbsoluteGeometry(image_info->page,&page);
- page.width=(size_t) floor(page.width*image->y_resolution/delta.x+0.5);
- page.height=(size_t) floor(page.height*image->y_resolution/delta.y+
+ page.width=(size_t) floor(page.width*image->resolution.y/delta.x+0.5);
+ page.height=(size_t) floor(page.height*image->resolution.y/delta.y+
0.5);
(void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
page.width,(double) page.height);