mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-05-31 11:18:42 +02:00
This commit is contained in:
+1
-2
@@ -364,8 +364,7 @@ static MagickBooleanType WriteAAIImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Write AAI header.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) WriteBlobLSBLong(image,(unsigned int) image->columns);
|
||||
(void) WriteBlobLSBLong(image,(unsigned int) image->rows);
|
||||
/*
|
||||
|
||||
+1
-2
@@ -311,8 +311,7 @@ static MagickBooleanType WriteARTImage(const ImageInfo *image_info,Image *image,
|
||||
return(status);
|
||||
if ((image->columns > 65535UL) || (image->rows > 65535UL))
|
||||
ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) SetImageType(image,BilevelType,exception);
|
||||
image->endian=MSBEndian;
|
||||
image->depth=1;
|
||||
|
||||
+1
-2
@@ -360,8 +360,7 @@ static MagickBooleanType WriteAVSImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Write AVS header.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) WriteBlobMSBLong(image,(unsigned int) image->columns);
|
||||
(void) WriteBlobMSBLong(image,(unsigned int) image->rows);
|
||||
/*
|
||||
|
||||
+1
-2
@@ -1106,8 +1106,7 @@ static MagickBooleanType WriteBGRImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Convert MIFF to BGR raster pixels.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
if ((LocaleCompare(image_info->magick,"BGRA") == 0) &&
|
||||
(image->alpha_trait != BlendPixelTrait))
|
||||
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
|
||||
|
||||
+1
-2
@@ -1565,8 +1565,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Initialize BMP raster file header.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) ResetMagickMemory(&bmp_info,0,sizeof(bmp_info));
|
||||
bmp_info.file_size=14+12;
|
||||
if (type > 2)
|
||||
|
||||
+1
-2
@@ -235,8 +235,7 @@ static MagickBooleanType WriteCIPImage(const ImageInfo *image_info,Image *image,
|
||||
(void) FormatLocaleString(buffer,MaxTextExtent,"<Depth>2</Depth>\n");
|
||||
(void) WriteBlobString(image,buffer);
|
||||
(void) WriteBlobString(image,"<Data>");
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
for (y=0; y < (ssize_t) image->rows; y++)
|
||||
{
|
||||
p=GetVirtualPixels(image,0,y,image->columns,1,exception);
|
||||
|
||||
+1
-3
@@ -2561,9 +2561,7 @@ static MagickBooleanType WriteDDSImage(const ImageInfo *image_info,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
pixelFormat=DDPF_FOURCC;
|
||||
compression=FOURCC_DXT5;
|
||||
|
||||
|
||||
+1
-2
@@ -1015,8 +1015,7 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Initialize DIB raster file header.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
if (image->storage_class == DirectClass)
|
||||
{
|
||||
/*
|
||||
|
||||
+1
-2
@@ -331,8 +331,7 @@ static MagickBooleanType WriteFAXImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Convert MIFF to monochrome.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
status=HuffmanEncodeImage(write_info,image,image,exception);
|
||||
if (GetNextImageInList(image) == (Image *) NULL)
|
||||
break;
|
||||
|
||||
+1
-2
@@ -643,8 +643,7 @@ static MagickBooleanType WriteFITSImage(const ImageInfo *image_info,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
/*
|
||||
Allocate image memory.
|
||||
*/
|
||||
|
||||
+1
-2
@@ -853,8 +853,7 @@ static MagickBooleanType WriteFPXImage(const ImageInfo *image_info,Image *image,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) CloseBlob(image);
|
||||
/*
|
||||
Initialize FPX toolkit.
|
||||
|
||||
+1
-2
@@ -1582,8 +1582,7 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image,
|
||||
one=1;
|
||||
do
|
||||
{
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
opacity=(-1);
|
||||
if (IsImageOpaque(image,exception) != MagickFalse)
|
||||
{
|
||||
|
||||
+1
-2
@@ -413,8 +413,7 @@ static MagickBooleanType WriteGRAYImage(const ImageInfo *image_info,
|
||||
/*
|
||||
Write grayscale pixels.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
quantum_type=GrayQuantum;
|
||||
quantum_info=AcquireQuantumInfo(image_info,image);
|
||||
if (quantum_info == (QuantumInfo *) NULL)
|
||||
|
||||
+1
-2
@@ -307,8 +307,7 @@ static MagickBooleanType WriteHRZImage(const ImageInfo *image_info,Image *image,
|
||||
hrz_image=ResizeImage(image,256,240,image->filter,exception);
|
||||
if (hrz_image == (Image *) NULL)
|
||||
return(MagickFalse);
|
||||
if (IssRGBCompatibleColorspace(hrz_image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(hrz_image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(hrz_image,sRGBColorspace,exception);
|
||||
/*
|
||||
Allocate memory for pixels.
|
||||
*/
|
||||
|
||||
+1
-2
@@ -250,8 +250,7 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info,
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
(void) CloseBlob(image);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
*url='\0';
|
||||
if ((LocaleCompare(image_info->magick,"FTP") == 0) ||
|
||||
(LocaleCompare(image_info->magick,"HTTP") == 0))
|
||||
|
||||
+1
-2
@@ -1001,8 +1001,7 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info,
|
||||
/*
|
||||
Initialize ICON raster file header.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(next->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(next,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(next,sRGBColorspace,exception);
|
||||
icon_info.file_size=14+12+28;
|
||||
icon_info.offset_bits=icon_info.file_size;
|
||||
icon_info.compression=BI_RGB;
|
||||
|
||||
+1
-4
@@ -577,10 +577,7 @@ static MagickBooleanType WriteIPLImage(const ImageInfo *image_info,Image *image,
|
||||
ipl_info.time = 1;
|
||||
ipl_info.width = (unsigned int) image->columns;
|
||||
ipl_info.height = (unsigned int) image->rows;
|
||||
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
if(IssRGBCompatibleColorspace(image->colorspace) != MagickFalse) { ipl_info.colors = 3; }
|
||||
else{ ipl_info.colors = 1; }
|
||||
|
||||
|
||||
+1
-2
@@ -450,8 +450,7 @@ static MagickBooleanType WriteJBIGImage(const ImageInfo *image_info,
|
||||
/*
|
||||
Allocate pixel data.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
number_packets=(image->columns+7)/8;
|
||||
pixel_info=AcquireVirtualMemory(number_packets,image->rows*sizeof(*pixels));
|
||||
if (pixel_info == (MemoryInfo *) NULL)
|
||||
|
||||
+1
-2
@@ -899,8 +899,7 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
if (IsGrayColorspace(image->colorspace) != MagickFalse)
|
||||
{
|
||||
channels=1;
|
||||
|
||||
+1
-2
@@ -2162,8 +2162,7 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info,
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
if (image_info->type == TrueColorType)
|
||||
break;
|
||||
if (IsImageGray(image,exception) != MagickFalse)
|
||||
|
||||
+1
-2
@@ -375,8 +375,7 @@ static MagickBooleanType WriteMAPImage(const ImageInfo *image_info,Image *image,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
/*
|
||||
Allocate colormap.
|
||||
*/
|
||||
|
||||
+1
-2
@@ -1230,8 +1230,7 @@ static MagickBooleanType WriteMATImage(const ImageInfo *image_info,Image *image,
|
||||
scene=0;
|
||||
do
|
||||
{
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
is_gray = IsImageGray(image,exception);
|
||||
z = is_gray ? 0 : 3;
|
||||
|
||||
|
||||
+1
-2
@@ -314,8 +314,7 @@ static MagickBooleanType WriteMONOImage(const ImageInfo *image_info,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
/*
|
||||
Convert image to a bi-level image.
|
||||
*/
|
||||
|
||||
+1
-2
@@ -366,8 +366,7 @@ static MagickBooleanType WriteMTVImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Allocate memory for pixels.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
pixels=(unsigned char *) AcquireQuantumMemory((size_t) image->columns,
|
||||
3UL*sizeof(*pixels));
|
||||
if (pixels == (unsigned char *) NULL)
|
||||
|
||||
+1
-2
@@ -334,8 +334,7 @@ static MagickBooleanType WriteOTBImage(const ImageInfo *image_info,Image *image,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
/*
|
||||
Convert image to a bi-level image.
|
||||
*/
|
||||
|
||||
+1
-2
@@ -733,8 +733,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
|
||||
scene=0;
|
||||
do
|
||||
{
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
count=GetNumberColors(image,NULL,exception);
|
||||
for (bits_per_pixel=1; (one << bits_per_pixel) < count; bits_per_pixel*=2) ;
|
||||
if (image_info->depth > 100)
|
||||
|
||||
+1
-2
@@ -1016,8 +1016,7 @@ static MagickBooleanType WritePCDTile(Image *image,const char *page_geometry,
|
||||
tile_image=bordered_image;
|
||||
}
|
||||
(void) TransformImage(&tile_image,(char *) NULL,tile_geometry,exception);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(tile_image,YCCColorspace,exception);
|
||||
(void) TransformImageColorspace(tile_image,YCCColorspace,exception);
|
||||
downsample_image=ResizeImage(tile_image,tile_image->columns/2,
|
||||
tile_image->rows/2,TriangleFilter,exception);
|
||||
if (downsample_image == (Image *) NULL)
|
||||
|
||||
+1
-2
@@ -725,11 +725,10 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
|
||||
one=1;
|
||||
do
|
||||
{
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
/*
|
||||
Initialize the printer.
|
||||
*/
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) WriteBlobString(image,"\033E"); /* printer reset */
|
||||
(void) WriteBlobString(image,"\033*r3F"); /* set presentation mode */
|
||||
(void) FormatLocaleString(buffer,MaxTextExtent,"\033*r%.20gs%.20gT",
|
||||
|
||||
+1
-2
@@ -889,8 +889,7 @@ static MagickBooleanType WritePCXImage(const ImageInfo *image_info,Image *image,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
page_table=(MagickOffsetType *) NULL;
|
||||
if ((LocaleCompare(image_info->magick,"DCX") == 0) ||
|
||||
((GetNextImageInList(image) != (Image *) NULL) &&
|
||||
|
||||
+1
-2
@@ -747,8 +747,7 @@ static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
if (image -> colors <= 2 || GetImageType( image, exception ) == BilevelType) { /* TS */
|
||||
bits_per_pixel = 1;
|
||||
} else if (image -> colors <= 4) {
|
||||
|
||||
+2
-5
@@ -1221,7 +1221,7 @@ RestoreMSCWarning
|
||||
scene=0;
|
||||
do
|
||||
{
|
||||
compression=UndefinedCompression;
|
||||
compression=image->compression;
|
||||
if (image_info->compression != UndefinedCompression)
|
||||
compression=image_info->compression;
|
||||
switch (compression)
|
||||
@@ -1280,10 +1280,7 @@ RestoreMSCWarning
|
||||
break;
|
||||
}
|
||||
if (compression == JPEG2000Compression)
|
||||
{
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
}
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
/*
|
||||
Scale relative to dots-per-inch.
|
||||
*/
|
||||
|
||||
+2
-5
@@ -1402,9 +1402,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info,
|
||||
(void) SetImageExtent(image,
|
||||
MagickMax(image->columns,tile_image->columns),
|
||||
MagickMax(image->rows,tile_image->rows),exception);
|
||||
if (IssRGBCompatibleColorspace(tile_image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,tile_image->colorspace,
|
||||
exception);
|
||||
(void) TransformImageColorspace(image,tile_image->colorspace,exception);
|
||||
(void) CompositeImage(image,tile_image,CopyCompositeOp,MagickTrue,
|
||||
frame.left,frame.right,exception);
|
||||
image->compression=tile_image->compression;
|
||||
@@ -1620,8 +1618,7 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
/*
|
||||
Initialize image info.
|
||||
*/
|
||||
|
||||
+2
-4
@@ -1839,8 +1839,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Convert image to a PNM image.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
if (image->depth <= 8)
|
||||
(void) WriteBlobString(image,"255\n");
|
||||
else
|
||||
@@ -2060,8 +2059,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Convert image to a PNM image.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
if (image->depth > 32)
|
||||
image->depth=32;
|
||||
(void) FormatLocaleString(buffer,MaxTextExtent,"%.20g\n",(double)
|
||||
|
||||
+11
-6
@@ -1366,6 +1366,9 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
|
||||
**labels,
|
||||
page_geometry[MaxTextExtent];
|
||||
|
||||
CompressionType
|
||||
compression;
|
||||
|
||||
const char
|
||||
**s,
|
||||
*value;
|
||||
@@ -1449,6 +1452,9 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
(void) ResetMagickMemory(&bounds,0,sizeof(bounds));
|
||||
compression=image->compression;
|
||||
if (image_info->compression != UndefinedCompression)
|
||||
compression=image_info->compression;
|
||||
page=1;
|
||||
scene=0;
|
||||
do
|
||||
@@ -1456,8 +1462,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Scale relative to dots-per-inch.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
delta.x=DefaultResolution;
|
||||
delta.y=DefaultResolution;
|
||||
resolution.x=image->resolution.x;
|
||||
@@ -1901,9 +1906,9 @@ RestoreMSCWarning
|
||||
*/
|
||||
(void) FormatLocaleString(buffer,MaxTextExtent,"%.20g %.20g\n0\n%d\n",
|
||||
(double) image->columns,(double) image->rows,
|
||||
image_info->compression == RLECompression ? 1 : 0);
|
||||
compression == RLECompression ? 1 : 0);
|
||||
(void) WriteBlobString(image,buffer);
|
||||
switch (image_info->compression)
|
||||
switch (compression)
|
||||
{
|
||||
case RLECompression:
|
||||
{
|
||||
@@ -2029,7 +2034,7 @@ RestoreMSCWarning
|
||||
(void) FormatLocaleString(buffer,MaxTextExtent,
|
||||
"%.20g %.20g\n%d\n%d\n0\n",(double) image->columns,(double)
|
||||
image->rows,image->storage_class == PseudoClass ? 1 : 0,
|
||||
image_info->compression == RLECompression ? 1 : 0);
|
||||
compression == RLECompression ? 1 : 0);
|
||||
(void) WriteBlobString(image,buffer);
|
||||
/*
|
||||
Dump number of colors and colormap.
|
||||
@@ -2045,7 +2050,7 @@ RestoreMSCWarning
|
||||
ScaleQuantumToChar(ClampToQuantum(image->colormap[i].blue)));
|
||||
(void) WriteBlobString(image,buffer);
|
||||
}
|
||||
switch (image_info->compression)
|
||||
switch (compression)
|
||||
{
|
||||
case RLECompression:
|
||||
{
|
||||
|
||||
+1
-1
@@ -469,7 +469,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
compression=UndefinedCompression;
|
||||
compression=image->compression;
|
||||
if (image_info->compression != UndefinedCompression)
|
||||
compression=image_info->compression;
|
||||
switch (compression)
|
||||
|
||||
+1
-1
@@ -885,7 +885,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(MagickFalse);
|
||||
compression=UndefinedCompression;
|
||||
compression=image->compression;
|
||||
if (image_info->compression != UndefinedCompression)
|
||||
compression=image_info->compression;
|
||||
switch (compression)
|
||||
|
||||
+1
-2
@@ -2471,8 +2471,7 @@ static MagickBooleanType WritePSDImage(const ImageInfo *image_info,Image *image,
|
||||
(image->colorspace != CMYKColorspace)) &&
|
||||
(image_info->colorspace != CMYKColorspace))
|
||||
{
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) WriteBlobMSBShort(image,(unsigned short)
|
||||
(image->storage_class == PseudoClass ? IndexedMode : RGBMode));
|
||||
}
|
||||
|
||||
+1
-2
@@ -1109,8 +1109,7 @@ static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,
|
||||
/*
|
||||
Convert MIFF to RGB raster pixels.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
if ((LocaleCompare(image_info->magick,"RGBA") == 0) &&
|
||||
(image->alpha_trait != BlendPixelTrait))
|
||||
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
|
||||
|
||||
+1
-4
@@ -340,18 +340,15 @@ static MagickBooleanType WriteRGFImage(const ImageInfo *image_info,Image *image,
|
||||
assert(exception->signature == MagickSignature);
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
return(status);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
if((image->columns > 255L) || (image->rows > 255L))
|
||||
ThrowWriterException(ImageError,"Dimensions must be less than 255x255");
|
||||
|
||||
/*
|
||||
Write header (just the image dimensions)
|
||||
*/
|
||||
(void) WriteBlobByte(image,image->columns & 0xff);
|
||||
(void) WriteBlobByte(image,image->rows & 0xff);
|
||||
|
||||
/*
|
||||
Convert MIFF to bit pixels.
|
||||
*/
|
||||
|
||||
+1
-2
@@ -927,8 +927,7 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Initialize SGI raster file header.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) ResetMagickMemory(&iris_info,0,sizeof(iris_info));
|
||||
iris_info.magic=0x01DA;
|
||||
compression=image->compression;
|
||||
|
||||
+1
-2
@@ -762,8 +762,7 @@ static MagickBooleanType WriteSUNImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Initialize SUN raster file header.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
sun_info.magic=0x59a66a95;
|
||||
if ((image->columns != (unsigned int) image->columns) ||
|
||||
(image->rows != (unsigned int) image->rows))
|
||||
|
||||
+1
-2
@@ -721,8 +721,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
|
||||
*/
|
||||
if ((image->columns > 65535L) || (image->rows > 65535L))
|
||||
ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
targa_info.id_length=0;
|
||||
value=GetImageProperty(image,"comment",exception);
|
||||
if (value != (const char *) NULL)
|
||||
|
||||
+1
-2
@@ -2999,8 +2999,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((photometric == PHOTOMETRIC_RGB) &&
|
||||
(IssRGBCompatibleColorspace(image->colorspace) == MagickFalse))
|
||||
if (photometric == PHOTOMETRIC_RGB)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
switch (image->endian)
|
||||
{
|
||||
|
||||
+1
-2
@@ -214,8 +214,7 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
transparent=MagickFalse;
|
||||
i=0;
|
||||
p=(const Quantum *) NULL;
|
||||
|
||||
+1
-2
@@ -457,8 +457,7 @@ static MagickBooleanType WriteVICARImage(const ImageInfo *image_info,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
/*
|
||||
Write header.
|
||||
*/
|
||||
|
||||
+1
-2
@@ -981,8 +981,7 @@ static MagickBooleanType WriteVIFFImage(const ImageInfo *image_info,
|
||||
/*
|
||||
Initialize VIFF image structure.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
DisableMSCWarning(4310)
|
||||
viff_info.identifier=(char) 0xab;
|
||||
RestoreMSCWarning
|
||||
|
||||
+1
-2
@@ -378,8 +378,7 @@ static MagickBooleanType WriteWBMPImage(const ImageInfo *image_info,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
/*
|
||||
Convert image to a bi-level image.
|
||||
*/
|
||||
|
||||
+1
-2
@@ -583,8 +583,7 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
|
||||
/*
|
||||
Allocate memory for pixels.
|
||||
*/
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
pixel_info=AcquireVirtualMemory(image->columns,image->rows*
|
||||
sizeof(*picture.argb));
|
||||
if (pixel_info == (MemoryInfo *) NULL)
|
||||
|
||||
+1
-2
@@ -511,8 +511,7 @@ static MagickBooleanType WriteXBMImage(const ImageInfo *image_info,Image *image,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
/*
|
||||
Write X bitmap header.
|
||||
*/
|
||||
|
||||
+1
-2
@@ -634,8 +634,7 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
SetGeometry(image,&geometry);
|
||||
(void) ParseMetaGeometry(PiconGeometry,&geometry.x,&geometry.y,
|
||||
&geometry.width,&geometry.height);
|
||||
|
||||
+1
-2
@@ -647,8 +647,7 @@ static MagickBooleanType WriteXWDImage(const ImageInfo *image_info,Image *image,
|
||||
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
|
||||
if (status == MagickFalse)
|
||||
return(status);
|
||||
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
(void) TransformImageColorspace(image,sRGBColorspace,exception);
|
||||
/*
|
||||
Initialize XWD file header.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user