summaryrefslogtreecommitdiff
path: root/coders
diff options
context:
space:
mode:
authorWenjie Zhou <zhouwenjie@google.com>2019-12-28 01:32:26 +0000
committerWenjie Zhou <zhouwenjie@google.com>2019-12-28 01:38:45 +0000
commit321c3aad9f897c6e6041d3b8fa5b3a2efc930445 (patch)
tree26a0cc77bb00efc51979bb5303d0b906c628a2ee /coders
parent1a0c68c49b36e245a43a4505fc032ce87ca19000 (diff)
downloadImageMagick-321c3aad9f897c6e6041d3b8fa5b3a2efc930445.tar.gz
Revert "Upgrade ImageMagick to '00c6fca4eccc3377114cc17346a77a096d00c9db'"
This reverts commit 1a0c68c49b36e245a43a4505fc032ce87ca19000. Reason for revert: Causing build failure Bug: 146941771 Change-Id: Ibaa2d6926c7a41f336618a1126b94d10f7c99a97
Diffstat (limited to 'coders')
-rw-r--r--coders/Makefile.am17
-rw-r--r--coders/aai.c2
-rw-r--r--coders/aai.h2
-rw-r--r--coders/art.c21
-rw-r--r--coders/art.h2
-rw-r--r--coders/avs.c2
-rw-r--r--coders/avs.h2
-rw-r--r--coders/bgr.c125
-rw-r--r--coders/bgr.h2
-rw-r--r--coders/bmp.c91
-rw-r--r--coders/bmp.h2
-rw-r--r--coders/braille.c2
-rw-r--r--coders/braille.h2
-rw-r--r--coders/bytebuffer-private.h2
-rw-r--r--coders/cals.c2
-rw-r--r--coders/cals.h2
-rw-r--r--coders/caption.c6
-rw-r--r--coders/caption.h2
-rw-r--r--coders/cin.c18
-rw-r--r--coders/cin.h2
-rw-r--r--coders/cip.c2
-rw-r--r--coders/cip.h2
-rw-r--r--coders/clip.c2
-rw-r--r--coders/clip.h2
-rw-r--r--coders/clipboard.c14
-rw-r--r--coders/clipboard.h2
-rw-r--r--coders/cmyk.c114
-rw-r--r--coders/cmyk.h2
-rw-r--r--coders/coders-list.h11
-rw-r--r--coders/coders-private.h2
-rw-r--r--coders/coders.h11
-rw-r--r--coders/cube.c2
-rw-r--r--coders/cube.h2
-rw-r--r--coders/cut.h2
-rw-r--r--coders/dcm.c8
-rw-r--r--coders/dcm.h2
-rw-r--r--coders/dds.c2
-rw-r--r--coders/dds.h2
-rw-r--r--coders/debug.c2
-rw-r--r--coders/debug.h2
-rw-r--r--coders/dib.c2
-rw-r--r--coders/dib.h2
-rw-r--r--coders/djvu.c2
-rw-r--r--coders/djvu.h2
-rw-r--r--coders/dng.c16
-rw-r--r--coders/dng.h5
-rw-r--r--coders/dot.c2
-rw-r--r--coders/dot.h2
-rw-r--r--coders/dps.c2
-rw-r--r--coders/dps.h2
-rw-r--r--coders/dpx.c23
-rw-r--r--coders/dpx.h2
-rw-r--r--coders/emf.c2
-rw-r--r--coders/emf.h2
-rw-r--r--coders/ept.c21
-rw-r--r--coders/ept.h2
-rw-r--r--coders/exr.c14
-rw-r--r--coders/exr.h2
-rw-r--r--coders/fax.c2
-rw-r--r--coders/fax.h2
-rw-r--r--coders/fits.c2
-rw-r--r--coders/fits.h2
-rw-r--r--coders/flif.c2
-rw-r--r--coders/flif.h2
-rw-r--r--coders/fpx.c2
-rw-r--r--coders/fpx.h2
-rw-r--r--coders/ghostscript-private.h2
-rw-r--r--coders/gif.c2
-rw-r--r--coders/gif.h2
-rw-r--r--coders/gradient.c2
-rw-r--r--coders/gradient.h2
-rw-r--r--coders/gray.c70
-rw-r--r--coders/gray.h2
-rw-r--r--coders/hald.c2
-rw-r--r--coders/hald.h2
-rw-r--r--coders/hdr.c12
-rw-r--r--coders/hdr.h2
-rw-r--r--coders/heic.c17
-rw-r--r--coders/heic.h2
-rw-r--r--coders/histogram.c2
-rw-r--r--coders/histogram.h2
-rw-r--r--coders/hrz.c2
-rw-r--r--coders/hrz.h2
-rw-r--r--coders/html.c2
-rw-r--r--coders/html.h2
-rw-r--r--coders/icon.c2
-rw-r--r--coders/icon.h2
-rw-r--r--coders/info.c2
-rw-r--r--coders/info.h2
-rw-r--r--coders/inline.c2
-rw-r--r--coders/inline.h2
-rw-r--r--coders/ipl.c2
-rw-r--r--coders/ipl.h2
-rw-r--r--coders/jbig.c2
-rw-r--r--coders/jbig.h2
-rw-r--r--coders/jnx.c2
-rw-r--r--coders/jnx.h2
-rw-r--r--coders/jp2.c4
-rw-r--r--coders/jp2.h2
-rw-r--r--coders/jpeg.c49
-rw-r--r--coders/jpeg.h2
-rw-r--r--coders/json.c2
-rw-r--r--coders/json.h2
-rw-r--r--coders/jxl.c326
-rw-r--r--coders/jxl.h34
-rw-r--r--coders/label.c8
-rw-r--r--coders/label.h2
-rw-r--r--coders/mac.c2
-rw-r--r--coders/mac.h2
-rw-r--r--coders/magick.c2
-rw-r--r--coders/magick.h2
-rw-r--r--coders/map.c2
-rw-r--r--coders/map.h2
-rw-r--r--coders/mask.c2
-rw-r--r--coders/mask.h2
-rw-r--r--coders/mat.c6
-rw-r--r--coders/mat.h2
-rw-r--r--coders/matte.c2
-rw-r--r--coders/matte.h2
-rw-r--r--coders/meta.c3
-rw-r--r--coders/meta.h2
-rw-r--r--coders/miff.c79
-rw-r--r--coders/miff.h2
-rw-r--r--coders/mono.c2
-rw-r--r--coders/mono.h2
-rw-r--r--coders/mpc.c2
-rw-r--r--coders/mpc.h2
-rw-r--r--coders/mpeg.c2
-rw-r--r--coders/mpeg.h2
-rw-r--r--coders/mpr.c2
-rw-r--r--coders/mpr.h2
-rw-r--r--coders/msl.c20
-rw-r--r--coders/msl.h2
-rw-r--r--coders/mtv.c2
-rw-r--r--coders/mtv.h2
-rw-r--r--coders/mvg.c2
-rw-r--r--coders/mvg.h2
-rw-r--r--coders/null.c2
-rw-r--r--coders/null.h2
-rw-r--r--coders/otb.c2
-rw-r--r--coders/otb.h2
-rw-r--r--coders/palm.c14
-rw-r--r--coders/palm.h2
-rw-r--r--coders/pango.c2
-rw-r--r--coders/pango.h2
-rw-r--r--coders/pattern.c2
-rw-r--r--coders/pattern.h2
-rw-r--r--coders/pcd.c2
-rw-r--r--coders/pcd.h2
-rw-r--r--coders/pcl.c2
-rw-r--r--coders/pcl.h2
-rw-r--r--coders/pcx.c22
-rw-r--r--coders/pcx.h2
-rw-r--r--coders/pdb.c2
-rw-r--r--coders/pdb.h2
-rw-r--r--coders/pdf.c150
-rw-r--r--coders/pdf.h5
-rw-r--r--coders/pes.c2
-rw-r--r--coders/pes.h2
-rw-r--r--coders/pgx.c17
-rw-r--r--coders/pgx.h2
-rw-r--r--coders/pict.c4
-rw-r--r--coders/pict.h2
-rw-r--r--coders/pix.c2
-rw-r--r--coders/pix.h2
-rw-r--r--coders/plasma.c2
-rw-r--r--coders/plasma.h2
-rw-r--r--coders/png.c29
-rw-r--r--coders/png.h2
-rw-r--r--coders/pnm.c60
-rw-r--r--coders/pnm.h2
-rw-r--r--coders/ps.c47
-rw-r--r--coders/ps.h2
-rw-r--r--coders/ps2.c2
-rw-r--r--coders/ps2.h2
-rw-r--r--coders/ps3.c2
-rw-r--r--coders/ps3.h2
-rw-r--r--coders/psd-private.h2
-rw-r--r--coders/psd.c2
-rw-r--r--coders/psd.h2
-rw-r--r--coders/pwp.c2
-rw-r--r--coders/pwp.h2
-rw-r--r--coders/raw.c23
-rw-r--r--coders/raw.h2
-rw-r--r--coders/rgb.c123
-rw-r--r--coders/rgb.h2
-rw-r--r--coders/rgf.c2
-rw-r--r--coders/rgf.h2
-rw-r--r--coders/rla.c2
-rw-r--r--coders/rla.h2
-rw-r--r--coders/rle.c2
-rw-r--r--coders/rle.h2
-rw-r--r--coders/scr.c2
-rw-r--r--coders/scr.h2
-rw-r--r--coders/screenshot.c2
-rw-r--r--coders/screenshot.h2
-rw-r--r--coders/sct.c2
-rw-r--r--coders/sct.h2
-rw-r--r--coders/sfw.c2
-rw-r--r--coders/sfw.h2
-rw-r--r--coders/sgi.c2
-rw-r--r--coders/sgi.h2
-rw-r--r--coders/sixel.c2
-rw-r--r--coders/sixel.h2
-rw-r--r--coders/stegano.c2
-rw-r--r--coders/stegano.h2
-rw-r--r--coders/sun.c9
-rw-r--r--coders/sun.h2
-rw-r--r--coders/svg.c71
-rw-r--r--coders/svg.h2
-rw-r--r--coders/tga.c102
-rw-r--r--coders/tga.h2
-rw-r--r--coders/thumbnail.c2
-rw-r--r--coders/thumbnail.h2
-rw-r--r--coders/tiff.c83
-rw-r--r--coders/tiff.h2
-rw-r--r--coders/tile.c2
-rw-r--r--coders/tile.h2
-rw-r--r--coders/tim.c2
-rw-r--r--coders/tim.h2
-rw-r--r--coders/tim2.h2
-rw-r--r--coders/ttf.c2
-rw-r--r--coders/ttf.h2
-rw-r--r--coders/txt.c22
-rw-r--r--coders/txt.h2
-rw-r--r--coders/uil.c2
-rw-r--r--coders/uil.h2
-rw-r--r--coders/url.c2
-rw-r--r--coders/url.h2
-rw-r--r--coders/uyvy.c2
-rw-r--r--coders/uyvy.h2
-rw-r--r--coders/vicar.c17
-rw-r--r--coders/vicar.h2
-rw-r--r--coders/vid.c2
-rw-r--r--coders/vid.h2
-rw-r--r--coders/viff.c9
-rw-r--r--coders/viff.h2
-rw-r--r--coders/vips.c2
-rw-r--r--coders/vips.h2
-rw-r--r--coders/wbmp.c2
-rw-r--r--coders/wbmp.h2
-rw-r--r--coders/webp.c624
-rw-r--r--coders/webp.h2
-rw-r--r--coders/wmf.c88
-rw-r--r--coders/wmf.h2
-rw-r--r--coders/wpg.c10
-rw-r--r--coders/wpg.h2
-rw-r--r--coders/x.c2
-rw-r--r--coders/x.h2
-rw-r--r--coders/xbm.c2
-rw-r--r--coders/xbm.h2
-rw-r--r--coders/xc.c2
-rw-r--r--coders/xc.h2
-rw-r--r--coders/xcf.c2
-rw-r--r--coders/xcf.h2
-rw-r--r--coders/xpm.c4
-rw-r--r--coders/xpm.h2
-rw-r--r--coders/xps.c2
-rw-r--r--coders/xps.h2
-rw-r--r--coders/xtrn.c2
-rw-r--r--coders/xtrn.h2
-rw-r--r--coders/xwd.c2
-rw-r--r--coders/xwd.h2
-rw-r--r--coders/ycbcr.c104
-rw-r--r--coders/ycbcr.h2
-rw-r--r--coders/yuv.c2
-rw-r--r--coders/yuv.h2
267 files changed, 1225 insertions, 1987 deletions
diff --git a/coders/Makefile.am b/coders/Makefile.am
index 67a891cde..4970ee3df 100644
--- a/coders/Makefile.am
+++ b/coders/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+# Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
# dedicated to making software imaging solutions freely available.
#
# You may not use this file except in compliance with the License. You may
@@ -57,11 +57,6 @@ MAGICKCORE_JPEG_MODULES = coders/jpeg.la
MAGICKCORE_JPEG_SRCS = coders/jpeg.c
endif
-if JXL_DELEGATE
-MAGICKCORE_JXL_MODULES = coders/jxl.la
-MAGICKCORE_JXL_SRCS = coders/jxl.c
-endif
-
if LIBOPENJP2_DELEGATE
MAGICKCORE_JP2_MODULES = coders/jp2.la
MAGICKCORE_JP2_SRCS = coders/jp2.c
@@ -193,7 +188,6 @@ MAGICKCORE_CODER_SRCS = \
coders/jpeg.h \
coders/json.c \
coders/json.h \
- coders/jxl.h \
coders/label.c \
coders/label.h \
coders/mac.c \
@@ -362,7 +356,6 @@ MAGICKCORE_CODER_SRCS = \
$(MAGICKCORE_JBIG_SRCS) \
$(MAGICKCORE_JPEG_SRCS) \
$(MAGICKCORE_JP2_SRCS) \
- $(MAGICKCORE_JXL_SRCS) \
$(MAGICKCORE_PNG_SRCS) \
$(MAGICKCORE_TIFF_SRCS) \
$(MAGICKCORE_WEBP_SRCS) \
@@ -424,7 +417,6 @@ CODERS_NOINST_HDRS = \
coders/jp2.h \
coders/jpeg.h \
coders/json.h \
- coders/jxl.h \
coders/label.h \
coders/mac.h \
coders/magick.h \
@@ -631,7 +623,6 @@ coders_LTLIBRARIES = \
$(MAGICKCORE_JBIG_MODULES) \
$(MAGICKCORE_JPEG_MODULES) \
$(MAGICKCORE_JP2_MODULES) \
- $(MAGICKCORE_JXL_MODULES) \
$(MAGICKCORE_PNG_MODULES) \
$(MAGICKCORE_TIFF_MODULES) \
$(MAGICKCORE_WEBP_MODULES) \
@@ -935,12 +926,6 @@ coders_json_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS)
coders_json_la_LDFLAGS = $(MODULECOMMONFLAGS)
coders_json_la_LIBADD = $(MAGICKCORE_LIBS)
-# JXL coder module
-coders_jxl_la_SOURCES = coders/jxl.c
-coders_jxl_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS)
-coders_jxl_la_LDFLAGS = $(MODULECOMMONFLAGS)
-coders_jxl_la_LIBADD = $(MAGICKCORE_LIBS) $(JXL_LIBS)
-
# LABEL coder module
coders_label_la_SOURCES = coders/label.c
coders_label_la_CPPFLAGS = $(MAGICK_CODER_CPPFLAGS)
diff --git a/coders/aai.c b/coders/aai.c
index 3e684fe02..dc05a18cf 100644
--- a/coders/aai.c
+++ b/coders/aai.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/aai.h b/coders/aai.h
index d9157c0c8..40fc04314 100644
--- a/coders/aai.h
+++ b/coders/aai.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/art.c b/coders/art.c
index 1872dc728..834d3828b 100644
--- a/coders/art.c
+++ b/coders/art.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -97,6 +97,9 @@ static MagickBooleanType
*/
static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
+ const unsigned char
+ *pixels;
+
Image
*image;
@@ -113,9 +116,6 @@ static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception)
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
@@ -157,25 +157,22 @@ static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
length=GetQuantumExtent(image,quantum_info,GrayQuantum);
- pixels=GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)
{
- const void
- *stream;
-
register Quantum
*magick_restrict q;
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
(void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
- GrayQuantum,(unsigned char *) stream,exception);
- stream=ReadBlobStream(image,(size_t) (-(ssize_t) length) & 0x01,pixels,
- &count);
+ GrayQuantum,pixels,exception);
+ pixels=(const unsigned char *) ReadBlobStream(image,(size_t) (-(ssize_t)
+ length) & 0x01,GetQuantumPixels(quantum_info),&count);
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
if (SetImageProgress(image,LoadImageTag,y,image->rows) == MagickFalse)
diff --git a/coders/art.h b/coders/art.h
index 854d4e397..3a58c3327 100644
--- a/coders/art.h
+++ b/coders/art.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/avs.c b/coders/avs.c
index 38344195d..6dbf54032 100644
--- a/coders/avs.c
+++ b/coders/avs.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/avs.h b/coders/avs.h
index 0f1793555..c04230e9d 100644
--- a/coders/avs.h
+++ b/coders/avs.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/bgr.c b/coders/bgr.c
index 89874731c..215f66d9d 100644
--- a/coders/bgr.c
+++ b/coders/bgr.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -97,10 +97,11 @@ static MagickBooleanType
% o exception: return any errors or warnings in this structure.
%
*/
-static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
+static Image *ReadBGRImage(const ImageInfo *image_info,
+ ExceptionInfo *exception)
{
- const void
- *stream;
+ const unsigned char
+ *pixels;
Image
*canvas_image,
@@ -128,9 +129,6 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
@@ -184,7 +182,7 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
image->alpha_trait=BlendPixelTrait;
canvas_image->alpha_trait=BlendPixelTrait;
}
- pixels=GetQuantumPixels(quantum_info);
+ pixels=(const unsigned char *) NULL;
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
{
@@ -195,7 +193,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
@@ -204,7 +203,6 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
length=0;
scene=0;
status=MagickTrue;
- stream=NULL;
do
{
/*
@@ -227,7 +225,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -252,10 +251,10 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,quantum_type,(unsigned char *) stream,exception);
+ quantum_info,quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
- if (((y-image->extract_info.y) >= 0) &&
+ if (((y-image->extract_info.y) >= 0) &&
((y-image->extract_info.y) < (ssize_t) image->rows))
{
p=GetVirtualPixels(canvas_image,canvas_image->extract_info.x,0,
@@ -286,7 +285,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (status == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
break;
}
@@ -307,7 +307,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -335,10 +336,10 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,quantum_type,(unsigned char *) stream,exception);
+ quantum_info,quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
- if (((y-image->extract_info.y) >= 0) &&
+ if (((y-image->extract_info.y) >= 0) &&
((y-image->extract_info.y) < (ssize_t) image->rows))
{
p=GetVirtualPixels(canvas_image,canvas_image->extract_info.x,0,
@@ -386,7 +387,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -406,7 +408,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -431,10 +434,10 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,RedQuantum,(unsigned char *) stream,exception);
+ quantum_info,RedQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
- if (((y-image->extract_info.y) >= 0) &&
+ if (((y-image->extract_info.y) >= 0) &&
((y-image->extract_info.y) < (ssize_t) image->rows))
{
p=GetVirtualPixels(canvas_image,canvas_image->extract_info.x,0,
@@ -453,7 +456,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -484,10 +488,10 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,GreenQuantum,(unsigned char *) stream,exception);
+ quantum_info,GreenQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
- if (((y-image->extract_info.y) >= 0) &&
+ if (((y-image->extract_info.y) >= 0) &&
((y-image->extract_info.y) < (ssize_t) image->rows))
{
p=GetVirtualPixels(canvas_image,canvas_image->extract_info.x,0,
@@ -506,7 +510,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -537,10 +542,10 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlueQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlueQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
- if (((y-image->extract_info.y) >= 0) &&
+ if (((y-image->extract_info.y) >= 0) &&
((y-image->extract_info.y) < (ssize_t) image->rows))
{
p=GetVirtualPixels(canvas_image,canvas_image->extract_info.x,0,
@@ -559,7 +564,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -598,10 +604,10 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,AlphaQuantum,(unsigned char *) stream,exception);
+ quantum_info,AlphaQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
- if (((y-image->extract_info.y) >= 0) &&
+ if (((y-image->extract_info.y) >= 0) &&
((y-image->extract_info.y) < (ssize_t) image->rows))
{
p=GetVirtualPixels(canvas_image,
@@ -621,7 +627,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -650,8 +657,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (DiscardBlobBytes(image,(MagickSizeType) image->offset) == MagickFalse)
{
status=MagickFalse;
- ThrowFileException(exception,CorruptImageError,
- "UnexpectedEndOfFile",image->filename);
+ ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
+ image->filename);
break;
}
length=GetQuantumExtent(canvas_image,quantum_info,BlueQuantum);
@@ -659,14 +666,16 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -690,10 +699,10 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlueQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlueQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
- if (((y-image->extract_info.y) >= 0) &&
+ if (((y-image->extract_info.y) >= 0) &&
((y-image->extract_info.y) < (ssize_t) image->rows))
{
p=GetVirtualPixels(canvas_image,canvas_image->extract_info.x,0,
@@ -712,7 +721,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -730,14 +740,16 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -761,10 +773,10 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,GreenQuantum,(unsigned char *) stream,exception);
+ quantum_info,GreenQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
- if (((y-image->extract_info.y) >= 0) &&
+ if (((y-image->extract_info.y) >= 0) &&
((y-image->extract_info.y) < (ssize_t) image->rows))
{
p=GetVirtualPixels(canvas_image,canvas_image->extract_info.x,0,
@@ -783,7 +795,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -801,14 +814,16 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -832,10 +847,10 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,RedQuantum,(unsigned char *) stream,exception);
+ quantum_info,RedQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
- if (((y-image->extract_info.y) >= 0) &&
+ if (((y-image->extract_info.y) >= 0) &&
((y-image->extract_info.y) < (ssize_t) image->rows))
{
p=GetVirtualPixels(canvas_image,canvas_image->extract_info.x,0,
@@ -854,7 +869,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -874,14 +890,16 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -905,10 +923,10 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlueQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlueQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
- if (((y-image->extract_info.y) >= 0) &&
+ if (((y-image->extract_info.y) >= 0) &&
((y-image->extract_info.y) < (ssize_t) image->rows))
{
p=GetVirtualPixels(canvas_image,canvas_image->extract_info.x,
@@ -927,7 +945,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
diff --git a/coders/bgr.h b/coders/bgr.h
index 866c2c729..13a00ae32 100644
--- a/coders/bgr.h
+++ b/coders/bgr.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/bmp.c b/coders/bmp.c
index 6ea9bc1a7..c964834fe 100644
--- a/coders/bmp.c
+++ b/coders/bmp.c
@@ -18,7 +18,7 @@
% December 2001 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -524,9 +524,6 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
profile_size,
start_position;
- MagickSizeType
- blob_size;
-
MemoryInfo
*pixel_info;
@@ -589,7 +586,6 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
count=ReadBlob(image,2,magick);
if (count != 2)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
- blob_size=GetBlobSize(image);
do
{
PixelInfo
@@ -657,22 +653,20 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
/*
Microsoft Windows BMP image file.
*/
+ if (bmp_info.size < 40)
+ ThrowReaderException(CorruptImageError,"NonOS2HeaderSizeError");
bmp_info.width=(ssize_t) ReadBlobLSBSignedLong(image);
bmp_info.height=(ssize_t) ReadBlobLSBSignedLong(image);
bmp_info.planes=ReadBlobLSBShort(image);
bmp_info.bits_per_pixel=ReadBlobLSBShort(image);
bmp_info.compression=ReadBlobLSBLong(image);
- if (bmp_info.size > 16)
- {
- bmp_info.image_size=ReadBlobLSBLong(image);
- bmp_info.x_pixels=ReadBlobLSBLong(image);
- bmp_info.y_pixels=ReadBlobLSBLong(image);
- bmp_info.number_colors=ReadBlobLSBLong(image);
- if ((MagickSizeType) bmp_info.number_colors > blob_size)
- ThrowReaderException(CorruptImageError,
- "InsufficientImageDataInFile");
- bmp_info.colors_important=ReadBlobLSBLong(image);
- }
+ bmp_info.image_size=ReadBlobLSBLong(image);
+ bmp_info.x_pixels=ReadBlobLSBLong(image);
+ bmp_info.y_pixels=ReadBlobLSBLong(image);
+ bmp_info.number_colors=ReadBlobLSBLong(image);
+ if ((MagickSizeType) bmp_info.number_colors > GetBlobSize(image))
+ ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
+ bmp_info.colors_important=ReadBlobLSBLong(image);
if (image->debug != MagickFalse)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
@@ -729,12 +723,9 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Number of colors: %u",bmp_info.number_colors);
}
- if ((bmp_info.size > 40) || (bmp_info.compression == BI_BITFIELDS))
- {
- bmp_info.red_mask=ReadBlobLSBLong(image);
- bmp_info.green_mask=ReadBlobLSBLong(image);
- bmp_info.blue_mask=ReadBlobLSBLong(image);
- }
+ bmp_info.red_mask=ReadBlobLSBLong(image);
+ bmp_info.green_mask=ReadBlobLSBLong(image);
+ bmp_info.blue_mask=ReadBlobLSBLong(image);
if (bmp_info.size > 40)
{
double
@@ -835,17 +826,14 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
(void) ReadBlobLSBLong(image); /* Reserved byte */
}
}
- if ((MagickSizeType) bmp_info.file_size != blob_size)
- {
- ExceptionType
- severity;
-
- severity=CorruptImageWarning;
- if ((MagickSizeType) bmp_info.file_size > blob_size + 4)
- severity=CorruptImageError;
- (void) ThrowMagickException(exception,GetMagickModule(),severity,
- "LengthAndFilesizeDoNotMatch","`%s'",image->filename);
- }
+ if ((MagickSizeType) bmp_info.file_size > GetBlobSize(image))
+ (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError,
+ "LengthAndFilesizeDoNotMatch","`%s'",image->filename);
+ else
+ if ((MagickSizeType) bmp_info.file_size < GetBlobSize(image))
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ CorruptImageWarning,"LengthAndFilesizeDoNotMatch","`%s'",
+ image->filename);
if (bmp_info.width <= 0)
ThrowReaderException(CorruptImageError,"NegativeOrZeroImageSize");
if (bmp_info.height == 0)
@@ -859,11 +847,11 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (bmp_info.bits_per_pixel < 16 &&
bmp_info.number_colors > (1U << bmp_info.bits_per_pixel))
ThrowReaderException(CorruptImageError,"UnrecognizedNumberOfColors");
- if ((bmp_info.compression == BI_RLE8) && (bmp_info.bits_per_pixel != 8))
+ if ((bmp_info.compression == 1) && (bmp_info.bits_per_pixel != 8))
ThrowReaderException(CorruptImageError,"UnsupportedBitsPerPixel");
- if ((bmp_info.compression == BI_RLE4) && (bmp_info.bits_per_pixel != 4))
+ if ((bmp_info.compression == 2) && (bmp_info.bits_per_pixel != 4))
ThrowReaderException(CorruptImageError,"UnsupportedBitsPerPixel");
- if ((bmp_info.compression == BI_BITFIELDS) && (bmp_info.bits_per_pixel < 16))
+ if ((bmp_info.compression == 3) && (bmp_info.bits_per_pixel < 16))
ThrowReaderException(CorruptImageError,"UnsupportedBitsPerPixel");
switch (bmp_info.compression)
{
@@ -970,7 +958,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
bmp_info.bits_per_pixel<<=1;
bytes_per_line=4*((image->columns*bmp_info.bits_per_pixel+31)/32);
length=(size_t) bytes_per_line*image->rows;
- if ((MagickSizeType) (length/256) > blob_size)
+ if ((MagickSizeType) (length/256) > GetBlobSize(image))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
if ((bmp_info.compression == BI_RGB) ||
(bmp_info.compression == BI_BITFIELDS))
@@ -1469,7 +1457,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
offset=start_position+14+profile_data;
if ((offset < TellBlob(image)) ||
(SeekBlob(image,offset,SEEK_SET) != offset) ||
- (blob_size < (MagickSizeType) (offset+profile_size)))
+ (GetBlobSize(image) < (MagickSizeType) (offset+profile_size)))
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
profile=AcquireStringInfo((size_t) profile_size);
if (profile == (StringInfo *) NULL)
@@ -1521,7 +1509,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
break;
}
image=SyncNextImageInList(image);
- status=SetImageProgress(image,LoadImagesTag,TellBlob(image),blob_size);
+ status=SetImageProgress(image,LoadImagesTag,TellBlob(image),
+ GetBlobSize(image));
if (status == MagickFalse)
break;
}
@@ -2313,32 +2302,32 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
else
(void) WriteBlobLSBLong(image,0x73524742U); /* sRGB */
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) image->chromaticity.red_primary.x*0x40000000));
+ (image->chromaticity.red_primary.x*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) image->chromaticity.red_primary.y*0x40000000));
+ (image->chromaticity.red_primary.y*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) (1.000f-(image->chromaticity.red_primary.x+
+ ((1.000f-(image->chromaticity.red_primary.x+
image->chromaticity.red_primary.y))*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) image->chromaticity.green_primary.x*0x40000000));
+ (image->chromaticity.green_primary.x*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) image->chromaticity.green_primary.y*0x40000000));
+ (image->chromaticity.green_primary.y*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) (1.000f-(image->chromaticity.green_primary.x+
+ ((1.000f-(image->chromaticity.green_primary.x+
image->chromaticity.green_primary.y))*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) image->chromaticity.blue_primary.x*0x40000000));
+ (image->chromaticity.blue_primary.x*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) image->chromaticity.blue_primary.y*0x40000000));
+ (image->chromaticity.blue_primary.y*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) (1.000f-(image->chromaticity.blue_primary.x+
+ ((1.000f-(image->chromaticity.blue_primary.x+
image->chromaticity.blue_primary.y))*0x40000000));
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) bmp_info.gamma_scale.x*0x10000));
+ (bmp_info.gamma_scale.x*0x10000));
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) bmp_info.gamma_scale.y*0x10000));
+ (bmp_info.gamma_scale.y*0x10000));
(void) WriteBlobLSBLong(image,(unsigned int)
- ((ssize_t) bmp_info.gamma_scale.z*0x10000));
+ (bmp_info.gamma_scale.z*0x10000));
if ((image->rendering_intent != UndefinedIntent) ||
(profile != (StringInfo *) NULL))
{
diff --git a/coders/bmp.h b/coders/bmp.h
index d414f0b11..f810a1491 100644
--- a/coders/bmp.h
+++ b/coders/bmp.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/braille.c b/coders/braille.c
index 188a5bf70..1db627df3 100644
--- a/coders/braille.c
+++ b/coders/braille.c
@@ -15,7 +15,7 @@
% February 2008 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/braille.h b/coders/braille.h
index c8ea23a7d..3e7bbb339 100644
--- a/coders/braille.h
+++ b/coders/braille.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/bytebuffer-private.h b/coders/bytebuffer-private.h
index 38cf74136..f53b5ee1f 100644
--- a/coders/bytebuffer-private.h
+++ b/coders/bytebuffer-private.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/cals.c b/coders/cals.c
index 9c677d1c6..25af653de 100644
--- a/coders/cals.c
+++ b/coders/cals.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/cals.h b/coders/cals.h
index f2ee57e2c..00761b2dc 100644
--- a/coders/cals.h
+++ b/coders/cals.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/caption.c b/coders/caption.c
index d9382447f..929b24933 100644
--- a/coders/caption.c
+++ b/coders/caption.c
@@ -17,7 +17,7 @@
% February 2002 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -304,8 +304,8 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info,
caption=DestroyString(caption);
(void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g",MagickMax(
draw_info->direction == RightToLeftDirection ? (double) image->columns-
- metrics.bounds.x2 : -metrics.bounds.x1,0.0),(draw_info->gravity ==
- UndefinedGravity ? MagickMax(metrics.ascent,metrics.bounds.y2) : 0.0));
+ metrics.bounds.x2 : -metrics.bounds.x1,0.0),draw_info->gravity ==
+ UndefinedGravity ? MagickMax(metrics.ascent,metrics.bounds.y2) : 0.0);
(void) CloneString(&draw_info->geometry,geometry);
status=AnnotateImage(image,draw_info,exception);
if (image_info->pointsize == 0.0)
diff --git a/coders/caption.h b/coders/caption.h
index 32959a4d9..3fae33da9 100644
--- a/coders/caption.h
+++ b/coders/caption.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/cin.c b/coders/cin.c
index fa3808d9a..c04cce3aa 100644
--- a/coders/cin.c
+++ b/coders/cin.c
@@ -20,7 +20,7 @@
% October 2003 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -388,6 +388,9 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception)
CINInfo
cin;
+ const unsigned char
+ *pixels;
+
Image
*image;
@@ -417,9 +420,7 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception)
y;
unsigned char
- magick[4],
- *pixels;
-
+ magick[4];
/*
Open image file.
@@ -759,20 +760,17 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception)
quantum_type=GrayQuantum;
length=GetBytesPerRow(image->columns,1,image->depth,MagickTrue);
}
- pixels=GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)
{
- const void
- *stream;
-
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if ((size_t) count != length)
break;
(void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
- quantum_type,(unsigned char *) stream,exception);
+ quantum_type,pixels,exception);
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
if (image->previous == (Image *) NULL)
diff --git a/coders/cin.h b/coders/cin.h
index 31f454e7c..4de0ce3b9 100644
--- a/coders/cin.h
+++ b/coders/cin.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/cip.c b/coders/cip.c
index 2050c75e7..41a928896 100644
--- a/coders/cip.c
+++ b/coders/cip.c
@@ -16,7 +16,7 @@
% April 2004 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/cip.h b/coders/cip.h
index a7bb20a42..3a381995e 100644
--- a/coders/cip.h
+++ b/coders/cip.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/clip.c b/coders/clip.c
index c05c4f64c..51d6c7a84 100644
--- a/coders/clip.c
+++ b/coders/clip.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/clip.h b/coders/clip.h
index 6e0966183..64fb89b1d 100644
--- a/coders/clip.h
+++ b/coders/clip.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/clipboard.c b/coders/clipboard.c
index 4a2c2d3a6..50d51f04f 100644
--- a/coders/clipboard.c
+++ b/coders/clipboard.c
@@ -17,7 +17,7 @@
% May 2002 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -138,7 +138,7 @@ static Image *ReadCLIPBOARDImage(const ImageInfo *image_info,
ssize_t
y;
- unsigned char
+ unsigned int
offset;
void
@@ -152,7 +152,8 @@ static Image *ReadCLIPBOARDImage(const ImageInfo *image_info,
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickCoreSignature);
image=AcquireImage(image_info,exception);
- if (!IsClipboardFormatAvailable(CF_DIB) &&
+ if (!IsClipboardFormatAvailable(CF_BITMAP) &&
+ !IsClipboardFormatAvailable(CF_DIB) &&
!IsClipboardFormatAvailable(CF_DIBV5))
ThrowReaderException(CoderError,"NoBitmapOnClipboard");
if (!OpenClipboard(NULL))
@@ -177,7 +178,6 @@ static Image *ReadCLIPBOARDImage(const ImageInfo *image_info,
if (clip_mem == (LPVOID) NULL)
{
CloseClipboard();
- clip_data=RelinquishMagickMemory(clip_data);
ThrowReaderException(CoderError,"UnableToReadImageData");
}
p=(unsigned char *) clip_data;
@@ -186,9 +186,7 @@ static Image *ReadCLIPBOARDImage(const ImageInfo *image_info,
(void) GlobalUnlock(clip_mem);
(void) CloseClipboard();
memset(clip_data,0,BMP_HEADER_SIZE);
- offset=p[0]+BMP_HEADER_SIZE;
- if ((p[0] == 40) && (p[16] == BI_BITFIELDS))
- offset+=12;
+ offset=((unsigned int) p[0])+BMP_HEADER_SIZE;
p-=BMP_HEADER_SIZE;
p[0]='B';
p[1]='M';
@@ -342,7 +340,7 @@ static MagickBooleanType WriteCLIPBOARDImage(const ImageInfo *image_info,
ThrowWriterException(CoderError,"UnableToWriteImageData");
}
clip_mem=GlobalLock(clip_handle);
- if (clip_mem == (LPVOID) NULL)
+ if (clip_handle == (LPVOID) NULL)
{
(void) GlobalFree((HGLOBAL) clip_handle);
clip_data=RelinquishMagickMemory(clip_data);
diff --git a/coders/clipboard.h b/coders/clipboard.h
index e344ba9ad..713abd6dc 100644
--- a/coders/clipboard.h
+++ b/coders/clipboard.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/cmyk.c b/coders/cmyk.c
index 964145656..8be16c3d3 100644
--- a/coders/cmyk.c
+++ b/coders/cmyk.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -99,8 +99,8 @@ static MagickBooleanType
static Image *ReadCMYKImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
- const void
- *stream;
+ const unsigned char
+ *pixels;
Image
*canvas_image,
@@ -128,9 +128,6 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
@@ -181,7 +178,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
quantum_type=CMYKAQuantum;
image->alpha_trait=BlendPixelTrait;
}
- pixels=GetQuantumPixels(quantum_info);
+ pixels=(const unsigned char *) NULL;
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
{
@@ -192,7 +189,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
@@ -201,7 +199,6 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
length=0;
scene=0;
status=MagickTrue;
- stream=NULL;
do
{
/*
@@ -226,7 +223,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -251,7 +249,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,quantum_type,(unsigned char *) stream,exception);
+ quantum_info,quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -285,7 +283,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (status == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
break;
}
@@ -307,7 +306,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,CyanQuantum);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -335,7 +335,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,quantum_type,(unsigned char *) stream,exception);
+ quantum_info,quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -385,7 +385,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -405,7 +406,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,CyanQuantum);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -430,7 +432,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,CyanQuantum,(unsigned char *) stream,exception);
+ quantum_info,CyanQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -451,7 +453,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -482,7 +485,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,MagentaQuantum,(unsigned char *) stream,exception);
+ quantum_info,MagentaQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -503,7 +506,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -534,7 +538,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,YellowQuantum,(unsigned char *) stream,exception);
+ quantum_info,YellowQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -555,7 +559,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -586,7 +591,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlackQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlackQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -607,7 +612,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -640,7 +646,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,AlphaQuantum,(unsigned char *) stream,exception);
+ quantum_info,AlphaQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -662,7 +668,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -700,14 +707,16 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -731,7 +740,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,CyanQuantum,(unsigned char *) stream,exception);
+ quantum_info,CyanQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -752,7 +761,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -770,14 +780,16 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -801,7 +813,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,MagentaQuantum,(unsigned char *) stream,exception);
+ quantum_info,MagentaQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -822,7 +834,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -840,14 +853,16 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -871,7 +886,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,YellowQuantum,(unsigned char *) stream,exception);
+ quantum_info,YellowQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -893,7 +908,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -911,14 +927,16 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -942,7 +960,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlackQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlackQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -964,7 +982,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -984,14 +1003,16 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -1015,7 +1036,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,YellowQuantum,(unsigned char *) stream,exception);
+ quantum_info,YellowQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -1037,7 +1058,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
diff --git a/coders/cmyk.h b/coders/cmyk.h
index d8b37a85b..c888207b9 100644
--- a/coders/cmyk.h
+++ b/coders/cmyk.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/coders-list.h b/coders/coders-list.h
index b3ec0d256..359d117a3 100644
--- a/coders/coders-list.h
+++ b/coders/coders-list.h
@@ -1,12 +1,12 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
-
+
You may not use this file except in compliance with the License. You may
obtain a copy of the License at
-
+
https://imagemagick.org/script/license.php
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -92,9 +92,6 @@ AddMagickCoder(JNX)
#endif
#if 0
AddMagickCoder(JSON)
-#if defined(MAGICKCORE_JXL_DELEGATE)
- AddMagickCoder(JXL)
-#endif
AddMagickCoder(LABEL)
AddMagickCoder(MAC)
AddMagickCoder(MAGICK)
diff --git a/coders/coders-private.h b/coders/coders-private.h
index 04d967adf..757cb97e6 100644
--- a/coders/coders-private.h
+++ b/coders/coders-private.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/coders.h b/coders/coders.h
index c48409c6b..c93350f48 100644
--- a/coders/coders.h
+++ b/coders/coders.h
@@ -1,12 +1,12 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
-
+
You may not use this file except in compliance with the License. You may
obtain a copy of the License at
-
+
https://imagemagick.org/script/license.php
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -92,9 +92,6 @@
#include "coders/jpeg.h"
#endif
#include "coders/json.h"
-#if defined(MAGICKCORE_JXL_DELEGATE)
- #include "coders/jxl.h"
-#endif
#include "coders/label.h"
#include "coders/mac.h"
#include "coders/magick.h"
diff --git a/coders/cube.c b/coders/cube.c
index d67d904e8..a10a3ec21 100644
--- a/coders/cube.c
+++ b/coders/cube.c
@@ -17,7 +17,7 @@
% July 2018 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/cube.h b/coders/cube.h
index 7c665cde4..2f7ade560 100644
--- a/coders/cube.h
+++ b/coders/cube.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/cut.h b/coders/cut.h
index d459e0912..0f080a82e 100644
--- a/coders/cut.h
+++ b/coders/cut.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/dcm.c b/coders/dcm.c
index d2890d09a..3b8d3be18 100644
--- a/coders/dcm.c
+++ b/coders/dcm.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -3600,7 +3600,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
*/
if (data == (unsigned char *) NULL)
break;
- colors=(size_t) (length/info.bytes_per_pixel);
+ colors=(size_t) (length/2);
datum=(int) colors;
if (redmap != (int *) NULL)
redmap=(int *) RelinquishMagickMemory(redmap);
@@ -3632,7 +3632,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
*/
if (data == (unsigned char *) NULL)
break;
- colors=(size_t) (length/info.bytes_per_pixel);
+ colors=(size_t) (length/2);
datum=(int) colors;
if (greenmap != (int *) NULL)
greenmap=(int *) RelinquishMagickMemory(greenmap);
@@ -3664,7 +3664,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
*/
if (data == (unsigned char *) NULL)
break;
- colors=(size_t) (length/info.bytes_per_pixel);
+ colors=(size_t) (length/2);
datum=(int) colors;
if (bluemap != (int *) NULL)
bluemap=(int *) RelinquishMagickMemory(bluemap);
diff --git a/coders/dcm.h b/coders/dcm.h
index bad57c6ce..3d36183fb 100644
--- a/coders/dcm.h
+++ b/coders/dcm.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/dds.c b/coders/dds.c
index d133636ba..fd506b2ed 100644
--- a/coders/dds.c
+++ b/coders/dds.c
@@ -19,7 +19,7 @@
% September 2013 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/dds.h b/coders/dds.h
index abe42496b..f325c2589 100644
--- a/coders/dds.h
+++ b/coders/dds.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/debug.c b/coders/debug.c
index b8ed09438..e689b7840 100644
--- a/coders/debug.c
+++ b/coders/debug.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/debug.h b/coders/debug.h
index 3a5347268..4ea296f99 100644
--- a/coders/debug.h
+++ b/coders/debug.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/dib.c b/coders/dib.c
index 80bb0aa4a..946901529 100644
--- a/coders/dib.c
+++ b/coders/dib.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/dib.h b/coders/dib.h
index 1398bd603..a9dac8d02 100644
--- a/coders/dib.h
+++ b/coders/dib.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/djvu.c b/coders/djvu.c
index 881515c22..d2cff2cf9 100644
--- a/coders/djvu.c
+++ b/coders/djvu.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/djvu.h b/coders/djvu.h
index 29e9fb2cb..a91774467 100644
--- a/coders/djvu.h
+++ b/coders/djvu.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/dng.c b/coders/dng.c
index 4bbc3955d..9a8cc6296 100644
--- a/coders/dng.c
+++ b/coders/dng.c
@@ -17,7 +17,7 @@
% July 1999 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -56,7 +56,6 @@
#include "MagickCore/monitor.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/opencl.h"
-#include "MagickCore/option.h"
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/profile.h"
#include "MagickCore/property.h"
@@ -179,6 +178,10 @@ static void SetDNGProperties(Image *image,const libraw_data_t *raw_info,
if (*raw_info->shootinginfo.BodySerial != '\0')
(void) SetImageProperty(image,"dng:serial.number",
raw_info->shootinginfo.BodySerial,exception);
+ (void) FormatLocaleString(property,MagickPathExtent,"%0.2f",
+ raw_info->other.FlashEC);
+ (void) SetImageProperty(image,"dng:flash.exposure.compensation",property,
+ exception);
(void) FormatLocaleString(property,MagickPathExtent,"1/%0.1f",
1.0/raw_info->other.shutter);
(void) SetImageProperty(image,"dng:exposure.time",property,exception);
@@ -384,8 +387,6 @@ static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
libraw_close(raw_info);
return(DestroyImageList(image));
}
- raw_info->params.use_camera_wb=IsStringTrue(GetImageOption(image_info,
- "dng:use_camera_wb"));
#if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_MSC_VER) && (_MSC_VER > 1310)
{
wchar_t
@@ -580,12 +581,6 @@ ModuleExport size_t RegisterDNGImage(void)
entry->flags^=CoderBlobSupportFlag;
entry->format_type=ExplicitFormatType;
(void) RegisterMagickInfo(entry);
- entry=AcquireMagickInfo("DNG","CR3","Canon Digital Camera Raw Image Format");
- entry->decoder=(DecodeImageHandler *) ReadDNGImage;
- entry->flags|=CoderDecoderSeekableStreamFlag;
- entry->flags^=CoderBlobSupportFlag;
- entry->format_type=ExplicitFormatType;
- (void) RegisterMagickInfo(entry);
entry=AcquireMagickInfo("DNG","CRW","Canon Digital Camera Raw Image Format");
entry->decoder=(DecodeImageHandler *) ReadDNGImage;
entry->flags|=CoderDecoderSeekableStreamFlag;
@@ -750,7 +745,6 @@ ModuleExport void UnregisterDNGImage(void)
(void) UnregisterMagickInfo("ERF");
(void) UnregisterMagickInfo("DCR");
(void) UnregisterMagickInfo("CRW");
- (void) UnregisterMagickInfo("CR3");
(void) UnregisterMagickInfo("CR2");
(void) UnregisterMagickInfo("DNG");
(void) UnregisterMagickInfo("ARW");
diff --git a/coders/dng.h b/coders/dng.h
index 6bed2ffcf..f6ef43577 100644
--- a/coders/dng.h
+++ b/coders/dng.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
@@ -17,8 +17,6 @@
#include "coders/coders-private.h"
#define MagickDNGHeaders \
- MagickCoderHeader("CR2", 0, "\115\115\000\052\000\020\000\000\122\103\002") \
- MagickCoderHeader("CR2", 0, "\111\111\052\000\020\000\000\000\103\122\002") \
MagickCoderHeader("CRW", 0, "II\x1a\x00\x00\x00HEAPCCDR") \
MagickCoderHeader("ORF", 0, "IIRO\x08\x00\x00\x00") \
MagickCoderHeader("MRW", 0, "\x00MRM") \
@@ -28,7 +26,6 @@
MagickCoderAlias("DNG", "3FR") \
MagickCoderAlias("DNG", "ARW") \
MagickCoderAlias("DNG", "CR2") \
- MagickCoderAlias("DNG", "CR3") \
MagickCoderAlias("DNG", "CRW") \
MagickCoderAlias("DNG", "DCR") \
MagickCoderAlias("DNG", "DCRAW") \
diff --git a/coders/dot.c b/coders/dot.c
index 44a9e1e52..47e926352 100644
--- a/coders/dot.c
+++ b/coders/dot.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/dot.h b/coders/dot.h
index bcd6ef1bf..b534682d2 100644
--- a/coders/dot.h
+++ b/coders/dot.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/dps.c b/coders/dps.c
index 05774252c..5ffbcc666 100644
--- a/coders/dps.c
+++ b/coders/dps.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/dps.h b/coders/dps.h
index a5491cc7a..25f36acfa 100644
--- a/coders/dps.h
+++ b/coders/dps.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/dpx.c b/coders/dpx.c
index cffe2353e..03b35cc2c 100644
--- a/coders/dpx.c
+++ b/coders/dpx.c
@@ -17,7 +17,7 @@
% March 2001 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -727,6 +727,8 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
dpx.file.version);
(void) FormatImageProperty(image,"dpx:file.version","%.8s",dpx.file.version);
dpx.file.file_size=ReadBlobLong(image);
+ if (0 && dpx.file.file_size > GetBlobSize(image))
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
offset+=4;
dpx.file.ditto_key=ReadBlobLong(image);
offset+=4;
@@ -1141,9 +1143,6 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
return(DestroyImageList(image));
for (n=0; n < (ssize_t) dpx.image.number_elements; n++)
{
- unsigned char
- *pixels;
-
/*
Convert DPX raster image to pixel packets.
*/
@@ -1239,11 +1238,10 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
SetQuantumQuantum(quantum_info,32);
SetQuantumPack(quantum_info,dpx.image.image_element[n].packing == 0 ?
MagickTrue : MagickFalse);
- pixels=GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)
{
- const void
- *stream;
+ const unsigned char
+ *pixels;
MagickBooleanType
sync;
@@ -1255,9 +1253,10 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
length;
ssize_t
- row_offset;
+ offset;
- stream=ReadBlobStream(image,extent,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,extent,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) extent)
break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -1271,12 +1270,12 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (proceed == MagickFalse)
break;
}
- row_offset=row++;
- q=QueueAuthenticPixels(image,0,row_offset,image->columns,1,exception);
+ offset=row++;
+ q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
- quantum_type,(unsigned char *) stream,exception);
+ quantum_type,pixels,exception);
(void) length;
sync=SyncAuthenticPixels(image,exception);
if (sync == MagickFalse)
diff --git a/coders/dpx.h b/coders/dpx.h
index 47c8f0907..4f502f45a 100644
--- a/coders/dpx.h
+++ b/coders/dpx.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/emf.c b/coders/emf.c
index 16c27389c..121885501 100644
--- a/coders/emf.c
+++ b/coders/emf.c
@@ -18,7 +18,7 @@
% Dirk Lemstra %
% January 2014 %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/emf.h b/coders/emf.h
index ef753cdec..d4c8ab104 100644
--- a/coders/emf.h
+++ b/coders/emf.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/ept.c b/coders/ept.c
index dd66725db..03dafd99d 100644
--- a/coders/ept.c
+++ b/coders/ept.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -156,10 +156,6 @@ static MagickBooleanType IsEPT(const unsigned char *magick,const size_t length)
*/
static Image *ReadEPTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
- const void
- *postscript_data,
- *tiff_data;
-
EPTInfo
ept_info;
@@ -200,13 +196,13 @@ static Image *ReadEPTImage(const ImageInfo *image_info,ExceptionInfo *exception)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
ept_info.postscript_offset=(MagickOffsetType) ReadBlobLSBLong(image);
ept_info.postscript_length=ReadBlobLSBLong(image);
- if ((MagickSizeType) ept_info.postscript_length > GetBlobSize(image))
+ if (ept_info.postscript_length > GetBlobSize(image))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
(void) ReadBlobLSBLong(image);
(void) ReadBlobLSBLong(image);
ept_info.tiff_offset=(MagickOffsetType) ReadBlobLSBLong(image);
ept_info.tiff_length=ReadBlobLSBLong(image);
- if ((MagickSizeType) ept_info.tiff_length > GetBlobSize(image))
+ if (ept_info.tiff_length > GetBlobSize(image))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
(void) ReadBlobLSBShort(image);
ept_info.postscript=(unsigned char *) AcquireQuantumMemory(
@@ -233,7 +229,7 @@ static Image *ReadEPTImage(const ImageInfo *image_info,ExceptionInfo *exception)
ept_info.postscript);
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
}
- tiff_data=ReadBlobStream(image,ept_info.tiff_length,ept_info.tiff,&count);
+ count=ReadBlob(image,ept_info.tiff_length,ept_info.tiff);
if (count != (ssize_t) (ept_info.tiff_length))
(void) ThrowMagickException(exception,GetMagickModule(),CorruptImageWarning,
"InsufficientImageDataInFile","`%s'",image->filename);
@@ -245,8 +241,7 @@ static Image *ReadEPTImage(const ImageInfo *image_info,ExceptionInfo *exception)
ept_info.postscript);
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
}
- postscript_data=ReadBlobStream(image,ept_info.postscript_length,
- ept_info.postscript,&count);
+ count=ReadBlob(image,ept_info.postscript_length,ept_info.postscript);
if (count != (ssize_t) (ept_info.postscript_length))
(void) ThrowMagickException(exception,GetMagickModule(),CorruptImageWarning,
"InsufficientImageDataInFile","`%s'",image->filename);
@@ -254,12 +249,12 @@ static Image *ReadEPTImage(const ImageInfo *image_info,ExceptionInfo *exception)
image=DestroyImage(image);
read_info=CloneImageInfo(image_info);
(void) CopyMagickString(read_info->magick,"EPS",MagickPathExtent);
- image=BlobToImage(read_info,postscript_data,ept_info.postscript_length,
+ image=BlobToImage(read_info,ept_info.postscript,ept_info.postscript_length,
exception);
if (image == (Image *) NULL)
{
(void) CopyMagickString(read_info->magick,"TIFF",MagickPathExtent);
- image=BlobToImage(read_info,tiff_data,ept_info.tiff_length,exception);
+ image=BlobToImage(read_info,ept_info.tiff,ept_info.tiff_length,exception);
}
read_info=DestroyImageInfo(read_info);
if (image != (Image *) NULL)
@@ -445,7 +440,7 @@ static MagickBooleanType WriteEPTImage(const ImageInfo *image_info,Image *image,
write_info=CloneImageInfo(image_info);
(void) CopyMagickString(write_info->magick,"TIFF",MagickPathExtent);
(void) FormatLocaleString(filename,MagickPathExtent,"tiff:%s",
- write_info->filename);
+ write_info->filename);
(void) CopyMagickString(write_info->filename,filename,MagickPathExtent);
if ((write_image->columns > 512) || (write_image->rows > 512))
{
diff --git a/coders/ept.h b/coders/ept.h
index 22a3d26d5..643fabc0f 100644
--- a/coders/ept.h
+++ b/coders/ept.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/exr.c b/coders/exr.c
index 91c8aa4ad..e5b79ed7b 100644
--- a/coders/exr.c
+++ b/coders/exr.c
@@ -17,7 +17,7 @@
% April 2007 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -61,9 +61,6 @@
#include "MagickCore/utility.h"
#if defined(MAGICKCORE_OPENEXR_DELEGATE)
#include <ImfCRgbaFile.h>
-#if IMF_VERSION_NUMBER > 1
-#include <OpenEXRConfig.h>
-#endif
/*
Typedef declaractions.
@@ -348,24 +345,15 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception)
*/
ModuleExport size_t RegisterEXRImage(void)
{
- char
- version[MagickPathExtent];
-
MagickInfo
*entry;
- *version='\0';
entry=AcquireMagickInfo("EXR","EXR","High Dynamic-range (HDR)");
#if defined(MAGICKCORE_OPENEXR_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadEXRImage;
entry->encoder=(EncodeImageHandler *) WriteEXRImage;
-#if defined( OPENEXR_PACKAGE_STRING)
- (void) FormatLocaleString(version,MagickPathExtent,OPENEXR_PACKAGE_STRING);
-#endif
#endif
entry->magick=(IsImageFormatHandler *) IsEXR;
- if (*version != '\0')
- entry->version=ConstantString(version);
entry->flags|=CoderDecoderSeekableStreamFlag;
entry->flags^=CoderAdjoinFlag;
entry->flags^=CoderBlobSupportFlag;
diff --git a/coders/exr.h b/coders/exr.h
index 8121126d6..ad67c6596 100644
--- a/coders/exr.h
+++ b/coders/exr.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/fax.c b/coders/fax.c
index 111300c15..bc9876d2b 100644
--- a/coders/fax.c
+++ b/coders/fax.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/fax.h b/coders/fax.h
index f0164fa74..0a5fa5407 100644
--- a/coders/fax.h
+++ b/coders/fax.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/fits.c b/coders/fits.c
index eea7a30e9..f342423f1 100644
--- a/coders/fits.c
+++ b/coders/fits.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/fits.h b/coders/fits.h
index 539bf900d..aa23ffe27 100644
--- a/coders/fits.h
+++ b/coders/fits.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/flif.c b/coders/flif.c
index 9b1af42d7..9133abbee 100644
--- a/coders/flif.c
+++ b/coders/flif.c
@@ -17,7 +17,7 @@
% April 2016 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/flif.h b/coders/flif.h
index ef51e439e..920299eef 100644
--- a/coders/flif.h
+++ b/coders/flif.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/fpx.c b/coders/fpx.c
index e5dc10576..e51fb4868 100644
--- a/coders/fpx.c
+++ b/coders/fpx.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/fpx.h b/coders/fpx.h
index 3c1fa09a3..fa4f8a423 100644
--- a/coders/fpx.h
+++ b/coders/fpx.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/ghostscript-private.h b/coders/ghostscript-private.h
index 836f3f2f5..5c16a9d08 100644
--- a/coders/ghostscript-private.h
+++ b/coders/ghostscript-private.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/gif.c b/coders/gif.c
index d9a140bf2..a37e2d684 100644
--- a/coders/gif.c
+++ b/coders/gif.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/gif.h b/coders/gif.h
index 597eb1180..2f338167f 100644
--- a/coders/gif.h
+++ b/coders/gif.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/gradient.c b/coders/gradient.c
index 4a10fcf41..4032791a0 100644
--- a/coders/gradient.c
+++ b/coders/gradient.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/gradient.h b/coders/gradient.h
index 73e20f0cb..f4d4e4a62 100644
--- a/coders/gradient.h
+++ b/coders/gradient.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/gray.c b/coders/gray.c
index c4643f353..b531ef773 100644
--- a/coders/gray.c
+++ b/coders/gray.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -100,8 +100,8 @@ static MagickBooleanType
static Image *ReadGRAYImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
- const void
- *stream;
+ const unsigned char
+ *pixels;
Image
*canvas_image,
@@ -129,9 +129,6 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
@@ -180,7 +177,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
image->alpha_trait=BlendPixelTrait;
canvas_image->alpha_trait=BlendPixelTrait;
}
- pixels=GetQuantumPixels(quantum_info);
+ pixels=(const unsigned char *) NULL;
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
{
@@ -191,7 +188,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
@@ -200,7 +198,6 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
length=0;
scene=0;
status=MagickTrue;
- stream=NULL;
do
{
/*
@@ -223,7 +220,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -248,7 +246,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,quantum_type,(unsigned char *) stream,exception);
+ quantum_info,quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -281,7 +279,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (status == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
break;
}
@@ -300,7 +299,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -328,7 +328,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,quantum_type,(unsigned char *) stream,exception);
+ quantum_info,quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -363,7 +363,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -383,7 +384,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -408,7 +410,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,RedQuantum,(unsigned char *) stream,exception);
+ quantum_info,RedQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -429,7 +431,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -462,7 +465,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,AlphaQuantum,(unsigned char *) stream,exception);
+ quantum_info,AlphaQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -484,7 +487,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -513,8 +517,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (DiscardBlobBytes(image,(MagickSizeType) image->offset) == MagickFalse)
{
status=MagickFalse;
- ThrowFileException(exception,CorruptImageError,
- "UnexpectedEndOfFile",image->filename);
+ ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
+ image->filename);
break;
}
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
@@ -522,14 +526,16 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -553,7 +559,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,RedQuantum,(unsigned char *) stream,exception);
+ quantum_info,RedQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -574,7 +580,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -595,14 +602,16 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -626,7 +635,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlueQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlueQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -647,7 +656,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
diff --git a/coders/gray.h b/coders/gray.h
index 2b08acd2f..05df56789 100644
--- a/coders/gray.h
+++ b/coders/gray.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/hald.c b/coders/hald.c
index b18e6dce5..131e2ae3c 100644
--- a/coders/hald.c
+++ b/coders/hald.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/hald.h b/coders/hald.h
index 3d062b46f..79d290cb6 100644
--- a/coders/hald.h
+++ b/coders/hald.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/hdr.c b/coders/hdr.c
index 85c30818a..698924219 100644
--- a/coders/hdr.c
+++ b/coders/hdr.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -785,13 +785,9 @@ static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image,
exponent;
gamma=frexp(gamma,&exponent)*256.0/gamma;
- if (GetPixelRed(image,p) > 0)
- pixel[0]=(unsigned char) (gamma*QuantumScale*GetPixelRed(image,p));
- if (GetPixelGreen(image,p) > 0)
- pixel[1]=(unsigned char) (gamma*QuantumScale*
- GetPixelGreen(image,p));
- if (GetPixelBlue(image,p) > 0)
- pixel[2]=(unsigned char) (gamma*QuantumScale*GetPixelBlue(image,p));
+ pixel[0]=(unsigned char) (gamma*QuantumScale*GetPixelRed(image,p));
+ pixel[1]=(unsigned char) (gamma*QuantumScale*GetPixelGreen(image,p));
+ pixel[2]=(unsigned char) (gamma*QuantumScale*GetPixelBlue(image,p));
pixel[3]=(unsigned char) (exponent+128);
}
if ((image->columns >= 8) && (image->columns <= 0x7ffff))
diff --git a/coders/hdr.h b/coders/hdr.h
index aeaff7c35..51e15f6c3 100644
--- a/coders/hdr.h
+++ b/coders/hdr.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/heic.c b/coders/heic.c
index f5db5964c..10d60c477 100644
--- a/coders/heic.c
+++ b/coders/heic.c
@@ -22,7 +22,7 @@
% %
% Copyright 2017-2018 YANDEX LLC. %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -284,7 +284,7 @@ static MagickBooleanType ReadHEICImageByID(const ImageInfo *image_info,
struct heif_image_handle
*image_handle;
- const uint8_t
+ uint8_t
*p_y,
*p_cb,
*p_cr;
@@ -361,9 +361,9 @@ static MagickBooleanType ReadHEICImageByID(const ImageInfo *image_info,
return(MagickFalse);
}
}
- p_y=heif_image_get_plane_readonly(heif_image,heif_channel_Y,&stride_y);
- p_cb=heif_image_get_plane_readonly(heif_image,heif_channel_Cb,&stride_cb);
- p_cr=heif_image_get_plane_readonly(heif_image,heif_channel_Cr,&stride_cr);
+ p_y=heif_image_get_plane(heif_image,heif_channel_Y,&stride_y);
+ p_cb=heif_image_get_plane(heif_image,heif_channel_Cb,&stride_cb);
+ p_cr=heif_image_get_plane(heif_image,heif_channel_Cr,&stride_cr);
for (y=0; y < (ssize_t) image->rows; y++)
{
Quantum
@@ -483,7 +483,7 @@ static Image *ReadHEICImage(const ImageInfo *image_info,
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
(void) heif_context_get_list_of_top_level_image_IDs(heif_context,
- image_ids,(int) count);
+ image_ids,count);
for (i=0; i < count; i++)
{
if (image_ids[i] == primary_image_id)
@@ -693,6 +693,9 @@ static void WriteProfile(struct heif_context *context,Image *image,
size_t
length;
+ StringInfo
+ *custom_profile;
+
struct heif_error
error;
@@ -709,6 +712,7 @@ static void WriteProfile(struct heif_context *context,Image *image,
/*
Save image profile as a APP marker.
*/
+ custom_profile=AcquireStringInfo(65535L);
ResetImageProfileIterator(image);
for (name=GetNextImageProfile(image); name != (const char *) NULL; )
{
@@ -754,6 +758,7 @@ static void WriteProfile(struct heif_context *context,Image *image,
"%s profile: %.20g bytes",name,(double) GetStringInfoLength(profile));
name=GetNextImageProfile(image);
}
+ custom_profile=DestroyStringInfo(custom_profile);
heif_image_handle_release(image_handle);
}
#endif
diff --git a/coders/heic.h b/coders/heic.h
index 951b43dae..00b3632c3 100644
--- a/coders/heic.h
+++ b/coders/heic.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/histogram.c b/coders/histogram.c
index 1f2a31a9b..b193cfe40 100644
--- a/coders/histogram.c
+++ b/coders/histogram.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/histogram.h b/coders/histogram.h
index b9276dbdc..c3712c5bf 100644
--- a/coders/histogram.h
+++ b/coders/histogram.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/hrz.c b/coders/hrz.c
index 87f18c946..4c7cc550a 100644
--- a/coders/hrz.c
+++ b/coders/hrz.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/hrz.h b/coders/hrz.h
index d1f502e19..6b1c9c06c 100644
--- a/coders/hrz.h
+++ b/coders/hrz.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/html.c b/coders/html.c
index 062197dc3..1b9abb38d 100644
--- a/coders/html.c
+++ b/coders/html.c
@@ -18,7 +18,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/html.h b/coders/html.h
index 2ee8de837..fd126877d 100644
--- a/coders/html.h
+++ b/coders/html.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/icon.c b/coders/icon.c
index 4fb6fd643..d70229695 100644
--- a/coders/icon.c
+++ b/coders/icon.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/icon.h b/coders/icon.h
index 4f494a745..fbc73791f 100644
--- a/coders/icon.h
+++ b/coders/icon.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/info.c b/coders/info.c
index 4ec814337..ec2e3ac65 100644
--- a/coders/info.c
+++ b/coders/info.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/info.h b/coders/info.h
index ff2b4241b..e8c7532d7 100644
--- a/coders/info.h
+++ b/coders/info.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/inline.c b/coders/inline.c
index fb1fb9a81..58701d452 100644
--- a/coders/inline.c
+++ b/coders/inline.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/inline.h b/coders/inline.h
index 9e793bc45..b241aa0df 100644
--- a/coders/inline.h
+++ b/coders/inline.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/ipl.c b/coders/ipl.c
index b1494acca..0b3f4b2b5 100644
--- a/coders/ipl.c
+++ b/coders/ipl.c
@@ -19,7 +19,7 @@
% 2008.05.07 %
% v 0.9 %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/ipl.h b/coders/ipl.h
index c45f94b2b..68e7364ec 100644
--- a/coders/ipl.h
+++ b/coders/ipl.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/jbig.c b/coders/jbig.c
index 7a38a9ecd..74f15720f 100644
--- a/coders/jbig.c
+++ b/coders/jbig.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/jbig.h b/coders/jbig.h
index 25aef7728..44799cbee 100644
--- a/coders/jbig.h
+++ b/coders/jbig.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/jnx.c b/coders/jnx.c
index 7f5b8b291..e9837d522 100644
--- a/coders/jnx.c
+++ b/coders/jnx.c
@@ -16,7 +16,7 @@
% July 2012 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/jnx.h b/coders/jnx.h
index 4fef1d6d5..c060b673c 100644
--- a/coders/jnx.h
+++ b/coders/jnx.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/jp2.c b/coders/jp2.c
index e96a1e310..63030715a 100644
--- a/coders/jp2.c
+++ b/coders/jp2.c
@@ -17,7 +17,7 @@
% June 2001 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -845,7 +845,7 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image,
/*
Initialize JPEG 2000 API.
*/
- parameters=(opj_cparameters_t *) AcquireMagickMemory(sizeof(*parameters));
+ parameters=AcquireMagickMemory(sizeof(*parameters));
if (parameters == (opj_cparameters_t *) NULL)
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
opj_set_default_encoder_parameters(parameters);
diff --git a/coders/jp2.h b/coders/jp2.h
index 3da5ea367..fc45935a2 100644
--- a/coders/jp2.h
+++ b/coders/jp2.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/jpeg.c b/coders/jpeg.c
index 7918eec5a..ecb021ffb 100644
--- a/coders/jpeg.c
+++ b/coders/jpeg.c
@@ -39,7 +39,8 @@
%
%
*/
-
+
+
/*
Include declarations.
*/
@@ -123,8 +124,8 @@ typedef struct _DestinationManager
typedef struct _ErrorManager
{
- jmp_buf
- error_recovery;
+ ExceptionInfo
+ *exception;
Image
*image;
@@ -135,8 +136,8 @@ typedef struct _ErrorManager
StringInfo
*profile;
- ExceptionInfo
- *exception;
+ jmp_buf
+ error_recovery;
} ErrorManager;
typedef struct _SourceManager
@@ -804,27 +805,26 @@ static boolean ReadProfile(j_decompress_ptr jpeg_info)
p=GetStringInfoDatum(profile);
if ((length > 4) && (LocaleNCompare((char *) p,"exif",4) == 0))
(void) CopyMagickString(name,"exif",MagickPathExtent);
- else
- if ((length > XmpNamespaceExtent) &&
- (LocaleNCompare((char *) p,xmp_namespace,XmpNamespaceExtent-1) == 0))
- {
- ssize_t
- j;
+ else if ((length > XmpNamespaceExtent) &&
+ (LocaleNCompare((char *) p,xmp_namespace,XmpNamespaceExtent-1) == 0))
+ {
+ ssize_t
+ j;
- /*
- Extract namespace from XMP profile.
- */
- p=GetStringInfoDatum(profile)+XmpNamespaceExtent;
- for (j=XmpNamespaceExtent; j < (ssize_t) GetStringInfoLength(profile); j++)
- {
- if (*p == '\0')
- break;
- p++;
- }
- if (j < (ssize_t) GetStringInfoLength(profile))
- (void) DestroyStringInfo(SplitStringInfo(profile,(size_t) (j+1)));
- (void) CopyMagickString(name,"xmp",MagickPathExtent);
+ /*
+ Extract namespace from XMP profile.
+ */
+ p=GetStringInfoDatum(profile)+XmpNamespaceExtent;
+ for (j=XmpNamespaceExtent; j < (ssize_t) GetStringInfoLength(profile); j++)
+ {
+ if (*p == '\0')
+ break;
+ p++;
}
+ if (j < (ssize_t) GetStringInfoLength(profile))
+ (void) DestroyStringInfo(SplitStringInfo(profile,(size_t) (j+1)));
+ (void) CopyMagickString(name,"xmp",MagickPathExtent);
+ }
}
previous_profile=GetImageProfile(image,name);
if ((previous_profile != (const StringInfo *) NULL) &&
@@ -842,7 +842,6 @@ static boolean ReadProfile(j_decompress_ptr jpeg_info)
(void) memcpy(GetStringInfoDatum(profile),
GetStringInfoDatum(previous_profile),
GetStringInfoLength(previous_profile));
- GetStringInfoDatum(profile)[GetStringInfoLength(profile)]='\0';
}
status=SetImageProfile(image,name,profile,exception);
profile=DestroyStringInfo(profile);
diff --git a/coders/jpeg.h b/coders/jpeg.h
index f7dd41fe2..2357a5d26 100644
--- a/coders/jpeg.h
+++ b/coders/jpeg.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/json.c b/coders/json.c
index 98104da75..1f9bf139b 100644
--- a/coders/json.c
+++ b/coders/json.c
@@ -17,7 +17,7 @@
% January 2014 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/json.h b/coders/json.h
index 1c3810da6..c93a44e8b 100644
--- a/coders/json.h
+++ b/coders/json.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/jxl.c b/coders/jxl.c
deleted file mode 100644
index fb0a6cb03..000000000
--- a/coders/jxl.c
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
-% JJJ X X L %
-% J X X L %
-% J X L %
-% J J X X L %
-% JJ X X LLLLL %
-% %
-% %
-% Read/Write JPEG XL Lossless JPEG1 Recompression %
-% %
-% The JPEG XL Project %
-% September 2019 %
-% %
-% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
-% dedicated to making software imaging solutions freely available. %
-% %
-% You may not use this file except in compliance with the License. You may %
-% obtain a copy of the License at %
-% %
-% https://imagemagick.org/script/license.php %
-% %
-% Unless required by applicable law or agreed to in writing, software %
-% distributed under the License is distributed on an "AS IS" BASIS, %
-% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
-% See the License for the specific language governing permissions and %
-% limitations under the License. %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%
-*/
-
-/*
- Include declarations.
-*/
-#include "MagickCore/studio.h"
-#include "MagickCore/attribute.h"
-#include "MagickCore/blob.h"
-#include "MagickCore/blob-private.h"
-#include "MagickCore/cache.h"
-#include "MagickCore/exception.h"
-#include "MagickCore/exception-private.h"
-#include "MagickCore/image.h"
-#include "MagickCore/image-private.h"
-#include "MagickCore/list.h"
-#include "MagickCore/magick.h"
-#include "MagickCore/memory_.h"
-#include "MagickCore/monitor.h"
-#include "MagickCore/monitor-private.h"
-#include "MagickCore/static.h"
-#include "MagickCore/string_.h"
-#include "MagickCore/module.h"
-#if defined(MAGICKCORE_JXL_DELEGATE)
-#include <brunsli/decode.h>
-#include <brunsli/encode.h>
-
-/*
- Forward declarations.
-*/
-static MagickBooleanType
- WriteJXLImage(const ImageInfo *,Image *);
-#endif
-
-#if defined(MAGICKCORE_JXL_DELEGATE)
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
-% R e a d J X L I m a g e %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% ReadJXLImage() reads a JXL image file and returns it. It allocates
-% the memory necessary for the new Image structure and returns a pointer to
-% the new image.
-%
-% The format of the ReadJXLImage method is:
-%
-% Image *ReadJXLImage(const ImageInfo *image_info,
-% ExceptionInfo *exception)
-%
-% A description of each parameter follows:
-%
-% o image_info: the image info.
-%
-% o exception: return any errors or warnings in this structure.
-%
-*/
-
-/*
- Typedef declarations.
-*/
-typedef struct OutBuffer
-{
- unsigned char
- *data;
-
- size_t
- size;
-} OutBuffer;
-
-static size_t AllocOutput(void* data, const uint8_t* buf, size_t count)
-{
- OutBuffer *buffer=(OutBuffer *) data;
- buffer->data=ResizeMagickMemory(buffer->data,buffer->size+count);
- if (!buffer->data) return 0;
- memcpy(buffer->data+buffer->size, buf, count);
- buffer->size+=count;
- return(count);
-}
-
-static Image *ReadJXLImage(const ImageInfo *image_info,ExceptionInfo *exception)
-{
- Image
- *temp_image,
- *result;
-
- MagickBooleanType
- status;
-
- OutBuffer
- b;
-
- unsigned char
- *jxl;
-
- /*
- TODO: do we need an Image here? No pixels are needed, but OpenBlob
- needs an Image.
- */
- temp_image=AcquireImage(image_info, exception);
- status=OpenBlob(image_info,temp_image,ReadBinaryBlobMode,exception);
- jxl=NULL;
- size_t jxlsize = 0;
- if (status == MagickTrue)
- {
- jxlsize=(size_t) GetBlobSize(temp_image);
- jxl=(unsigned char *) AcquireMagickMemory(jxlsize);
- size_t num_read=ReadBlob(temp_image,jxlsize,jxl);
- if (num_read != jxlsize) status=MagickFalse;
- }
- (void) DestroyImage(temp_image);
-
- b.data=NULL;
- b.size=0;
-
- if (status == MagickTrue)
- {
- status=DecodeBrunsli(jxlsize,jxl,&b,AllocOutput) == 1 ?
- MagickTrue : MagickFalse;
- }
- (void) RelinquishMagickMemory(jxl);
-
- result=NULL;
-
- if (status == MagickTrue)
- {
- ImageInfo* temp_info=AcquireImageInfo();
- SetImageInfoBlob(temp_info,b.data,b.size);
- result=BlobToImage(temp_info,b.data,b.size,exception);
- (void) DestroyImageInfo(temp_info);
- }
- (void) RelinquishMagickMemory(b.data);
-
- return(result);
-}
-#endif
-
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
-% R e g i s t e r J X L I m a g e %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% RegisterJXLImage() adds properties for the JXL image format to
-% the list of supported formats. The properties include the image format
-% tag, a method to read and/or write the format, whether the format
-% supports the saving of more than one frame to the same file or blob,
-% whether the format supports native in-memory I/O, and a brief
-% description of the format.
-%
-% The format of the RegisterJXLImage method is:
-%
-% size_t RegisterJXLImage(void)
-%
-*/
-ModuleExport size_t RegisterJXLImage(void)
-{
- MagickInfo
- *entry;
-
- entry=AcquireMagickInfo("JXL", "JXL", "JPEG XL Lossless JPEG1 Recompression");
-#if defined(MAGICKCORE_JXL_DELEGATE)
- entry->decoder=(DecodeImageHandler *) ReadJXLImage;
- entry->encoder=(EncodeImageHandler *) WriteJXLImage;
-#endif
- entry->note=ConstantString(
- "JPEG1 recompression as specified in https://arxiv.org/pdf/1908.03565.pdf"
- " page 135. Full JPEG XL support will be implemented in this coder later.");
- (void) RegisterMagickInfo(entry);
- return(MagickImageCoderSignature);
-}
-
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
-% U n r e g i s t e r J X L I m a g e %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% UnregisterJXLImage() removes format registrations made by the
-% JXL module from the list of supported formats.
-%
-% The format of the UnregisterJXLImage method is:
-%
-% UnregisterJXLImage(void)
-%
-*/
-ModuleExport void UnregisterJXLImage(void)
-{
- (void) UnregisterMagickInfo("JXL");
-}
-
-#if defined(MAGICKCORE_JXL_DELEGATE)
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
-% W r i t e J X L I m a g e %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% WriteJXLImage() writes a JXL image file and returns it. It
-% allocates the memory necessary for the new Image structure and returns a
-% pointer to the new image.
-%
-% The format of the WriteJXLImage method is:
-%
-% MagickBooleanType WriteJXLImage(const ImageInfo *image_info,
-% Image *image)
-%
-% A description of each parameter follows:
-%
-% o image_info: the image info.
-%
-% o image: The image.
-%
-%
-*/
-static MagickBooleanType WriteJXLImage(const ImageInfo *image_info,
- Image *image)
-{
- ExceptionInfo
- *exception;
-
- Image
- *temp_image;
-
- ImageInfo
- *temp_info;
-
- MagickBooleanType
- status;
-
- OutBuffer
- b;
-
- size_t
- jpegsize;
-
- unsigned char
- *jpeg;
-
- exception=AcquireExceptionInfo();
-
- /*
- TODO: can cloning the image be avoided? The pixels don't need to be cloned,
- only filename or blob information. ImageToBlob overwrites this information.
- */
- temp_image=CloneImage(image, 0, 0, MagickTrue, exception);
- temp_info=AcquireImageInfo();
- (void) CopyMagickString(temp_image->magick,"JPG",MaxTextExtent);
- jpeg=ImageToBlob(temp_info,temp_image,&jpegsize,exception);
- (void) DestroyImage(temp_image);
- (void) DestroyImageInfo(temp_info);
-
- b.data=NULL;
- b.size=0;
- status=EncodeBrunsli(jpegsize,jpeg,&b,AllocOutput) == 1 ?
- MagickTrue : MagickFalse;
- if (status == MagickTrue)
- {
- status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
- }
-
- if (status == MagickTrue)
- {
- WriteBlob(image,b.size,b.data);
- CloseBlob(image);
- }
- (void) RelinquishMagickMemory(b.data);
-
- if(exception) exception=DestroyExceptionInfo(exception);
- return(status);
-}
-#endif
diff --git a/coders/jxl.h b/coders/jxl.h
deleted file mode 100644
index 4c44b06cc..000000000
--- a/coders/jxl.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
- dedicated to making software imaging solutions freely available.
-
- You may not use this file except in compliance with the License. You may
- obtain a copy of the License at
-
- https://imagemagick.org/script/license.php
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-#include "coders/coders-private.h"
-
-// The pattern for JXL JPEG1 recompression for now, the main pattern will be
-// added when full decoder support is added.
-#define MagickJXLHeaders \
- MagickCoderHeader("JXL", 0, "\x0a\x04\x42\xd2\xd5\x4e")
-
-#define MagickJXLAliases
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-MagickCoderExports(JXL)
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
diff --git a/coders/label.c b/coders/label.c
index 366ee5670..3e543a349 100644
--- a/coders/label.c
+++ b/coders/label.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -255,9 +255,9 @@ static Image *ReadLABELImage(const ImageInfo *image_info,
Draw label.
*/
(void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g",
- (draw_info->direction == RightToLeftDirection ? (double) image->columns-
- metrics.bounds.x2 : 0.0),(draw_info->gravity == UndefinedGravity ?
- MagickMax(metrics.ascent,metrics.bounds.y2) : 0.0));
+ draw_info->direction == RightToLeftDirection ? (double) image->columns-
+ metrics.bounds.x2 : 0.0,draw_info->gravity == UndefinedGravity ?
+ MagickMax(metrics.ascent,metrics.bounds.y2) : 0.0);
(void) CloneString(&draw_info->geometry,geometry);
status=AnnotateImage(image,draw_info,exception);
if (image_info->pointsize == 0.0)
diff --git a/coders/label.h b/coders/label.h
index 786a54d32..d69d3fe24 100644
--- a/coders/label.h
+++ b/coders/label.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/mac.c b/coders/mac.c
index a159bb1dd..f96f6d8c6 100644
--- a/coders/mac.c
+++ b/coders/mac.c
@@ -18,7 +18,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/mac.h b/coders/mac.h
index 899777fb7..58654a96e 100644
--- a/coders/mac.h
+++ b/coders/mac.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/magick.c b/coders/magick.c
index b485e2e1e..22b26b514 100644
--- a/coders/magick.c
+++ b/coders/magick.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/magick.h b/coders/magick.h
index e766832bf..8c4fd93a4 100644
--- a/coders/magick.h
+++ b/coders/magick.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/map.c b/coders/map.c
index a279ff7f5..6fff231e2 100644
--- a/coders/map.c
+++ b/coders/map.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/map.h b/coders/map.h
index ef7a732fb..168fc1cf4 100644
--- a/coders/map.h
+++ b/coders/map.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/mask.c b/coders/mask.c
index 59ccb2e30..a6fdcd108 100644
--- a/coders/mask.c
+++ b/coders/mask.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/mask.h b/coders/mask.h
index fd8b353ed..aa601f10f 100644
--- a/coders/mask.h
+++ b/coders/mask.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/mat.c b/coders/mat.c
index 2ddeb06a5..f1af3d534 100644
--- a/coders/mat.c
+++ b/coders/mat.c
@@ -819,9 +819,6 @@ static Image *ReadMATImageV4(const ImageInfo *image_info,Image *image,
Allocate next image structure.
*/
skip_reading_current:
- if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))
- if (image->scene >= (image_info->scene+image_info->number_scenes-1))
- break;
AcquireNextImage(image_info,image,exception);
if (GetNextImageInList(image) == (Image *) NULL)
{
@@ -1404,9 +1401,6 @@ done_reading:
break;
/* Allocate next image structure. */
- if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))
- if (image->scene >= (image_info->scene+image_info->number_scenes-1))
- break;
AcquireNextImage(image_info,image,exception);
if (image->next == (Image *) NULL) break;
image=SyncNextImageInList(image);
diff --git a/coders/mat.h b/coders/mat.h
index 675c3c2d2..cdfbadd0f 100644
--- a/coders/mat.h
+++ b/coders/mat.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/matte.c b/coders/matte.c
index 0bf3ce6b6..1a10f590c 100644
--- a/coders/matte.c
+++ b/coders/matte.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/matte.h b/coders/matte.h
index e6ef265b5..70dd19540 100644
--- a/coders/matte.h
+++ b/coders/matte.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/meta.c b/coders/meta.c
index 8045895ae..2e77186d8 100644
--- a/coders/meta.c
+++ b/coders/meta.c
@@ -17,7 +17,7 @@
% July 2001 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -1146,7 +1146,6 @@ static inline void CopyBlob(Image *source,Image *destination)
sizeof(*buffer));
if (buffer != (unsigned char *) NULL)
{
- (void) memset(buffer,0,MagickMaxBufferExtent*sizeof(*buffer));
i=0;
while ((length=ReadBlob(source,MagickMaxBufferExtent,buffer)) != 0)
{
diff --git a/coders/meta.h b/coders/meta.h
index 4be842c5b..d07db12d3 100644
--- a/coders/meta.h
+++ b/coders/meta.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/miff.c b/coders/miff.c
index da0de1ad2..56df00194 100644
--- a/coders/miff.c
+++ b/coders/miff.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -169,8 +169,9 @@ static void *AcquireCompressionMemory(void *context,const size_t items,
extent;
(void) context;
- if (HeapOverflowSanityCheckGetSize(items,size,&extent) != MagickFalse)
+ if (HeapOverflowSanityCheck(items,size) != MagickFalse)
return((void *) NULL);
+ extent=items*size;
if (extent > GetMaxMemoryRequest())
return((void *) NULL);
return(AcquireMagickMemory(extent));
@@ -221,7 +222,6 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels,
switch (image->depth)
{
case 32:
- default:
{
pixel->index=(MagickRealType) ConstrainColormapIndex(image,(ssize_t)
(((size_t) *p << 24) | ((size_t) *(p+1) << 16) |
@@ -243,6 +243,9 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels,
p++;
break;
}
+ default:
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ CorruptImageError,"ImageDepthNotSupported","`%s'",image->filename);
}
switch (image->depth)
{
@@ -266,13 +269,12 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels,
if (image->alpha_trait != UndefinedPixelTrait)
{
p=PushShortPixel(MSBEndian,p,&quantum);
- pixel->alpha=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->alpha=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
}
break;
}
case 32:
- default:
{
unsigned int
quantum;
@@ -280,11 +282,14 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels,
if (image->alpha_trait != UndefinedPixelTrait)
{
p=PushLongPixel(MSBEndian,p,&quantum);
- pixel->alpha=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->alpha=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
}
break;
}
+ default:
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ CorruptImageError,"ImageDepthNotSupported","`%s'",image->filename);
}
*length=((size_t) *p++)+1;
return;
@@ -325,67 +330,69 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels,
quantum;
p=PushShortPixel(MSBEndian,p,&quantum);
- pixel->red=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->red=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
pixel->green=pixel->red;
pixel->blue=pixel->red;
if (IsGrayColorspace(image->colorspace) == MagickFalse)
{
p=PushShortPixel(MSBEndian,p,&quantum);
- pixel->green=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->green=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
p=PushShortPixel(MSBEndian,p,&quantum);
- pixel->blue=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->blue=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
}
if (image->colorspace == CMYKColorspace)
{
p=PushShortPixel(MSBEndian,p,&quantum);
- pixel->black=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->black=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
}
if (image->alpha_trait != UndefinedPixelTrait)
{
p=PushShortPixel(MSBEndian,p,&quantum);
- pixel->alpha=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->alpha=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
}
break;
}
case 32:
- default:
{
unsigned int
quantum;
p=PushLongPixel(MSBEndian,p,&quantum);
- pixel->red=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->red=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
pixel->green=pixel->red;
pixel->blue=pixel->red;
if (IsGrayColorspace(image->colorspace) == MagickFalse)
{
p=PushLongPixel(MSBEndian,p,&quantum);
- pixel->green=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->green=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
p=PushLongPixel(MSBEndian,p,&quantum);
- pixel->blue=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->blue=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
}
if (image->colorspace == CMYKColorspace)
{
p=PushLongPixel(MSBEndian,p,&quantum);
- pixel->black=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->black=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
}
if (image->alpha_trait != UndefinedPixelTrait)
{
p=PushLongPixel(MSBEndian,p,&quantum);
- pixel->alpha=(MagickRealType) ((size_t) quantum >> (image->depth-
+ pixel->alpha=(MagickRealType) (quantum >> (image->depth-
MAGICKCORE_QUANTUM_DEPTH));
}
break;
}
+ default:
+ (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError,
+ "ImageDepthNotSupported","`%s'",image->filename);
}
*length=(size_t) (*p++)+1;
}
@@ -1227,6 +1234,12 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
p=colormap;
switch (image->depth)
{
+ default:
+ {
+ colormap=(unsigned char *) RelinquishMagickMemory(colormap);
+ ThrowMIFFException(CorruptImageError,"ImageDepthNotSupported");
+ break;
+ }
case 8:
{
unsigned char
@@ -1266,7 +1279,6 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
break;
}
case 32:
- default:
{
unsigned int
long_pixel;
@@ -1592,14 +1604,11 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
}
default:
{
- const void
- *stream;
-
- stream=ReadBlobStream(image,packet_size*image->columns,pixels,&count);
+ count=ReadBlob(image,packet_size*image->columns,pixels);
if (count != (ssize_t) (packet_size*image->columns))
ThrowMIFFException(CorruptImageError,"UnableToReadImageData");
extent=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
- quantum_type,(unsigned char *) stream,exception);
+ quantum_type,pixels,exception);
break;
}
}
@@ -1832,7 +1841,7 @@ ModuleExport void UnregisterMIFFImage(void)
*/
static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
- size_t length,PixelInfo *pixel)
+ size_t length,PixelInfo *pixel,ExceptionInfo *exception)
{
if (image->storage_class != DirectClass)
{
@@ -1843,7 +1852,6 @@ static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
switch (image->depth)
{
case 32:
- default:
{
*pixels++=(unsigned char) (value >> 24);
*pixels++=(unsigned char) (value >> 16);
@@ -1855,11 +1863,13 @@ static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
*pixels++=(unsigned char) value;
break;
}
+ default:
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ CorruptImageError,"ImageDepthNotSupported","`%s'",image->filename);
}
switch (image->depth)
{
case 32:
- default:
{
unsigned int
long_value;
@@ -1896,6 +1906,9 @@ static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
}
break;
}
+ default:
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ CorruptImageError,"ImageDepthNotSupported","`%s'",image->filename);
}
*pixels++=(unsigned char) length;
return(pixels);
@@ -1903,7 +1916,6 @@ static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
switch (image->depth)
{
case 32:
- default:
{
unsigned int
value;
@@ -1984,6 +1996,9 @@ static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
}
break;
}
+ default:
+ (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError,
+ "ImageDepthNotSupported","`%s'",image->filename);
}
*pixels++=(unsigned char) length;
return(pixels);
@@ -2077,7 +2092,8 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
if ((image->storage_class == PseudoClass) &&
(image->colors > (size_t) (GetQuantumRange(image->depth)+1)))
(void) SetImageStorageClass(image,DirectClass,exception);
- image->depth=image->depth <= 8 ? 8UL : image->depth <= 16 ? 16UL : 32UL;
+ image->depth=image->depth <= 8 ? 8UL : image->depth <= 16 ? 16UL :
+ image->depth <= 32 ? 32UL : 64UL;
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
@@ -2436,8 +2452,9 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
{
switch (quantum_info->depth)
{
- case 32:
default:
+ ThrowWriterException(CorruptImageError,"ImageDepthNotSupported");
+ case 32:
{
register unsigned int
long_pixel;
@@ -2666,13 +2683,13 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
length++;
else
{
- q=PopRunlengthPacket(image,q,length,&pixel);
+ q=PopRunlengthPacket(image,q,length,&pixel,exception);
length=0;
}
GetPixelInfoPixel(image,p,&pixel);
p+=GetPixelChannels(image);
}
- q=PopRunlengthPacket(image,q,length,&pixel);
+ q=PopRunlengthPacket(image,q,length,&pixel,exception);
(void) WriteBlob(image,(size_t) (q-pixels),pixels);
break;
}
diff --git a/coders/miff.h b/coders/miff.h
index 235be4a2e..7815305ac 100644
--- a/coders/miff.h
+++ b/coders/miff.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/mono.c b/coders/mono.c
index e8237564a..a45445b5e 100644
--- a/coders/mono.c
+++ b/coders/mono.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/mono.h b/coders/mono.h
index c355b6e49..950a90a43 100644
--- a/coders/mono.h
+++ b/coders/mono.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/mpc.c b/coders/mpc.c
index 7848320f5..9211ac544 100644
--- a/coders/mpc.c
+++ b/coders/mpc.c
@@ -17,7 +17,7 @@
% March 2000 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/mpc.h b/coders/mpc.h
index 74e73712e..44403f496 100644
--- a/coders/mpc.h
+++ b/coders/mpc.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/mpeg.c b/coders/mpeg.c
index 260b56167..4ae7e96d3 100644
--- a/coders/mpeg.c
+++ b/coders/mpeg.c
@@ -17,7 +17,7 @@
% July 1999 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/mpeg.h b/coders/mpeg.h
index 9dead7483..1783e1d0c 100644
--- a/coders/mpeg.h
+++ b/coders/mpeg.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/mpr.c b/coders/mpr.c
index fcc8e5bbf..0c7bd3e35 100644
--- a/coders/mpr.c
+++ b/coders/mpr.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/mpr.h b/coders/mpr.h
index 3473ebf6c..17d2d40d6 100644
--- a/coders/mpr.h
+++ b/coders/mpr.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/msl.c b/coders/msl.c
index 8d0db1941..cbc72116a 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -19,7 +19,7 @@
% December 2001 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -544,13 +544,6 @@ static void MSLEndDocument(void *context)
msl_info=(MSLInfo *) context;
if (msl_info->content != (char *) NULL)
msl_info->content=DestroyString(msl_info->content);
-#if defined(MAGICKCORE_XML_DELEGATE)
- if (msl_info->document != (xmlDocPtr) NULL)
- {
- xmlFreeDoc(msl_info->document);
- msl_info->document=(xmlDocPtr) NULL;
- }
-#endif
}
static void MSLPushImage(MSLInfo *msl_info,Image *image)
@@ -7702,8 +7695,8 @@ static void MSLCDataBlock(void *context,const xmlChar *value,int length)
MSLInfo
*msl_info;
- xmlNodePtr
- child;
+ xmlNodePtr
+ child;
xmlParserCtxtPtr
parser;
@@ -7722,9 +7715,7 @@ static void MSLCDataBlock(void *context,const xmlChar *value,int length)
xmlTextConcat(child,value,length);
return;
}
- child=xmlNewCDataBlock(parser->myDoc,value,length);
- if (xmlAddChild(parser->node,child) == (xmlNodePtr) NULL)
- xmlFreeNode(child);
+ (void) xmlAddChild(parser->node,xmlNewCDataBlock(parser->myDoc,value,length));
}
static void MSLExternalSubset(void *context,const xmlChar *name,
@@ -7921,8 +7912,6 @@ static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,
/*
Free resources.
*/
- if (msl_info.parser->myDoc != (xmlDocPtr) NULL)
- xmlFreeDoc(msl_info.parser->myDoc);
xmlFreeParserCtxt(msl_info.parser);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),"end SAX");
if (*image == (Image *) NULL)
@@ -8366,6 +8355,7 @@ static MagickBooleanType WriteMSLImage(const ImageInfo *image_info,Image *image,
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
msl_image=CloneImage(image,0,0,MagickTrue,exception);
status=ProcessMSLScript(image_info,&msl_image,exception);
+ msl_image=DestroyImageList(msl_image);
return(status);
}
#endif
diff --git a/coders/msl.h b/coders/msl.h
index 305a4735f..8e9b0e8e3 100644
--- a/coders/msl.h
+++ b/coders/msl.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/mtv.c b/coders/mtv.c
index 118a63d97..7b4b09af5 100644
--- a/coders/mtv.c
+++ b/coders/mtv.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/mtv.h b/coders/mtv.h
index 4b4f7faa6..d04c703ff 100644
--- a/coders/mtv.h
+++ b/coders/mtv.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/mvg.c b/coders/mvg.c
index cfa684b19..481c5a433 100644
--- a/coders/mvg.c
+++ b/coders/mvg.c
@@ -17,7 +17,7 @@
% April 2000 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/mvg.h b/coders/mvg.h
index 0667d3b9b..9a93b93fd 100644
--- a/coders/mvg.h
+++ b/coders/mvg.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/null.c b/coders/null.c
index 57bb16ea3..b155e4906 100644
--- a/coders/null.c
+++ b/coders/null.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/null.h b/coders/null.h
index 474a1b367..05774f905 100644
--- a/coders/null.h
+++ b/coders/null.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/otb.c b/coders/otb.c
index 24fb92794..7ab2b04b0 100644
--- a/coders/otb.c
+++ b/coders/otb.c
@@ -17,7 +17,7 @@
% January 2000 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/otb.h b/coders/otb.h
index d51654164..ce28de58f 100644
--- a/coders/otb.h
+++ b/coders/otb.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/palm.c b/coders/palm.c
index 737d5412b..c8a85d83c 100644
--- a/coders/palm.c
+++ b/coders/palm.c
@@ -771,7 +771,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
{
(void) TransformImageColorspace(image,sRGBColorspace,exception);
count=GetNumberColors(image,NULL,exception);
- for (bits_per_pixel=1; (one << bits_per_pixel) < count; bits_per_pixel*=2) ;
+ for (bits_per_pixel=1; (one << bits_per_pixel) < count; bits_per_pixel*=2) ;
if (bits_per_pixel > 16)
bits_per_pixel=16;
else
@@ -876,7 +876,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
last_row=(unsigned char *) NULL;
if (image_info->compression == FaxCompression)
{
- last_row=(unsigned char *) AcquireQuantumMemory(bytes_per_row+256,
+ last_row=(unsigned char *) AcquireQuantumMemory(bytes_per_row,
sizeof(*last_row));
if (last_row == (unsigned char *) NULL)
{
@@ -884,7 +884,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
}
}
- one_row=(unsigned char *) AcquireQuantumMemory(bytes_per_row+256,
+ one_row=(unsigned char *) AcquireQuantumMemory(bytes_per_row,
sizeof(*one_row));
if (one_row == (unsigned char *) NULL)
{
@@ -904,10 +904,10 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
{
for (x=0; x < (ssize_t) image->columns; x++)
{
- color16=(unsigned short) ((((31*(ssize_t) GetPixelRed(image,p))/
- (ssize_t) QuantumRange) << 11) | (((63*(ssize_t)
- GetPixelGreen(image,p))/(ssize_t) QuantumRange) << 5) |
- ((31*(ssize_t) GetPixelBlue(image,p))/(ssize_t) QuantumRange));
+ color16=(unsigned short) ((((31*(size_t) GetPixelRed(image,p))/
+ (size_t) QuantumRange) << 11) | (((63*(size_t)
+ GetPixelGreen(image,p))/(size_t) QuantumRange) << 5) |
+ ((31*(size_t) GetPixelBlue(image,p))/(size_t) QuantumRange));
if (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha)
{
transpix.red=(MagickRealType) GetPixelRed(image,p);
diff --git a/coders/palm.h b/coders/palm.h
index db3a8f22f..014fcc910 100644
--- a/coders/palm.h
+++ b/coders/palm.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pango.c b/coders/pango.c
index ed4460e93..5f9118738 100644
--- a/coders/pango.c
+++ b/coders/pango.c
@@ -17,7 +17,7 @@
% March 2012 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/pango.h b/coders/pango.h
index 315c91c6f..3fd75f51f 100644
--- a/coders/pango.h
+++ b/coders/pango.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pattern.c b/coders/pattern.c
index 846bfdd14..2d9584d8a 100644
--- a/coders/pattern.c
+++ b/coders/pattern.c
@@ -17,7 +17,7 @@
% May 2003 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/pattern.h b/coders/pattern.h
index 5c2c053d1..ee5ecacfd 100644
--- a/coders/pattern.h
+++ b/coders/pattern.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pcd.c b/coders/pcd.c
index e18b5b94e..7e48c138c 100644
--- a/coders/pcd.c
+++ b/coders/pcd.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/pcd.h b/coders/pcd.h
index 50e8a6563..121df97fb 100644
--- a/coders/pcd.h
+++ b/coders/pcd.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pcl.c b/coders/pcl.c
index a200af4d3..5a6fc7dce 100644
--- a/coders/pcl.c
+++ b/coders/pcl.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/pcl.h b/coders/pcl.h
index 54f68e283..267c0931b 100644
--- a/coders/pcl.h
+++ b/coders/pcl.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pcx.c b/coders/pcx.c
index 4332dc0ad..600603c69 100644
--- a/coders/pcx.c
+++ b/coders/pcx.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -340,12 +340,14 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception)
/*
Read PCX raster colormap.
*/
- if ((pcx_info.right < pcx_info.left) || (pcx_info.bottom < pcx_info.top) ||
+ image->columns=(size_t) MagickAbsoluteValue((ssize_t) pcx_info.right-
+ pcx_info.left)+1UL;
+ image->rows=(size_t) MagickAbsoluteValue((ssize_t) pcx_info.bottom-
+ pcx_info.top)+1UL;
+ if ((image->columns == 0) || (image->rows == 0) ||
((pcx_info.bits_per_pixel != 1) && (pcx_info.bits_per_pixel != 2) &&
(pcx_info.bits_per_pixel != 4) && (pcx_info.bits_per_pixel != 8)))
ThrowPCXException(CorruptImageError,"ImproperImageHeader");
- image->columns=(size_t) (pcx_info.right-pcx_info.left)+1UL;
- image->rows=(size_t) (pcx_info.bottom-pcx_info.top)+1UL;
image->depth=pcx_info.bits_per_pixel;
image->units=PixelsPerInchResolution;
image->resolution.x=(double) pcx_info.horizontal_resolution;
@@ -398,10 +400,12 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception)
/*
Read image data.
*/
- if (HeapOverflowSanityCheckGetSize(image->rows,(size_t) pcx_info.bytes_per_line,&pcx_packets) != MagickFalse)
+ if (HeapOverflowSanityCheck(image->rows, (size_t) pcx_info.bytes_per_line) != MagickFalse)
ThrowPCXException(CorruptImageError,"ImproperImageHeader");
- if (HeapOverflowSanityCheckGetSize(pcx_packets,(size_t) pcx_info.planes,&pcx_packets) != MagickFalse)
+ pcx_packets=(size_t) image->rows*pcx_info.bytes_per_line;
+ if (HeapOverflowSanityCheck(pcx_packets, (size_t) pcx_info.planes) != MagickFalse)
ThrowPCXException(CorruptImageError,"ImproperImageHeader");
+ pcx_packets=(size_t) pcx_packets*pcx_info.planes;
if ((size_t) (pcx_info.bits_per_pixel*pcx_info.planes*image->columns) > (pcx_packets*8U))
ThrowPCXException(CorruptImageError,"ImproperImageHeader");
if ((MagickSizeType) (pcx_packets/32+128) > GetBlobSize(image))
@@ -574,13 +578,13 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception)
for (x=0; x < ((ssize_t) image->columns-7); x+=8)
{
for (bit=7; bit >= 0; bit--)
- *r++=(unsigned char) ((*p) & (0x01 << bit) ? 0x00 : 0x01);
+ *r++=(unsigned char) ((*p) & (0x01 << bit) ? 0x01 : 0x00);
p++;
}
if ((image->columns % 8) != 0)
{
for (bit=7; bit >= (ssize_t) (8-(image->columns % 8)); bit--)
- *r++=(unsigned char) ((*p) & (0x01 << bit) ? 0x00 : 0x01);
+ *r++=(unsigned char) ((*p) & (0x01 << bit) ? 0x01 : 0x00);
p++;
}
break;
@@ -1146,7 +1150,7 @@ static MagickBooleanType WritePCXImage(const ImageInfo *image_info,Image *image,
for (x=0; x < (ssize_t) image->columns; x++)
{
byte<<=1;
- if (GetPixelLuma(image,p) < (QuantumRange/2.0))
+ if (GetPixelLuma(image,p) >= (QuantumRange/2.0))
byte|=0x01;
bit++;
if (bit == 8)
diff --git a/coders/pcx.h b/coders/pcx.h
index a72685015..fa331d0cf 100644
--- a/coders/pcx.h
+++ b/coders/pcx.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pdb.c b/coders/pdb.c
index 7be605c2f..5a1f59885 100644
--- a/coders/pdb.c
+++ b/coders/pdb.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/pdb.h b/coders/pdb.h
index 43ff3051b..6d547910a 100644
--- a/coders/pdb.h
+++ b/coders/pdb.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pdf.c b/coders/pdf.c
index 0b36d0ff1..113124e45 100644
--- a/coders/pdf.c
+++ b/coders/pdf.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -45,7 +45,6 @@
#include "MagickCore/blob.h"
#include "MagickCore/blob-private.h"
#include "MagickCore/cache.h"
-#include "MagickCore/channel.h"
#include "MagickCore/color.h"
#include "MagickCore/color-private.h"
#include "MagickCore/colorspace.h"
@@ -54,7 +53,6 @@
#include "MagickCore/constitute.h"
#include "MagickCore/delegate.h"
#include "MagickCore/delegate-private.h"
-#include "MagickCore/distort.h"
#include "MagickCore/draw.h"
#include "MagickCore/exception.h"
#include "MagickCore/exception-private.h"
@@ -66,7 +64,6 @@
#include "MagickCore/memory_.h"
#include "MagickCore/module.h"
#include "MagickCore/monitor.h"
-#include "MagickCore/montage.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/nt-base-private.h"
#include "MagickCore/option.h"
@@ -120,8 +117,7 @@ typedef struct _PDFInfo
Forward declarations.
*/
static MagickBooleanType
- WritePDFImage(const ImageInfo *,Image *,ExceptionInfo *),
- WritePOCKETMODImage(const ImageInfo *,Image *,ExceptionInfo *);
+ WritePDFImage(const ImageInfo *,Image *,ExceptionInfo *);
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -472,10 +468,10 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
(void) ParseAbsoluteGeometry(PSPageGeometry,&page);
if (image_info->page != (char *) NULL)
(void) ParseAbsoluteGeometry(image_info->page,&page);
- page.width=(size_t) ((ssize_t) ceil((double) (page.width*
- image->resolution.x/delta.x)-0.5));
- page.height=(size_t) ((ssize_t) ceil((double) (page.height*
- image->resolution.y/delta.y)-0.5));
+ page.width=(size_t) ceil((double) (page.width*image->resolution.x/delta.x)-
+ 0.5);
+ page.height=(size_t) ceil((double) (page.height*image->resolution.y/delta.y)-
+ 0.5);
/*
Determine page geometry from the PDF media box.
*/
@@ -491,10 +487,10 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
pdf_info.bounds.x2-pdf_info.bounds.x1,pdf_info.bounds.y2-
pdf_info.bounds.y1,pdf_info.bounds.x1,pdf_info.bounds.y1);
(void) SetImageProperty(image,"pdf:HiResBoundingBox",geometry,exception);
- page.width=(size_t) ((ssize_t) ceil((double) ((pdf_info.bounds.x2-
- pdf_info.bounds.x1)*image->resolution.x/delta.x)-0.5));
- page.height=(size_t) ((ssize_t) ceil((double) ((pdf_info.bounds.y2-
- pdf_info.bounds.y1)*image->resolution.y/delta.y)-0.5));
+ page.width=(size_t) ceil((double) ((pdf_info.bounds.x2-
+ pdf_info.bounds.x1)*image->resolution.x/delta.x)-0.5);
+ page.height=(size_t) ceil((double) ((pdf_info.bounds.y2-
+ pdf_info.bounds.y1)*image->resolution.y/delta.y)-0.5);
}
fitPage=MagickFalse;
option=GetImageOption(image_info,"pdf:fit-page");
@@ -515,10 +511,10 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
image=DestroyImage(image);
return((Image *) NULL);
}
- page.width=(size_t) ((ssize_t) ceil((double) (page.width*
- image->resolution.x/delta.x)-0.5));
- page.height=(size_t) ((ssize_t) ceil((double) (page.height*
- image->resolution.y/delta.y)-0.5));
+ page.width=(size_t) ceil((double) (page.width*image->resolution.x/
+ delta.x)-0.5);
+ page.height=(size_t) ceil((double) (page.height*image->resolution.y/
+ delta.y)-0.5);
fitPage=MagickTrue;
}
if ((fabs(pdf_info.angle) == 90.0) || (fabs(pdf_info.angle) == 270.0))
@@ -545,14 +541,7 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
image=DestroyImage(image);
return((Image *) NULL);
}
- if (write(file," ",1) != 1)
- {
- file=close(file)-1;
- (void) RelinquishUniqueFileResource(postscript_filename);
- CleanupPDFInfo(&pdf_info);
- image=DestroyImage(image);
- return((Image *) NULL);
- }
+ (void) write(file," ",1);
file=close(file)-1;
/*
Render Postscript with the Ghostscript delegate.
@@ -785,14 +774,6 @@ ModuleExport size_t RegisterPDFImage(void)
entry->flags^=CoderBlobSupportFlag;
entry->mime_type=ConstantString("application/pdf");
(void) RegisterMagickInfo(entry);
- entry=AcquireMagickInfo("PDF","POCKETMOD","Pocketmod Personal Organizer");
- entry->decoder=(DecodeImageHandler *) ReadPDFImage;
- entry->encoder=(EncodeImageHandler *) WritePOCKETMODImage;
- entry->format_type=ImplicitFormatType;
- entry->flags|=CoderDecoderSeekableStreamFlag;
- entry->flags^=CoderBlobSupportFlag;
- entry->mime_type=ConstantString("application/pdf");
- (void) RegisterMagickInfo(entry);
return(MagickImageCoderSignature);
}
@@ -1045,96 +1026,6 @@ static MagickBooleanType Huffman2DEncodeImage(const ImageInfo *image_info,
return(status);
}
-static MagickBooleanType WritePOCKETMODImage(const ImageInfo *image_info,
- Image *image,ExceptionInfo *exception)
-{
-#define PocketPageOrder "1,2,3,4,0,7,6,5"
-
- const Image
- *next;
-
- Image
- *pages,
- *pocket_mod;
-
- MagickBooleanType
- status;
-
- register ssize_t
- i;
-
- assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickCoreSignature);
- assert(image != (Image *) NULL);
- assert(image->signature == MagickCoreSignature);
- if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- assert(exception != (ExceptionInfo *) NULL);
- assert(exception->signature == MagickCoreSignature);
- pocket_mod=NewImageList();
- pages=NewImageList();
- i=0;
- for (next=image; next != (Image *) NULL; next=GetNextImageInList(next))
- {
- Image
- *page;
-
- if ((i == 0) || (i == 5) || (i == 6) || (i == 7))
- page=RotateImage(next,180.0,exception);
- else
- page=CloneImage(next,0,0,MagickTrue,exception);
- if (page == (Image *) NULL)
- break;
- (void) SetImageAlphaChannel(page,RemoveAlphaChannel,exception);
- page->scene=i++;
- AppendImageToList(&pages,page);
- if ((i == 8) || (GetNextImageInList(next) == (Image *) NULL))
- {
- Image
- *images,
- *page_layout;
-
- MontageInfo
- *montage_info;
-
- /*
- Create PocketMod page.
- */
- for (i=(ssize_t) GetImageListLength(pages); i < 8; i++)
- {
- page=CloneImage(pages,0,0,MagickTrue,exception);
- (void) QueryColorCompliance("#FFF",AllCompliance,
- &page->background_color,exception);
- SetImageBackgroundColor(page,exception);
- page->scene=i;
- AppendImageToList(&pages,page);
- }
- images=CloneImages(pages,PocketPageOrder,exception);
- pages=DestroyImageList(pages);
- if (images == (Image *) NULL)
- break;
- montage_info=CloneMontageInfo(image_info,(MontageInfo *) NULL);
- (void) CloneString(&montage_info->geometry,"877x1240+0+0");
- (void) CloneString(&montage_info->tile,"4x2");
- (void) QueryColorCompliance("#000",AllCompliance,
- &montage_info->border_color,exception);
- montage_info->border_width=2;
- page_layout=MontageImages(images,montage_info,exception);
- montage_info=DestroyMontageInfo(montage_info);
- images=DestroyImageList(images);
- if (page_layout == (Image *) NULL)
- break;
- AppendImageToList(&pocket_mod,page_layout);
- i=0;
- }
- }
- if (pocket_mod == (Image *) NULL)
- return(MagickFalse);
- status=WritePDFImage(image_info,GetFirstImageInList(pocket_mod),exception);
- pocket_mod=DestroyImageList(pocket_mod);
- return(status);
-}
-
static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
@@ -2091,7 +1982,7 @@ RestoreMSCWarning
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- *q++=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
+ *q++=(unsigned char) GetPixelIndex(image,p);
p+=GetPixelChannels(image);
}
if (image->previous == (Image *) NULL)
@@ -2133,8 +2024,7 @@ RestoreMSCWarning
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- Ascii85Encode(image,(unsigned char) ((ssize_t)
- GetPixelIndex(image,p)));
+ Ascii85Encode(image,(unsigned char) GetPixelIndex(image,p));
p+=GetPixelChannels(image);
}
if (image->previous == (Image *) NULL)
@@ -2212,7 +2102,7 @@ RestoreMSCWarning
*p;
/*
- Write ICC profile.
+ Write ICC profile.
*/
(void) FormatLocaleString(buffer,MagickPathExtent,
"[/ICCBased %.20g 0 R]\n",(double) object+1);
@@ -2609,7 +2499,7 @@ RestoreMSCWarning
break;
for (x=0; x < (ssize_t) tile_image->columns; x++)
{
- *q++=(unsigned char) ((ssize_t) GetPixelIndex(tile_image,p));
+ *q++=(unsigned char) GetPixelIndex(tile_image,p);
p+=GetPixelChannels(tile_image);
}
}
@@ -2646,7 +2536,7 @@ RestoreMSCWarning
for (x=0; x < (ssize_t) tile_image->columns; x++)
{
Ascii85Encode(image,(unsigned char)
- ((ssize_t) GetPixelIndex(tile_image,p)));
+ GetPixelIndex(tile_image,p));
p+=GetPixelChannels(image);
}
}
diff --git a/coders/pdf.h b/coders/pdf.h
index 2df5d9c51..7ddc245fd 100644
--- a/coders/pdf.h
+++ b/coders/pdf.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
@@ -22,8 +22,7 @@
#define MagickPDFAliases \
MagickCoderAlias("PDF", "AI") \
MagickCoderAlias("PDF", "EPDF") \
- MagickCoderAlias("PDF", "PDFA") \
- MagickCoderAlias("PDF", "POCKETMOD")
+ MagickCoderAlias("PDF", "PDFA")
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
diff --git a/coders/pes.c b/coders/pes.c
index 7b5863654..af5dc1cd4 100644
--- a/coders/pes.c
+++ b/coders/pes.c
@@ -17,7 +17,7 @@
% July 2009 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/pes.h b/coders/pes.h
index 6f4adbb88..cbd47d75e 100644
--- a/coders/pes.h
+++ b/coders/pes.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pgx.c b/coders/pgx.c
index e820c77fe..1dead57c3 100644
--- a/coders/pgx.c
+++ b/coders/pgx.c
@@ -17,7 +17,7 @@
% July 2016 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -137,6 +137,9 @@ static Image *ReadPGXImage(const ImageInfo *image_info,ExceptionInfo *exception)
sans[MagickPathExtent],
sign[MagickPathExtent];
+ const unsigned char
+ *pixels;
+
Image
*image;
@@ -158,9 +161,6 @@ static Image *ReadPGXImage(const ImageInfo *image_info,ExceptionInfo *exception)
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
@@ -207,23 +207,20 @@ static Image *ReadPGXImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
length=GetQuantumExtent(image,quantum_info,GrayQuantum);
- pixels=GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)
{
- const void
- *stream;
-
register Quantum
*magick_restrict q;
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
(void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
- GrayQuantum,(unsigned char *) stream,exception);
+ GrayQuantum,pixels,exception);
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
if (SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,image->rows) == MagickFalse)
diff --git a/coders/pgx.h b/coders/pgx.h
index cd8f7693d..a16f7f23a 100644
--- a/coders/pgx.h
+++ b/coders/pgx.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pict.c b/coders/pict.c
index e8ce3f719..b8f7c6c78 100644
--- a/coders/pict.c
+++ b/coders/pict.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -1786,8 +1786,6 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
bytes_per_line=image->columns;
if (storage_class == DirectClass)
bytes_per_line*=image->alpha_trait != UndefinedPixelTrait ? 4 : 3;
- if ((bytes_per_line == 0) || (bytes_per_line > 0x7FFF))
- ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
buffer=(unsigned char *) AcquireQuantumMemory(PictInfoSize,sizeof(*buffer));
packed_scanline=(unsigned char *) AcquireQuantumMemory((size_t)
(row_bytes+2*MaxCount),sizeof(*packed_scanline));
diff --git a/coders/pict.h b/coders/pict.h
index 36442723d..973d7019f 100644
--- a/coders/pict.h
+++ b/coders/pict.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pix.c b/coders/pix.c
index bb42bd793..c266ba656 100644
--- a/coders/pix.c
+++ b/coders/pix.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/pix.h b/coders/pix.h
index 80db7ba9e..ee58db45d 100644
--- a/coders/pix.h
+++ b/coders/pix.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/plasma.c b/coders/plasma.c
index 4a9165fc5..461407836 100644
--- a/coders/plasma.c
+++ b/coders/plasma.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/plasma.h b/coders/plasma.h
index 00f224753..5b476d19f 100644
--- a/coders/plasma.h
+++ b/coders/plasma.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/png.c b/coders/png.c
index c838b7d57..ca7151e3f 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -18,7 +18,7 @@
% November 1997 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -1790,11 +1790,9 @@ Magick_png_read_raw_profile(png_struct *ping,Image *image,
size_t
extent,
+ length,
nibbles;
- ssize_t
- length;
-
StringInfo
*profile;
@@ -1808,11 +1806,6 @@ Magick_png_read_raw_profile(png_struct *ping,Image *image,
sp=text[ii].text+1;
extent=text[ii].text_length;
- if ((sp+extent) < sp)
- {
- png_warning(ping,"invalid profile length");
- return(MagickFalse);
- }
/* look for newline */
while ((*sp != '\n') && extent--)
sp++;
@@ -2221,6 +2214,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
*volatile quantum_scanline;
ssize_t
+ ping_rowbytes,
y;
register unsigned char
@@ -2235,7 +2229,6 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
size_t
length,
- ping_rowbytes,
row_offset;
ssize_t
@@ -6836,8 +6829,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info,
MngBox
crop_box;
- if (((mng_info->magn_methx > 0) && (mng_info->magn_methx <= 5)) &&
- ((mng_info->magn_methy > 0) && (mng_info->magn_methy <= 5)))
+ if (mng_info->magn_methx || mng_info->magn_methy)
{
png_uint_32
magnified_height,
@@ -7677,7 +7669,10 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info,
next_image=CoalesceImages(image,exception);
image=DestroyImageList(image);
if (next_image == (Image *) NULL)
- return((Image *) NULL);
+ {
+ mng_info=MngInfoFreeStruct(mng_info);
+ return((Image *) NULL);
+ }
image=next_image;
for (next=image; next != (Image *) NULL; next=next_image)
@@ -9016,7 +9011,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" i (red,green,blue,alpha)");
- for (i=0; i < (ssize_t) MagickMin(image->colors,256); i++)
+ for (i=0; i < 256; i++)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" %d (%d,%d,%d,%d)",
@@ -11388,13 +11383,11 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Allocating %.20g bytes of memory for pixels",(double) rowbytes);
}
- pixel_info=AcquireVirtualMemory(rowbytes,GetPixelChannels(image)*
- sizeof(*ping_pixels));
+ pixel_info=AcquireVirtualMemory(rowbytes,sizeof(*ping_pixels));
if (pixel_info == (MemoryInfo *) NULL)
png_error(ping,"Allocation of memory for pixels failed");
ping_pixels=(unsigned char *) GetVirtualMemoryBlob(pixel_info);
- (void) memset(ping_pixels,0,rowbytes*GetPixelChannels(image)*
- sizeof(*ping_pixels));
+ (void) memset(ping_pixels,0,rowbytes*sizeof(*ping_pixels));
/*
Initialize image scanlines.
*/
diff --git a/coders/png.h b/coders/png.h
index dc2159319..a2b183c65 100644
--- a/coders/png.h
+++ b/coders/png.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pnm.c b/coders/pnm.c
index ab4af6087..fd231ef31 100644
--- a/coders/pnm.c
+++ b/coders/pnm.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -242,9 +242,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
CommentInfo
comment_info;
- const void
- *stream;
-
double
quantum_scale;
@@ -273,9 +270,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
row,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
@@ -612,9 +606,11 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
ThrowPNMException(ResourceLimitError,"MemoryAllocationFailed");
SetQuantumMinIsWhite(quantum_info,MagickTrue);
extent=GetQuantumExtent(image,quantum_info,quantum_type);
- pixels=GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)
{
+ const unsigned char
+ *pixels;
+
MagickBooleanType
sync;
@@ -627,7 +623,8 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
size_t
length;
- stream=ReadBlobStream(image,extent,pixels,&count);
+ pixels=(unsigned char *) ReadBlobStream(image,extent,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) extent)
break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -646,7 +643,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
- quantum_type,(unsigned char *) stream,exception);
+ quantum_type,pixels,exception);
if (length != extent)
break;
sync=SyncAuthenticPixels(image,exception);
@@ -669,9 +666,11 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowPNMException(ResourceLimitError,"MemoryAllocationFailed");
- pixels=GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)
{
+ const unsigned char
+ *pixels;
+
MagickBooleanType
sync;
@@ -687,7 +686,8 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
ssize_t
offset;
- stream=ReadBlobStream(image,extent,pixels,&count);
+ pixels=(unsigned char *) ReadBlobStream(image,extent,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) extent)
break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -705,7 +705,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
- p=(unsigned char *) stream;
+ p=pixels;
switch (image->depth)
{
case 8:
@@ -713,7 +713,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
case 32:
{
(void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
- quantum_type,(unsigned char *) stream,exception);
+ quantum_type,pixels,exception);
break;
}
default:
@@ -777,9 +777,11 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (quantum_info == (QuantumInfo *) NULL)
ThrowPNMException(ResourceLimitError,"MemoryAllocationFailed");
(void) SetQuantumEndian(image,quantum_info,MSBEndian);
- pixels=GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)
{
+ const unsigned char
+ *pixels;
+
MagickBooleanType
sync;
@@ -795,7 +797,8 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
ssize_t
offset;
- stream=ReadBlobStream(image,extent,pixels,&count);
+ pixels=(unsigned char *) ReadBlobStream(image,extent,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) extent)
break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -813,7 +816,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
- p=(unsigned char *) stream;
+ p=pixels;
switch (image->depth)
{
case 8:
@@ -962,9 +965,11 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowPNMException(ResourceLimitError,"MemoryAllocationFailed");
- pixels=GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)
{
+ const unsigned char
+ *pixels;
+
MagickBooleanType
sync;
@@ -980,7 +985,8 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
ssize_t
offset;
- stream=ReadBlobStream(image,extent,pixels,&count);
+ pixels=(unsigned char *) ReadBlobStream(image,extent,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) extent)
break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -998,7 +1004,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
- p=(unsigned char *) stream;
+ p=pixels;
switch (image->depth)
{
case 8:
@@ -1006,7 +1012,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
case 32:
{
(void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
- quantum_type,(unsigned char *) stream,exception);
+ quantum_type,pixels,exception);
break;
}
default:
@@ -1285,9 +1291,11 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
ThrowPNMException(ResourceLimitError,"MemoryAllocationFailed");
SetQuantumScale(quantum_info,(double) QuantumRange*fabs(quantum_scale));
extent=GetQuantumExtent(image,quantum_info,quantum_type);
- pixels=GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)
{
+ const unsigned char
+ *pixels;
+
MagickBooleanType
sync;
@@ -1300,7 +1308,8 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
size_t
length;
- stream=ReadBlobStream(image,extent,pixels,&count);
+ pixels=(unsigned char *) ReadBlobStream(image,extent,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) extent)
break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
@@ -1320,7 +1329,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
- quantum_type,(unsigned char *) stream,exception);
+ quantum_type,pixels,exception);
if (length != extent)
break;
sync=SyncAuthenticPixels(image,exception);
@@ -1601,8 +1610,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
case 'f':
{
format='F';
- if ((image_info->type != TrueColorType) &&
- (SetImageGray(image,exception) != MagickFalse))
+ if (SetImageGray(image,exception) != MagickFalse)
format='f';
break;
}
diff --git a/coders/pnm.h b/coders/pnm.h
index b89792c6b..45031c2b9 100644
--- a/coders/pnm.h
+++ b/coders/pnm.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/ps.c b/coders/ps.c
index 8d0c362b3..50aef44eb 100644
--- a/coders/ps.c
+++ b/coders/ps.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -73,7 +73,6 @@
#include "MagickCore/quantum-private.h"
#include "MagickCore/static.h"
#include "MagickCore/string_.h"
-#include "MagickCore/string-private.h"
#include "MagickCore/timer-private.h"
#include "MagickCore/token.h"
#include "MagickCore/transform.h"
@@ -207,7 +206,7 @@ static void ReadPSInfo(const ImageInfo *image_info,Image *image,
{
#define BeginDocument "BeginDocument:"
#define EndDocument "EndDocument:"
-#define PostscriptLevel "PS-"
+#define PostscriptLevel "!PS-"
#define ImageData "ImageData:"
#define DocumentProcessColors "DocumentProcessColors:"
#define CMYKCustomColor "CMYKCustomColor:"
@@ -229,7 +228,6 @@ static void ReadPSInfo(const ImageInfo *image_info,Image *image,
c;
MagickBooleanType
- new_line,
skip;
MagickByteBuffer
@@ -291,7 +289,6 @@ static void ReadPSInfo(const ImageInfo *image_info,Image *image,
*version='\0';
spotcolor=0;
skip=MagickFalse;
- new_line=MagickTrue;
(void) memset(&buffer,0,sizeof(buffer));
buffer.image=image;
for (c=ReadMagickByteBuffer(&buffer); c != EOF; c=ReadMagickByteBuffer(&buffer))
@@ -305,18 +302,8 @@ static void ReadPSInfo(const ImageInfo *image_info,Image *image,
}
case '\n':
case '\r':
- new_line=MagickTrue;
- continue;
case '%':
- {
- if (new_line == MagickFalse)
- continue;
- new_line=MagickFalse;
- c=ReadMagickByteBuffer(&buffer);
- if ((c == '%') || (c == '!'))
- break;
- continue;
- }
+ break;
default:
continue;
}
@@ -353,9 +340,9 @@ static void ReadPSInfo(const ImageInfo *image_info,Image *image,
if (CompareMagickByteBuffer(&buffer,DocumentProcessColors,length) != MagickFalse)
{
p=GetMagickByteBufferDatum(&buffer);
- if ((StringLocateSubstring(p,"Cyan") != (char *) NULL) ||
- (StringLocateSubstring(p,"Magenta") != (char *) NULL) ||
- (StringLocateSubstring(p,"Yellow") != (char *) NULL))
+ if ((GlobExpression(p,"*Cyan*",MagickTrue) != MagickFalse) ||
+ (GlobExpression(p,"*Magenta*",MagickTrue) != MagickFalse) ||
+ (GlobExpression(p,"*Yellow*",MagickTrue) != MagickFalse))
ps_info->cmyk=MagickTrue;
}
if (CompareMagickByteBuffer(&buffer,CMYKCustomColor,strlen(CMYKCustomColor)) != MagickFalse)
@@ -623,10 +610,8 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (image_info->page != (char *) NULL)
(void) ParseAbsoluteGeometry(image_info->page,&page);
resolution=image->resolution;
- page.width=(size_t) ((ssize_t) ceil((double) (page.width*resolution.x/
- delta.x)-0.5));
- page.height=(size_t) ((ssize_t) ceil((double) (page.height*resolution.y/
- delta.y)-0.5));
+ page.width=(size_t) ceil((double) (page.width*resolution.x/delta.x)-0.5);
+ page.height=(size_t) ceil((double) (page.height*resolution.y/delta.y)-0.5);
/*
Determine page geometry from the Postscript bounding box.
*/
@@ -642,10 +627,10 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
info.bounds.x2-info.bounds.x1,info.bounds.y2-info.bounds.y1,
info.bounds.x1,info.bounds.y1);
(void) SetImageProperty(image,"ps:HiResBoundingBox",geometry,exception);
- page.width=(size_t) ((ssize_t) ceil((double) ((info.bounds.x2-
- info.bounds.x1)*resolution.x/delta.x)-0.5));
- page.height=(size_t) ((ssize_t) ceil((double) ((info.bounds.y2-
- info.bounds.y1)*resolution.y/delta.y)-0.5));
+ page.width=(size_t) ceil((double) ((info.bounds.x2-info.bounds.x1)*
+ resolution.x/delta.x)-0.5);
+ page.height=(size_t) ceil((double) ((info.bounds.y2-info.bounds.y1)*
+ resolution.y/delta.y)-0.5);
}
fitPage=MagickFalse;
option=GetImageOption(image_info,"eps:fit-page");
@@ -665,10 +650,10 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
image=DestroyImage(image);
return((Image *) NULL);
}
- page.width=(size_t) ((ssize_t) ceil((double) (page.width*
- image->resolution.x/delta.x)-0.5));
- page.height=(size_t) ((ssize_t) ceil((double) (page.height*
- image->resolution.y/delta.y) -0.5));
+ page.width=(size_t) ceil((double) (page.width*image->resolution.x/delta.x)
+ -0.5);
+ page.height=(size_t) ceil((double) (page.height*image->resolution.y/
+ delta.y) -0.5);
page_geometry=DestroyString(page_geometry);
fitPage=MagickTrue;
}
diff --git a/coders/ps.h b/coders/ps.h
index 847c04acb..afa83731e 100644
--- a/coders/ps.h
+++ b/coders/ps.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/ps2.c b/coders/ps2.c
index 98cbc8741..6cd898a5e 100644
--- a/coders/ps2.c
+++ b/coders/ps2.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/ps2.h b/coders/ps2.h
index cc5b75fc0..77e43a6b3 100644
--- a/coders/ps2.h
+++ b/coders/ps2.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/ps3.c b/coders/ps3.c
index 45affdb4d..29e8900b2 100644
--- a/coders/ps3.c
+++ b/coders/ps3.c
@@ -18,7 +18,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/ps3.h b/coders/ps3.h
index 1b2a10fda..66d821137 100644
--- a/coders/ps3.h
+++ b/coders/ps3.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/psd-private.h b/coders/psd-private.h
index 617e72626..89d947487 100644
--- a/coders/psd-private.h
+++ b/coders/psd-private.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/psd.c b/coders/psd.c
index 18cad3823..ac3eb6d70 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -20,7 +20,7 @@
% December 2013 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/psd.h b/coders/psd.h
index dcd31ce19..5275d9063 100644
--- a/coders/psd.h
+++ b/coders/psd.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/pwp.c b/coders/pwp.c
index d09fbbc67..0874e07bb 100644
--- a/coders/pwp.c
+++ b/coders/pwp.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/pwp.h b/coders/pwp.h
index b25bd515b..bee0a5b7b 100644
--- a/coders/pwp.h
+++ b/coders/pwp.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/raw.c b/coders/raw.c
index cfef622bd..519dea65b 100644
--- a/coders/raw.c
+++ b/coders/raw.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -96,8 +96,8 @@ static MagickBooleanType
*/
static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
- const void
- *stream;
+ const unsigned char
+ *pixels;
Image
*canvas_image,
@@ -122,9 +122,6 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
@@ -166,7 +163,7 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
canvas_image=DestroyImage(canvas_image);
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
- pixels=GetQuantumPixels(quantum_info);
+ pixels=(const unsigned char *) NULL;
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
{
@@ -177,7 +174,8 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
@@ -186,7 +184,6 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
count=0;
length=0;
status=MagickTrue;
- stream=NULL;
do
{
/*
@@ -201,7 +198,8 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
@@ -227,7 +225,7 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,quantum_info,
- quantum_type,(unsigned char *) stream,exception);
+ quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -257,7 +255,8 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (status == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
diff --git a/coders/raw.h b/coders/raw.h
index 063413f50..5424a514e 100644
--- a/coders/raw.h
+++ b/coders/raw.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/rgb.c b/coders/rgb.c
index 324d0481e..0bff43650 100644
--- a/coders/rgb.c
+++ b/coders/rgb.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -99,8 +99,8 @@ static MagickBooleanType
*/
static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
- const void
- *stream;
+ const unsigned char
+ *pixels;
Image
*canvas_image,
@@ -128,9 +128,6 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
@@ -184,7 +181,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
image->alpha_trait=BlendPixelTrait;
canvas_image->alpha_trait=BlendPixelTrait;
}
- pixels=GetQuantumPixels(quantum_info);
+ pixels=(const unsigned char *) NULL;
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
{
@@ -195,7 +192,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
@@ -204,7 +202,6 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
length=0;
scene=0;
status=MagickTrue;
- stream=NULL;
do
{
/*
@@ -227,7 +224,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -252,7 +250,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,quantum_type,(unsigned char *) stream,exception);
+ quantum_info,quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -285,7 +283,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (status == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
break;
}
@@ -308,7 +307,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -336,7 +336,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,quantum_type,(unsigned char *) stream,exception);
+ quantum_info,quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -386,7 +386,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -406,7 +407,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -431,7 +433,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,RedQuantum,(unsigned char *) stream,exception);
+ quantum_info,RedQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -452,7 +454,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -483,7 +486,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,GreenQuantum,(unsigned char *) stream,exception);
+ quantum_info,GreenQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -504,7 +507,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -535,7 +539,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlueQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlueQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -556,7 +560,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -589,7 +594,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,AlphaQuantum,(unsigned char *) stream,exception);
+ quantum_info,AlphaQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -611,7 +616,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -640,8 +646,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (DiscardBlobBytes(image,(MagickSizeType) image->offset) == MagickFalse)
{
status=MagickFalse;
- ThrowFileException(exception,CorruptImageError,
- "UnexpectedEndOfFile",image->filename);
+ ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
+ image->filename);
break;
}
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
@@ -649,14 +655,16 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -680,7 +688,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,RedQuantum,(unsigned char *) stream,exception);
+ quantum_info,RedQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -701,7 +709,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -719,14 +728,16 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -750,7 +761,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,GreenQuantum,(unsigned char *) stream,exception);
+ quantum_info,GreenQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -771,7 +782,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -789,14 +801,16 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -820,7 +834,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlueQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlueQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -841,7 +855,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -861,14 +876,16 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -892,7 +909,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlueQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlueQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -913,7 +930,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -998,8 +1016,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
static Image *ReadRGB565Image(const ImageInfo *image_info,
ExceptionInfo *exception)
{
- const void
- *stream;
+ const unsigned char
+ *pixels;
Image
*canvas_image,
@@ -1024,9 +1042,6 @@ static Image *ReadRGB565Image(const ImageInfo *image_info,
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
@@ -1069,7 +1084,7 @@ static Image *ReadRGB565Image(const ImageInfo *image_info,
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
quantum_type=GrayQuantum;
- pixels=GetQuantumPixels(quantum_info);
+ pixels=(const unsigned char *) NULL;
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
{
@@ -1080,7 +1095,8 @@ static Image *ReadRGB565Image(const ImageInfo *image_info,
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
@@ -1089,7 +1105,6 @@ static Image *ReadRGB565Image(const ImageInfo *image_info,
length=0;
scene=0;
status=MagickTrue;
- stream=NULL;
do
{
/*
@@ -1107,7 +1122,8 @@ static Image *ReadRGB565Image(const ImageInfo *image_info,
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -1131,7 +1147,7 @@ static Image *ReadRGB565Image(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,quantum_type,(unsigned char *) stream,exception);
+ quantum_info,quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -1166,7 +1182,8 @@ static Image *ReadRGB565Image(const ImageInfo *image_info,
if (status == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (status == MagickFalse)
break;
diff --git a/coders/rgb.h b/coders/rgb.h
index d8a5d4133..d235c2838 100644
--- a/coders/rgb.h
+++ b/coders/rgb.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/rgf.c b/coders/rgf.c
index 61708a4f1..97a19e57b 100644
--- a/coders/rgf.c
+++ b/coders/rgf.c
@@ -17,7 +17,7 @@
% August 2013 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/rgf.h b/coders/rgf.h
index 748321357..cc5824e6d 100644
--- a/coders/rgf.h
+++ b/coders/rgf.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/rla.c b/coders/rla.c
index d2a4f0f23..4b6e13913 100644
--- a/coders/rla.c
+++ b/coders/rla.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/rla.h b/coders/rla.h
index 89d44676c..d3b7674d9 100644
--- a/coders/rla.h
+++ b/coders/rla.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/rle.c b/coders/rle.c
index 1d40860f8..5abca5448 100644
--- a/coders/rle.c
+++ b/coders/rle.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/rle.h b/coders/rle.h
index c08f1d725..492856baa 100644
--- a/coders/rle.h
+++ b/coders/rle.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/scr.c b/coders/scr.c
index c62c1a167..3f18a7399 100644
--- a/coders/scr.c
+++ b/coders/scr.c
@@ -17,7 +17,7 @@
% October 2003 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/scr.h b/coders/scr.h
index 928d87632..dac9e4339 100644
--- a/coders/scr.h
+++ b/coders/scr.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/screenshot.c b/coders/screenshot.c
index b0f60c449..42b790565 100644
--- a/coders/screenshot.c
+++ b/coders/screenshot.c
@@ -17,7 +17,7 @@
% April 2014 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/screenshot.h b/coders/screenshot.h
index a414a4bb5..be1088bf8 100644
--- a/coders/screenshot.h
+++ b/coders/screenshot.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/sct.c b/coders/sct.c
index 47ff9a9a6..4975d78b1 100644
--- a/coders/sct.c
+++ b/coders/sct.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/sct.h b/coders/sct.h
index ce7f12d5b..f632a0f95 100644
--- a/coders/sct.h
+++ b/coders/sct.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/sfw.c b/coders/sfw.c
index 7923fd721..0d02e44f8 100644
--- a/coders/sfw.c
+++ b/coders/sfw.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/sfw.h b/coders/sfw.h
index 81aa88906..77d5e92ff 100644
--- a/coders/sfw.h
+++ b/coders/sfw.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/sgi.c b/coders/sgi.c
index 4eabb5b79..415598122 100644
--- a/coders/sgi.c
+++ b/coders/sgi.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/sgi.h b/coders/sgi.h
index 69be6405f..bd7b73c62 100644
--- a/coders/sgi.h
+++ b/coders/sgi.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/sixel.c b/coders/sixel.c
index 186a2463f..46cde2dad 100644
--- a/coders/sixel.c
+++ b/coders/sixel.c
@@ -18,7 +18,7 @@
% Based on kmiya's sixel (2014-03-28) %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/sixel.h b/coders/sixel.h
index 1de333324..43f5a4702 100644
--- a/coders/sixel.h
+++ b/coders/sixel.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/stegano.c b/coders/stegano.c
index 0b87fec2b..e1a9a6b0e 100644
--- a/coders/stegano.c
+++ b/coders/stegano.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/stegano.h b/coders/stegano.h
index f4c82be71..995fc4190 100644
--- a/coders/stegano.h
+++ b/coders/stegano.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/sun.c b/coders/sun.c
index 2071986bc..6a1553af7 100644
--- a/coders/sun.c
+++ b/coders/sun.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -57,6 +57,7 @@
#include "MagickCore/list.h"
#include "MagickCore/magick.h"
#include "MagickCore/memory_.h"
+#include "MagickCore/memory-private.h"
#include "MagickCore/monitor.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/pixel-accessor.h"
@@ -433,8 +434,9 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
if ((sun_info.type != RT_ENCODED) &&
((number_pixels*sun_info.depth) > (8UL*sun_info.length)))
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
- if (HeapOverflowSanityCheckGetSize(sun_info.width,sun_info.depth,&bytes_per_line) != MagickFalse)
+ if (HeapOverflowSanityCheck(sun_info.width,sun_info.depth) != MagickFalse)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ bytes_per_line=sun_info.width*sun_info.depth;
if (sun_info.length > GetBlobSize(image))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
sun_data=(unsigned char *) AcquireQuantumMemory(sun_info.length,
@@ -463,11 +465,12 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
ThrowReaderException(ResourceLimitError,"ImproperImageHeader");
}
bytes_per_line>>=4;
- if (HeapOverflowSanityCheckGetSize(height,bytes_per_line,&pixels_length) != MagickFalse)
+ if (HeapOverflowSanityCheck(height,bytes_per_line) != MagickFalse)
{
sun_data=(unsigned char *) RelinquishMagickMemory(sun_data);
ThrowReaderException(ResourceLimitError,"ImproperImageHeader");
}
+ pixels_length=height*bytes_per_line;
sun_pixels=(unsigned char *) AcquireQuantumMemory(pixels_length+image->rows,
sizeof(*sun_pixels));
if (sun_pixels == (unsigned char *) NULL)
diff --git a/coders/sun.h b/coders/sun.h
index 21661bbb8..96955453b 100644
--- a/coders/sun.h
+++ b/coders/sun.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/svg.c b/coders/svg.c
index 63cf8edf6..39f5a1d5c 100644
--- a/coders/svg.c
+++ b/coders/svg.c
@@ -18,7 +18,7 @@
% March 2000 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -65,10 +65,9 @@
#include "MagickCore/module.h"
#include "MagickCore/monitor.h"
#include "MagickCore/monitor-private.h"
-#include "MagickCore/option.h"
+#include "MagickCore/quantum-private.h"
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/property.h"
-#include "MagickCore/quantum-private.h"
#include "MagickCore/resource_.h"
#include "MagickCore/static.h"
#include "MagickCore/string_.h"
@@ -1669,14 +1668,18 @@ static void SVGStartElement(void *context,const xmlChar *name,
const char
*p;
- p=value;
- (void) GetNextToken(p,&p,MagickPathExtent,token);
- if (*token == ',')
+ for (p=value; ; )
+ {
(void) GetNextToken(p,&p,MagickPathExtent,token);
- if (*token != '\0')
- (void) FormatLocaleFile(svg_info->file,"class \"%s\"\n",value);
- else
- (void) FormatLocaleFile(svg_info->file,"class \"none\"\n");
+ if (*token == ',')
+ (void) GetNextToken(p,&p,MagickPathExtent,token);
+ if (*token != '\0')
+ {
+ (void) FormatLocaleFile(svg_info->file,"class \"%s\"\n",
+ value);
+ break;
+ }
+ }
break;
}
if (LocaleCompare(keyword,"clip-path") == 0)
@@ -2524,8 +2527,8 @@ static void SVGStartElement(void *context,const xmlChar *name,
svg_info->height=(size_t) floor(svg_info->bounds.height+0.5);
(void) FormatLocaleFile(svg_info->file,"viewbox 0 0 %.20g %.20g\n",
(double) svg_info->width,(double) svg_info->height);
- sx=PerceptibleReciprocal(svg_info->view_box.width)*svg_info->width;
- sy=PerceptibleReciprocal(svg_info->view_box.height)*svg_info->height;
+ sx=(double) svg_info->width/svg_info->view_box.width;
+ sy=(double) svg_info->height/svg_info->view_box.height;
tx=svg_info->view_box.x != 0.0 ? (double) -sx*svg_info->view_box.x :
0.0;
ty=svg_info->view_box.y != 0.0 ? (double) -sy*svg_info->view_box.y :
@@ -3084,8 +3087,8 @@ static void SVGCDataBlock(void *context,const xmlChar *value,int length)
SVGInfo
*svg_info;
- xmlNodePtr
- child;
+ xmlNodePtr
+ child;
xmlParserCtxtPtr
parser;
@@ -3103,9 +3106,7 @@ static void SVGCDataBlock(void *context,const xmlChar *value,int length)
xmlTextConcat(child,value,length);
return;
}
- child=xmlNewCDataBlock(parser->myDoc,value,length);
- if (xmlAddChild(parser->node,child) == (xmlNodePtr) NULL)
- xmlFreeNode(child);
+ (void) xmlAddChild(parser->node,xmlNewCDataBlock(parser->myDoc,value,length));
}
static void SVGExternalSubset(void *context,const xmlChar *name,
@@ -3578,14 +3579,9 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
message[n]='\0';
if (n > 0)
{
- const char
- *value;
-
svg_info->parser=xmlCreatePushParserCtxt(sax_handler,svg_info,(char *)
message,n,image->filename);
- value=GetImageOption(image_info,"svg:xml-parse-huge");
- if ((value != (char *) NULL) && (IsStringTrue(value) != MagickFalse))
- (void) xmlCtxtUseOptions(svg_info->parser,XML_PARSE_HUGE);
+ (void) xmlCtxtUseOptions(svg_info->parser,XML_PARSE_HUGE);
while ((n=ReadBlob(image,MagickPathExtent-1,message)) != 0)
{
message[n]='\0';
@@ -3596,8 +3592,6 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
}
(void) xmlParseChunk(svg_info->parser,(char *) message,0,1);
SVGEndDocument(svg_info);
- if (svg_info->parser->myDoc != (xmlDocPtr) NULL)
- xmlFreeDoc(svg_info->parser->myDoc);
xmlFreeParserCtxt(svg_info->parser);
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),"end SAX");
@@ -3988,9 +3982,6 @@ static MagickBooleanType TraceSVGImage(Image *image,ExceptionInfo *exception)
filename[MagickPathExtent],
message[MagickPathExtent];
- const DelegateInfo
- *delegate_info;
-
Image
*clone_image;
@@ -4013,21 +4004,15 @@ static MagickBooleanType TraceSVGImage(Image *image,ExceptionInfo *exception)
unsigned char
*blob;
- delegate_info=GetDelegateInfo((char *) NULL,"TRACE",exception);
- if (delegate_info != (DelegateInfo *) NULL)
- {
- /*
- Trace SVG with tracing delegate.
- */
- image_info=AcquireImageInfo();
- (void) CopyMagickString(image_info->magick,"TRACE",MagickPathExtent);
- (void) FormatLocaleString(filename,MagickPathExtent,"trace:%s",
- image_info->filename);
- (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
- status=WriteImage(image_info,image,exception);
- image_info=DestroyImageInfo(image_info);
- return(status);
- }
+ image_info=AcquireImageInfo();
+ (void) CopyMagickString(image_info->magick,"TRACE",MagickPathExtent);
+ (void) FormatLocaleString(filename,MagickPathExtent,"trace:%s",
+ image_info->filename);
+ (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
+ status=WriteImage(image_info,image,exception);
+ image_info=DestroyImageInfo(image_info);
+ if (status != MagickFalse)
+ return(status);
(void) WriteBlobString(image,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");
(void) WriteBlobString(image,
diff --git a/coders/svg.h b/coders/svg.h
index 9ba5387b0..79a2826fa 100644
--- a/coders/svg.h
+++ b/coders/svg.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/tga.c b/coders/tga.c
index f74819dd6..427f96f47 100644
--- a/coders/tga.c
+++ b/coders/tga.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -167,6 +167,7 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception)
base,
flag,
offset,
+ real,
skip;
ssize_t
@@ -310,20 +311,19 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception)
}
comment=DestroyString(comment);
}
- image->orientation=BottomLeftOrientation;
- if ((tga_info.attributes & (1UL << 4)) == 0)
+ if (tga_info.attributes & (1UL << 4))
{
- if ((tga_info.attributes & (1UL << 5)) == 0)
- image->orientation=BottomLeftOrientation;
+ if (tga_info.attributes & (1UL << 5))
+ image->orientation=TopRightOrientation;
else
- image->orientation=TopLeftOrientation;
+ image->orientation=BottomRightOrientation;
}
else
{
- if ((tga_info.attributes & (1UL << 5)) == 0)
- image->orientation=BottomRightOrientation;
+ if (tga_info.attributes & (1UL << 5))
+ image->orientation=TopLeftOrientation;
else
- image->orientation=TopRightOrientation;
+ image->orientation=BottomLeftOrientation;
}
if (image_info->ping != MagickFalse)
{
@@ -419,12 +419,16 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception)
base=0;
flag=0;
skip=MagickFalse;
+ real=0;
index=0;
runlength=0;
offset=0;
for (y=0; y < (ssize_t) image->rows; y++)
{
- q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
+ real=offset;
+ if (((unsigned char) (tga_info.attributes & 0x20) >> 5) == 0)
+ real=image->rows-real-1;
+ q=QueueAuthenticPixels(image,0,(ssize_t) real,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
for (x=0; x < (ssize_t) image->columns; x++)
@@ -539,10 +543,15 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception)
SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
q+=GetPixelChannels(image);
}
- if (((unsigned char) (tga_info.attributes & 0xc0) >> 6) == 2)
- offset+=2;
- else
- offset++;
+ /*
+ if (((unsigned char) (tga_info.attributes & 0xc0) >> 6) == 4)
+ offset+=4;
+ else
+ */
+ if (((unsigned char) (tga_info.attributes & 0xc0) >> 6) == 2)
+ offset+=2;
+ else
+ offset++;
if (offset >= image->rows)
{
base++;
@@ -750,9 +759,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
channels;
ssize_t
- base,
count,
- offset,
y;
TGAInfo
@@ -844,7 +851,6 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
(image->orientation == TopRightOrientation))
tga_info.attributes|=(1UL << 4);
if ((image->orientation == TopLeftOrientation) ||
- (image->orientation == UndefinedOrientation) ||
(image->orientation == TopRightOrientation))
tga_info.attributes|=(1UL << 5);
if ((image->columns > 65535) || (image->rows > 65535))
@@ -908,12 +914,10 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
/*
Convert MIFF to TGA raster pixels.
*/
- base=0;
- offset=0;
channels=GetPixelChannels(image);
- for (y=0; y < (ssize_t) image->rows; y++)
+ for (y=(ssize_t) (image->rows-1); y >= 0; y--)
{
- p=GetVirtualPixels(image,0,offset,image->columns,1,exception);
+ p=GetVirtualPixels(image,0,y,image->columns,1,exception);
if (p == (const Quantum *) NULL)
break;
if (compression == RLECompression)
@@ -932,27 +936,26 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
GetPixelIndex(image,p+((i-1)*channels)))
break;
}
+ else if (tga_info.image_type == TGARLEMonochrome)
+ {
+ if (GetPixelLuma(image,p+(i*channels)) !=
+ GetPixelLuma(image,p+((i-1)*channels)))
+ break;
+ }
else
- if (tga_info.image_type == TGARLEMonochrome)
- {
- if (GetPixelLuma(image,p+(i*channels)) !=
- GetPixelLuma(image,p+((i-1)*channels)))
- break;
- }
- else
- {
- if ((GetPixelBlue(image,p+(i*channels)) !=
- GetPixelBlue(image,p+((i-1)*channels))) ||
- (GetPixelGreen(image,p+(i*channels)) !=
- GetPixelGreen(image,p+((i-1)*channels))) ||
- (GetPixelRed(image,p+(i*channels)) !=
- GetPixelRed(image,p+((i-1)*channels))))
- break;
- if ((image->alpha_trait != UndefinedPixelTrait) &&
- (GetPixelAlpha(image,p+(i*channels)) !=
- GetPixelAlpha(image,p+(i-1)*channels)))
- break;
- }
+ {
+ if ((GetPixelBlue(image,p+(i*channels)) !=
+ GetPixelBlue(image,p+((i-1)*channels))) ||
+ (GetPixelGreen(image,p+(i*channels)) !=
+ GetPixelGreen(image,p+((i-1)*channels))) ||
+ (GetPixelRed(image,p+(i*channels)) !=
+ GetPixelRed(image,p+((i-1)*channels))))
+ break;
+ if ((image->alpha_trait != UndefinedPixelTrait) &&
+ (GetPixelAlpha(image,p+(i*channels)) !=
+ GetPixelAlpha(image,p+(i-1)*channels)))
+ break;
+ }
i++;
}
if (i < 3)
@@ -985,20 +988,13 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
}
}
else
- for (x=0; x < (ssize_t) image->columns; x++)
{
- WriteTGAPixel(image,tga_info.image_type,p,range,midpoint);
- p+=channels;
+ for (x=0; x < (ssize_t) image->columns; x++)
+ {
+ WriteTGAPixel(image,tga_info.image_type,p,range,midpoint);
+ p+=channels;
+ }
}
- if (((unsigned char) (tga_info.attributes & 0xc0) >> 6) == 2)
- offset+=2;
- else
- offset++;
- if (offset >= image->rows)
- {
- base++;
- offset=base;
- }
if (image->previous == (Image *) NULL)
{
status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
diff --git a/coders/tga.h b/coders/tga.h
index 3e1a931e3..c0bee86d2 100644
--- a/coders/tga.h
+++ b/coders/tga.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/thumbnail.c b/coders/thumbnail.c
index 1f7900aef..da2a86e7e 100644
--- a/coders/thumbnail.c
+++ b/coders/thumbnail.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/thumbnail.h b/coders/thumbnail.h
index 8dd34799c..843c4f9bb 100644
--- a/coders/thumbnail.h
+++ b/coders/thumbnail.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/tiff.c b/coders/tiff.c
index 211d82f36..8114f05c1 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -292,7 +292,6 @@ static MagickOffsetType TIFFTellCustomStream(void *user_data)
static void InitPSDInfo(const Image *image,PSDInfo *info)
{
- (void) memset(info,0,sizeof(*info));
info->version=1;
info->columns=image->columns;
info->rows=image->rows;
@@ -703,20 +702,9 @@ static void TIFFGetProfiles(TIFF *tiff,Image *image,ExceptionInfo *exception)
if ((TIFFGetField(tiff,TIFFTAG_XMLPACKET,&length,&profile) == 1) &&
(profile != (unsigned char *) NULL))
{
- StringInfo
- *dng;
-
(void) ReadProfile(image,"xmp",profile,(ssize_t) length,exception);
- dng=BlobToStringInfo(profile,length);
- if (dng != (StringInfo *) NULL)
- {
- const char
- *target = "dc:format=\"image/dng\"";
-
- if (strstr((char *) GetStringInfoDatum(dng),target) != (char *) NULL)
- (void) CopyMagickString(image->magick,"DNG",MagickPathExtent);
- dng=DestroyStringInfo(dng);
- }
+ if (strstr((char *) profile,"dc:format=\"image/dng\"") != (char *) NULL)
+ (void) CopyMagickString(image->magick,"DNG",MagickPathExtent);
}
#endif
if ((TIFFGetField(tiff,34118,&length,&profile) == 1) &&
@@ -880,7 +868,7 @@ static void TIFFGetEXIFProperties(TIFF *tiff,Image *image,
{
uint16
*shorty;
-
+
shorty=0;
if ((TIFFGetField(tiff,exif_info[i].tag,&shorty,sans) == 1) &&
(shorty != (uint16 *) NULL))
@@ -1130,7 +1118,7 @@ static ssize_t TIFFReadCustomStream(unsigned char *data,const size_t count,
size_t
total;
- MagickOffsetType
+ ssize_t
remaining;
if (count == 0)
@@ -1340,9 +1328,6 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
unsigned char
*pixels;
- void
- *sans[2] = { NULL, NULL };
-
/*
Open image.
*/
@@ -1414,15 +1399,15 @@ RestoreMSCWarning
photometric=PHOTOMETRIC_RGB;
if ((TIFFGetField(tiff,TIFFTAG_IMAGEWIDTH,&width) != 1) ||
(TIFFGetField(tiff,TIFFTAG_IMAGELENGTH,&height) != 1) ||
- (TIFFGetFieldDefaulted(tiff,TIFFTAG_PHOTOMETRIC,&photometric,sans) != 1) ||
- (TIFFGetFieldDefaulted(tiff,TIFFTAG_COMPRESSION,&compress_tag,sans) != 1) ||
- (TIFFGetFieldDefaulted(tiff,TIFFTAG_FILLORDER,&endian,sans) != 1) ||
- (TIFFGetFieldDefaulted(tiff,TIFFTAG_PLANARCONFIG,&interlace,sans) != 1) ||
- (TIFFGetFieldDefaulted(tiff,TIFFTAG_SAMPLESPERPIXEL,&samples_per_pixel,sans) != 1) ||
- (TIFFGetFieldDefaulted(tiff,TIFFTAG_BITSPERSAMPLE,&bits_per_sample,sans) != 1) ||
- (TIFFGetFieldDefaulted(tiff,TIFFTAG_SAMPLEFORMAT,&sample_format,sans) != 1) ||
- (TIFFGetFieldDefaulted(tiff,TIFFTAG_MINSAMPLEVALUE,&min_sample_value,sans) != 1) ||
- (TIFFGetFieldDefaulted(tiff,TIFFTAG_MAXSAMPLEVALUE,&max_sample_value,sans) != 1))
+ (TIFFGetFieldDefaulted(tiff,TIFFTAG_PHOTOMETRIC,&photometric) != 1) ||
+ (TIFFGetFieldDefaulted(tiff,TIFFTAG_COMPRESSION,&compress_tag) != 1) ||
+ (TIFFGetFieldDefaulted(tiff,TIFFTAG_FILLORDER,&endian) != 1) ||
+ (TIFFGetFieldDefaulted(tiff,TIFFTAG_PLANARCONFIG,&interlace) != 1) ||
+ (TIFFGetFieldDefaulted(tiff,TIFFTAG_SAMPLESPERPIXEL,&samples_per_pixel) != 1) ||
+ (TIFFGetFieldDefaulted(tiff,TIFFTAG_BITSPERSAMPLE,&bits_per_sample) != 1) ||
+ (TIFFGetFieldDefaulted(tiff,TIFFTAG_SAMPLEFORMAT,&sample_format) != 1) ||
+ (TIFFGetFieldDefaulted(tiff,TIFFTAG_MINSAMPLEVALUE,&min_sample_value) != 1) ||
+ (TIFFGetFieldDefaulted(tiff,TIFFTAG_MAXSAMPLEVALUE,&max_sample_value) != 1))
{
TIFFClose(tiff);
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
@@ -1548,26 +1533,28 @@ RestoreMSCWarning
option=GetImageOption(image_info,"tiff:exif-properties");
if (IsStringFalse(option) == MagickFalse) /* enabled by default */
TIFFGetEXIFProperties(tiff,image,exception);
- if ((TIFFGetFieldDefaulted(tiff,TIFFTAG_XRESOLUTION,&x_resolution,sans) == 1) &&
- (TIFFGetFieldDefaulted(tiff,TIFFTAG_YRESOLUTION,&y_resolution,sans) == 1))
+ (void) TIFFGetFieldDefaulted(tiff,TIFFTAG_SAMPLESPERPIXEL,
+ &samples_per_pixel);
+ if ((TIFFGetFieldDefaulted(tiff,TIFFTAG_XRESOLUTION,&x_resolution) == 1) &&
+ (TIFFGetFieldDefaulted(tiff,TIFFTAG_YRESOLUTION,&y_resolution) == 1))
{
image->resolution.x=x_resolution;
image->resolution.y=y_resolution;
}
- if (TIFFGetFieldDefaulted(tiff,TIFFTAG_RESOLUTIONUNIT,&units,sans) == 1)
+ if (TIFFGetFieldDefaulted(tiff,TIFFTAG_RESOLUTIONUNIT,&units) == 1)
{
if (units == RESUNIT_INCH)
image->units=PixelsPerInchResolution;
if (units == RESUNIT_CENTIMETER)
image->units=PixelsPerCentimeterResolution;
}
- if ((TIFFGetFieldDefaulted(tiff,TIFFTAG_XPOSITION,&x_position,sans) == 1) &&
- (TIFFGetFieldDefaulted(tiff,TIFFTAG_YPOSITION,&y_position,sans) == 1))
+ if ((TIFFGetFieldDefaulted(tiff,TIFFTAG_XPOSITION,&x_position) == 1) &&
+ (TIFFGetFieldDefaulted(tiff,TIFFTAG_YPOSITION,&y_position) == 1))
{
image->page.x=(ssize_t) ceil(x_position*image->resolution.x-0.5);
image->page.y=(ssize_t) ceil(y_position*image->resolution.y-0.5);
}
- if (TIFFGetFieldDefaulted(tiff,TIFFTAG_ORIENTATION,&orientation,sans) == 1)
+ if (TIFFGetFieldDefaulted(tiff,TIFFTAG_ORIENTATION,&orientation) == 1)
image->orientation=(OrientationType) orientation;
if (TIFFGetField(tiff,TIFFTAG_WHITEPOINT,&chromaticity) == 1)
{
@@ -1659,7 +1646,7 @@ RestoreMSCWarning
}
}
value=(unsigned short) image->scene;
- if (TIFFGetFieldDefaulted(tiff,TIFFTAG_PAGENUMBER,&value,&pages,sans) == 1)
+ if (TIFFGetFieldDefaulted(tiff,TIFFTAG_PAGENUMBER,&value,&pages) == 1)
image->scene=value;
if (image->storage_class == PseudoClass)
{
@@ -1752,7 +1739,7 @@ RestoreMSCWarning
break;
}
tiff_status=TIFFGetFieldDefaulted(tiff,TIFFTAG_EXTRASAMPLES,&extra_samples,
- &sample_info,sans);
+ &sample_info);
if (tiff_status == 1)
{
(void) SetImageProperty(image,"tiff:alpha","unspecified",exception);
@@ -1831,7 +1818,7 @@ RestoreMSCWarning
quantum_type=RGBQuantum;
if (TIFFScanlineSize(tiff) <= 0)
ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed");
- if ((1.0*TIFFScanlineSize(tiff)) > (2.1*GetBlobSize(image)))
+ if (((MagickSizeType) TIFFScanlineSize(tiff)) > (2*GetBlobSize(image)))
ThrowTIFFException(CorruptImageError,"InsufficientImageDataInFile");
number_pixels=MagickMax(TIFFScanlineSize(tiff),MagickMax((ssize_t)
image->columns*samples_per_pixel*pow(2.0,ceil(log(bits_per_sample)/
@@ -3620,9 +3607,6 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
unsigned char
*pixels;
- void
- *sans[2] = { NULL, NULL };
-
/*
Open TIFF file.
*/
@@ -3649,7 +3633,8 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
}
mode=endian_type == LSBEndian ? "wl" : "wb";
#if defined(TIFF_VERSION_BIG)
- if (LocaleCompare(image_info->magick,"TIFF64") == 0)
+ if ((LocaleCompare(image_info->magick,"TIFF64") == 0) ||
+ (((MagickOffsetType) image->columns*image->rows) > SSIZE_MAX))
mode=endian_type == LSBEndian ? "wl8" : "wb8";
#endif
tiff=TIFFClientOpen(image->filename,mode,(thandle_t) image,TIFFReadBlob,
@@ -3894,7 +3879,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
}
}
}
- (void) TIFFGetFieldDefaulted(tiff,TIFFTAG_FILLORDER,&endian,sans);
+ (void) TIFFGetFieldDefaulted(tiff,TIFFTAG_FILLORDER,&endian);
if ((compress_tag == COMPRESSION_CCITTFAX3) ||
(compress_tag == COMPRESSION_CCITTFAX4))
{
@@ -3938,7 +3923,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
sample_info[0]=EXTRASAMPLE_UNSPECIFIED;
}
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_SAMPLESPERPIXEL,
- &samples_per_pixel,sans);
+ &samples_per_pixel);
(void) TIFFSetField(tiff,TIFFTAG_SAMPLESPERPIXEL,samples_per_pixel+1);
(void) TIFFSetField(tiff,TIFFTAG_EXTRASAMPLES,extra_samples,
&sample_info);
@@ -4021,7 +4006,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
}
}
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_BITSPERSAMPLE,
- &bits_per_sample,sans);
+ &bits_per_sample);
if (bits_per_sample == 12)
(void) TIFFSetField(tiff,TIFFTAG_JPEGTABLESMODE,JPEGTABLESMODE_QUANT);
#endif
@@ -4030,7 +4015,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
case COMPRESSION_ADOBE_DEFLATE:
{
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_BITSPERSAMPLE,
- &bits_per_sample,sans);
+ &bits_per_sample);
if (((photometric == PHOTOMETRIC_RGB) ||
(photometric == PHOTOMETRIC_SEPARATED) ||
(photometric == PHOTOMETRIC_MINISBLACK)) &&
@@ -4068,7 +4053,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
case COMPRESSION_LZW:
{
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_BITSPERSAMPLE,
- &bits_per_sample,sans);
+ &bits_per_sample);
if (((photometric == PHOTOMETRIC_RGB) ||
(photometric == PHOTOMETRIC_SEPARATED) ||
(photometric == PHOTOMETRIC_MINISBLACK)) &&
@@ -4080,7 +4065,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
case COMPRESSION_WEBP:
{
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_BITSPERSAMPLE,
- &bits_per_sample,sans);
+ &bits_per_sample);
if (((photometric == PHOTOMETRIC_RGB) ||
(photometric == PHOTOMETRIC_SEPARATED) ||
(photometric == PHOTOMETRIC_MINISBLACK)) &&
@@ -4096,7 +4081,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
case COMPRESSION_ZSTD:
{
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_BITSPERSAMPLE,
- &bits_per_sample,sans);
+ &bits_per_sample);
if (((photometric == PHOTOMETRIC_RGB) ||
(photometric == PHOTOMETRIC_SEPARATED) ||
(photometric == PHOTOMETRIC_MINISBLACK)) &&
diff --git a/coders/tiff.h b/coders/tiff.h
index 4fd0514c5..ce2d79ddd 100644
--- a/coders/tiff.h
+++ b/coders/tiff.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/tile.c b/coders/tile.c
index 8909890a9..6f5483bf0 100644
--- a/coders/tile.c
+++ b/coders/tile.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/tile.h b/coders/tile.h
index e05155f6a..4dd45cd65 100644
--- a/coders/tile.h
+++ b/coders/tile.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/tim.c b/coders/tim.c
index 1bf343564..c3dcee562 100644
--- a/coders/tim.c
+++ b/coders/tim.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/tim.h b/coders/tim.h
index e284c39af..49259cdbd 100644
--- a/coders/tim.h
+++ b/coders/tim.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/tim2.h b/coders/tim2.h
index 85625d23c..c87949b50 100644
--- a/coders/tim2.h
+++ b/coders/tim2.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/ttf.c b/coders/ttf.c
index 271d04a8a..633280058 100644
--- a/coders/ttf.c
+++ b/coders/ttf.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/ttf.h b/coders/ttf.h
index c13833607..613307616 100644
--- a/coders/ttf.h
+++ b/coders/ttf.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/txt.c b/coders/txt.c
index dcc874f0c..f3d3d599b 100644
--- a/coders/txt.c
+++ b/coders/txt.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -563,16 +563,16 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
green+=(range+1)/2.0;
blue+=(range+1)/2.0;
}
- pixel.red=(MagickRealType) ScaleAnyToQuantum((QuantumAny)
- MagickMax(red+0.5,0.0),range);
- pixel.green=(MagickRealType) ScaleAnyToQuantum((QuantumAny)
- MagickMax(green+0.5,0.0),range);
- pixel.blue=(MagickRealType) ScaleAnyToQuantum((QuantumAny)
- MagickMax(blue+0.5,0.0),range);
- pixel.black=(MagickRealType) ScaleAnyToQuantum((QuantumAny)
- MagickMax(black+0.5,0.0),range);
- pixel.alpha=(MagickRealType) ScaleAnyToQuantum((QuantumAny)
- MagickMax(alpha+0.5,0.0),range);
+ pixel.red=(MagickRealType) ScaleAnyToQuantum((QuantumAny) (red+0.5),
+ range);
+ pixel.green=(MagickRealType) ScaleAnyToQuantum((QuantumAny) (green+0.5),
+ range);
+ pixel.blue=(MagickRealType) ScaleAnyToQuantum((QuantumAny) (blue+0.5),
+ range);
+ pixel.black=(MagickRealType) ScaleAnyToQuantum((QuantumAny) (black+0.5),
+ range);
+ pixel.alpha=(MagickRealType) ScaleAnyToQuantum((QuantumAny) (alpha+0.5),
+ range);
q=GetAuthenticPixels(image,(ssize_t) x_offset,(ssize_t) y_offset,1,1,
exception);
if (q == (Quantum *) NULL)
diff --git a/coders/txt.h b/coders/txt.h
index 994acfb5d..68a3d3954 100644
--- a/coders/txt.h
+++ b/coders/txt.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/uil.c b/coders/uil.c
index 6804fd222..c9bcbfb7c 100644
--- a/coders/uil.c
+++ b/coders/uil.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/uil.h b/coders/uil.h
index 1f8f83917..5009d62e6 100644
--- a/coders/uil.h
+++ b/coders/uil.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/url.c b/coders/url.c
index 19b586c73..d5d9954ba 100644
--- a/coders/url.c
+++ b/coders/url.c
@@ -18,7 +18,7 @@
% March 2000 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/url.h b/coders/url.h
index 67da23411..054aec914 100644
--- a/coders/url.h
+++ b/coders/url.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/uyvy.c b/coders/uyvy.c
index ce5269849..379ed8a31 100644
--- a/coders/uyvy.c
+++ b/coders/uyvy.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/uyvy.h b/coders/uyvy.h
index 0df87f99f..dccb711f4 100644
--- a/coders/uyvy.h
+++ b/coders/uyvy.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/vicar.c b/coders/vicar.c
index 212648f1e..7bc166531 100644
--- a/coders/vicar.c
+++ b/coders/vicar.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -149,6 +149,9 @@ static Image *ReadVICARImage(const ImageInfo *image_info,
keyword[MagickPathExtent],
value[MagickPathExtent];
+ const unsigned char
+ *pixels;
+
Image
*image;
@@ -175,9 +178,6 @@ static Image *ReadVICARImage(const ImageInfo *image_info,
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
@@ -300,20 +300,17 @@ static Image *ReadVICARImage(const ImageInfo *image_info,
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
length=GetQuantumExtent(image,quantum_info,quantum_type);
- pixels=GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)
{
- const void
- *stream;
-
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
(void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
- quantum_type,(unsigned char *) stream,exception);
+ quantum_type,pixels,exception);
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
diff --git a/coders/vicar.h b/coders/vicar.h
index 1ba2f7bfb..b1da3bb20 100644
--- a/coders/vicar.h
+++ b/coders/vicar.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/vid.c b/coders/vid.c
index cab4dc28b..dd57930a3 100644
--- a/coders/vid.c
+++ b/coders/vid.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/vid.h b/coders/vid.h
index 2d918256b..246f63fab 100644
--- a/coders/vid.h
+++ b/coders/vid.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/viff.c b/coders/viff.c
index d0e5719c7..05aac7c55 100644
--- a/coders/viff.c
+++ b/coders/viff.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -57,6 +57,7 @@
#include "MagickCore/list.h"
#include "MagickCore/magick.h"
#include "MagickCore/memory_.h"
+#include "MagickCore/memory-private.h"
#include "MagickCore/monitor.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/pixel-accessor.h"
@@ -514,13 +515,15 @@ static Image *ReadVIFFImage(const ImageInfo *image_info,
}
if (viff_info.data_storage_type == VFF_TYP_BIT)
{
- if (HeapOverflowSanityCheckGetSize((image->columns+7UL) >> 3UL,image->rows,&max_packets) != MagickFalse)
+ if (HeapOverflowSanityCheck((image->columns+7UL) >> 3UL,image->rows) != MagickFalse)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ max_packets=((image->columns+7UL) >> 3UL)*image->rows;
}
else
{
- if (HeapOverflowSanityCheckGetSize((size_t) number_pixels,viff_info.number_data_bands,&max_packets) != MagickFalse)
+ if (HeapOverflowSanityCheck((size_t) number_pixels,viff_info.number_data_bands) != MagickFalse)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ max_packets=(size_t) (number_pixels*viff_info.number_data_bands);
}
if ((MagickSizeType) (bytes_per_pixel*max_packets) > GetBlobSize(image))
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
diff --git a/coders/viff.h b/coders/viff.h
index 0e0d5ce61..439559a5d 100644
--- a/coders/viff.h
+++ b/coders/viff.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/vips.c b/coders/vips.c
index 4c019ab60..48e0a632b 100644
--- a/coders/vips.c
+++ b/coders/vips.c
@@ -17,7 +17,7 @@
% April 2014 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/vips.h b/coders/vips.h
index 9cdc0baeb..9d86b195b 100644
--- a/coders/vips.h
+++ b/coders/vips.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/wbmp.c b/coders/wbmp.c
index 440b18187..6eeed17e0 100644
--- a/coders/wbmp.c
+++ b/coders/wbmp.c
@@ -17,7 +17,7 @@
% January 2000 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/wbmp.h b/coders/wbmp.h
index 28ade8dab..907e751a3 100644
--- a/coders/wbmp.h
+++ b/coders/wbmp.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/webp.c b/coders/webp.c
index d4b704ced..cf2e5549b 100644
--- a/coders/webp.c
+++ b/coders/webp.c
@@ -17,7 +17,7 @@
% March 2011 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -58,7 +58,6 @@
#include "MagickCore/option.h"
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/profile.h"
-#include "MagickCore/property.h"
#include "MagickCore/quantum-private.h"
#include "MagickCore/static.h"
#include "MagickCore/string_.h"
@@ -72,7 +71,6 @@
#include <webp/encode.h>
#if defined(MAGICKCORE_WEBPMUX_DELEGATE)
#include <webp/mux.h>
-#include <webp/demux.h>
#endif
#endif
@@ -177,7 +175,7 @@ static MagickBooleanType IsWEBPImageLossless(const unsigned char *stream,
#define CHUNK_HEADER_SIZE 8
#define MAX_CHUNK_PAYLOAD (~0U-CHUNK_HEADER_SIZE-1)
- size_t
+ ssize_t
offset;
/*
@@ -191,7 +189,7 @@ static MagickBooleanType IsWEBPImageLossless(const unsigned char *stream,
Read extended header.
*/
offset=RIFF_HEADER_SIZE+TAG_SIZE+CHUNK_SIZE_BYTES+VP8X_CHUNK_SIZE;
- while (offset <= (length-TAG_SIZE-TAG_SIZE-4))
+ while (offset+TAG_SIZE <= (ssize_t) (length-TAG_SIZE))
{
uint32_t
chunk_size,
@@ -209,260 +207,6 @@ static MagickBooleanType IsWEBPImageLossless(const unsigned char *stream,
return(MagickFalse);
}
-static int FillBasicWEBPInfo(Image *image,const uint8_t *stream,size_t length,
- WebPDecoderConfig *configure)
-{
- WebPBitstreamFeatures
- *magick_restrict features = &configure->input;
-
- int
- webp_status;
-
- webp_status=WebPGetFeatures(stream,length,features);
-
- if (webp_status != VP8_STATUS_OK)
- return(webp_status);
-
- image->columns=(size_t) features->width;
- image->rows=(size_t) features->height;
- image->depth=8;
- image->alpha_trait=features->has_alpha != 0 ? BlendPixelTrait :
- UndefinedPixelTrait;
-
- return(webp_status);
-}
-
-static int ReadSingleWEBPImage(Image *image,const uint8_t *stream,
- size_t length,WebPDecoderConfig *configure,ExceptionInfo *exception,
- MagickBooleanType is_first)
-{
- int
- webp_status;
-
- register unsigned char
- *p;
-
- size_t
- canvas_width,
- canvas_height,
- image_width,
- image_height;
-
- ssize_t
- x_offset,
- y_offset,
- y;
-
- WebPDecBuffer
- *magick_restrict webp_image = &configure->output;
-
- MagickBooleanType
- status;
-
- if (is_first)
- {
- canvas_width=image->columns;
- canvas_height=image->rows;
- x_offset=image->page.x;
- y_offset=image->page.y;
- image->page.x=0;
- image->page.y=0;
- }
- else
- {
- x_offset=0;
- y_offset=0;
- }
- webp_status=FillBasicWEBPInfo(image,stream,length,configure);
- image_width=image->columns;
- image_height=image->rows;
- if (is_first)
- {
- image->columns=canvas_width;
- image->rows=canvas_height;
- }
-
- if (webp_status != VP8_STATUS_OK)
- return(webp_status);
-
- if (IsWEBPImageLossless(stream,length) != MagickFalse)
- image->quality=100;
-
- webp_status=WebPDecode(stream,length,configure);
- if (webp_status != VP8_STATUS_OK)
- return(webp_status);
-
- p=(unsigned char *) webp_image->u.RGBA.rgba;
- for (y=0; y < (ssize_t) image->rows; y++)
- {
- register Quantum
- *q;
-
- register ssize_t
- x;
-
- q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
- if (q == (Quantum *) NULL)
- break;
- for (x=0; x < (ssize_t) image->columns; x++)
- {
- if ((x >= x_offset && x < x_offset + image_width) &&
- (y >= y_offset && y < y_offset + image_height))
- {
- SetPixelRed(image,ScaleCharToQuantum(*p++),q);
- SetPixelGreen(image,ScaleCharToQuantum(*p++),q);
- SetPixelBlue(image,ScaleCharToQuantum(*p++),q);
- SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
- }
- else
- {
- SetPixelRed(image,0,q);
- SetPixelGreen(image,0,q);
- SetPixelBlue(image,0,q);
- SetPixelAlpha(image,0,q);
- }
- q+=GetPixelChannels(image);
- }
- if (SyncAuthenticPixels(image,exception) == MagickFalse)
- break;
- status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
- image->rows);
- if (status == MagickFalse)
- break;
- }
- WebPFreeDecBuffer(webp_image);
-#if defined(MAGICKCORE_WEBPMUX_DELEGATE)
- {
- StringInfo
- *profile;
-
- uint32_t
- webp_flags = 0;
-
- WebPData
- chunk,
- content;
-
- WebPMux
- *mux;
-
- /*
- Extract any profiles.
- */
- content.bytes=stream;
- content.size=length;
- mux=WebPMuxCreate(&content,0);
- (void) memset(&chunk,0,sizeof(chunk));
- WebPMuxGetFeatures(mux,&webp_flags);
- if (webp_flags & ICCP_FLAG)
- {
- WebPMuxGetChunk(mux,"ICCP",&chunk);
- profile=BlobToStringInfo(chunk.bytes,chunk.size);
- if (profile != (StringInfo *) NULL)
- {
- SetImageProfile(image,"ICC",profile,exception);
- profile=DestroyStringInfo(profile);
- }
- }
- if (webp_flags & EXIF_FLAG)
- {
- WebPMuxGetChunk(mux,"EXIF",&chunk);
- profile=BlobToStringInfo(chunk.bytes,chunk.size);
- if (profile != (StringInfo *) NULL)
- {
- SetImageProfile(image,"EXIF",profile,exception);
- profile=DestroyStringInfo(profile);
- }
- }
- if (webp_flags & XMP_FLAG)
- {
- WebPMuxGetChunk(mux,"XMP",&chunk);
- profile=BlobToStringInfo(chunk.bytes,chunk.size);
- if (profile != (StringInfo *) NULL)
- {
- SetImageProfile(image,"XMP",profile,exception);
- profile=DestroyStringInfo(profile);
- }
- }
- WebPMuxDelete(mux);
- }
-#endif
- return(webp_status);
-}
-
-#if defined(MAGICKCORE_WEBPMUX_DELEGATE)
-static int ReadAnimatedWEBPImage(const ImageInfo *image_info,Image *image,
- uint8_t *stream,size_t length,WebPDecoderConfig *configure,
- ExceptionInfo *exception)
-{
- Image
- *original_image;
-
- int
- image_count,
- webp_status;
-
- size_t
- canvas_width,
- canvas_height;
-
- WebPData
- data;
-
- WebPDemuxer
- *demux;
-
- WebPIterator
- iter;
-
- image_count=0;
- webp_status=0;
- original_image=image;
- webp_status=FillBasicWEBPInfo(image,stream,length,configure);
- canvas_width=image->columns;
- canvas_height=image->rows;
- data.bytes=stream;
- data.size=length;
- demux=WebPDemux(&data);
- if (WebPDemuxGetFrame(demux,1,&iter)) {
- do {
- if (image_count != 0)
- {
- AcquireNextImage(image_info,image,exception);
- if (GetNextImageInList(image) == (Image *) NULL)
- break;
- image=SyncNextImageInList(image);
- CloneImageProperties(image,original_image);
- image->page.x=iter.x_offset;
- image->page.y=iter.y_offset;
- webp_status=ReadSingleWEBPImage(image,iter.fragment.bytes,
- iter.fragment.size,configure,exception,MagickFalse);
- }
- else
- {
- image->page.x=iter.x_offset;
- image->page.y=iter.y_offset;
- webp_status=ReadSingleWEBPImage(image,iter.fragment.bytes,
- iter.fragment.size,configure,exception,MagickTrue);
- }
- if (webp_status != VP8_STATUS_OK)
- break;
-
- image->page.width=canvas_width;
- image->page.height=canvas_height;
- image->ticks_per_second=100;
- image->delay=iter.duration/10;
- if (iter.dispose_method == WEBP_MUX_DISPOSE_BACKGROUND)
- image->dispose=BackgroundDispose;
- image_count++;
- } while (WebPDemuxNextFrame(&iter));
- WebPDemuxReleaseIterator(&iter);
- }
- WebPDemuxDelete(demux);
- return(webp_status);
-}
-#endif
-
static Image *ReadWEBPImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
@@ -484,11 +228,15 @@ static Image *ReadWEBPImage(const ImageInfo *image_info,
MagickBooleanType
status;
+ register unsigned char
+ *p;
+
size_t
length;
ssize_t
- count;
+ count,
+ y;
unsigned char
header[12],
@@ -500,6 +248,9 @@ static Image *ReadWEBPImage(const ImageInfo *image_info,
WebPDecBuffer
*magick_restrict webp_image = &configure.output;
+ WebPBitstreamFeatures
+ *magick_restrict features = &configure.input;
+
/*
Open image file.
*/
@@ -539,21 +290,31 @@ static Image *ReadWEBPImage(const ImageInfo *image_info,
count=ReadBlob(image,length-12,stream+12);
if (count != (ssize_t) (length-12))
ThrowWEBPException(CorruptImageError,"InsufficientImageDataInFile");
-
- webp_status=FillBasicWEBPInfo(image,stream,length,&configure);
- if (webp_status == VP8_STATUS_OK) {
- if (configure.input.has_animation) {
-#if defined(MAGICKCORE_WEBPMUX_DELEGATE)
- webp_status=ReadAnimatedWEBPImage(image_info,image,stream,length,
- &configure,exception);
-#else
- webp_status=VP8_STATUS_UNSUPPORTED_FEATURE;
-#endif
- } else {
- webp_status=ReadSingleWEBPImage(image,stream,length,&configure,exception,MagickFalse);
+ webp_status=WebPGetFeatures(stream,length,features);
+ if (webp_status == VP8_STATUS_OK)
+ {
+ image->columns=(size_t) features->width;
+ image->rows=(size_t) features->height;
+ image->depth=8;
+ image->alpha_trait=features->has_alpha != 0 ? BlendPixelTrait :
+ UndefinedPixelTrait;
+ if (image_info->ping != MagickFalse)
+ {
+ stream=(unsigned char*) RelinquishMagickMemory(stream);
+ (void) CloseBlob(image);
+ return(GetFirstImageInList(image));
+ }
+ status=SetImageExtent(image,image->columns,image->rows,exception);
+ if (status == MagickFalse)
+ {
+ stream=(unsigned char*) RelinquishMagickMemory(stream);
+ (void) CloseBlob(image);
+ return(DestroyImageList(image));
+ }
+ if (IsWEBPImageLossless(stream,length) != MagickFalse)
+ image->quality=100;
+ webp_status=WebPDecode(stream,length,&configure);
}
- }
-
if (webp_status != VP8_STATUS_OK)
switch (webp_status)
{
@@ -595,7 +356,88 @@ static Image *ReadWEBPImage(const ImageInfo *image_info,
default:
ThrowWEBPException(CorruptImageError,"CorruptImage");
}
+ p=(unsigned char *) webp_image->u.RGBA.rgba;
+ for (y=0; y < (ssize_t) image->rows; y++)
+ {
+ register Quantum
+ *q;
+
+ register ssize_t
+ x;
+
+ q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
+ if (q == (Quantum *) NULL)
+ break;
+ for (x=0; x < (ssize_t) image->columns; x++)
+ {
+ SetPixelRed(image,ScaleCharToQuantum(*p++),q);
+ SetPixelGreen(image,ScaleCharToQuantum(*p++),q);
+ SetPixelBlue(image,ScaleCharToQuantum(*p++),q);
+ SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
+ q+=GetPixelChannels(image);
+ }
+ if (SyncAuthenticPixels(image,exception) == MagickFalse)
+ break;
+ status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
+ image->rows);
+ if (status == MagickFalse)
+ break;
+ }
+ WebPFreeDecBuffer(webp_image);
+#if defined(MAGICKCORE_WEBPMUX_DELEGATE)
+ {
+ StringInfo
+ *profile;
+
+ uint32_t
+ webp_flags = 0;
+
+ WebPData
+ chunk,
+ content = { stream, length };
+
+ WebPMux
+ *mux;
+ /*
+ Extract any profiles.
+ */
+ mux=WebPMuxCreate(&content,0);
+ (void) memset(&chunk,0,sizeof(chunk));
+ WebPMuxGetFeatures(mux,&webp_flags);
+ if (webp_flags & ICCP_FLAG)
+ {
+ WebPMuxGetChunk(mux,"ICCP",&chunk);
+ profile=BlobToStringInfo(chunk.bytes,chunk.size);
+ if (profile != (StringInfo *) NULL)
+ {
+ SetImageProfile(image,"ICC",profile,exception);
+ profile=DestroyStringInfo(profile);
+ }
+ }
+ if (webp_flags & EXIF_FLAG)
+ {
+ WebPMuxGetChunk(mux,"EXIF",&chunk);
+ profile=BlobToStringInfo(chunk.bytes,chunk.size);
+ if (profile != (StringInfo *) NULL)
+ {
+ SetImageProfile(image,"EXIF",profile,exception);
+ profile=DestroyStringInfo(profile);
+ }
+ }
+ if (webp_flags & XMP_FLAG)
+ {
+ WebPMuxGetChunk(mux,"XMP",&chunk);
+ profile=BlobToStringInfo(chunk.bytes,chunk.size);
+ if (profile != (StringInfo *) NULL)
+ {
+ SetImageProfile(image,"XMP",profile,exception);
+ profile=DestroyStringInfo(profile);
+ }
+ }
+ WebPMuxDelete(mux);
+ }
+#endif
stream=(unsigned char*) RelinquishMagickMemory(stream);
(void) CloseBlob(image);
return(image);
@@ -645,7 +487,7 @@ ModuleExport size_t RegisterWEBPImage(void)
#endif
entry->mime_type=ConstantString("image/webp");
entry->flags|=CoderDecoderSeekableStreamFlag;
- entry->flags|=CoderAdjoinFlag;
+ entry->flags^=CoderAdjoinFlag;
entry->magick=(IsImageFormatHandler *) IsWEBP;
if (*version != '\0')
entry->version=ConstantString(version);
@@ -733,159 +575,8 @@ static int WebPEncodeWriter(const unsigned char *stream,size_t length,
}
#endif
-typedef struct PictureMemory {
- MemoryInfo *pixel_info;
- struct PictureMemory *next;
-} PictureMemory;
-
-static MagickBooleanType WriteSingleWEBPImage(const ImageInfo *image_info,
- Image *image,WebPPicture *picture,PictureMemory *picture_memory,
- ExceptionInfo *exception)
-{
- MagickBooleanType
- status = MagickFalse;
-
- register uint32_t
- *magick_restrict q;
-
- ssize_t
- y;
-
-#if WEBP_ENCODER_ABI_VERSION >= 0x0100
- picture->progress_hook=WebPEncodeProgress;
- picture->user_data=(void *) image;
-#endif
- picture->width=(int) image->columns;
- picture->height=(int) image->rows;
- picture->argb_stride=(int) image->columns;
- picture->use_argb=1;
-
- /*
- Allocate memory for pixels.
- */
- (void) TransformImageColorspace(image,sRGBColorspace,exception);
- picture_memory->pixel_info=AcquireVirtualMemory(image->columns,image->rows*
- sizeof(*(picture->argb)));
-
- if (picture_memory->pixel_info == (MemoryInfo *) NULL)
- ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
- picture->argb=(uint32_t *) GetVirtualMemoryBlob(picture_memory->pixel_info);
- /*
- Convert image to WebP raster pixels.
- */
- q=picture->argb;
- for (y=0; y < (ssize_t) image->rows; y++)
- {
- register const Quantum
- *magick_restrict p;
-
- register ssize_t
- x;
-
- p=GetVirtualPixels(image,0,y,image->columns,1,exception);
- if (p == (const Quantum *) NULL)
- break;
- for (x=0; x < (ssize_t) image->columns; x++)
- {
- *q++=(uint32_t) (image->alpha_trait != UndefinedPixelTrait ? (uint32_t)
- ScaleQuantumToChar(GetPixelAlpha(image,p)) << 24 : 0xff000000) |
- ((uint32_t) ScaleQuantumToChar(GetPixelRed(image,p)) << 16) |
- ((uint32_t) ScaleQuantumToChar(GetPixelGreen(image,p)) << 8) |
- ((uint32_t) ScaleQuantumToChar(GetPixelBlue(image,p)));
- p+=GetPixelChannels(image);
- }
- status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
- image->rows);
- if (status == MagickFalse)
- break;
- }
- return status;
-}
-
-#if defined(MAGICKCORE_WEBPMUX_DELEGATE)
-static void FreePictureMemoryList (PictureMemory* head) {
- PictureMemory* next;
- while(head != NULL) {
- next = head->next;
- if(head->pixel_info != NULL)
- RelinquishVirtualMemory(head->pixel_info);
- free(head);
- head = next;
- }
-}
-
-static MagickBooleanType WriteAnimatedWEBPImage(const ImageInfo *image_info,
- Image *image,WebPConfig *configure,WebPMemoryWriter *writer_info,
- ExceptionInfo *exception)
-{
- Image
- *first_image;
-
- PictureMemory
- *current,
- *head;
-
- size_t
- effective_delta = 0,
- frame_timestamp = 0;
-
- WebPAnimEncoder
- *enc;
-
- WebPAnimEncoderOptions
- enc_options;
-
- WebPData
- webp_data;
-
- WebPPicture
- picture;
-
- WebPAnimEncoderOptionsInit(&enc_options);
- if (image_info->verbose)
- enc_options.verbose = 1;
-
- image=CoalesceImages(image, exception);
- first_image=image;
- enc=WebPAnimEncoderNew((int) image->page.width,(int) image->page.height,
- &enc_options);
-
- head=(PictureMemory *) calloc(sizeof(*head),1);
- current=head;
-
- while (image != NULL)
- {
- if (WebPPictureInit(&picture) == 0)
- ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile");
-
- WriteSingleWEBPImage(image_info, image, &picture, current, exception);
-
- effective_delta = image->delay*1000/image->ticks_per_second;
- if (effective_delta < 10)
- effective_delta = 100; /* Consistent with gif2webp */
- frame_timestamp+=effective_delta;
-
- WebPAnimEncoderAdd(enc,&picture,(int) frame_timestamp,configure);
-
- image = GetNextImageInList(image);
- current->next=(PictureMemory *) calloc(sizeof(*head), 1);
- current = current->next;
- }
- webp_data.bytes=writer_info->mem;
- webp_data.size=writer_info->size;
- WebPAnimEncoderAssemble(enc, &webp_data);
- WebPMemoryWriterClear(writer_info);
- writer_info->size=webp_data.size;
- writer_info->mem=(unsigned char *) webp_data.bytes;
- WebPAnimEncoderDelete(enc);
- DestroyImageList(first_image);
- FreePictureMemoryList(head);
- return(MagickTrue);
-}
-#endif
-
static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
- Image *image,ExceptionInfo * exception)
+ Image *image,ExceptionInfo *exception)
{
const char
*value;
@@ -896,6 +587,15 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
MagickBooleanType
status;
+ MemoryInfo
+ *pixel_info;
+
+ register uint32_t
+ *magick_restrict q;
+
+ ssize_t
+ y;
+
WebPAuxStats
statistics;
@@ -910,9 +610,6 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
WebPPicture
picture;
- PictureMemory
- memory = {0};
-
/*
Open output image file.
*/
@@ -927,9 +624,7 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
- if (WebPConfigInit(&configure) == 0)
- ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile");
- if (WebPPictureInit(&picture) == 0)
+ if ((WebPPictureInit(&picture) == 0) || (WebPConfigInit(&configure) == 0))
ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile");
#if !defined(MAGICKCORE_WEBPMUX_DELEGATE)
picture.writer=WebPEncodeWriter;
@@ -939,7 +634,15 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
picture.writer=WebPMemoryWrite;
picture.custom_ptr=(&writer_info);
#endif
+#if WEBP_ENCODER_ABI_VERSION >= 0x0100
+ picture.progress_hook=WebPEncodeProgress;
+ picture.user_data=(void *) image;
+#endif
picture.stats=(&statistics);
+ picture.width=(int) image->columns;
+ picture.height=(int) image->rows;
+ picture.argb_stride=(int) image->columns;
+ picture.use_argb=1;
if (image->quality != UndefinedCompressionQuality)
configure.quality=(float) image->quality;
if (image->quality >= 100)
@@ -1034,17 +737,44 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
#endif
if (WebPValidateConfig(&configure) == 0)
ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile");
+ /*
+ Allocate memory for pixels.
+ */
+ (void) TransformImageColorspace(image,sRGBColorspace,exception);
+ pixel_info=AcquireVirtualMemory(image->columns,image->rows*
+ sizeof(*picture.argb));
+ if (pixel_info == (MemoryInfo *) NULL)
+ ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+ picture.argb=(uint32_t *) GetVirtualMemoryBlob(pixel_info);
+ /*
+ Convert image to WebP raster pixels.
+ */
+ q=picture.argb;
+ for (y=0; y < (ssize_t) image->rows; y++)
+ {
+ register const Quantum
+ *magick_restrict p;
- WriteSingleWEBPImage(image_info,image,&picture,&memory,exception);
-
-#if defined(MAGICKCORE_WEBPMUX_DELEGATE)
- if ((image_info->adjoin != MagickFalse) &&
- (GetPreviousImageInList(image) == (Image *) NULL) &&
- (GetNextImageInList(image) != (Image *) NULL) &&
- (image->iterations != 1))
- WriteAnimatedWEBPImage(image_info,image,&configure,&writer_info,exception);
-#endif
+ register ssize_t
+ x;
+ p=GetVirtualPixels(image,0,y,image->columns,1,exception);
+ if (p == (const Quantum *) NULL)
+ break;
+ for (x=0; x < (ssize_t) image->columns; x++)
+ {
+ *q++=(uint32_t) (image->alpha_trait != UndefinedPixelTrait ? (uint32_t)
+ ScaleQuantumToChar(GetPixelAlpha(image,p)) << 24 : 0xff000000) |
+ ((uint32_t) ScaleQuantumToChar(GetPixelRed(image,p)) << 16) |
+ ((uint32_t) ScaleQuantumToChar(GetPixelGreen(image,p)) << 8) |
+ ((uint32_t) ScaleQuantumToChar(GetPixelBlue(image,p)));
+ p+=GetPixelChannels(image);
+ }
+ status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
+ image->rows);
+ if (status == MagickFalse)
+ break;
+ }
webp_status=WebPEncode(&configure,&picture);
if (webp_status == 0)
{
@@ -1121,7 +851,7 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
WebPData
chunk,
- image_chunk;
+ image_chunk = { writer_info.mem, writer_info.size };
WebPMux
*mux;
@@ -1132,8 +862,6 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
/*
Set image profiles (if any).
*/
- image_chunk.bytes=writer_info.mem;
- image_chunk.size=writer_info.size;
mux_error=WEBP_MUX_OK;
(void) memset(&chunk,0,sizeof(chunk));
mux=WebPMuxNew();
@@ -1164,13 +892,11 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
if (chunk.size != 0)
{
WebPData
- picture_profiles;
+ picture_profiles = { writer_info.mem, writer_info.size };
/*
Replace original container with image profile (if any).
*/
- picture_profiles.bytes=writer_info.mem;
- picture_profiles.size=writer_info.size;
WebPMuxSetImage(mux,&image_chunk,1);
mux_error=WebPMuxAssemble(mux,&picture_profiles);
WebPMemoryWriterClear(&writer_info);
@@ -1186,8 +912,8 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
#if defined(MAGICKCORE_WEBPMUX_DELEGATE)
WebPMemoryWriterClear(&writer_info);
#endif
+ pixel_info=RelinquishVirtualMemory(pixel_info);
(void) CloseBlob(image);
- RelinquishVirtualMemory(memory.pixel_info);
return(webp_status == 0 ? MagickFalse : MagickTrue);
}
#endif
diff --git a/coders/webp.h b/coders/webp.h
index 66ef821cc..25c0b2b2a 100644
--- a/coders/webp.h
+++ b/coders/webp.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/wmf.c b/coders/wmf.c
index 9e36ed53e..503ffbf46 100644
--- a/coders/wmf.c
+++ b/coders/wmf.c
@@ -17,7 +17,7 @@
% December 2000 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -441,6 +441,9 @@ static void ipa_udata_init(wmfAPI * API, wmfUserData_t * userdata);
static void ipa_udata_set(wmfAPI * API, wmfUserData_t * userdata);
static int magick_progress_callback(void* wand,float quantum);
static void util_draw_arc(wmfAPI * API, wmfDrawArc_t * draw_arc,magick_arc_t finish);
+#if defined(MAGICKCORE_WMF_DELEGATE)
+/*static int util_font_weight( const char* font );*/
+#endif
static double util_pointsize( wmfAPI* API, wmfFont* font, char* str, double font_height, ExceptionInfo *);
static void util_set_brush(wmfAPI * API, wmfDC * dc, const BrushApply brush_apply);
static void util_set_pen(wmfAPI * API, wmfDC * dc);
@@ -828,7 +831,8 @@ static void ipa_device_close(wmfAPI * API)
static void ipa_device_begin(wmfAPI * API)
{
char
- comment[MagickPathExtent];
+ comment[MagickPathExtent],
+ *url;
wmf_magick_t
*ddata = WMF_MAGICK_GetData(API);
@@ -838,8 +842,10 @@ static void ipa_device_begin(wmfAPI * API)
DrawSetViewbox(WmfDrawingWand,0,0,ddata->image->columns,ddata->image->rows);
- (void) FormatLocaleString(comment,MagickPathExtent,"Created by %s",
- GetMagickVersion((unsigned long *) NULL));
+ url=GetMagickHomeURL();
+ (void) FormatLocaleString(comment,MagickPathExtent,
+ "Created by ImageMagick %s",url);
+ url=DestroyString(url);
DrawComment(WmfDrawingWand,comment);
/* Scale width and height to image */
@@ -1434,6 +1440,8 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text)
{
double
angle = 0, /* text rotation angle */
+ bbox_height, /* bounding box height */
+ bbox_width, /* bounding box width */
pointsize = 0; /* pointsize to output font with desired height */
ExceptionInfo
@@ -1442,17 +1450,11 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text)
TypeMetric
metrics;
-#if !defined(MAGICKCORE_WMF_DELEGATE)
- double
- bbox_height, /* bounding box height */
- bbox_width; /* bounding box width */
-
wmfD_Coord
BL, /* bottom left of bounding box */
BR, /* bottom right of bounding box */
TL, /* top left of bounding box */
TR; /* top right of bounding box */
-#endif
wmfD_Coord
point; /* text placement point */
@@ -1466,7 +1468,6 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text)
point = draw_text->pt;
/* Choose bounding box and calculate its width and height */
-#if !defined(MAGICKCORE_WMF_DELEGATE)
{
double dx,
dy;
@@ -1494,7 +1495,6 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text)
dy = ((BL.y - TL.y) + (BR.y - TR.y)) / 2;
bbox_height = hypot(dx,dy);
}
-#endif
font = WMF_DC_FONT(draw_text->dc);
@@ -1505,6 +1505,8 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text)
/* Save graphic wand */
(void) PushDrawingWand(WmfDrawingWand);
+ (void) bbox_width;
+ (void) bbox_height;
#if 0
printf("\nipa_draw_text\n");
printf("Text = \"%s\"\n", draw_text->str);
@@ -2167,17 +2169,17 @@ static double util_pointsize( wmfAPI* API, wmfFont* font, char* str, double font
if (strlen(str) == 1)
{
pointsize = (font_height *
- ( font_height * PerceptibleReciprocal(metrics.ascent + fabs(metrics.descent))));
+ ( font_height / (metrics.ascent + fabs(metrics.descent))));
draw_info->pointsize = pointsize;
if (GetTypeMetrics(image, draw_info, &metrics, exception) != MagickFalse)
- pointsize *= (font_height * PerceptibleReciprocal( metrics.ascent + fabs(metrics.descent)));
+ pointsize *= (font_height / ( metrics.ascent + fabs(metrics.descent)));
}
else
{
- pointsize = (font_height * (font_height * PerceptibleReciprocal(metrics.height)));
+ pointsize = (font_height * (font_height / (metrics.height)));
draw_info->pointsize = pointsize;
if (GetTypeMetrics(image, draw_info, &metrics, exception) != MagickFalse)
- pointsize *= (font_height * PerceptibleReciprocal((double) metrics.height));
+ pointsize *= (font_height / metrics.height);
}
#if 0
@@ -2206,6 +2208,38 @@ static double util_pointsize( wmfAPI* API, wmfFont* font, char* str, double font
}
#if defined(MAGICKCORE_WMF_DELEGATE)
+/* Estimate weight based on font name */
+/*
+static int util_font_weight( const char* font )
+{
+ int
+ weight;
+
+ weight = 400;
+ if ((strstr(font,"Normal") || strstr(font,"Regular")))
+ weight = 400;
+ else if ( strstr(font,"Bold") )
+ {
+ weight = 700;
+ if ((strstr(font,"Semi") || strstr(font,"Demi")))
+ weight = 600;
+ if ( (strstr(font,"Extra") || strstr(font,"Ultra")))
+ weight = 800;
+ }
+ else if ( strstr(font,"Light") )
+ {
+ weight = 300;
+ if ( (strstr(font,"Extra") || strstr(font,"Ultra")))
+ weight = 200;
+ }
+ else if ((strstr(font,"Heavy") || strstr(font,"Black")))
+ weight = 900;
+ else if ( strstr(font,"Thin") )
+ weight = 100;
+ return weight;
+}
+*/
+
/*
* Returns width of string in points, assuming (unstretched) font size of 1pt
* (similar to wmf_ipa_font_stringwidth)
@@ -2374,7 +2408,7 @@ static void lite_font_map( wmfAPI* API, wmfFont* font)
exception=ddata->exception;
type_info_base=GetTypeInfo("*",exception);
if (type_info_base == 0)
- return;
+ return;
/* Certain short-hand font names are not the proper Windows names
and should be promoted to the proper names */
@@ -2389,16 +2423,11 @@ static void lite_font_map( wmfAPI* API, wmfFont* font)
int
target_weight;
- StyleType
- style = AnyStyle;
-
if (WMF_FONT_WEIGHT(font) == 0)
target_weight = 400;
else
target_weight = WMF_FONT_WEIGHT(font);
- if (WMF_FONT_ITALIC(font))
- style=ItalicStyle;
- type_info=GetTypeInfoByFamily(wmf_font_name,style,AnyStretch,
+ type_info=GetTypeInfoByFamily(wmf_font_name,AnyStyle,AnyStretch,
target_weight,exception);
if (type_info == (const TypeInfo *) NULL)
type_info=GetTypeInfoByFamily(wmf_font_name,AnyStyle,AnyStretch,0,
@@ -2407,14 +2436,6 @@ static void lite_font_map( wmfAPI* API, wmfFont* font)
CloneString(&magick_font->ps_name,type_info->name);
}
- /* Look for exact full match */
- if(!magick_font->ps_name)
- {
- type_info=GetTypeInfo(wmf_font_name,exception);
- if (type_info != (const TypeInfo *) NULL)
- CloneString(&magick_font->ps_name,type_info->name);
- }
-
/* Now let's try simple substitution mappings from WMFFontMap */
if (!magick_font->ps_name)
{
@@ -2707,7 +2728,6 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
"leave ReadWMFImage()");
}
- ipa_device_close(API);
wmf_api_destroy(API);
ThrowReaderException(DelegateError,"FailedToComputeOutputSize");
}
@@ -2841,7 +2861,6 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (image_info->ping != MagickFalse)
{
- ipa_device_close(API);
wmf_api_destroy(API);
(void) CloseBlob(image);
if (image->debug != MagickFalse)
@@ -2885,7 +2904,6 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
"leave ReadWMFImage()");
}
- ipa_device_close(API);
wmf_api_destroy(API);
ThrowReaderException(DelegateError,"FailedToRenderFile");
}
@@ -2940,7 +2958,7 @@ ModuleExport size_t RegisterWMFImage(void)
MagickInfo
*entry;
- entry=AcquireMagickInfo("WMF","WMZ","Compressed Windows Meta File");
+ entry = AcquireMagickInfo("WMF","WMZ","Compressed Windows Meta File");
#if defined(MAGICKCORE_SANS_DELEGATE) || defined(MAGICKCORE_WMF_DELEGATE)
entry->decoder=ReadWMFImage;
#endif
diff --git a/coders/wmf.h b/coders/wmf.h
index 051d14acd..9245fc887 100644
--- a/coders/wmf.h
+++ b/coders/wmf.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/wpg.c b/coders/wpg.c
index 11623a735..6994ca0c5 100644
--- a/coders/wpg.c
+++ b/coders/wpg.c
@@ -16,7 +16,7 @@
% June 2000 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -1334,10 +1334,6 @@ static Image *ReadWPGImage(const ImageInfo *image_info,
}
/* Allocate next image structure. */
- if ((image_info->ping != MagickFalse) &&
- (image_info->number_scenes != 0))
- if (image->scene >= (image_info->scene+image_info->number_scenes-1))
- goto Finish;
AcquireNextImage(image_info,image,exception);
image->depth=8;
if (image->next == (Image *) NULL)
@@ -1541,10 +1537,6 @@ static Image *ReadWPGImage(const ImageInfo *image_info,
/* Allocate next image structure. */
- if ((image_info->ping != MagickFalse) &&
- (image_info->number_scenes != 0))
- if (image->scene >= (image_info->scene+image_info->number_scenes-1))
- goto Finish;
AcquireNextImage(image_info,image,exception);
image->depth=8;
if (image->next == (Image *) NULL)
diff --git a/coders/wpg.h b/coders/wpg.h
index 100530cb8..2e6542121 100644
--- a/coders/wpg.h
+++ b/coders/wpg.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/x.c b/coders/x.c
index f13297bbf..471edd096 100644
--- a/coders/x.c
+++ b/coders/x.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/x.h b/coders/x.h
index 308cd5407..697c97bc1 100644
--- a/coders/x.h
+++ b/coders/x.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/xbm.c b/coders/xbm.c
index 3a3b8f598..76c5b4224 100644
--- a/coders/xbm.c
+++ b/coders/xbm.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/xbm.h b/coders/xbm.h
index 2a11c9be0..6f196302a 100644
--- a/coders/xbm.h
+++ b/coders/xbm.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/xc.c b/coders/xc.c
index b81993e1e..a3594beb1 100644
--- a/coders/xc.c
+++ b/coders/xc.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/xc.h b/coders/xc.h
index ef44b49d8..289777a88 100644
--- a/coders/xc.h
+++ b/coders/xc.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/xcf.c b/coders/xcf.c
index f17857b66..0ba99f7ff 100644
--- a/coders/xcf.c
+++ b/coders/xcf.c
@@ -17,7 +17,7 @@
% November 2001 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/xcf.h b/coders/xcf.h
index dd66cd8d9..a36dd3904 100644
--- a/coders/xcf.h
+++ b/coders/xcf.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/xpm.c b/coders/xpm.c
index f393eadb6..722d65d27 100644
--- a/coders/xpm.c
+++ b/coders/xpm.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -1089,7 +1089,7 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image,
symbol[j]=Cixel[k];
}
symbol[j]='\0';
- symbolic=(const char *) GetValueFromSplayTree(xpm_symbolic,name);
+ symbolic=GetValueFromSplayTree(xpm_symbolic,name);
if (symbolic == (const char *) NULL)
(void) FormatLocaleString(buffer,MagickPathExtent,
"\"%.1024s c %.1024s\",\n",symbol,name);
diff --git a/coders/xpm.h b/coders/xpm.h
index 3425066cf..98df5cd9d 100644
--- a/coders/xpm.h
+++ b/coders/xpm.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/xps.c b/coders/xps.c
index 0fdfbd2db..83d89df29 100644
--- a/coders/xps.c
+++ b/coders/xps.c
@@ -17,7 +17,7 @@
% January 2008 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/xps.h b/coders/xps.h
index 0241455e3..c4fbb1338 100644
--- a/coders/xps.h
+++ b/coders/xps.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/xtrn.c b/coders/xtrn.c
index d909b9223..d4dc0e0a3 100644
--- a/coders/xtrn.c
+++ b/coders/xtrn.c
@@ -17,7 +17,7 @@
% May 2001 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/xtrn.h b/coders/xtrn.h
index 09557dcf8..c30f922cc 100644
--- a/coders/xtrn.h
+++ b/coders/xtrn.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/xwd.c b/coders/xwd.c
index fbb297ed8..32c8a223d 100644
--- a/coders/xwd.c
+++ b/coders/xwd.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/xwd.h b/coders/xwd.h
index c3b7139ea..494f631b9 100644
--- a/coders/xwd.h
+++ b/coders/xwd.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/ycbcr.c b/coders/ycbcr.c
index 85c49d574..212c2fb8e 100644
--- a/coders/ycbcr.c
+++ b/coders/ycbcr.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
@@ -99,8 +99,8 @@ static MagickBooleanType
static Image *ReadYCBCRImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
- const void
- *stream;
+ const unsigned char
+ *pixels;
Image
*canvas_image,
@@ -128,9 +128,6 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
@@ -181,7 +178,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
quantum_type=RGBAQuantum;
image->alpha_trait=BlendPixelTrait;
}
- pixels=GetQuantumPixels(quantum_info);
+ pixels=(const unsigned char *) NULL;
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
{
@@ -192,7 +189,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
@@ -201,7 +199,6 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
length=0;
scene=0;
status=MagickTrue;
- stream=NULL;
do
{
/*
@@ -226,7 +223,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -251,7 +249,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,quantum_type,(unsigned char *) stream,exception);
+ quantum_info,quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -284,7 +282,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (status == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
break;
}
@@ -305,7 +304,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -333,7 +333,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,quantum_type,(unsigned char *) stream,exception);
+ quantum_info,quantum_type,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -379,7 +379,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -399,7 +400,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -424,7 +426,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,RedQuantum,(unsigned char *) stream,exception);
+ quantum_info,RedQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -446,7 +448,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -477,7 +480,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,GreenQuantum,(unsigned char *) stream,exception);
+ quantum_info,GreenQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -498,8 +501,9 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
- }
- stream=ReadBlobStream(image,length,pixels,&count);
+ }
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -530,7 +534,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlueQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlueQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -552,7 +556,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -585,7 +590,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,AlphaQuantum,(unsigned char *) stream,exception);
+ quantum_info,AlphaQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -608,7 +613,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -637,8 +643,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (DiscardBlobBytes(image,(MagickSizeType) image->offset) == MagickFalse)
{
status=MagickFalse;
- ThrowFileException(exception,CorruptImageError,
- "UnexpectedEndOfFile",image->filename);
+ ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
+ image->filename);
break;
}
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
@@ -646,14 +652,16 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -677,7 +685,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,RedQuantum,(unsigned char *) stream,exception);
+ quantum_info,RedQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -699,7 +707,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -717,14 +726,16 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -748,7 +759,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,GreenQuantum,(unsigned char *) stream,exception);
+ quantum_info,GreenQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -770,7 +781,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -788,14 +800,16 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -819,7 +833,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlueQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlueQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -841,7 +855,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
@@ -861,14 +876,16 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) length)
break;
}
if (count != (ssize_t) length)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -892,7 +909,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (q == (Quantum *) NULL)
break;
length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
- quantum_info,BlueQuantum,(unsigned char *) stream,exception);
+ quantum_info,BlueQuantum,pixels,exception);
if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
break;
if (((y-image->extract_info.y) >= 0) &&
@@ -915,7 +932,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- stream=ReadBlobStream(image,length,pixels,&count);
+ pixels=(const unsigned char *) ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
}
if (image->previous == (Image *) NULL)
{
diff --git a/coders/ycbcr.h b/coders/ycbcr.h
index 3e7a331fb..5d77dbfef 100644
--- a/coders/ycbcr.h
+++ b/coders/ycbcr.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
diff --git a/coders/yuv.c b/coders/yuv.c
index 145f01bb8..b454a01d0 100644
--- a/coders/yuv.c
+++ b/coders/yuv.c
@@ -17,7 +17,7 @@
% July 1992 %
% %
% %
-% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
diff --git a/coders/yuv.h b/coders/yuv.h
index 606aae723..b9ec59dfa 100644
--- a/coders/yuv.h
+++ b/coders/yuv.h
@@ -1,5 +1,5 @@
/*
- Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may