}
if (image->units == PixelsPerCentimeterResolution)
{
- x_resolution*=2.54;
- y_resolution*=2.54;
+ x_resolution=(unsigned long) (100.0*2.54*x_resolution+0.5)/100.0;
+ y_resolution=(unsigned long) (100.0*2.54*y_resolution+0.5)/100.0;
}
(void) jbg_enc_lrlmax(&jbig_info,x_resolution,y_resolution);
}
}
if (image->units == PixelsPerCentimeterResolution)
{
- resolution.x*=2.54;
- resolution.y*=2.54;
+ resolution.x=(unsigned long) (100.0*2.54*resolution.x+0.5)/100.0;
+ resolution.y=(unsigned long) (100.0*2.54*resolution.y+0.5)/100.0;
}
SetGeometry(image,&geometry);
(void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu",
Set image resolution.
*/
(void) png_get_pHYs(ping,ping_info,&x_resolution,&y_resolution,
- &unit_type);
- image->x_resolution=(float) x_resolution;
- image->y_resolution=(float) y_resolution;
+ &unit_type);
+ image->x_resolution=(double) x_resolution;
+ image->y_resolution=(double) y_resolution;
if (unit_type == PNG_RESOLUTION_METER)
{
image->units=PixelsPerCentimeterResolution;
if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Reading PNG pHYs chunk: xres: %lu, yres: %lu, units: %d.",
- (unsigned long) x_resolution, (unsigned long) y_resolution,
- unit_type);
+ (unsigned long) x_resolution,(unsigned long) y_resolution,unit_type);
}
#endif
if (png_get_valid(ping,ping_info,PNG_INFO_PLTE))
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" TERM delay: %lu",
- (png_uint_32) (mng_info->ticks_per_second*
+ (unsigned long) (mng_info->ticks_per_second*
final_delay/MagickMax(image->ticks_per_second,1)));
if (image->iterations == 0)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
}
if (image->units == PixelsPerCentimeterResolution)
{
- resolution.x*=2.54;
- resolution.y*=2.54;
+ resolution.x=(unsigned long) (100.0*2.54*resolution.x+0.5)/100.0;
+ resolution.y=(unsigned long) (100.0*2.54*resolution.y+0.5)/100.0;
}
SetGeometry(image,&geometry);
(void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu",
}
if (image->units == PixelsPerCentimeterResolution)
{
- resolution.x*=2.54;
- resolution.y*=2.54;
+ resolution.x=(unsigned long) (100.0*2.54*resolution.x+0.5)/100.0;
+ resolution.y=(unsigned long) (100.0*2.54*resolution.y+0.5)/100.0;
}
SetGeometry(image,&geometry);
(void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu",
}
if (image->units == PixelsPerCentimeterResolution)
{
- resolution.x*=2.54;
- resolution.y*=2.54;
+ resolution.x=(unsigned long) (100.0*2.54*resolution.x+0.5)/100.0;
+ resolution.y=(unsigned long) (100.0*2.54*resolution.y+0.5)/100.0;
}
SetGeometry(image,&geometry);
(void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu",
{
if (units == PixelsPerInchResolution)
{
- image->x_resolution*=2.54;
- image->y_resolution*=2.54;
+ image->x_resolution=(unsigned long) (100.0*2.54*
+ image->x_resolution+0.5)/100.0;
+ image->y_resolution=(unsigned long) (100.0*2.54*
+ image->y_resolution+0.5)/100.0;
}
break;
}