static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
-#define AdobeIllustrator "âãÏÓ"
+#define Count "Count"
#define CropBox "CropBox"
#define DeviceCMYK "DeviceCMYK"
#define MediaBox "MediaBox"
file;
MagickBooleanType
- adobe_illustrator,
cmyk,
cropbox,
trimbox,
count;
size_t
+ pages,
scene,
spotcolor;
hires_bounds.x2=0.0;
hires_bounds.y2=0.0;
angle=0.0;
- adobe_illustrator=MagickFalse;
+ pages=0;
p=command;
for (c=ReadBlobByte(image); c != EOF; c=ReadBlobByte(image))
{
if (c == '\n')
c=' ';
*p++=(char) c;
- if ((c != (int) '/') && (c != (int) '%') &&
+ if ((c != (int) '/') && (c != (int) '%') &&
((size_t) (p-command) < (MaxTextExtent-1)))
continue;
*(--p)='\0';
*/
if (LocaleNCompare(DeviceCMYK,command,strlen(DeviceCMYK)) == 0)
cmyk=MagickTrue;
- if (LocaleNCompare(AdobeIllustrator,command,strlen(AdobeIllustrator)) == 0)
- adobe_illustrator=MagickTrue;
+ if (LocaleNCompare(Count,command,strlen(Count)) == 0)
+ {
+ count=strtol(command+6,(char **) NULL,10);
+ if (count > (ssize_t) pages)
+ pages=(size_t) count;
+ }
if (LocaleNCompare(SpotColor,command,strlen(SpotColor)) == 0)
{
char
if (cmyk != MagickFalse)
delegate_info=GetDelegateInfo("ps:cmyk",(char *) NULL,exception);
else
- if (adobe_illustrator != MagickFalse)
+ if (pages <= 1)
delegate_info=GetDelegateInfo("ps:alpha",(char *) NULL,exception);
else
delegate_info=GetDelegateInfo("ps:color",(char *) NULL,exception);