if ((flags & SigmaValue) == 0)
image->resolution.y=image->resolution.x;
}
+ if (image_info->density != (char *) NULL)
+ {
+ flags=ParseGeometry(image_info->density,&geometry_info);
+ image->resolution.x=geometry_info.rho;
+ image->resolution.y=geometry_info.sigma;
+ if ((flags & SigmaValue) == 0)
+ image->resolution.y=image->resolution.x;
+ }
+ (void) ParseAbsoluteGeometry(PSPageGeometry,&page);
+ if (image_info->page != (char *) NULL)
+ (void) ParseAbsoluteGeometry(image_info->page,&page);
+ page.width=(size_t) ceil((double) (page.width*image->resolution.x/delta.x)-
+ 0.5);
+ page.height=(size_t) ceil((double) (page.height*image->resolution.y/delta.y)-
+ 0.5);
/*
Determine page geometry from the Postscript bounding box.
*/
(void) ResetMagickMemory(&bounds,0,sizeof(bounds));
- (void) ResetMagickMemory(&hires_bounds,0,sizeof(hires_bounds));
- (void) ResetMagickMemory(&page,0,sizeof(page));
(void) ResetMagickMemory(command,0,sizeof(command));
+ cmyk=image_info->colorspace == CMYKColorspace ? MagickTrue : MagickFalse;
+ (void) ResetMagickMemory(&hires_bounds,0,sizeof(hires_bounds));
priority=0;
rows=0;
extent=0;
spotcolor=0;
language_level=1;
- skip=MagickFalse;
- cmyk=image_info->colorspace == CMYKColorspace ? MagickTrue : MagickFalse;
pages=(~0UL);
+ skip=MagickFalse;
p=command;
for (c=ReadBlobByte(image); c != EOF; c=ReadBlobByte(image))
{
value=DestroyString(value);
continue;
}
+ if (image_info->page != (char *) NULL)
+ continue;
/*
Note region defined by bounding box.
*/
hires_bounds.x2-hires_bounds.x1,hires_bounds.y2-hires_bounds.y1,
hires_bounds.x1,hires_bounds.y1);
(void) SetImageProperty(image,"ps:HiResBoundingBox",geometry,exception);
- page.width=(size_t) floor(hires_bounds.x2-hires_bounds.x1+0.5);
- page.height=(size_t) floor(hires_bounds.y2-hires_bounds.y1+0.5);
+ page.width=(size_t) ceil((double) ((hires_bounds.x2-hires_bounds.x1)*
+ image->resolution.x/delta.x)-0.5);
+ page.height=(size_t) ceil((double) ((hires_bounds.y2-hires_bounds.y1)*
+ image->resolution.y/delta.y)-0.5);
}
(void) CloseBlob(image);
if (IsRGBColorspace(image_info->colorspace) != MagickFalse)
return((Image *) NULL);
}
*options='\0';
- if ((page.width == 0) || (page.height == 0))
- (void) ParseAbsoluteGeometry(PSPageGeometry,&page);
- if (image_info->density != (char *) NULL)
- {
- flags=ParseGeometry(image_info->density,&geometry_info);
- image->resolution.x=geometry_info.rho;
- image->resolution.y=geometry_info.sigma;
- if ((flags & SigmaValue) == 0)
- image->resolution.y=image->resolution.x;
- }
(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->resolution.x/delta.x)+
- 0.5);
- 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);
read_info=CloneImageInfo(image_info);
};
if (image->previous == (Image *) NULL)
{
- status=SetImageProgress(image,SaveImageTag,(MagickOffsetType)
+ status=SetImageProgress(image,SaveImageTag,(MagickOffsetType)
y,image->rows);
if (status == MagickFalse)
break;