% July 1992 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2012 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 %
#include "MagickCore/static.h"
#include "MagickCore/string_.h"
#include "MagickCore/module.h"
+#include "MagickCore/token.h"
#include "MagickCore/transform.h"
#include "MagickCore/utility.h"
#include "MagickCore/module.h"
Determine page geometry from the PDF media box.
*/
cmyk=image_info->colorspace == CMYKColorspace ? MagickTrue : MagickFalse;
- cropbox=MagickFalse;
- option=GetImageOption(image_info,"pdf:use-cropbox");
- if (option != (const char *) NULL)
- cropbox=IsMagickTrue(option);
- trimbox=MagickFalse;
- option=GetImageOption(image_info,"pdf:use-trimbox");
- if (option != (const char *) NULL)
- trimbox=IsMagickTrue(option);
+ cropbox=IsStringTrue(GetImageOption(image_info,"pdf:use-cropbox"));
+ trimbox=IsStringTrue(GetImageOption(image_info,"pdf:use-trimbox"));
count=0;
spotcolor=0;
(void) ResetMagickMemory(&bounding_box,0,sizeof(bounding_box));
}
if (count != 4)
continue;
+ if ((fabs(bounds.x2-bounds.x1) <= fabs(hires_bounds.x2-hires_bounds.x1)) ||
+ (fabs(bounds.y2-bounds.y1) <= fabs(hires_bounds.y2-hires_bounds.y1)))
+ continue;
hires_bounds=bounds;
}
- if ((hires_bounds.x2 != 0.0) && (hires_bounds.y2 != 0.0))
+ if ((fabs(hires_bounds.x2-hires_bounds.x1) >= MagickEpsilon) &&
+ (fabs(hires_bounds.y2-hires_bounds.y1) >= MagickEpsilon))
{
/*
Set PDF render geometry.
page.width=page.height;
page.height=swap;
}
- if (IsRGBColorspace(image_info->colorspace) != MagickFalse)
+ if (IssRGBColorspace(image_info->colorspace) != MagickFalse)
cmyk=MagickFalse;
/*
Create Ghostscript control file.
*options='\0';
(void) FormatLocaleString(density,MaxTextExtent,"%gx%g",image->resolution.x,
image->resolution.y);
- (void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
- page.width,(double) page.height);
+ if (image_info->page != (char *) NULL)
+ (void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
+ page.width,(double) page.height);
if (cmyk != MagickFalse)
(void) ConcatenateMagickString(options,"-dUseCIEColor ",MaxTextExtent);
if (cropbox != MagickFalse)
}
if (compression == JPEG2000Compression)
{
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
- (void) TransformImageColorspace(image,RGBColorspace,exception);
+ if (IssRGBColorspace(image->colorspace) == MagickFalse)
+ (void) TransformImageColorspace(image,sRGBColorspace,exception);
}
/*
Scale relative to dots-per-inch.