% MagickCore Methods to Consitute an Image %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% October 1998 %
% %
% %
#include "MagickCore/utility.h"
#include "MagickCore/utility-private.h"
\f
-static SemaphoreInfo
- *constitute_semaphore = (SemaphoreInfo *) NULL;
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
-+ C o n s t i t u t e C o m p o n e n t G e n e s i s %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% ConstituteComponentGenesis() instantiates the constitute component.
-%
-% The format of the ConstituteComponentGenesis method is:
-%
-% MagickBooleanType ConstituteComponentGenesis(void)
-%
-*/
-MagickPrivate MagickBooleanType ConstituteComponentGenesis(void)
-{
- AcquireSemaphoreInfo(&constitute_semaphore);
- return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
-+ C o n s t i t u t e C o m p o n e n t T e r m i n u s %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% ConstituteComponentTerminus() destroys the constitute component.
-%
-% The format of the ConstituteComponentTerminus method is:
-%
-% ConstituteComponentTerminus(void)
-%
-*/
-MagickPrivate void ConstituteComponentTerminus(void)
-{
- if (constitute_semaphore == (SemaphoreInfo *) NULL)
- AcquireSemaphoreInfo(&constitute_semaphore);
- DestroySemaphoreInfo(&constitute_semaphore);
-}
-\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
image=DestroyImage(image);
}
image=NewImageList();
- if (constitute_semaphore == (SemaphoreInfo *) NULL)
- AcquireSemaphoreInfo(&constitute_semaphore);
if ((magick_info == (const MagickInfo *) NULL) ||
(GetImageDecoder(magick_info) == (DecodeImageHandler *) NULL))
{
{
thread_support=GetMagickThreadSupport(magick_info);
if ((thread_support & DecoderThreadSupport) == 0)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(magick_info->semaphore);
image=GetImageDecoder(magick_info)(read_info,exception);
if ((thread_support & DecoderThreadSupport) == 0)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(magick_info->semaphore);
}
else
{
{
(void) ThrowMagickException(exception,GetMagickModule(),
MissingDelegateError,"NoDecodeDelegateForThisImageFormat","`%s'",
- read_info->filename);
+ read_info->magick);
if (read_info->temporary != MagickFalse)
(void) RelinquishUniqueFileResource(read_info->filename);
read_info=DestroyImageInfo(read_info);
MaxTextExtent);
*read_info->filename='\0';
if (GetDelegateThreadSupport(delegate_info) == MagickFalse)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(delegate_info->semaphore);
(void) InvokeDelegate(read_info,image,read_info->magick,(char *) NULL,
exception);
if (GetDelegateThreadSupport(delegate_info) == MagickFalse)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(delegate_info->semaphore);
image=DestroyImageList(image);
read_info->temporary=MagickTrue;
(void) SetImageInfo(read_info,0,exception);
if (IsPathAccessible(read_info->filename) != MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),
MissingDelegateError,"NoDecodeDelegateForThisImageFormat","`%s'",
- read_info->filename);
+ read_info->magick);
else
ThrowFileException(exception,FileOpenError,"UnableToOpenFile",
read_info->filename);
}
thread_support=GetMagickThreadSupport(magick_info);
if ((thread_support & DecoderThreadSupport) == 0)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(magick_info->semaphore);
image=(Image *) (GetImageDecoder(magick_info))(read_info,exception);
if ((thread_support & DecoderThreadSupport) == 0)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(magick_info->semaphore);
}
if (read_info->temporary != MagickFalse)
{
(void) CloseBlob(image);
}
}
- if (constitute_semaphore == (SemaphoreInfo *) NULL)
- AcquireSemaphoreInfo(&constitute_semaphore);
if ((magick_info != (const MagickInfo *) NULL) &&
(GetImageEncoder(magick_info) != (EncodeImageHandler *) NULL))
{
*/
thread_support=GetMagickThreadSupport(magick_info);
if ((thread_support & EncoderThreadSupport) == 0)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(magick_info->semaphore);
status=GetImageEncoder(magick_info)(write_info,image,exception);
if ((thread_support & EncoderThreadSupport) == 0)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(magick_info->semaphore);
}
else
{
*/
*write_info->filename='\0';
if (GetDelegateThreadSupport(delegate_info) == MagickFalse)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(delegate_info->semaphore);
status=InvokeDelegate(write_info,image,(char *) NULL,
write_info->magick,exception);
if (GetDelegateThreadSupport(delegate_info) == MagickFalse)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(delegate_info->semaphore);
(void) CopyMagickString(image->filename,filename,MaxTextExtent);
}
else
(GetImageEncoder(magick_info) == (EncodeImageHandler *) NULL))
(void) ThrowMagickException(exception,GetMagickModule(),
MissingDelegateError,"NoEncodeDelegateForThisImageFormat",
- "`%s'",image->filename);
+ "`%s'",write_info->magick);
else
(void) ThrowMagickException(exception,GetMagickModule(),
MissingDelegateWarning,"NoEncodeDelegateForThisImageFormat",
- "`%s'",image->filename);
+ "`%s'",write_info->magick);
}
if ((magick_info != (const MagickInfo *) NULL) &&
(GetImageEncoder(magick_info) != (EncodeImageHandler *) NULL))
*/
thread_support=GetMagickThreadSupport(magick_info);
if ((thread_support & EncoderThreadSupport) == 0)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(magick_info->semaphore);
status=GetImageEncoder(magick_info)(write_info,image,exception);
if ((thread_support & EncoderThreadSupport) == 0)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(magick_info->semaphore);
}
}
}
if (GetBlobError(image) != MagickFalse)
ThrowFileException(exception,FileOpenError,
"AnErrorHasOccurredWritingToFile",image->filename);
- if (temporary == MagickTrue)
+ if (temporary != MagickFalse)
{
/*
Copy temporary image file to permanent.