geometry=DestroyString(geometry);
break;
}
+ if (LocaleCompare(property,"profile") == 0)
+ {
+ ImageInfo
+ *image_info;
+
+ StringInfo
+ *profile;
+
+ image_info=AcquireImageInfo();
+ (void) CopyMagickString(image_info->filename,value,MaxTextExtent);
+ (void) SetImageInfo(image_info,1,&image->exception);
+ profile=FileToStringInfo(image_info->filename,~0UL,&image->exception);
+ if (profile != (StringInfo *) NULL)
+ status=SetImageProfile(image,image_info->magick,profile);
+ image_info=DestroyImageInfo(image_info);
+ break;
+ }
status=AddValueToSplayTree((SplayTreeInfo *) image->properties,
ConstantString(property),ConstantString(value));
break;
return(image);
}
-static int IsPathDirectory(const char *path)
-{
- MagickBooleanType
- status;
-
- struct stat
- attributes;
-
- if ((path == (const char *) NULL) || (*path == '\0'))
- return(MagickFalse);
- status=GetPathAttributes(path,&attributes);
- if (status == MagickFalse)
- return(-1);
- if (S_ISDIR(attributes.st_mode) == 0)
- return(0);
- return(1);
-}
-
static MagickBooleanType IsPathWritable(const char *path)
{
if (IsPathAccessible(path) == MagickFalse)
profile_info=DestroyImageInfo(profile_info);
if (profile_image == (Image *) NULL)
{
- char
- name[MaxTextExtent],
- filename[MaxTextExtent];
-
- register char
- *p;
-
StringInfo
*profile;
- (void) CopyMagickString(filename,argv[i+1],MaxTextExtent);
- (void) CopyMagickString(name,argv[i+1],MaxTextExtent);
- for (p=filename; *p != '\0'; p++)
- if ((*p == ':') && (IsPathDirectory(argv[i+1]) < 0) &&
- (IsPathAccessible(argv[i+1]) == MagickFalse))
- {
- register char
- *q;
-
- /*
- Look for profile name (e.g. name:profile).
- */
- (void) CopyMagickString(name,filename,(size_t)
- (p-filename+1));
- for (q=filename; *q != '\0'; q++)
- *q=(*++p);
- break;
- }
- profile=FileToStringInfo(filename,~0UL,exception);
+ profile_info=CloneImageInfo(image_info);
+ (void) CopyMagickString(profile_info->filename,argv[i+1],
+ MaxTextExtent);
+ profile=FileToStringInfo(profile_info->filename,~0UL,exception);
if (profile != (StringInfo *) NULL)
{
- (void) ProfileImage(*image,name,GetStringInfoDatum(profile),
- (unsigned long) GetStringInfoLength(profile),MagickFalse);
+ (void) ProfileImage(*image,profile_info->magick,
+ GetStringInfoDatum(profile),(unsigned long)
+ GetStringInfoLength(profile),MagickFalse);
profile=DestroyStringInfo(profile);
}
+ profile_info=DestroyImageInfo(profile_info);
break;
}
ResetImageProfileIterator(profile_image);
{
if (LocaleCompare("write",option+1) == 0)
{
- char
+ char
key[MaxTextExtent];
Image