% o exception: return any errors or warnings in this structure.
%
*/
-MagickExport Image *ConstituteImage(const size_t columns,
- const size_t rows,const char *map,const StorageType storage,
- const void *pixels,ExceptionInfo *exception)
+MagickExport Image *ConstituteImage(const size_t columns,const size_t rows,
+ const char *map,const StorageType storage,const void *pixels,
+ ExceptionInfo *exception)
{
Image
*image;
sans=AcquireExceptionInfo();
(void) SetImageInfo(read_info,0,sans);
sans=DestroyExceptionInfo(sans);
+ if (read_info->number_scenes == 0)
+ {
+ read_info=DestroyImageInfo(read_info);
+ return(PingImage(image_info,exception));
+ }
(void) CopyMagickString(ping_filename,read_info->filename,MaxTextExtent);
images=NewImageList();
extent=(ssize_t) (read_info->scene+read_info->number_scenes);
{
errno=EPERM;
(void) ThrowMagickException(exception,GetMagickModule(),PolicyError,
- "NotAuthorized","`%s'",read_info->filename);
+ "NotAuthorized","'%s'",read_info->filename);
+ read_info=DestroyImageInfo(read_info);
return((Image *) NULL);
}
/*
image=NewImageList();
if (constitute_semaphore == (SemaphoreInfo *) NULL)
AcquireSemaphoreInfo(&constitute_semaphore);
+ if ((magick_info == (const MagickInfo *) NULL) ||
+ (GetImageDecoder(magick_info) == (DecodeImageHandler *) NULL))
+ {
+ delegate_info=GetDelegateInfo(read_info->magick,(char *) NULL,exception);
+ if (delegate_info == (const DelegateInfo *) NULL)
+ {
+ (void) SetImageInfo(read_info,0,exception);
+ (void) CopyMagickString(read_info->filename,filename,MaxTextExtent);
+ magick_info=GetMagickInfo(read_info->magick,exception);
+ }
+ }
if ((magick_info != (const MagickInfo *) NULL) &&
(GetImageDecoder(magick_info) != (DecodeImageHandler *) NULL))
{
if (delegate_info == (const DelegateInfo *) NULL)
{
(void) ThrowMagickException(exception,GetMagickModule(),
- MissingDelegateError,"NoDecodeDelegateForThisImageFormat","`%s'",
+ MissingDelegateError,"NoDecodeDelegateForThisImageFormat","'%s'",
read_info->filename);
if (read_info->temporary != MagickFalse)
(void) RelinquishUniqueFileResource(read_info->filename);
{
if (IsPathAccessible(read_info->filename) != MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
- MissingDelegateError,"NoDecodeDelegateForThisImageFormat","`%s'",
+ MissingDelegateError,"NoDecodeDelegateForThisImageFormat","'%s'",
read_info->filename);
else
ThrowFileException(exception,FileOpenError,"UnableToOpenFile",
clones=CloneImages(image,read_info->scenes,exception);
if (clones == (Image *) NULL)
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
- "SubimageSpecificationReturnsNoImages","`%s'",read_info->filename);
+ "SubimageSpecificationReturnsNoImages","'%s'",read_info->filename);
else
{
image=DestroyImageList(image);
next->magick_columns=next->columns;
if (next->magick_rows == 0)
next->magick_rows=next->rows;
- if ((next->colorspace == sRGBColorspace) && (next->gamma == 1.0))
- next->colorspace=RGBColorspace;
value=GetImageProperty(next,"tiff:Orientation",exception);
if (value == (char *) NULL)
value=GetImageProperty(next,"exif:Orientation",exception);
if (IsRightsAuthorized(domain,rights,write_info->magick) == MagickFalse)
{
sans_exception=DestroyExceptionInfo(sans_exception);
+ write_info=DestroyImageInfo(write_info);
errno=EPERM;
ThrowBinaryException(PolicyError,"NotAuthorized",filename);
}
+ /*
+ Call appropriate image reader based on image type.
+ */
magick_info=GetMagickInfo(write_info->magick,sans_exception);
sans_exception=DestroyExceptionInfo(sans_exception);
if (magick_info != (const MagickInfo *) NULL)
}
(void) SyncImageProfiles(image);
option=GetImageOption(image_info,"delegate:bimodal");
- if ((option != (const char *) NULL) &&
- (IsMagickTrue(option) != MagickFalse) &&
+ if ((IfMagickTrue(IsStringTrue(option))) &&
(write_info->page == (char *) NULL) &&
(GetPreviousImageInList(image) == (Image *) NULL) &&
(GetNextImageInList(image) == (Image *) NULL) &&
- (IsTaintImage(image) == MagickFalse))
+ (IfMagickFalse(IsTaintImage(image))) )
{
delegate_info=GetDelegateInfo(image->magick,write_info->magick,exception);
if ((delegate_info != (const DelegateInfo *) NULL) &&
}
if ((magick_info == (const MagickInfo *) NULL) ||
(GetImageEncoder(magick_info) == (EncodeImageHandler *) NULL))
- (void) ThrowMagickException(exception,GetMagickModule(),
- MissingDelegateError,"NoEncodeDelegateForThisImageFormat","`%s'",
- image->filename);
- else
+ {
+ magick_info=GetMagickInfo(image->magick,exception);
+ if ((magick_info == (const MagickInfo *) NULL) ||
+ (GetImageEncoder(magick_info) == (EncodeImageHandler *) NULL))
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ MissingDelegateError,"NoEncodeDelegateForThisImageFormat",
+ "'%s'",image->filename);
+ else
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ MissingDelegateWarning,"NoEncodeDelegateForThisImageFormat",
+ "'%s'",image->filename);
+ }
+ if ((magick_info != (const MagickInfo *) NULL) &&
+ (GetImageEncoder(magick_info) != (EncodeImageHandler *) NULL))
{
/*
Call appropriate image writer based on image type.