#define ICCProfile "BeginICCProfile:"
#define PhotoshopProfile "BeginPhotoshop:"
- MagickByteBuffer
- buffer;
+ char
+ version[128];
int
c;
MagickBooleanType
skip;
+ MagickByteBuffer
+ buffer;
+
register char
*p;
hex_digits[(int) 'F']=15;
extent=0;
priority=0;
+ *version='\0';
spotcolor=0;
skip=MagickFalse;
(void) memset(&buffer,0,sizeof(buffer));
skip=MagickFalse;
if (skip != MagickFalse)
continue;
- if (CompareMagickByteBuffer(&buffer,PostscriptLevel,strlen(PostscriptLevel)) != MagickFalse)
+ if ((*version == '\0') &&
+ (CompareMagickByteBuffer(&buffer,PostscriptLevel,strlen(PostscriptLevel)) != MagickFalse))
{
- p=GetMagickByteBufferDatum(&buffer)+4;
- (void) SetImageProperty(image,"ps:Level",p,exception);
+ i=0;
+ for (c=ReadMagickByteBuffer(&buffer); c != EOF; c=ReadMagickByteBuffer(&buffer))
+ {
+ if ((c == '\r') || (c == '\n') || ((i+1) == sizeof(version)))
+ break;
+ version[i++]=(char) c;
+ }
+ version[i]='\0';
}
if (CompareMagickByteBuffer(&buffer,ImageData,strlen(ImageData)) != MagickFalse)
{
ps_info->bounds=bounds;
priority=i;
}
+ if (version[0] != '\0')
+ (void) SetImageProperty(image,"ps:Level",version,exception);
}
static inline void CleanupPSInfo(PSInfo *pdf_info)