static MagickBooleanType DecodeImage(Image *image,
const MagickBooleanType compression,unsigned char *pixels)
{
-#if !defined(__WINDOWS__) || defined(__MINGW32__)
+#if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__)
#define BI_RGB 0
#define BI_RLE8 1
#define BI_RLE4 2
Correct image orientation.
*/
flipped_image=FlipImage(image,exception);
- if (flipped_image == (Image *) NULL)
+ if (flipped_image != (Image *) NULL)
{
- image=DestroyImageList(image);
- return((Image *) NULL);
+ DuplicateBlob(flipped_image,image);
+ image=DestroyImage(image);
+ image=flipped_image;
}
- DuplicateBlob(flipped_image,image);
- image=DestroyImage(image);
- image=flipped_image;
}
(void) CloseBlob(image);
return(GetFirstImageInList(image));
for (x=0; x < (long) image->columns; x++)
{
word=(unsigned short) ((ScaleColor8to5((unsigned char)
- ScaleQuantumToChar(p->red)) << 11) | (ScaleColor8to6((unsigned char)
- ScaleQuantumToChar(p->green)) << 5) | (ScaleColor8to5(
- (unsigned char) ScaleQuantumToChar((unsigned char) p->blue) << 0)));
+ ScaleQuantumToChar(GetRedPixelComponent(p))) << 11) | (ScaleColor8to6((unsigned char)
+ ScaleQuantumToChar(GetGreenPixelComponent(p))) << 5) | (ScaleColor8to5(
+ (unsigned char) ScaleQuantumToChar((unsigned char) GetBluePixelComponent(p)) << 0)));
*q++=(unsigned char)(word & 0xff);
*q++=(unsigned char)(word >> 8);
p++;
q=pixels+(image->rows-y-1)*bytes_per_line;
for (x=0; x < (long) image->columns; x++)
{
- *q++=ScaleQuantumToChar(p->blue);
- *q++=ScaleQuantumToChar(p->green);
- *q++=ScaleQuantumToChar(p->red);
+ *q++=ScaleQuantumToChar(GetBluePixelComponent(p));
+ *q++=ScaleQuantumToChar(GetGreenPixelComponent(p));
+ *q++=ScaleQuantumToChar(GetRedPixelComponent(p));
if (image->matte != MagickFalse)
- *q++=ScaleQuantumToChar(p->opacity);
+ *q++=ScaleQuantumToChar(GetOpacityPixelComponent(p));
p++;
}
if (dib_info.bits_per_pixel == 24)