}
MagickExport MagickBooleanType CompositeImage(Image *image,
- const Image *composite_image,const CompositeOperator compose,
+ const Image *composite,const CompositeOperator compose,
const MagickBooleanType clip_to_self,const ssize_t x_offset,
const ssize_t y_offset,ExceptionInfo *exception)
{
geometry_info;
Image
+ *composite_image,
*destination_image;
MagickBooleanType
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- assert(composite_image != (Image *) NULL);
- assert(composite_image->signature == MagickSignature);
+ assert(composite!= (Image *) NULL);
+ assert(composite->signature == MagickSignature);
if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
- if (IsGrayColorspace(image->colorspace) != MagickFalse)
- {
- if (IsGrayColorspace(composite_image->colorspace) != MagickFalse)
- (void) SetImageColorspace(image,RGBColorspace,exception);
- else
- (void) TransformImageColorspace(image,composite_image->colorspace,
- exception);
- }
+ composite_image=CloneImage(composite,0,0,MagickTrue,exception);
+ if (composite_image == (const Image *) NULL)
+ return(MagickFalse);
+ (void) TransformImageColorspace(composite_image,image->colorspace,exception);
if ((compose == OverCompositeOp) || (compose == SrcOverCompositeOp))
{
status=CompositeOverImage(image,composite_image,clip_to_self,x_offset,
y_offset,exception);
+ composite_image=DestroyImage(composite_image);
return(status);
}
destination_image=(Image *) NULL;
image_view=DestroyCacheView(image_view);
if (destination_image != (Image * ) NULL)
destination_image=DestroyImage(destination_image);
+ composite_image=DestroyImage(composite_image);
return(status);
}
\f
texture_image=CloneImage(texture,0,0,MagickTrue,exception);
if (texture_image == (const Image *) NULL)
return(MagickFalse);
- if (IsGrayColorspace(texture_image->colorspace) != MagickFalse)
- (void) TransformImageColorspace(texture_image,RGBColorspace,exception);
+ (void) TransformImageColorspace(texture_image,image->colorspace,exception);
(void) SetImageVirtualPixelMethod(texture_image,TileVirtualPixelMethod,
exception);
status=MagickTrue;
const Quantum *restrict pixel)
{
if (image->channel_map[BlackPixelChannel].traits == UndefinedPixelTrait)
- return(0);
+ return((Quantum) 0);
return(pixel[image->channel_map[BlackPixelChannel].offset]);
}
const PixelChannel channel,const Quantum *restrict pixel)
{
if (image->channel_map[channel].traits == UndefinedPixelTrait)
- return(0);
+ return((Quantum) 0);
return(pixel[image->channel_map[channel].offset]);
}
const Quantum *restrict pixel)
{
if (image->channel_map[IndexPixelChannel].traits == UndefinedPixelTrait)
- return(0);
+ return((Quantum) 0);
return(pixel[image->channel_map[IndexPixelChannel].offset]);
}
const Quantum *restrict pixel)
{
if (image->channel_map[MaskPixelChannel].traits == UndefinedPixelTrait)
- return(0);
+ return((Quantum) 0);
return(pixel[image->channel_map[MaskPixelChannel].offset]);
}
Include declarations.
*/
#include "MagickCore/studio.h"
-#include "MagickCore/property.h"
+#include "MagickCore/attribute.h"
#include "MagickCore/blob.h"
#include "MagickCore/blob-private.h"
#include "MagickCore/cache.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/option.h"
#include "MagickCore/pixel-accessor.h"
+#include "MagickCore/property.h"
#include "MagickCore/resource_.h"
#include "MagickCore/quantum-private.h"
#include "MagickCore/static.h"
image->columns=(size_t) width;
image->rows=(size_t) height;
image->depth=depth;
+ image->colorspace=RGBColorspace;
if ((image->colormap == (PixelInfo *) NULL) && (samples_per_pixel == 1))
{
size_t
}
}
}
+ if (IsImageGray(image,exception) != MagickFalse)
+ (void) SetImageColorspace(image,GRAYColorspace,exception);
if (EOFBlob(image) != MagickFalse)
{
ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
}
#ifdef PNG_USER_MEM_SUPPORTED
-static png_voidp Magick_png_malloc(png_structp png_ptr,png_uint_32 size)
+#if PNG_LIBPNG_VER >= 14000
+static png_voidp Magick_png_malloc(png_structp png_ptr,png_alloc_size_t size)
+#else
+static png_voidp Magick_png_malloc(png_structp png_ptr,png_size_t size)
+#endif
{
(void) png_ptr;
return((png_voidp) AcquireMagickMemory((size_t) size));
(char *) profile_type, (double) length);
}
- text=(png_textp) png_malloc(ping,(png_uint_32) sizeof(png_text));
+#if PNG_LIBPNG_VER >= 14000
+ text=(png_textp) png_malloc(ping,(png_alloc_size_t) sizeof(png_text));
+#else
+ text=(png_textp) png_malloc(ping,(png_size_t) sizeof(png_text));
+#endif
description_length=(png_uint_32) strlen((const char *) profile_description);
allocated_length=(png_uint_32) (length*2 + (length >> 5) + 20
+ description_length);
- text[0].text=(png_charp) png_malloc(ping,allocated_length);
- text[0].key=(png_charp) png_malloc(ping, (png_uint_32) 80);
+#if PNG_LIBPNG_VER >= 14000
+ text[0].text=(png_charp) png_malloc(ping,
+ (png_alloc_size_t) allocated_length);
+ text[0].key=(png_charp) png_malloc(ping, (png_alloc_size_t) 80);
+#else
+ text[0].text=(png_charp) png_malloc(ping, (png_size_t) allocated_length);
+ text[0].key=(png_charp) png_malloc(ping, (png_size_t) 80);
+#endif
text[0].key[0]='\0';
(void) ConcatenateMagickString(text[0].key,
"Raw profile type ",MaxTextExtent);
{
if (value != (const char *) NULL)
{
- text=(png_textp) png_malloc(ping,(png_uint_32) sizeof(png_text));
+
+#if PNG_LIBPNG_VER >= 14000
+ text=(png_textp) png_malloc(ping,
+ (png_alloc_size_t) sizeof(png_text));
+#else
+ text=(png_textp) png_malloc(ping,(png_size_t) sizeof(png_text));
+#endif
text[0].key=(char *) property;
text[0].text=(char *) value;
text[0].text_length=strlen(value);
double
gamma;
- gamma=1.0-QuantumScale*fill_color.alpha;
+ gamma=QuantumScale*fill_color.alpha;
gamma=MagickEpsilonReciprocal(gamma);
fill_color.blue*=gamma;
fill_color.green*=gamma;