c,
file;
+ LinkedListInfo
+ *profiles;
+
MagickBooleanType
cmyk,
fitPage,
(void) ResetMagickMemory(command,0,sizeof(command));
cmyk=image_info->colorspace == CMYKColorspace ? MagickTrue : MagickFalse;
(void) ResetMagickMemory(&hires_bounds,0,sizeof(hires_bounds));
+ profiles=(LinkedListInfo *) NULL;
columns=0;
rows=0;
priority=0;
datum[i]=(unsigned char) c;
}
SetStringInfoLength(profile,(size_t) i+1);
- (void) SetImageProfile(image,"icc",profile,exception);
+ if (profiles == (LinkedListInfo *) NULL)
+ profiles=NewLinkedList(0);
+ (void) AppendValueToLinkedList(profiles,AcquireString("icc"));
profile=DestroyStringInfo(profile);
continue;
}
if (count != 1)
continue;
length=extent;
- if (length > GetBlobSize(image))
+ if ((MagickSizeType) length > GetBlobSize(image))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
profile=BlobToStringInfo((const void *) NULL,length);
if (profile != (StringInfo *) NULL)
q=GetStringInfoDatum(profile);
for (i=0; i < (ssize_t) length; i++)
*q++=(unsigned char) ProfileInteger(image,hex_digits);
- (void) SetImageProfile(image,"8bim",profile,exception);
+ if (profiles == (LinkedListInfo *) NULL)
+ profiles=NewLinkedList(0);
+ (void) AppendValueToLinkedList(profiles,AcquireString("8bim"));
profile=DestroyStringInfo(profile);
}
continue;
*/
p=command;
profile=StringToStringInfo(command);
- for (i=GetStringInfoLength(profile)-1; c != EOF; i++)
+ for (i=(ssize_t) GetStringInfoLength(profile)-1; c != EOF; i++)
{
- SetStringInfoLength(profile,i+1);
+ SetStringInfoLength(profile,(size_t) i+1);
c=ReadBlobByte(image);
if (c == EOF)
continue;
if (LocaleNCompare(EndXMPPacket,command,strlen(EndXMPPacket)) == 0)
break;
}
- SetStringInfoLength(profile,i);
+ SetStringInfoLength(profile,(size_t) i);
if (EOFBlob(image) == MagickFalse)
- (void) SetImageProfile(image,"xmp",profile,exception);
+ {
+ if (profiles == (LinkedListInfo *) NULL)
+ profiles=NewLinkedList(0);
+ (void) AppendValueToLinkedList(profiles,AcquireString("xmp"));
+ }
profile=DestroyStringInfo(profile);
continue;
}
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"InvalidGeometry","`%s'",option);
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,RelinquishMagickMemory);
image=DestroyImage(image);
return((Image *) NULL);
}
{
ThrowFileException(exception,FileOpenError,"UnableToOpenFile",
image_info->filename);
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,RelinquishMagickMemory);
image=DestroyImageList(image);
return((Image *) NULL);
}
if (delegate_info == (const DelegateInfo *) NULL)
{
(void) RelinquishUniqueFileResource(postscript_filename);
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,RelinquishMagickMemory);
image=DestroyImageList(image);
return((Image *) NULL);
}
if (*message != '\0')
(void) ThrowMagickException(exception,GetMagickModule(),
DelegateError,"PostscriptDelegateFailed","`%s'",message);
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,RelinquishMagickMemory);
image=DestroyImageList(image);
return((Image *) NULL);
}
PrependImageToList(&postscript_image,clone_image);
}
}
+ if (profiles != (LinkedListInfo *) NULL)
+ {
+ const char
+ *name;
+
+ const StringInfo
+ *profile;
+
+ /*
+ Read image profiles.
+ */
+ ResetLinkedListIterator(profiles);
+ name=(const char *) GetNextValueInLinkedList(profiles);
+ while (name != (const char *) NULL)
+ {
+ profile=GetImageProfile(image,name);
+ if (profile != (StringInfo *) NULL)
+ {
+ register unsigned char
+ *p;
+
+ p=GetStringInfoDatum(profile);
+ count=ReadBlob(image,GetStringInfoLength(profile),p);
+ (void) count;
+ }
+ name=(const char *) GetNextValueInLinkedList(profiles);
+ }
+ profiles=DestroyLinkedList(profiles,RelinquishMagickMemory);
+ }
do
{
(void) CopyMagickString(postscript_image->filename,filename,