% March 2000 %
% %
% %
-% 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 %
for (p=comment; comment != (char *) NULL; p++)
{
c=ReadBlobByte(image);
- if ((c == EOF) || (c == (int) '}'))
- break;
+ if (c == (int) '\\')
+ c=ReadBlobByte(image);
+ else
+ if ((c == EOF) || (c == (int) '}'))
+ break;
if ((size_t) (p-comment+1) >= length)
{
*p='\0';
"MemoryAllocationFailed");
*p++=(char) c;
c=ReadBlobByte(image);
+ if (c == '\\')
+ {
+ c=ReadBlobByte(image);
+ if (c == (int) '}')
+ {
+ *p++=(char) c;
+ c=ReadBlobByte(image);
+ }
+ }
if (*options != '{')
if (isspace((int) ((unsigned char) c)) != 0)
break;
}
if (LocaleCompare(keyword,"error") == 0)
{
- image->error.mean_error_per_pixel=StringToDouble(
- options,(char **) NULL);
+ image->error.mean_error_per_pixel=StringToDouble(options,
+ (char **) NULL);
break;
}
(void) SetImageProperty(image,keyword,options,exception);
}
if (LocaleCompare(keyword,"maximum-error") == 0)
{
- image->error.normalized_maximum_error=
- StringToDouble(options,(char **) NULL);
+ image->error.normalized_maximum_error=StringToDouble(
+ options,(char **) NULL);
break;
}
if (LocaleCompare(keyword,"mean-error") == 0)
{
- image->error.normalized_mean_error=StringToDouble(
- options,(char **) NULL);
+ image->error.normalized_mean_error=StringToDouble(options,
+ (char **) NULL);
break;
}
if (LocaleCompare(keyword,"montage") == 0)
for (i=0; i < (ssize_t) strlen(value); i++)
if (isspace((int) ((unsigned char) value[i])) != 0)
break;
- if (i <= (ssize_t) strlen(value))
- (void) WriteBlobByte(image,'{');
- (void) WriteBlob(image,strlen(value),(unsigned char *) value);
- if (i <= (ssize_t) strlen(value))
- (void) WriteBlobByte(image,'}');
+ if (i == (ssize_t) strlen(value))
+ (void) WriteBlob(image,strlen(value),(const unsigned char *) value);
+ else
+ {
+ (void) WriteBlobByte(image,'{');
+ for (i=0; i < (ssize_t) strlen(value); i++)
+ {
+ if (value[i] == (int) '}')
+ (void) WriteBlobByte(image,'\\');
+ (void) WriteBlobByte(image,value[i]);
+ }
+ (void) WriteBlobByte(image,'}');
+ }
}
(void) WriteBlobByte(image,'\n');
property=GetNextImageProperty(image);