return(MagickTrue);
}
#if !defined(MAGICKCORE_LCMS_DELEGATE)
- status=SetImageProfile(image,name,profile);
(void) ThrowMagickException(&image->exception,GetMagickModule(),
MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn","`%s' (LCMS)",
image->filename);
ThrowBinaryException(ResourceLimitError,
"ColorspaceColorProfileMismatch",name);
target_profile=(cmsHPROFILE) NULL;
- if (cmsGetDeviceClass(source_profile) != cmsSigLinkClass)
+ if ((cmsGetDeviceClass(source_profile) != cmsSigLinkClass) &&
+ (icc_profile != (StringInfo *) NULL))
{
- status=SetImageProfile(image,name,profile);
- if (icc_profile != (StringInfo *) NULL)
- {
- target_profile=source_profile;
- source_profile=cmsOpenProfileFromMem(
- GetStringInfoDatum(icc_profile),(cmsUInt32Number)
- GetStringInfoLength(icc_profile));
- if (source_profile == (cmsHPROFILE) NULL)
- ThrowBinaryException(ResourceLimitError,
- "ColorspaceColorProfileMismatch",name);
- }
+ target_profile=source_profile;
+ source_profile=cmsOpenProfileFromMem(
+ GetStringInfoDatum(icc_profile),(cmsUInt32Number)
+ GetStringInfoLength(icc_profile));
+ if (source_profile == (cmsHPROFILE) NULL)
+ ThrowBinaryException(ResourceLimitError,
+ "ColorspaceColorProfileMismatch",name);
}
switch (cmsGetColorSpace(source_profile))
{
#endif
transform=AcquireTransformThreadSet(source_profile,source_type,
target_profile,target_type,intent,flags);
- (void) cmsCloseProfile(source_profile);
if (transform == (cmsHTRANSFORM *) NULL)
ThrowBinaryException(ImageError,"UnableToCreateColorTransform",
name);
target_pixels=DestroyPixelThreadSet(target_pixels);
source_pixels=DestroyPixelThreadSet(source_pixels);
transform=DestroyTransformThreadSet(transform);
+ if (cmsGetDeviceClass(source_profile) != cmsSigLinkClass)
+ status=SetImageProfile(image,name,profile);
if (target_profile != (cmsHPROFILE) NULL)
(void) cmsCloseProfile(target_profile);
+ (void) cmsCloseProfile(source_profile);
}
#endif
}