From e303e319f23603dfe265547dd6a6ad333749ab47 Mon Sep 17 00:00:00 2001 From: GitHub Date: Mon, 18 Sep 2023 01:16:57 +0000 Subject: [PATCH] Update ImageMagick from 7.1.1-15 -> 7.1.1-16 --- Android.mk | 2 +- .../Magick++/lib/Blob.cpp | 0 .../Magick++/lib/BlobRef.cpp | 0 .../Magick++/lib/CoderInfo.cpp | 0 .../Magick++/lib/Color.cpp | 22 +- .../Magick++/lib/Drawable.cpp | 0 .../Magick++/lib/Exception.cpp | 0 .../Magick++/lib/Functions.cpp | 0 .../Magick++/lib/Geometry.cpp | 0 .../Magick++/lib/Image.cpp | 7 +- .../Magick++/lib/ImageRef.cpp | 4 +- .../Magick++/lib/Magick++.h | 0 .../Magick++/lib/Magick++/Blob.h | 0 .../Magick++/lib/Magick++/BlobRef.h | 0 .../Magick++/lib/Magick++/CoderInfo.h | 0 .../Magick++/lib/Magick++/Color.h | 0 .../Magick++/lib/Magick++/Drawable.h | 0 .../Magick++/lib/Magick++/Exception.h | 0 .../Magick++/lib/Magick++/Functions.h | 0 .../Magick++/lib/Magick++/Geometry.h | 0 .../Magick++/lib/Magick++/Image.h | 4 +- .../Magick++/lib/Magick++/ImageRef.h | 0 .../Magick++/lib/Magick++/Include.h | 4 +- .../Magick++/lib/Magick++/Montage.h | 0 .../Magick++/lib/Magick++/Options.h | 0 .../Magick++/lib/Magick++/Pixels.h | 0 .../Magick++/lib/Magick++/ResourceLimits.h | 0 .../Magick++/lib/Magick++/STL.h | 8 +- .../Magick++/lib/Magick++/SecurityPolicy.h | 0 .../Magick++/lib/Magick++/Statistic.h | 0 .../Magick++/lib/Magick++/Thread.h | 0 .../Magick++/lib/Magick++/TypeMetric.h | 0 .../Magick++/lib/Montage.cpp | 0 .../Magick++/lib/Options.cpp | 2 +- .../Magick++/lib/Pixels.cpp | 10 +- .../Magick++/lib/ResourceLimits.cpp | 0 .../Magick++/lib/STL.cpp | 4 +- .../Magick++/lib/SecurityPolicy.cpp | 0 .../Magick++/lib/Statistic.cpp | 10 +- .../Magick++/lib/Thread.cpp | 0 .../Magick++/lib/TypeMetric.cpp | 0 .../MagickCore/MagickCore.h | 0 .../MagickCore/accelerate-kernels-private.h | 301 +----- .../MagickCore/accelerate-private.h | 5 +- .../MagickCore/accelerate.c | 628 +---------- .../MagickCore/animate-private.h | 0 .../MagickCore/animate.c | 39 +- .../MagickCore/animate.h | 0 .../MagickCore/annotate-private.h | 0 .../MagickCore/annotate.c | 64 +- .../MagickCore/annotate.h | 0 .../MagickCore/artifact.c | 0 .../MagickCore/artifact.h | 0 .../MagickCore/attribute.c | 14 +- .../MagickCore/attribute.h | 0 .../MagickCore/blob-private.h | 0 .../MagickCore/blob.c | 73 +- .../MagickCore/blob.h | 0 .../MagickCore/cache-private.h | 0 .../MagickCore/cache-view.c | 0 .../MagickCore/cache-view.h | 0 .../MagickCore/cache.c | 159 +-- .../MagickCore/cache.h | 0 .../MagickCore/channel.c | 18 +- .../MagickCore/channel.h | 0 .../MagickCore/cipher.c | 0 .../MagickCore/cipher.h | 0 .../MagickCore/client.c | 0 .../MagickCore/client.h | 0 .../MagickCore/coder-private.h | 0 .../MagickCore/coder.c | 4 +- .../MagickCore/coder.h | 0 .../MagickCore/color-private.h | 0 .../MagickCore/color.c | 46 +- .../MagickCore/color.h | 0 .../MagickCore/colormap-private.h | 0 .../MagickCore/colormap.c | 7 +- .../MagickCore/colormap.h | 0 .../MagickCore/colorspace-private.h | 20 +- .../MagickCore/colorspace.c | 108 +- .../MagickCore/colorspace.h | 0 .../MagickCore/compare.c | 132 +-- .../MagickCore/compare.h | 0 .../MagickCore/composite-private.h | 3 +- .../MagickCore/composite.c | 331 +++--- .../MagickCore/composite.h | 0 .../MagickCore/compress.c | 22 +- .../MagickCore/compress.h | 3 +- .../MagickCore/configure-private.h | 0 .../MagickCore/configure.c | 4 +- .../MagickCore/configure.h | 0 .../MagickCore/constitute-private.h | 0 .../MagickCore/constitute.c | 2 +- .../MagickCore/constitute.h | 0 .../MagickCore/decorate.c | 171 +-- .../MagickCore/decorate.h | 0 .../MagickCore/delegate-private.h | 0 .../MagickCore/delegate.c | 25 +- .../MagickCore/delegate.h | 0 .../MagickCore/deprecate.c | 0 .../MagickCore/deprecate.h | 0 .../MagickCore/display-private.h | 0 .../MagickCore/display.c | 436 ++++---- .../MagickCore/display.h | 0 .../MagickCore/distort.c | 19 +- .../MagickCore/distort.h | 0 .../MagickCore/distribute-cache-private.h | 0 .../MagickCore/distribute-cache.c | 30 +- .../MagickCore/distribute-cache.h | 0 .../MagickCore/draw-private.h | 4 +- .../MagickCore/draw.c | 356 ++++--- .../MagickCore/draw.h | 0 .../MagickCore/effect.c | 228 ++-- .../MagickCore/effect.h | 0 .../MagickCore/enhance.c | 228 ++-- .../MagickCore/enhance.h | 0 .../MagickCore/exception-private.h | 0 .../MagickCore/exception.c | 0 .../MagickCore/exception.h | 0 .../MagickCore/feature.c | 12 +- .../MagickCore/feature.h | 0 .../MagickCore/fourier.c | 168 ++- .../MagickCore/fourier.h | 0 .../MagickCore/fx-private.h | 0 .../MagickCore/fx.c | 190 ++-- .../MagickCore/fx.h | 0 .../MagickCore/gem-private.h | 60 +- .../MagickCore/gem.c | 182 ++-- .../MagickCore/gem.h | 2 +- .../MagickCore/geometry-private.h | 0 .../MagickCore/geometry.c | 6 +- .../MagickCore/geometry.h | 0 .../MagickCore/histogram.c | 10 +- .../MagickCore/histogram.h | 0 .../MagickCore/identify.c | 4 +- .../MagickCore/identify.h | 0 .../MagickCore/image-private.h | 4 +- .../MagickCore/image-view.c | 10 +- .../MagickCore/image-view.h | 0 .../MagickCore/image.c | 64 +- .../MagickCore/image.h | 2 +- .../MagickCore/layer.c | 96 +- .../MagickCore/layer.h | 0 .../MagickCore/linked-list-private.h | 0 .../MagickCore/linked-list.c | 0 .../MagickCore/linked-list.h | 0 .../MagickCore/list.c | 4 +- .../MagickCore/list.h | 0 .../MagickCore/locale-private.h | 0 .../MagickCore/locale.c | 4 +- .../MagickCore/locale_.h | 0 .../MagickCore/log-private.h | 0 .../MagickCore/log.c | 12 +- .../MagickCore/log.h | 0 .../MagickCore/magic-private.h | 0 .../MagickCore/magic.c | 4 +- .../MagickCore/magic.h | 0 .../MagickCore/magick-config.h | 45 +- .../MagickCore/magick-private.h | 0 .../MagickCore/magick-type.h | 8 +- .../MagickCore/magick.c | 24 +- .../MagickCore/magick.h | 0 .../MagickCore/matrix-private.h | 0 .../MagickCore/matrix.c | 28 +- .../MagickCore/matrix.h | 0 .../MagickCore/memory-private.h | 0 .../MagickCore/memory.c | 2 +- .../MagickCore/memory_.h | 0 .../MagickCore/method-attribute.h | 0 .../MagickCore/methods.h | 0 .../MagickCore/mime-private.h | 0 .../MagickCore/mime.c | 5 +- .../MagickCore/mime.h | 0 .../MagickCore/module-private.h | 0 .../MagickCore/module.c | 1 + .../MagickCore/module.h | 0 .../MagickCore/monitor-private.h | 0 .../MagickCore/monitor.c | 0 .../MagickCore/monitor.h | 0 .../MagickCore/montage.c | 38 +- .../MagickCore/montage.h | 0 .../MagickCore/morphology-private.h | 0 .../MagickCore/morphology.c | 104 +- .../MagickCore/morphology.h | 0 .../MagickCore/mutex.h | 0 .../MagickCore/nt-base-private.h | 3 +- .../MagickCore/nt-base.c | 66 +- .../MagickCore/nt-base.h | 6 - .../MagickCore/nt-feature.c | 0 .../MagickCore/nt-feature.h | 0 .../MagickCore/opencl-private.h | 0 .../MagickCore/opencl.c | 54 +- .../MagickCore/opencl.h | 0 .../MagickCore/option-private.h | 0 .../MagickCore/option.c | 226 ++-- .../MagickCore/option.h | 0 .../MagickCore/paint.c | 22 +- .../MagickCore/paint.h | 0 .../MagickCore/pixel-accessor.h | 87 +- .../MagickCore/pixel-private.h | 0 .../MagickCore/pixel.c | 454 ++++---- .../MagickCore/pixel.h | 10 +- .../MagickCore/policy-private.h | 0 .../MagickCore/policy.c | 10 +- .../MagickCore/policy.h | 0 .../MagickCore/prepress.c | 4 +- .../MagickCore/prepress.h | 0 .../MagickCore/profile-private.h | 0 .../MagickCore/profile.c | 72 +- .../MagickCore/profile.h | 0 .../MagickCore/property.c | 188 ++-- .../MagickCore/property.h | 0 .../MagickCore/quantize.c | 184 ++-- .../MagickCore/quantize.h | 0 .../MagickCore/quantum-export.c | 160 ++- .../MagickCore/quantum-import.c | 109 +- .../MagickCore/quantum-private.h | 52 +- .../MagickCore/quantum.c | 0 .../MagickCore/quantum.h | 6 +- .../MagickCore/random-private.h | 7 +- .../MagickCore/random.c | 16 +- .../MagickCore/random_.h | 0 .../MagickCore/registry-private.h | 0 .../MagickCore/registry.c | 2 +- .../MagickCore/registry.h | 0 .../MagickCore/resample-private.h | 1 - .../MagickCore/resample.c | 18 +- .../MagickCore/resample.h | 0 .../MagickCore/resize-private.h | 0 .../MagickCore/resize.c | 130 +-- .../MagickCore/resize.h | 0 .../MagickCore/resource-private.h | 0 .../MagickCore/resource.c | 35 +- .../MagickCore/resource_.h | 0 .../MagickCore/segment.c | 10 +- .../MagickCore/segment.h | 0 .../MagickCore/semaphore-private.h | 0 .../MagickCore/semaphore.c | 2 +- .../MagickCore/semaphore.h | 0 .../MagickCore/shear.c | 112 +- .../MagickCore/shear.h | 0 .../MagickCore/signature-private.h | 0 .../MagickCore/signature.c | 2 +- .../MagickCore/signature.h | 0 .../MagickCore/splay-tree.c | 0 .../MagickCore/splay-tree.h | 0 .../MagickCore/static.c | 0 .../MagickCore/static.h | 0 .../MagickCore/statistic-private.h | 0 .../MagickCore/statistic.c | 162 +-- .../MagickCore/statistic.h | 0 .../MagickCore/stream-private.h | 0 .../MagickCore/stream.c | 118 +-- .../MagickCore/stream.h | 0 .../MagickCore/string-private.h | 0 .../MagickCore/string.c | 10 +- .../MagickCore/string_.h | 0 .../MagickCore/studio.h | 0 .../MagickCore/thread-private.h | 5 +- .../MagickCore/thread.c | 6 +- .../MagickCore/thread_.h | 0 .../MagickCore/threshold.c | 73 +- .../MagickCore/threshold.h | 0 .../MagickCore/timer-private.h | 0 .../MagickCore/timer.c | 4 +- .../MagickCore/timer.h | 0 .../MagickCore/token-private.h | 0 .../MagickCore/token.c | 2 +- .../MagickCore/token.h | 0 .../MagickCore/transform-private.h | 0 .../MagickCore/transform.c | 110 +- .../MagickCore/transform.h | 0 .../MagickCore/type-private.h | 0 .../MagickCore/type.c | 29 +- .../MagickCore/type.h | 0 .../MagickCore/utility-private.h | 19 +- .../MagickCore/utility.c | 8 +- .../MagickCore/utility.h | 0 .../MagickCore/version-private.h | 0 .../MagickCore/version.c | 15 +- .../MagickCore/vision.c | 67 +- .../MagickCore/vision.h | 0 .../MagickCore/visual-effects.c | 137 +-- .../MagickCore/visual-effects.h | 0 .../MagickCore/vms.c | 0 .../MagickCore/vms.h | 0 .../MagickCore/widget-private.h | 0 .../MagickCore/widget.c | 995 +++++++++--------- .../MagickCore/widget.h | 0 .../MagickCore/xml-tree-private.h | 0 .../MagickCore/xml-tree.c | 38 +- .../MagickCore/xml-tree.h | 0 .../MagickCore/xwindow-private.h | 22 +- .../MagickCore/xwindow.c | 175 +-- .../MagickCore/xwindow.h | 0 .../MagickWand/MagickWand.h | 0 .../MagickWand/animate.c | 4 +- .../MagickWand/animate.h | 0 .../MagickWand/compare.c | 32 +- .../MagickWand/compare.h | 0 .../MagickWand/composite.c | 35 +- .../MagickWand/composite.h | 0 .../MagickWand/conjure.c | 0 .../MagickWand/conjure.h | 0 .../MagickWand/convert.c | 5 +- .../MagickWand/convert.h | 0 .../MagickWand/deprecate.c | 0 .../MagickWand/deprecate.h | 0 .../MagickWand/display.c | 5 +- .../MagickWand/display.h | 0 .../MagickWand/drawing-wand.c | 54 +- .../MagickWand/drawing-wand.h | 0 .../MagickWand/identify.c | 2 +- .../MagickWand/identify.h | 0 .../MagickWand/import.c | 4 +- .../MagickWand/import.h | 0 .../MagickWand/magick-cli.c | 6 +- .../MagickWand/magick-cli.h | 0 .../MagickWand/magick-image.c | 59 +- .../MagickWand/magick-image.h | 0 .../MagickWand/magick-property.c | 0 .../MagickWand/magick-property.h | 0 .../MagickWand/magick-wand-private.h | 0 .../MagickWand/magick-wand.c | 24 +- .../MagickWand/method-attribute.h | 0 .../MagickWand/mogrify-private.h | 10 +- .../MagickWand/mogrify.c | 98 +- .../MagickWand/mogrify.h | 0 .../MagickWand/montage.c | 5 +- .../MagickWand/montage.h | 0 .../MagickWand/operation-private.h | 0 .../MagickWand/operation.c | 77 +- .../MagickWand/operation.h | 0 .../MagickWand/pixel-iterator.c | 0 .../MagickWand/pixel-iterator.h | 0 .../MagickWand/pixel-wand-private.h | 0 .../MagickWand/pixel-wand.c | 56 +- .../MagickWand/pixel-wand.h | 0 .../MagickWand/script-token.c | 0 .../MagickWand/script-token.h | 0 .../MagickWand/stream.c | 2 +- .../MagickWand/stream.h | 0 .../MagickWand/studio.h | 0 .../MagickWand/wand-view.c | 10 +- .../MagickWand/wand-view.h | 0 .../MagickWand/wand.c | 0 .../MagickWand/wand.h | 0 .../MagickWand/wandcli-private.h | 0 .../MagickWand/wandcli.c | 0 .../MagickWand/wandcli.h | 0 .../coders/aai.c | 0 .../coders/aai.h | 0 .../coders/art.c | 0 .../coders/art.h | 0 .../coders/ashlar.c | 43 +- .../coders/ashlar.h | 0 .../coders/avs.c | 0 .../coders/avs.h | 0 .../coders/bayer.c | 13 +- .../coders/bayer.h | 0 .../coders/bgr.c | 2 +- .../coders/bgr.h | 0 .../coders/bmp.c | 201 +++- .../coders/bmp.h | 0 .../coders/braille.c | 16 +- .../coders/braille.h | 0 .../coders/bytebuffer-private.h | 9 +- .../coders/cals.c | 0 .../coders/cals.h | 0 .../coders/caption.c | 2 +- .../coders/caption.h | 0 .../coders/cin.c | 2 +- .../coders/cin.h | 0 .../coders/cip.c | 8 +- .../coders/cip.h | 0 .../coders/clip.c | 0 .../coders/clip.h | 0 .../coders/clipboard.c | 0 .../coders/clipboard.h | 0 .../coders/cmyk.c | 0 .../coders/cmyk.h | 0 .../coders/coders-list.h | 0 .../coders/coders-private.h | 0 .../coders/coders.h | 0 .../coders/cube.c | 7 +- .../coders/cube.h | 0 .../coders/cut.c | 24 +- .../coders/cut.h | 0 .../coders/dcm.c | 96 +- .../coders/dcm.h | 0 .../coders/dds.c | 129 +-- .../coders/dds.h | 0 .../coders/debug.c | 0 .../coders/debug.h | 0 .../coders/dib.c | 32 +- .../coders/dib.h | 0 .../coders/djvu.c | 31 +- .../coders/djvu.h | 0 .../coders/dmr.c | 8 +- .../coders/dmr.h | 0 .../coders/dng.c | 80 +- .../coders/dng.h | 0 .../coders/dot.c | 0 .../coders/dot.h | 0 .../coders/dps.c | 0 .../coders/dps.h | 0 .../coders/dpx.c | 28 +- .../coders/dpx.h | 0 .../coders/emf.c | 0 .../coders/emf.h | 0 .../coders/ept.c | 0 .../coders/ept.h | 0 .../coders/exr.c | 38 +- .../coders/exr.h | 0 .../coders/farbfeld.c | 0 .../coders/farbfeld.h | 0 .../coders/fax.c | 0 .../coders/fax.h | 0 .../coders/fits.c | 16 +- .../coders/fits.h | 0 .../coders/fl32.c | 2 +- .../coders/fl32.h | 0 .../coders/flif.c | 2 +- .../coders/flif.h | 0 .../coders/fpx.c | 0 .../coders/fpx.h | 0 .../coders/ftxt.c | 4 +- .../coders/ftxt.h | 0 .../coders/ghostscript-private.h | 0 .../coders/gif.c | 39 +- .../coders/gif.h | 0 .../coders/gradient.c | 0 .../coders/gradient.h | 0 .../coders/gray.c | 0 .../coders/gray.h | 0 .../coders/hald.c | 16 +- .../coders/hald.h | 0 .../coders/hdr.c | 46 +- .../coders/hdr.h | 0 .../coders/heic.c | 5 +- .../coders/heic.h | 0 .../coders/histogram.c | 6 +- .../coders/histogram.h | 0 .../coders/hrz.c | 0 .../coders/hrz.h | 0 .../coders/html.c | 7 +- .../coders/html.h | 0 .../coders/icon.c | 53 +- .../coders/icon.h | 0 .../coders/info.c | 0 .../coders/info.h | 0 .../coders/inline.c | 10 +- .../coders/inline.h | 0 .../coders/ipl.c | 0 .../coders/ipl.h | 0 .../coders/jbig.c | 6 +- .../coders/jbig.h | 0 .../coders/jnx.c | 0 .../coders/jnx.h | 0 .../coders/jp2.c | 67 +- .../coders/jp2.h | 0 .../coders/jpeg.c | 31 +- .../coders/jpeg.h | 0 .../coders/json.c | 2 +- .../coders/json.h | 0 .../coders/jxl.c | 4 +- .../coders/jxl.h | 0 .../coders/kernel.c | 0 .../coders/kernel.h | 0 .../coders/label.c | 0 .../coders/label.h | 0 .../coders/mac.c | 0 .../coders/mac.h | 0 .../coders/magick.c | 0 .../coders/magick.h | 0 .../coders/map.c | 24 +- .../coders/map.h | 0 .../coders/mask.c | 0 .../coders/mask.h | 0 .../coders/mat.c | 66 +- .../coders/mat.h | 0 .../coders/matte.c | 0 .../coders/matte.h | 0 .../coders/meta.c | 36 +- .../coders/meta.h | 0 .../coders/miff.c | 20 +- .../coders/miff.h | 0 .../coders/mono.c | 6 +- .../coders/mono.h | 0 .../coders/mpc.c | 10 +- .../coders/mpc.h | 0 .../coders/mpr.c | 0 .../coders/mpr.h | 0 .../coders/msl.c | 170 ++- .../coders/msl.h | 0 .../coders/mtv.c | 0 .../coders/mtv.h | 0 .../coders/mvg.c | 0 .../coders/mvg.h | 0 .../coders/null.c | 0 .../coders/null.h | 0 .../coders/ora.c | 0 .../coders/ora.h | 0 .../coders/otb.c | 2 +- .../coders/otb.h | 0 .../coders/palm.c | 57 +- .../coders/palm.h | 0 .../coders/pango.c | 10 +- .../coders/pango.h | 0 .../coders/pattern.c | 0 .../coders/pattern.h | 0 .../coders/pcd.c | 4 +- .../coders/pcd.h | 0 .../coders/pcl.c | 2 +- .../coders/pcl.h | 0 .../coders/pcx.c | 2 +- .../coders/pcx.h | 0 .../coders/pdb.c | 10 +- .../coders/pdb.h | 0 .../coders/pdf.c | 7 +- .../coders/pdf.h | 0 .../coders/pes.c | 2 +- .../coders/pes.h | 0 .../coders/pgx.c | 0 .../coders/pgx.h | 0 .../coders/pict.c | 22 +- .../coders/pict.h | 0 .../coders/pix.c | 0 .../coders/pix.h | 0 .../coders/plasma.c | 37 +- .../coders/plasma.h | 0 .../coders/png.c | 215 ++-- .../coders/png.h | 0 .../coders/pnm.c | 40 +- .../coders/pnm.h | 0 .../coders/ps.c | 43 +- .../coders/ps.h | 0 .../coders/ps2.c | 18 +- .../coders/ps2.h | 0 .../coders/ps3.c | 9 +- .../coders/ps3.h | 0 .../coders/psd-private.h | 0 .../coders/psd.c | 163 +-- .../coders/psd.h | 0 .../coders/pwp.c | 0 .../coders/pwp.h | 0 .../coders/qoi.c | 26 +- .../coders/qoi.h | 0 .../coders/raw.c | 0 .../coders/raw.h | 0 .../coders/rgb.c | 0 .../coders/rgb.h | 0 .../coders/rgf.c | 2 +- .../coders/rgf.h | 0 .../coders/rla.c | 6 +- .../coders/rla.h | 0 .../coders/rle.c | 37 +- .../coders/rle.h | 0 .../coders/scr.c | 0 .../coders/scr.h | 0 .../coders/screenshot.c | 0 .../coders/screenshot.h | 0 .../coders/sct.c | 34 +- .../coders/sct.h | 0 .../coders/sfw.c | 0 .../coders/sfw.h | 0 .../coders/sgi.c | 20 +- .../coders/sgi.h | 0 .../coders/sixel.c | 79 +- .../coders/sixel.h | 0 .../coders/stegano.c | 0 .../coders/stegano.h | 0 .../coders/strimg.c | 0 .../coders/strimg.h | 0 .../coders/sun.c | 2 +- .../coders/sun.h | 0 .../coders/svg.c | 21 +- .../coders/svg.h | 0 .../coders/tga.c | 146 +-- .../coders/tga.h | 0 .../coders/thumbnail.c | 0 .../coders/thumbnail.h | 0 .../coders/tiff.c | 119 ++- .../coders/tiff.h | 0 .../coders/tile.c | 0 .../coders/tile.h | 0 .../coders/tim.c | 10 +- .../coders/tim.h | 0 .../coders/tim2.c | 18 +- .../coders/tim2.h | 0 .../coders/ttf.c | 0 .../coders/ttf.h | 0 .../coders/txt.c | 0 .../coders/txt.h | 0 .../coders/uil.c | 2 +- .../coders/uil.h | 0 .../coders/url.c | 4 +- .../coders/url.h | 0 .../coders/uyvy.c | 6 +- .../coders/uyvy.h | 0 .../coders/vicar.c | 4 +- .../coders/vicar.h | 0 .../coders/vid.c | 3 +- .../coders/vid.h | 0 .../coders/video.c | 6 +- .../coders/video.h | 0 .../coders/viff.c | 30 +- .../coders/viff.h | 0 .../coders/vips.c | 3 +- .../coders/vips.h | 0 .../coders/wbmp.c | 6 +- .../coders/wbmp.h | 0 .../coders/webp.c | 46 +- .../coders/webp.h | 0 .../coders/wmf.c | 418 ++++---- .../coders/wmf.h | 0 .../coders/wpg.c | 53 +- .../coders/wpg.h | 0 .../coders/x.c | 0 .../coders/x.h | 0 .../coders/xbm.c | 4 +- .../coders/xbm.h | 0 .../coders/xc.c | 0 .../coders/xc.h | 0 .../coders/xcf.c | 32 +- .../coders/xcf.h | 0 .../coders/xpm.c | 14 +- .../coders/xpm.h | 0 .../coders/xps.c | 0 .../coders/xps.h | 0 .../coders/xwd.c | 16 +- .../coders/xwd.h | 0 .../coders/yaml.c | 2 +- .../coders/yaml.h | 0 .../coders/ycbcr.c | 0 .../coders/ycbcr.h | 0 .../coders/yuv.c | 17 +- .../coders/yuv.h | 0 .../arm64/MagickCore/magick-baseconfig.h | 6 +- .../configs/arm64/MagickCore/version.h | 6 +- .../filters/analyze.c | 4 +- .../utilities/magick.c | 10 +- README.md | 2 +- 643 files changed, 6023 insertions(+), 6428 deletions(-) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Blob.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/BlobRef.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/CoderInfo.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Color.cpp (95%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Drawable.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Exception.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Functions.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Geometry.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Image.cpp (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/ImageRef.cpp (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Blob.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/BlobRef.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/CoderInfo.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Color.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Drawable.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Exception.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Functions.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Geometry.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Image.h (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/ImageRef.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Include.h (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Montage.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Options.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Pixels.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/ResourceLimits.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/STL.h (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/SecurityPolicy.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Statistic.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/Thread.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Magick++/TypeMetric.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Montage.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Options.cpp (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Pixels.cpp (93%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/ResourceLimits.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/STL.cpp (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/SecurityPolicy.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Statistic.cpp (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/Thread.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/Magick++/lib/TypeMetric.cpp (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/MagickCore.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/accelerate-kernels-private.h (90%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/accelerate-private.h (93%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/accelerate.c (87%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/animate-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/animate.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/animate.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/annotate-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/annotate.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/annotate.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/artifact.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/artifact.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/attribute.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/attribute.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/blob-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/blob.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/blob.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/cache-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/cache-view.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/cache-view.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/cache.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/cache.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/channel.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/channel.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/cipher.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/cipher.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/client.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/client.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/coder-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/coder.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/coder.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/color-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/color.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/color.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/colormap-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/colormap.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/colormap.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/colorspace-private.h (88%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/colorspace.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/colorspace.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/compare.c (95%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/compare.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/composite-private.h (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/composite.c (91%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/composite.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/compress.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/compress.h (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/configure-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/configure.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/configure.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/constitute-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/constitute.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/constitute.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/decorate.c (84%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/decorate.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/delegate-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/delegate.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/delegate.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/deprecate.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/deprecate.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/display-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/display.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/display.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/distort.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/distort.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/distribute-cache-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/distribute-cache.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/distribute-cache.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/draw-private.h (92%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/draw.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/draw.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/effect.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/effect.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/enhance.c (95%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/enhance.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/exception-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/exception.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/exception.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/feature.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/feature.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/fourier.c (92%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/fourier.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/fx-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/fx.c (95%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/fx.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/gem-private.h (86%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/gem.c (93%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/gem.h (94%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/geometry-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/geometry.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/geometry.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/histogram.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/histogram.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/identify.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/identify.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/image-private.h (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/image-view.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/image-view.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/image.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/image.h (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/layer.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/layer.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/linked-list-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/linked-list.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/linked-list.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/list.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/list.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/locale-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/locale.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/locale_.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/log-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/log.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/log.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/magic-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/magic.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/magic.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/magick-config.h (92%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/magick-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/magick-type.h (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/magick.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/magick.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/matrix-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/matrix.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/matrix.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/memory-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/memory.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/memory_.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/method-attribute.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/methods.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/mime-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/mime.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/mime.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/module-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/module.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/module.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/monitor-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/monitor.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/monitor.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/montage.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/montage.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/morphology-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/morphology.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/morphology.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/mutex.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/nt-base-private.h (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/nt-base.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/nt-base.h (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/nt-feature.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/nt-feature.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/opencl-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/opencl.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/opencl.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/option-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/option.c (95%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/option.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/paint.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/paint.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/pixel-accessor.h (91%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/pixel-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/pixel.c (92%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/pixel.h (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/policy-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/policy.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/policy.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/prepress.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/prepress.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/profile-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/profile.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/profile.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/property.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/property.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/quantize.c (95%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/quantize.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/quantum-export.c (95%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/quantum-import.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/quantum-private.h (94%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/quantum.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/quantum.h (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/random-private.h (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/random.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/random_.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/registry-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/registry.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/registry.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/resample-private.h (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/resample.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/resample.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/resize-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/resize.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/resize.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/resource-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/resource.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/resource_.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/segment.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/segment.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/semaphore-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/semaphore.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/semaphore.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/shear.c (93%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/shear.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/signature-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/signature.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/signature.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/splay-tree.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/splay-tree.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/static.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/static.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/statistic-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/statistic.c (95%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/statistic.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/stream-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/stream.c (95%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/stream.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/string-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/string.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/string_.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/studio.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/thread-private.h (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/thread.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/thread_.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/threshold.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/threshold.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/timer-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/timer.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/timer.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/token-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/token.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/token.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/transform-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/transform.c (95%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/transform.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/type-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/type.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/type.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/utility-private.h (93%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/utility.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/utility.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/version-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/version.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/vision.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/vision.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/visual-effects.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/visual-effects.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/vms.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/vms.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/widget-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/widget.c (91%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/widget.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/xml-tree-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/xml-tree.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/xml-tree.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/xwindow-private.h (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/xwindow.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickCore/xwindow.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/MagickWand.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/animate.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/animate.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/compare.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/compare.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/composite.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/composite.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/conjure.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/conjure.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/convert.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/convert.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/deprecate.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/deprecate.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/display.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/display.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/drawing-wand.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/drawing-wand.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/identify.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/identify.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/import.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/import.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/magick-cli.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/magick-cli.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/magick-image.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/magick-image.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/magick-property.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/magick-property.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/magick-wand-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/magick-wand.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/method-attribute.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/mogrify-private.h (91%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/mogrify.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/mogrify.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/montage.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/montage.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/operation-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/operation.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/operation.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/pixel-iterator.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/pixel-iterator.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/pixel-wand-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/pixel-wand.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/pixel-wand.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/script-token.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/script-token.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/stream.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/stream.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/studio.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/wand-view.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/wand-view.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/wand.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/wand.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/wandcli-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/wandcli.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/MagickWand/wandcli.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/aai.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/aai.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/art.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/art.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ashlar.c (94%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ashlar.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/avs.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/avs.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/bayer.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/bayer.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/bgr.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/bgr.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/bmp.c (93%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/bmp.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/braille.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/braille.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/bytebuffer-private.h (91%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cals.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cals.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/caption.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/caption.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cin.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cin.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cip.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cip.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/clip.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/clip.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/clipboard.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/clipboard.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cmyk.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cmyk.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/coders-list.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/coders-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/coders.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cube.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cube.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cut.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/cut.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dcm.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dcm.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dds.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dds.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/debug.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/debug.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dib.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dib.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/djvu.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/djvu.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dmr.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dmr.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dng.c (94%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dng.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dot.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dot.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dps.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dps.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dpx.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/dpx.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/emf.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/emf.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ept.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ept.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/exr.c (94%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/exr.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/farbfeld.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/farbfeld.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/fax.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/fax.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/fits.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/fits.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/fl32.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/fl32.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/flif.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/flif.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/fpx.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/fpx.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ftxt.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ftxt.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ghostscript-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/gif.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/gif.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/gradient.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/gradient.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/gray.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/gray.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/hald.c (94%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/hald.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/hdr.c (95%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/hdr.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/heic.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/heic.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/histogram.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/histogram.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/hrz.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/hrz.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/html.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/html.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/icon.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/icon.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/info.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/info.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/inline.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/inline.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ipl.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ipl.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/jbig.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/jbig.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/jnx.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/jnx.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/jp2.c (94%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/jp2.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/jpeg.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/jpeg.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/json.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/json.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/jxl.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/jxl.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/kernel.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/kernel.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/label.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/label.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mac.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mac.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/magick.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/magick.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/map.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/map.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mask.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mask.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mat.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mat.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/matte.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/matte.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/meta.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/meta.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/miff.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/miff.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mono.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mono.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mpc.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mpc.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mpr.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mpr.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/msl.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/msl.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mtv.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mtv.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mvg.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/mvg.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/null.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/null.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ora.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ora.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/otb.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/otb.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/palm.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/palm.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pango.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pango.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pattern.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pattern.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pcd.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pcd.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pcl.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pcl.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pcx.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pcx.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pdb.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pdb.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pdf.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pdf.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pes.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pes.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pgx.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pgx.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pict.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pict.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pix.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pix.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/plasma.c (89%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/plasma.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/png.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/png.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pnm.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pnm.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ps.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ps.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ps2.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ps2.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ps3.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ps3.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/psd-private.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/psd.c (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/psd.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pwp.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/pwp.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/qoi.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/qoi.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/raw.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/raw.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/rgb.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/rgb.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/rgf.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/rgf.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/rla.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/rla.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/rle.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/rle.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/scr.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/scr.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/screenshot.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/screenshot.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/sct.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/sct.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/sfw.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/sfw.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/sgi.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/sgi.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/sixel.c (94%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/sixel.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/stegano.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/stegano.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/strimg.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/strimg.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/sun.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/sun.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/svg.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/svg.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/tga.c (91%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/tga.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/thumbnail.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/thumbnail.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/tiff.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/tiff.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/tile.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/tile.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/tim.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/tim.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/tim2.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/tim2.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ttf.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ttf.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/txt.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/txt.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/uil.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/uil.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/url.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/url.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/uyvy.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/uyvy.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/vicar.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/vicar.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/vid.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/vid.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/video.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/video.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/viff.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/viff.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/vips.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/vips.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/wbmp.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/wbmp.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/webp.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/webp.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/wmf.c (84%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/wmf.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/wpg.c (97%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/wpg.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/x.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/x.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xbm.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xbm.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xc.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xc.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xcf.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xcf.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xpm.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xpm.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xps.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xps.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xwd.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/xwd.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/yaml.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/yaml.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ycbcr.c (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/ycbcr.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/yuv.c (98%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/coders/yuv.h (100%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/configs/arm64/MagickCore/magick-baseconfig.h (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/configs/arm64/MagickCore/version.h (96%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/filters/analyze.c (99%) rename {ImageMagick-7.1.1-15 => ImageMagick-7.1.1-16}/utilities/magick.c (99%) diff --git a/Android.mk b/Android.mk index 55dd72fc..f94d4487 100644 --- a/Android.mk +++ b/Android.mk @@ -30,7 +30,7 @@ OPENCL_INCLUDE_PATH := $(OPENCL_PATH)/qualcomm/include LTDL_LIB_PATH := $(LOCAL_PATH)/libltdl-2.4.6 -IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.1-15 +IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.1-16 IMAGE_MAGICK := $(LOCAL_PATH)/$(IMAGE_MAGICK_BASEDIR) JPEG_LIB_PATH := $(LOCAL_PATH)/libjpeg-turbo-2.0.2 diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Blob.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Blob.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Blob.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Blob.cpp diff --git a/ImageMagick-7.1.1-15/Magick++/lib/BlobRef.cpp b/ImageMagick-7.1.1-16/Magick++/lib/BlobRef.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/BlobRef.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/BlobRef.cpp diff --git a/ImageMagick-7.1.1-15/Magick++/lib/CoderInfo.cpp b/ImageMagick-7.1.1-16/Magick++/lib/CoderInfo.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/CoderInfo.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/CoderInfo.cpp diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Color.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Color.cpp similarity index 95% rename from ImageMagick-7.1.1-15/Magick++/lib/Color.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Color.cpp index a48d6b15..5c650f2a 100644 --- a/ImageMagick-7.1.1-15/Magick++/lib/Color.cpp +++ b/ImageMagick-7.1.1-16/Magick++/lib/Color.cpp @@ -24,9 +24,9 @@ MagickPPExport int Magick::operator == (const Magick::Color &left_, { #if defined(MAGICKCORE_HDRI_SUPPORT) return((left_.isValid() == right_.isValid()) && - (fabs(left_.quantumRed()-right_.quantumRed()) < MagickEpsilon) && - (fabs(left_.quantumGreen()-right_.quantumGreen()) < MagickEpsilon) && - (fabs(left_.quantumBlue()-right_.quantumBlue()) < MagickEpsilon)); + (fabs((double) left_.quantumRed()-(double) right_.quantumRed()) < MagickEpsilon) && + (fabs((double) left_.quantumGreen()-(double) right_.quantumGreen()) < MagickEpsilon) && + (fabs((double) left_.quantumBlue()-(double) right_.quantumBlue()) < MagickEpsilon)); #else return((left_.isValid() == right_.isValid()) && (left_.quantumRed() == right_.quantumRed()) && @@ -399,13 +399,13 @@ void Magick::Color::pixel(PixelInfo *rep_,PixelType pixelType_) Magick::Quantum Magick::Color::scaleDoubleToQuantum(const double double_) { - return(static_cast(double_*QuantumRange)); + return(static_cast(double_*(double) QuantumRange)); } double Magick::Color::scaleQuantumToDouble(const Magick::Quantum quantum_) { #if (MAGICKCORE_QUANTUM_DEPTH < 32) && (MAGICKCORE_SIZEOF_FLOAT_T != MAGICKCORE_SIZEOF_DOUBLE || !defined(MAGICKCORE_HDRI_SUPPORT)) - return(static_cast(QuantumScale*quantum_)); + return(static_cast(QuantumScale*(double) quantum_)); #else return(QuantumScale*quantum_); #endif @@ -891,8 +891,8 @@ void Magick::ColorYUV::u(const double u_) double Magick::ColorYUV::u(void) const { - return(scaleQuantumToDouble((-0.14740 * quantumRed()) - (0.28950 * - quantumGreen()) + (0.43690 * quantumBlue()))); + return(scaleQuantumToDouble((-0.14740 * (double) quantumRed()) - (0.28950 * + (double) quantumGreen()) + (0.43690 * (double) quantumBlue()))); } void Magick::ColorYUV::v(const double v_) @@ -902,8 +902,8 @@ void Magick::ColorYUV::v(const double v_) double Magick::ColorYUV::v(void) const { - return(scaleQuantumToDouble((0.61500 * quantumRed()) - (0.51500 * - quantumGreen()) - (0.10000 * quantumBlue()))); + return(scaleQuantumToDouble((0.61500 * (double) quantumRed()) - (0.51500 * + (double) quantumGreen()) - (0.10000 * (double) quantumBlue()))); } void Magick::ColorYUV::y(const double y_) @@ -913,8 +913,8 @@ void Magick::ColorYUV::y(const double y_) double Magick::ColorYUV::y ( void ) const { - return(scaleQuantumToDouble((0.29900 * quantumRed()) + (0.58700 * - quantumGreen()) + (0.11400 * quantumBlue()))); + return(scaleQuantumToDouble((0.29900 * (double) quantumRed()) + (0.58700 * + (double) quantumGreen()) + (0.11400 * (double) quantumBlue()))); } void Magick::ColorYUV::convert(const double y_,const double u_,const double v_) diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Drawable.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Drawable.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Drawable.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Drawable.cpp diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Exception.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Exception.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Exception.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Exception.cpp diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Functions.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Functions.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Functions.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Functions.cpp diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Geometry.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Geometry.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Geometry.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Geometry.cpp diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Image.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Image.cpp similarity index 99% rename from ImageMagick-7.1.1-15/Magick++/lib/Image.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Image.cpp index dbe8578b..4914f43f 100644 --- a/ImageMagick-7.1.1-15/Magick++/lib/Image.cpp +++ b/ImageMagick-7.1.1-16/Magick++/lib/Image.cpp @@ -764,7 +764,7 @@ void Magick::Image::fileName(const std::string &fileName_) modifyImage(); max_length=sizeof(image()->filename)-1; - fileName_.copy(image()->filename,max_length); + fileName_.copy(image()->filename,(size_t) max_length); if ((ssize_t) fileName_.length() > max_length) image()->filename[max_length]=0; else @@ -4210,14 +4210,13 @@ void Magick::Image::roll(const Geometry &roll_) ThrowImageException; } -void Magick::Image::roll(const size_t columns_,const size_t rows_) +void Magick::Image::roll(const ssize_t columns_,const ssize_t rows_) { MagickCore::Image *newImage; GetPPException; - newImage=RollImage(constImage(),static_cast(columns_), - static_cast(rows_),exceptionInfo); + newImage=RollImage(constImage(),columns_, rows_,exceptionInfo); replaceImage(newImage); ThrowImageException; } diff --git a/ImageMagick-7.1.1-15/Magick++/lib/ImageRef.cpp b/ImageMagick-7.1.1-16/Magick++/lib/ImageRef.cpp similarity index 98% rename from ImageMagick-7.1.1-15/Magick++/lib/ImageRef.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/ImageRef.cpp index d33fe7ed..6d98440b 100644 --- a/ImageMagick-7.1.1-15/Magick++/lib/ImageRef.cpp +++ b/ImageMagick-7.1.1-16/Magick++/lib/ImageRef.cpp @@ -60,7 +60,7 @@ size_t Magick::ImageRef::decrease() "Invalid call to decrease"); return(0); } - count=--_refCount; + count=(size_t) (--_refCount); _mutexLock.unlock(); return(count); } @@ -154,4 +154,4 @@ Magick::ImageRef::ImageRef(MagickCore::Image *image_,const Options *options_) _refCount(1) { _options=new Options(*options_); -} \ No newline at end of file +} diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Blob.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Blob.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Blob.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Blob.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/BlobRef.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/BlobRef.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/BlobRef.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/BlobRef.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/CoderInfo.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/CoderInfo.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/CoderInfo.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/CoderInfo.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Color.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Color.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Color.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Color.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Drawable.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Drawable.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Drawable.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Drawable.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Exception.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Exception.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Exception.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Exception.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Functions.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Functions.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Functions.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Functions.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Geometry.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Geometry.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Geometry.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Geometry.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Image.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Image.h similarity index 99% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Image.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Image.h index f061d9b2..d76d642c 100644 --- a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Image.h +++ b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Image.h @@ -1271,7 +1271,7 @@ namespace Magick // Roll image (rolls image vertically and horizontally) by specified // number of columns and rows) void roll(const Geometry &roll_); - void roll(const size_t columns_,const size_t rows_); + void roll(const ssize_t columns_,const ssize_t rows_); // Rotate image clockwise by specified number of degrees. Specify a // negative number for degrees to rotate counter-clockwise. @@ -1345,7 +1345,7 @@ namespace Magick // adjust the image contrast with a non-linear sigmoidal contrast algorithm void sigmoidalContrast(const bool sharpen_,const double contrast, - const double midpoint=QuantumRange/2.0); + const double midpoint=(double) QuantumRange/2.0); // Image signature. Set force_ to true in order to re-calculate // the signature regardless of whether the image data has been diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/ImageRef.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/ImageRef.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/ImageRef.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/ImageRef.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Include.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Include.h similarity index 99% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Include.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Include.h index 5c3d8f02..5573ffa1 100644 --- a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Include.h +++ b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Include.h @@ -122,7 +122,7 @@ namespace MagickCore # pragma comment(lib, "CORE_DB_jbig_.lib") # endif # if defined(MAGICKCORE_JP2_DELEGATE) -# pragma comment(lib, "CORE_DB_jp2_.lib") +# pragma comment(lib, "CORE_DB_jasper_.lib") # endif # if defined(MAGICKCORE_JPEG_DELEGATE) # pragma comment(lib, "CORE_DB_jpeg-turbo_.lib") @@ -211,7 +211,7 @@ namespace MagickCore # pragma comment(lib, "CORE_RL_jbig_.lib") # endif # if defined(MAGICKCORE_JP2_DELEGATE) -# pragma comment(lib, "CORE_RL_jp2_.lib") +# pragma comment(lib, "CORE_RL_jasper_.lib") # endif # if defined(MAGICKCORE_JPEG_DELEGATE) # pragma comment(lib, "CORE_RL_jpeg-turbo_.lib") diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Montage.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Montage.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Montage.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Montage.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Options.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Options.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Options.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Options.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Pixels.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Pixels.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Pixels.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Pixels.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/ResourceLimits.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/ResourceLimits.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/ResourceLimits.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/ResourceLimits.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/STL.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/STL.h similarity index 99% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/STL.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/STL.h index 161643a8..076e7a12 100644 --- a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/STL.h +++ b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/STL.h @@ -940,8 +940,8 @@ namespace Magick void operator()( Image &image_ ) const; private: - size_t _columns; - size_t _rows; + ssize_t _columns; + ssize_t _rows; }; // Rotate image counter-clockwise by specified number of degrees. @@ -1735,7 +1735,7 @@ namespace Magick public: sigmoidalContrastImage( const size_t sharpen_, const double contrast, - const double midpoint = QuantumRange / 2.0 ); + const double midpoint = (double) QuantumRange / 2.0 ); void operator()( Image &image_ ) const; @@ -1922,7 +1922,7 @@ namespace Magick current->previous=previous; current->next=(MagickCore::Image *) NULL; - current->scene=scene++; + current->scene=(size_t) scene++; if (previous != (MagickCore::Image *) NULL) previous->next=current; diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/SecurityPolicy.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/SecurityPolicy.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/SecurityPolicy.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/SecurityPolicy.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Statistic.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Statistic.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Statistic.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Statistic.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/Thread.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/Thread.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/Thread.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/Thread.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Magick++/TypeMetric.h b/ImageMagick-7.1.1-16/Magick++/lib/Magick++/TypeMetric.h similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Magick++/TypeMetric.h rename to ImageMagick-7.1.1-16/Magick++/lib/Magick++/TypeMetric.h diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Montage.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Montage.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Montage.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Montage.cpp diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Options.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Options.cpp similarity index 99% rename from ImageMagick-7.1.1-15/Magick++/lib/Options.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Options.cpp index 7e25ee2a..9a2c3fb5 100644 --- a/ImageMagick-7.1.1-15/Magick++/lib/Options.cpp +++ b/ImageMagick-7.1.1-16/Magick++/lib/Options.cpp @@ -229,7 +229,7 @@ void Magick::Options::fileName(const std::string &fileName_) max_length; max_length=sizeof(_imageInfo->filename)-1; - fileName_.copy(_imageInfo->filename,max_length); + fileName_.copy(_imageInfo->filename,(size_t) max_length); if ((ssize_t) fileName_.length() > max_length) _imageInfo->filename[max_length]=0; else diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Pixels.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Pixels.cpp similarity index 93% rename from ImageMagick-7.1.1-15/Magick++/lib/Pixels.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Pixels.cpp index b65424f8..cb039125 100644 --- a/ImageMagick-7.1.1-15/Magick++/lib/Pixels.cpp +++ b/ImageMagick-7.1.1-16/Magick++/lib/Pixels.cpp @@ -150,8 +150,8 @@ void Magick::PixelData::init(Magick::Image &image_,const ::ssize_t x_, _length=0; _size=0; if ((x_ < 0) || (width_ == 0) || (y_ < 0) || (height_ == 0) || - (x_ > (ssize_t) image_.columns()) || ((width_ + x_) > image_.columns()) - || (y_ > (ssize_t) image_.rows()) || ((height_ + y_) > image_.rows()) + (x_ > (ssize_t) image_.columns()) || (((ssize_t) width_ + x_) > (ssize_t) image_.columns()) + || (y_ > (ssize_t) image_.rows()) || (((ssize_t) height_ + y_) > (ssize_t) image_.rows()) || (map_.length() == 0)) return; @@ -183,9 +183,9 @@ void Magick::PixelData::init(Magick::Image &image_,const ::ssize_t x_, return; } - _length=width_*height_*map_.length(); - _size=_length*size; - _data=AcquireMagickMemory(_size); + _length=(ssize_t) (width_*height_*map_.length()); + _size=_length*(ssize_t) size; + _data=AcquireMagickMemory((size_t) _size); GetPPException; MagickCore::ExportImagePixels(image_.image(),x_,y_,width_,height_, diff --git a/ImageMagick-7.1.1-15/Magick++/lib/ResourceLimits.cpp b/ImageMagick-7.1.1-16/Magick++/lib/ResourceLimits.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/ResourceLimits.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/ResourceLimits.cpp diff --git a/ImageMagick-7.1.1-15/Magick++/lib/STL.cpp b/ImageMagick-7.1.1-16/Magick++/lib/STL.cpp similarity index 99% rename from ImageMagick-7.1.1-15/Magick++/lib/STL.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/STL.cpp index 7e8a3ffc..b17d0037 100644 --- a/ImageMagick-7.1.1-15/Magick++/lib/STL.cpp +++ b/ImageMagick-7.1.1-16/Magick++/lib/STL.cpp @@ -890,8 +890,8 @@ void Magick::reduceNoiseImage::operator()( Image &image_ ) const // Roll image (rolls image vertically and horizontally) by specified // number of columns and rows) Magick::rollImage::rollImage( const Magick::Geometry &roll_ ) - : _columns( roll_.width() ), - _rows( roll_.height() ) + : _columns( static_cast(roll_.width()) ), + _rows( static_cast(roll_.height()) ) { } Magick::rollImage::rollImage( const ssize_t columns_, diff --git a/ImageMagick-7.1.1-15/Magick++/lib/SecurityPolicy.cpp b/ImageMagick-7.1.1-16/Magick++/lib/SecurityPolicy.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/SecurityPolicy.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/SecurityPolicy.cpp diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Statistic.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Statistic.cpp similarity index 99% rename from ImageMagick-7.1.1-15/Magick++/lib/Statistic.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Statistic.cpp index d3e4c748..f7eca73a 100644 --- a/ImageMagick-7.1.1-15/Magick++/lib/Statistic.cpp +++ b/ImageMagick-7.1.1-16/Magick++/lib/Statistic.cpp @@ -139,7 +139,7 @@ Magick::ChannelPerceptualHash::ChannelPerceptualHash( _srgbHuPhash(7), _hclpHuPhash(7) { - ssize_t + size_t i; if (hash_.length() != 70) @@ -175,7 +175,7 @@ Magick::ChannelPerceptualHash::operator std::string() const std::string hash; - ssize_t + size_t i; if (!isValid()) @@ -230,7 +230,7 @@ double Magick::ChannelPerceptualHash::sumSquaredDifferences( double ssd; - ssize_t + size_t i; ssd=0.0; @@ -267,7 +267,7 @@ Magick::ChannelPerceptualHash::ChannelPerceptualHash( _srgbHuPhash(7), _hclpHuPhash(7) { - ssize_t + size_t i; for (i=0; i<7; i++) @@ -552,7 +552,7 @@ double Magick::ImagePerceptualHash::sumSquaredDifferences( double ssd; - ssize_t + size_t i; if (!isValid()) diff --git a/ImageMagick-7.1.1-15/Magick++/lib/Thread.cpp b/ImageMagick-7.1.1-16/Magick++/lib/Thread.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/Thread.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/Thread.cpp diff --git a/ImageMagick-7.1.1-15/Magick++/lib/TypeMetric.cpp b/ImageMagick-7.1.1-16/Magick++/lib/TypeMetric.cpp similarity index 100% rename from ImageMagick-7.1.1-15/Magick++/lib/TypeMetric.cpp rename to ImageMagick-7.1.1-16/Magick++/lib/TypeMetric.cpp diff --git a/ImageMagick-7.1.1-15/MagickCore/MagickCore.h b/ImageMagick-7.1.1-16/MagickCore/MagickCore.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/MagickCore.h rename to ImageMagick-7.1.1-16/MagickCore/MagickCore.h diff --git a/ImageMagick-7.1.1-15/MagickCore/accelerate-kernels-private.h b/ImageMagick-7.1.1-16/MagickCore/accelerate-kernels-private.h similarity index 90% rename from ImageMagick-7.1.1-15/MagickCore/accelerate-kernels-private.h rename to ImageMagick-7.1.1-16/MagickCore/accelerate-kernels-private.h index b47d0ff1..564f024b 100644 --- a/ImageMagick-7.1.1-15/MagickCore/accelerate-kernels-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/accelerate-kernels-private.h @@ -50,6 +50,7 @@ const char *accelerateKernels = OPENCL_DEFINE(TauGaussian, (attenuate*0.078125f)) OPENCL_DEFINE(MagickMax(x,y), (((x) > (y)) ? (x) : (y))) OPENCL_DEFINE(MagickMin(x,y), (((x) < (y)) ? (x) : (y))) + OPENCL_DEFINE(QuantumScale, (1.0/QuantumRange)) /* Typedef declarations. @@ -254,7 +255,7 @@ const char *accelerateKernels = WriteMaskChannel = 0x0080, /* Pixel is Write Protected? */ MetaChannel = 0x0100, /* ???? */ CompositeChannels = 0x001F, - AllChannels = 0x7ffffff, + AllChannels = 0x7ffffff, /* 0x7FFFFFFFFFFFFFFF for 64-bit channel masks */ /* Special purpose channel types. FUTURE: are these needed any more - they are more like hacks @@ -820,60 +821,6 @@ OPENCL_ENDIF() } return noise; } - - __kernel - void AddNoise(const __global CLQuantum *image, - const unsigned int number_channels,const ChannelType channel, - const unsigned int length,const unsigned int pixelsPerWorkItem, - const NoiseType noise_type,const float attenuate,const unsigned int seed0, - const unsigned int seed1,const unsigned int numRandomNumbersPerPixel, - __global CLQuantum *filteredImage) - { - mwc64x_state_t rng; - rng.seed0 = seed0; - rng.seed1 = seed1; - - uint span = pixelsPerWorkItem * numRandomNumbersPerPixel; // length of RNG substream each workitem will use - uint offset = span * get_local_size(0) * get_group_id(0); // offset of this workgroup's RNG substream (in master stream); - MWC64X_SeedStreams(&rng, offset, span); // Seed the RNG streams - - uint pos = get_group_id(0) * get_local_size(0) * pixelsPerWorkItem * number_channels + (get_local_id(0) * number_channels); - uint count = pixelsPerWorkItem; - - while (count > 0 && pos < length) - { - const __global CLQuantum *p = image + pos; - __global CLQuantum *q = filteredImage + pos; - - float red; - float green; - float blue; - float alpha; - - ReadChannels(p, number_channels, channel, &red, &green, &blue, &alpha); - - if ((channel & RedChannel) != 0) - red=mwcGenerateDifferentialNoise(&rng,red,noise_type,attenuate); - - if (number_channels > 2) - { - if ((channel & GreenChannel) != 0) - green=mwcGenerateDifferentialNoise(&rng,green,noise_type,attenuate); - - if ((channel & BlueChannel) != 0) - blue=mwcGenerateDifferentialNoise(&rng,blue,noise_type,attenuate); - } - - if (((number_channels == 4) || (number_channels == 2)) && - ((channel & AlphaChannel) != 0)) - alpha=mwcGenerateDifferentialNoise(&rng,alpha,noise_type,attenuate); - - WriteChannels(q, number_channels, channel, red, green, blue, alpha); - - pos += (get_local_size(0) * number_channels); - count--; - } - } ) /* @@ -1230,231 +1177,6 @@ OPENCL_ENDIF() } ) - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% C o n v o l v e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*/ - - STRINGIFY( - __kernel - void ConvolveOptimized(const __global CLPixelType *input, __global CLPixelType *output, - const unsigned int imageWidth, const unsigned int imageHeight, - __constant float *filter, const unsigned int filterWidth, const unsigned int filterHeight, - const uint matte, const ChannelType channel, __local CLPixelType *pixelLocalCache, __local float* filterCache) { - - int2 blockID; - blockID.x = get_global_id(0) / get_local_size(0); - blockID.y = get_global_id(1) / get_local_size(1); - - // image area processed by this workgroup - int2 imageAreaOrg; - imageAreaOrg.x = blockID.x * get_local_size(0); - imageAreaOrg.y = blockID.y * get_local_size(1); - - int2 midFilterDimen; - midFilterDimen.x = (filterWidth-1)/2; - midFilterDimen.y = (filterHeight-1)/2; - - int2 cachedAreaOrg = imageAreaOrg - midFilterDimen; - - // dimension of the local cache - int2 cachedAreaDimen; - cachedAreaDimen.x = get_local_size(0) + filterWidth - 1; - cachedAreaDimen.y = get_local_size(1) + filterHeight - 1; - - // cache the pixels accessed by this workgroup in local memory - int localID = get_local_id(1)*get_local_size(0)+get_local_id(0); - int cachedAreaNumPixels = cachedAreaDimen.x * cachedAreaDimen.y; - int groupSize = get_local_size(0) * get_local_size(1); - for (int i = localID; i < cachedAreaNumPixels; i+=groupSize) { - - int2 cachedAreaIndex; - cachedAreaIndex.x = i % cachedAreaDimen.x; - cachedAreaIndex.y = i / cachedAreaDimen.x; - - int2 imagePixelIndex; - imagePixelIndex = cachedAreaOrg + cachedAreaIndex; - - // only support EdgeVirtualPixelMethod through ClampToCanvas - // TODO: implement other virtual pixel method - imagePixelIndex.x = ClampToCanvas(imagePixelIndex.x, imageWidth); - imagePixelIndex.y = ClampToCanvas(imagePixelIndex.y, imageHeight); - - pixelLocalCache[i] = input[imagePixelIndex.y * imageWidth + imagePixelIndex.x]; - } - - // cache the filter - for (int i = localID; i < filterHeight*filterWidth; i+=groupSize) { - filterCache[i] = filter[i]; - } - barrier(CLK_LOCAL_MEM_FENCE); - - - int2 imageIndex; - imageIndex.x = imageAreaOrg.x + get_local_id(0); - imageIndex.y = imageAreaOrg.y + get_local_id(1); - - // if out-of-range, stops here and quit - if (imageIndex.x >= imageWidth - || imageIndex.y >= imageHeight) { - return; - } - - int filterIndex = 0; - float4 sum = (float4)0.0f; - float gamma = 0.0f; - if (((channel & AlphaChannel) == 0) || (matte == 0)) { - int cacheIndexY = get_local_id(1); - for (int j = 0; j < filterHeight; j++) { - int cacheIndexX = get_local_id(0); - for (int i = 0; i < filterWidth; i++) { - CLPixelType p = pixelLocalCache[cacheIndexY*cachedAreaDimen.x + cacheIndexX]; - float f = filterCache[filterIndex]; - - sum.x += f * p.x; - sum.y += f * p.y; - sum.z += f * p.z; - sum.w += f * p.w; - - gamma += f; - filterIndex++; - cacheIndexX++; - } - cacheIndexY++; - } - } - else { - int cacheIndexY = get_local_id(1); - for (int j = 0; j < filterHeight; j++) { - int cacheIndexX = get_local_id(0); - for (int i = 0; i < filterWidth; i++) { - - CLPixelType p = pixelLocalCache[cacheIndexY*cachedAreaDimen.x + cacheIndexX]; - float alpha = QuantumScale*p.w; - float f = filterCache[filterIndex]; - float g = alpha * f; - - sum.x += g*p.x; - sum.y += g*p.y; - sum.z += g*p.z; - sum.w += f*p.w; - - gamma += g; - filterIndex++; - cacheIndexX++; - } - cacheIndexY++; - } - gamma = PerceptibleReciprocal(gamma); - sum.xyz = gamma*sum.xyz; - } - CLPixelType outputPixel; - outputPixel.x = ClampToQuantum(sum.x); - outputPixel.y = ClampToQuantum(sum.y); - outputPixel.z = ClampToQuantum(sum.z); - outputPixel.w = ((channel & AlphaChannel)!=0)?ClampToQuantum(sum.w):input[imageIndex.y * imageWidth + imageIndex.x].w; - - output[imageIndex.y * imageWidth + imageIndex.x] = outputPixel; - } - ) - - STRINGIFY( - __kernel - void Convolve(const __global CLPixelType *input, __global CLPixelType *output, - const uint imageWidth, const uint imageHeight, - __constant float *filter, const unsigned int filterWidth, const unsigned int filterHeight, - const uint matte, const ChannelType channel) { - - int2 imageIndex; - imageIndex.x = get_global_id(0); - imageIndex.y = get_global_id(1); - - /* - unsigned int imageWidth = get_global_size(0); - unsigned int imageHeight = get_global_size(1); - */ - if (imageIndex.x >= imageWidth - || imageIndex.y >= imageHeight) - return; - - int2 midFilterDimen; - midFilterDimen.x = (filterWidth-1)/2; - midFilterDimen.y = (filterHeight-1)/2; - - int filterIndex = 0; - float4 sum = (float4)0.0f; - float gamma = 0.0f; - if (((channel & AlphaChannel) == 0) || (matte == 0)) { - for (int j = 0; j < filterHeight; j++) { - int2 inputPixelIndex; - inputPixelIndex.y = imageIndex.y - midFilterDimen.y + j; - inputPixelIndex.y = ClampToCanvas(inputPixelIndex.y, imageHeight); - for (int i = 0; i < filterWidth; i++) { - inputPixelIndex.x = imageIndex.x - midFilterDimen.x + i; - inputPixelIndex.x = ClampToCanvas(inputPixelIndex.x, imageWidth); - - CLPixelType p = input[inputPixelIndex.y * imageWidth + inputPixelIndex.x]; - float f = filter[filterIndex]; - - sum.x += f * p.x; - sum.y += f * p.y; - sum.z += f * p.z; - sum.w += f * p.w; - - gamma += f; - - filterIndex++; - } - } - } - else { - - for (int j = 0; j < filterHeight; j++) { - int2 inputPixelIndex; - inputPixelIndex.y = imageIndex.y - midFilterDimen.y + j; - inputPixelIndex.y = ClampToCanvas(inputPixelIndex.y, imageHeight); - for (int i = 0; i < filterWidth; i++) { - inputPixelIndex.x = imageIndex.x - midFilterDimen.x + i; - inputPixelIndex.x = ClampToCanvas(inputPixelIndex.x, imageWidth); - - CLPixelType p = input[inputPixelIndex.y * imageWidth + inputPixelIndex.x]; - float alpha = QuantumScale*p.w; - float f = filter[filterIndex]; - float g = alpha * f; - - sum.x += g*p.x; - sum.y += g*p.y; - sum.z += g*p.z; - sum.w += f*p.w; - - gamma += g; - - - filterIndex++; - } - } - gamma = PerceptibleReciprocal(gamma); - sum.xyz = gamma*sum.xyz; - } - - CLPixelType outputPixel; - outputPixel.x = ClampToQuantum(sum.x); - outputPixel.y = ClampToQuantum(sum.y); - outputPixel.z = ClampToQuantum(sum.z); - outputPixel.w = ((channel & AlphaChannel)!=0)?ClampToQuantum(sum.w):input[imageIndex.y * imageWidth + imageIndex.x].w; - - output[imageIndex.y * imageWidth + imageIndex.x] = outputPixel; - } - ) - /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -2035,6 +1757,7 @@ OPENCL_ENDIF() switch ((int) floor(h) % 6) { case 0: + default: { r=tmin+c; g=tmin+x; @@ -2076,12 +1799,6 @@ OPENCL_ENDIF() b=tmin+x; break; } - default: - { - r=0.0; - g=0.0; - b=0.0; - } } *red=ClampToQuantum(QuantumRange*r); *green=ClampToQuantum(QuantumRange*g); @@ -3013,6 +2730,18 @@ OPENCL_ENDIF() } ) +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% W a v e l e t D e n o i s e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +*/ + STRINGIFY( __kernel __attribute__((reqd_work_group_size(64, 4, 1))) void WaveletDenoise(__global CLQuantum *srcImage,__global CLQuantum *dstImage, diff --git a/ImageMagick-7.1.1-15/MagickCore/accelerate-private.h b/ImageMagick-7.1.1-16/MagickCore/accelerate-private.h similarity index 93% rename from ImageMagick-7.1.1-15/MagickCore/accelerate-private.h rename to ImageMagick-7.1.1-16/MagickCore/accelerate-private.h index a676eca2..2eebe8b0 100644 --- a/ImageMagick-7.1.1-15/MagickCore/accelerate-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/accelerate-private.h @@ -19,11 +19,13 @@ #ifndef MAGICKCORE_ACCELERATE_PRIVATE_H #define MAGICKCORE_ACCELERATE_PRIVATE_H +#if defined(MAGICKCORE_OPENCL_SUPPORT) #include "MagickCore/morphology.h" #include "MagickCore/resample.h" #include "MagickCore/resize.h" #include "MagickCore/statistic.h" #include "MagickCore/visual-effects.h" +#endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { @@ -32,10 +34,7 @@ extern "C" { #if defined(MAGICKCORE_OPENCL_SUPPORT) extern MagickPrivate Image - *AccelerateAddNoiseImage(const Image*,const NoiseType,const double attenuate, - ExceptionInfo *), *AccelerateBlurImage(const Image *,const double,const double,ExceptionInfo *), - *AccelerateConvolveImage(const Image *,const KernelInfo *,ExceptionInfo *), *AccelerateDespeckleImage(const Image *,ExceptionInfo *), *AccelerateLocalContrastImage(const Image *,const double,const double, ExceptionInfo *), diff --git a/ImageMagick-7.1.1-15/MagickCore/accelerate.c b/ImageMagick-7.1.1-16/MagickCore/accelerate.c similarity index 87% rename from ImageMagick-7.1.1-15/MagickCore/accelerate.c rename to ImageMagick-7.1.1-16/MagickCore/accelerate.c index d971de8d..7c7d778b 100644 --- a/ImageMagick-7.1.1-15/MagickCore/accelerate.c +++ b/ImageMagick-7.1.1-16/MagickCore/accelerate.c @@ -43,7 +43,6 @@ Include declarations. */ #include "MagickCore/studio.h" #include "MagickCore/accelerate-private.h" -#include "MagickCore/accelerate-kernels-private.h" #include "MagickCore/artifact.h" #include "MagickCore/cache.h" #include "MagickCore/cache-private.h" @@ -135,6 +134,11 @@ static MagickBooleanType checkAccelerateCondition(const Image* image) if (image->number_channels > 4) return(MagickFalse); + /* check if */ + if ((image->channel_mask != AllChannels) && + (image->channel_mask > 0x7ffffff)) + return(MagickFalse); + /* check if pixel order is R */ if (GetPixelChannelOffset(image,RedPixelChannel) != 0) return(MagickFalse); @@ -308,6 +312,15 @@ static cl_mem createKernelInfo(MagickCLDevice device,const double radius, return(imageKernelBuffer); } +static cl_int get32BitChannelValue(const ChannelType channel) +{ +#if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT) + if (channel == AllChannels) + return(0x7ffffff); +#endif + return((cl_int) channel); +} + static MagickBooleanType LaunchHistogramKernel(MagickCLEnv clEnv, MagickCLDevice device,cl_command_queue queue,cl_mem imageBuffer, cl_mem histogramBuffer,Image *image,const ChannelType channel, @@ -317,6 +330,7 @@ static MagickBooleanType LaunchHistogramKernel(MagickCLEnv clEnv, outputReady; cl_int + channel_mask=get32BitChannelValue(channel), clStatus; cl_kernel @@ -352,7 +366,7 @@ static MagickBooleanType LaunchHistogramKernel(MagickCLEnv clEnv, /* set the kernel arguments */ i = 0; clStatus=clEnv->library->clSetKernelArg(histogramKernel,i++,sizeof(cl_mem),(void *)&imageBuffer); - clStatus|=clEnv->library->clSetKernelArg(histogramKernel,i++,sizeof(ChannelType),&channel); + clStatus|=clEnv->library->clSetKernelArg(histogramKernel,i++,sizeof(cl_int),&channel_mask); clStatus|=clEnv->library->clSetKernelArg(histogramKernel,i++,sizeof(cl_uint),&colorspace); clStatus|=clEnv->library->clSetKernelArg(histogramKernel,i++,sizeof(cl_uint),&method); clStatus|=clEnv->library->clSetKernelArg(histogramKernel,i++,sizeof(cl_mem),(void *)&histogramBuffer); @@ -385,216 +399,6 @@ static MagickBooleanType LaunchHistogramKernel(MagickCLEnv clEnv, return(outputReady); } -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% A c c e l e r a t e A d d N o i s e I m a g e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*/ - -static Image *ComputeAddNoiseImage(const Image *image,MagickCLEnv clEnv, - const NoiseType noise_type,const double attenuate,ExceptionInfo *exception) -{ - cl_command_queue - queue; - - cl_float - cl_attenuate; - - cl_int - status; - - cl_kernel - addNoiseKernel; - - cl_mem - filteredImageBuffer, - imageBuffer; - - cl_uint - bufferLength, - inputPixelCount, - number_channels, - numRandomNumberPerPixel, - pixelsPerWorkitem, - seed0, - seed1, - workItemCount; - - const unsigned long - *s; - - MagickBooleanType - outputReady; - - MagickCLDevice - device; - - Image - *filteredImage; - - RandomInfo - *randomInfo; - - size_t - gsize[1], - i, - lsize[1], - numRandPerChannel; - - filteredImage=NULL; - imageBuffer=NULL; - filteredImageBuffer=NULL; - addNoiseKernel=NULL; - outputReady=MagickFalse; - - device=RequestOpenCLDevice(clEnv); - queue=AcquireOpenCLCommandQueue(device); - if (queue == (cl_command_queue) NULL) - goto cleanup; - filteredImage=cloneImage(image,exception); - if (filteredImage == (Image *) NULL) - goto cleanup; - if (filteredImage->number_channels != image->number_channels) - goto cleanup; - imageBuffer=GetAuthenticOpenCLBuffer(image,device,exception); - if (imageBuffer == (cl_mem) NULL) - goto cleanup; - filteredImageBuffer=GetAuthenticOpenCLBuffer(filteredImage,device,exception); - if (filteredImageBuffer == (cl_mem) NULL) - goto cleanup; - - /* find out how many random numbers needed by pixel */ - numRandPerChannel=0; - numRandomNumberPerPixel=0; - switch (noise_type) - { - case UniformNoise: - case ImpulseNoise: - case LaplacianNoise: - case RandomNoise: - default: - numRandPerChannel=1; - break; - case GaussianNoise: - case MultiplicativeGaussianNoise: - case PoissonNoise: - numRandPerChannel=2; - break; - }; - if (GetPixelRedTraits(image) != UndefinedPixelTrait) - numRandomNumberPerPixel+=(cl_uint) numRandPerChannel; - if (GetPixelGreenTraits(image) != UndefinedPixelTrait) - numRandomNumberPerPixel+=(cl_uint) numRandPerChannel; - if (GetPixelBlueTraits(image) != UndefinedPixelTrait) - numRandomNumberPerPixel+=(cl_uint) numRandPerChannel; - if (GetPixelAlphaTraits(image) != UndefinedPixelTrait) - numRandomNumberPerPixel+=(cl_uint) numRandPerChannel; - - addNoiseKernel=AcquireOpenCLKernel(device,"AddNoise"); - if (addNoiseKernel == (cl_kernel) NULL) - { - (void)OpenCLThrowMagickException(device,exception,GetMagickModule(), - ResourceLimitWarning,"AcquireOpenCLKernel failed.","."); - goto cleanup; - } - - /* 256 work items per group, 2 groups per CU */ - workItemCount=device->max_compute_units*2*256; - inputPixelCount=(cl_int) (image->columns*image->rows); - pixelsPerWorkitem=(inputPixelCount+workItemCount-1)/workItemCount; - pixelsPerWorkitem=((pixelsPerWorkitem+3)/4)*4; - lsize[0]=256; - gsize[0]=workItemCount; - - randomInfo=AcquireRandomInfo(); - s=GetRandomInfoSeed(randomInfo); - seed0=s[0]; - (void) GetPseudoRandomValue(randomInfo); - seed1=s[0]; - randomInfo=DestroyRandomInfo(randomInfo); - - number_channels=(cl_uint) image->number_channels; - bufferLength=(cl_uint) (image->columns*image->rows*image->number_channels); - cl_attenuate=(cl_float) attenuate; - - i=0; - status =SetOpenCLKernelArg(addNoiseKernel,i++,sizeof(cl_mem),(void *)&imageBuffer); - status|=SetOpenCLKernelArg(addNoiseKernel,i++,sizeof(cl_uint),(void *)&number_channels); - status|=SetOpenCLKernelArg(addNoiseKernel,i++,sizeof(ChannelType),(void *)&image->channel_mask); - status|=SetOpenCLKernelArg(addNoiseKernel,i++,sizeof(cl_uint),(void *)&bufferLength); - status|=SetOpenCLKernelArg(addNoiseKernel,i++,sizeof(cl_uint),(void *)&pixelsPerWorkitem); - status|=SetOpenCLKernelArg(addNoiseKernel,i++,sizeof(NoiseType),(void *)&noise_type); - status|=SetOpenCLKernelArg(addNoiseKernel,i++,sizeof(cl_float),(void *)&cl_attenuate); - status|=SetOpenCLKernelArg(addNoiseKernel,i++,sizeof(cl_uint),(void *)&seed0); - status|=SetOpenCLKernelArg(addNoiseKernel,i++,sizeof(cl_uint),(void *)&seed1); - status|=SetOpenCLKernelArg(addNoiseKernel,i++,sizeof(cl_uint),(void *)&numRandomNumberPerPixel); - status|=SetOpenCLKernelArg(addNoiseKernel,i++,sizeof(cl_mem),(void *)&filteredImageBuffer); - if (status != CL_SUCCESS) - { - (void) OpenCLThrowMagickException(device,exception,GetMagickModule(), - ResourceLimitWarning,"clSetKernelArg failed.","."); - goto cleanup; - } - - outputReady=EnqueueOpenCLKernel(queue,addNoiseKernel,1,(const size_t *) NULL,gsize, - lsize,image,filteredImage,MagickFalse,exception); - -cleanup: - - if (imageBuffer != (cl_mem) NULL) - ReleaseOpenCLMemObject(imageBuffer); - if (filteredImageBuffer != (cl_mem) NULL) - ReleaseOpenCLMemObject(filteredImageBuffer); - if (addNoiseKernel != (cl_kernel) NULL) - ReleaseOpenCLKernel(addNoiseKernel); - if (queue != (cl_command_queue) NULL) - ReleaseOpenCLCommandQueue(device,queue); - if (device != (MagickCLDevice) NULL) - ReleaseOpenCLDevice(device); - if ((outputReady == MagickFalse) && (filteredImage != (Image *) NULL)) - filteredImage=DestroyImage(filteredImage); - - return(filteredImage); -} - -MagickPrivate Image *AccelerateAddNoiseImage(const Image *image, - const NoiseType noise_type,const double attenuate,ExceptionInfo *exception) -{ - /* Temporary disabled because of repetition. - - Image - *filteredImage; - - MagickCLEnv - clEnv; - - assert(image != NULL); - assert(exception != (ExceptionInfo *) NULL); - - if (checkAccelerateCondition(image) == MagickFalse) - return((Image *) NULL); - - clEnv=getOpenCLEnvironment(exception); - if (clEnv == (MagickCLEnv) NULL) - return((Image *) NULL); - - filteredImage=ComputeAddNoiseImage(image,clEnv,noise_type,attenuate, - exception); - return(filteredImage); - */ - magick_unreferenced(image); - magick_unreferenced(noise_type); - magick_unreferenced(attenuate); - magick_unreferenced(exception); - return((Image *)NULL); -} - /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -614,6 +418,7 @@ static Image *ComputeBlurImage(const Image* image,MagickCLEnv clEnv, queue; cl_int + channel_mask=get32BitChannelValue(image->channel_mask), status; cl_kernel @@ -704,7 +509,7 @@ static Image *ComputeBlurImage(const Image* image,MagickCLEnv clEnv, i=0; status =SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_mem),(void *)&imageBuffer); status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_uint),&number_channels); - status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(ChannelType),&image->channel_mask); + status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_int),&channel_mask); status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_mem),(void *)&imageKernelBuffer); status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_uint),(void *)&kernelWidth); status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_uint),(void *)&imageColumns); @@ -739,7 +544,7 @@ static Image *ComputeBlurImage(const Image* image,MagickCLEnv clEnv, i=0; status =SetOpenCLKernelArg(blurColumnKernel,i++,sizeof(cl_mem),(void *)&tempImageBuffer); status|=SetOpenCLKernelArg(blurColumnKernel,i++,sizeof(cl_uint),&number_channels); - status|=SetOpenCLKernelArg(blurColumnKernel,i++,sizeof(ChannelType),&image->channel_mask); + status|=SetOpenCLKernelArg(blurColumnKernel,i++,sizeof(cl_int),&channel_mask); status|=SetOpenCLKernelArg(blurColumnKernel,i++,sizeof(cl_mem),(void *)&imageKernelBuffer); status|=SetOpenCLKernelArg(blurColumnKernel,i++,sizeof(cl_uint),(void *)&kernelWidth); status|=SetOpenCLKernelArg(blurColumnKernel,i++,sizeof(cl_uint),(void *)&imageColumns); @@ -959,6 +764,7 @@ static MagickBooleanType ComputeContrastStretchImage(Image *image, queue; cl_int + channel_mask=get32BitChannelValue(image->channel_mask), clStatus; cl_mem_flags @@ -1401,7 +1207,7 @@ static MagickBooleanType ComputeContrastStretchImage(Image *image, /* set the kernel arguments */ i = 0; clStatus=clEnv->library->clSetKernelArg(stretchKernel,i++,sizeof(cl_mem),(void *)&imageBuffer); - clStatus|=clEnv->library->clSetKernelArg(stretchKernel,i++,sizeof(ChannelType),&image->channel_mask); + clStatus|=clEnv->library->clSetKernelArg(stretchKernel,i++,sizeof(cl_int),&channel_mask); clStatus|=clEnv->library->clSetKernelArg(stretchKernel,i++,sizeof(cl_mem),(void *)&stretchMapBuffer); clStatus|=clEnv->library->clSetKernelArg(stretchKernel,i++,sizeof(cl_float4),&white); clStatus|=clEnv->library->clSetKernelArg(stretchKernel,i++,sizeof(cl_float4),&black); @@ -1498,366 +1304,6 @@ MagickPrivate MagickBooleanType AccelerateContrastStretchImage( return(status); } -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% A c c e l e r a t e C o n v o l v e I m a g e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*/ - -static Image *ComputeConvolveImage(const Image* image,MagickCLEnv clEnv, - const KernelInfo *kernel,ExceptionInfo *exception) -{ - CacheView - *filteredImage_view, - *image_view; - - cl_command_queue - queue; - - cl_event - event; - - cl_kernel - clkernel; - - cl_int - clStatus; - - cl_mem - convolutionKernel, - filteredImageBuffer, - imageBuffer; - - cl_mem_flags - mem_flags; - - const void - *inputPixels; - - float - *kernelBufferPtr; - - Image - *filteredImage; - - MagickBooleanType - outputReady; - - MagickCLDevice - device; - - MagickSizeType - length; - - size_t - global_work_size[3], - localGroupSize[3], - localMemoryRequirement; - - unsigned - kernelSize; - - unsigned int - filterHeight, - filterWidth, - i, - imageHeight, - imageWidth, - matte; - - void - *filteredPixels, - *hostPtr; - - /* initialize all CL objects to NULL */ - imageBuffer = NULL; - filteredImageBuffer = NULL; - convolutionKernel = NULL; - clkernel = NULL; - queue = NULL; - - filteredImage = NULL; - filteredImage_view = NULL; - outputReady = MagickFalse; - - device = RequestOpenCLDevice(clEnv); - - image_view=AcquireAuthenticCacheView(image,exception); - inputPixels=GetCacheViewAuthenticPixels(image_view,0,0,image->columns,image->rows,exception); - if (inputPixels == (const void *) NULL) - { - (void) OpenCLThrowMagickException(device,exception,GetMagickModule(),CacheWarning,"UnableToReadPixelCache.","`%s'",image->filename); - goto cleanup; - } - - /* Create and initialize OpenCL buffers. */ - - /* If the host pointer is aligned to the size of CLPixelPacket, - then use the host buffer directly from the GPU; otherwise, - create a buffer on the GPU and copy the data over */ - if (ALIGNED(inputPixels,CLPixelPacket)) - { - mem_flags = CL_MEM_READ_ONLY|CL_MEM_USE_HOST_PTR; - } - else - { - mem_flags = CL_MEM_READ_ONLY|CL_MEM_COPY_HOST_PTR; - } - /* create a CL buffer from image pixel buffer */ - length = image->columns * image->rows; - imageBuffer = clEnv->library->clCreateBuffer(device->context, mem_flags, length * sizeof(CLPixelPacket), (void*)inputPixels, &clStatus); - if (clStatus != CL_SUCCESS) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clCreateBuffer failed.","."); - goto cleanup; - } - - filteredImage = CloneImage(image,0,0,MagickTrue,exception); - assert(filteredImage != NULL); - if (SetImageStorageClass(filteredImage,DirectClass,exception) != MagickTrue) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "CloneImage failed.", "."); - goto cleanup; - } - filteredImage_view=AcquireAuthenticCacheView(filteredImage,exception); - filteredPixels=GetCacheViewAuthenticPixels(filteredImage_view,0,0,filteredImage->columns,filteredImage->rows,exception); - if (filteredPixels == (void *) NULL) - { - (void) OpenCLThrowMagickException(device,exception,GetMagickModule(),CacheWarning, "UnableToReadPixelCache.","`%s'",filteredImage->filename); - goto cleanup; - } - - if (ALIGNED(filteredPixels,CLPixelPacket)) - { - mem_flags = CL_MEM_WRITE_ONLY|CL_MEM_USE_HOST_PTR; - hostPtr = filteredPixels; - } - else - { - mem_flags = CL_MEM_WRITE_ONLY; - hostPtr = NULL; - } - /* create a CL buffer from image pixel buffer */ - length = image->columns * image->rows; - filteredImageBuffer = clEnv->library->clCreateBuffer(device->context, mem_flags, length * sizeof(CLPixelPacket), hostPtr, &clStatus); - if (clStatus != CL_SUCCESS) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clCreateBuffer failed.","."); - goto cleanup; - } - - kernelSize = (unsigned int) (kernel->width * kernel->height); - convolutionKernel = clEnv->library->clCreateBuffer(device->context, CL_MEM_READ_ONLY|CL_MEM_ALLOC_HOST_PTR, kernelSize * sizeof(float), NULL, &clStatus); - if (clStatus != CL_SUCCESS) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clCreateBuffer failed.","."); - goto cleanup; - } - - queue = AcquireOpenCLCommandQueue(device); - - kernelBufferPtr = (float*)clEnv->library->clEnqueueMapBuffer(queue, convolutionKernel, CL_TRUE, CL_MAP_WRITE, 0, kernelSize * sizeof(float) - , 0, NULL, NULL, &clStatus); - if (clStatus != CL_SUCCESS) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clEnqueueMapBuffer failed.","."); - goto cleanup; - } - for (i = 0; i < kernelSize; i++) - { - kernelBufferPtr[i] = (float) kernel->values[i]; - } - clStatus = clEnv->library->clEnqueueUnmapMemObject(queue, convolutionKernel, kernelBufferPtr, 0, NULL, NULL); - if (clStatus != CL_SUCCESS) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clEnqueueUnmapMemObject failed.", "."); - goto cleanup; - } - - /* Compute the local memory requirement for a 16x16 workgroup. - If it's larger than 16k, reduce the workgroup size to 8x8 */ - localGroupSize[0] = 16; - localGroupSize[1] = 16; - localMemoryRequirement = (localGroupSize[0]+kernel->width-1) * (localGroupSize[1]+kernel->height-1) * sizeof(CLPixelPacket) - + kernel->width*kernel->height*sizeof(float); - - if (localMemoryRequirement > device->local_memory_size) - { - localGroupSize[0] = 8; - localGroupSize[1] = 8; - localMemoryRequirement = (localGroupSize[0]+kernel->width-1) * (localGroupSize[1]+kernel->height-1) * sizeof(CLPixelPacket) - + kernel->width*kernel->height*sizeof(float); - } - if (localMemoryRequirement <= device->local_memory_size) - { - /* get the OpenCL kernel */ - clkernel = AcquireOpenCLKernel(device,"ConvolveOptimized"); - if (clkernel == NULL) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "AcquireOpenCLKernel failed.", "."); - goto cleanup; - } - - /* set the kernel arguments */ - i = 0; - clStatus =clEnv->library->clSetKernelArg(clkernel,i++,sizeof(cl_mem),(void *)&imageBuffer); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(cl_mem),(void *)&filteredImageBuffer); - imageWidth = (unsigned int) image->columns; - imageHeight = (unsigned int) image->rows; - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&imageWidth); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&imageHeight); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(cl_mem),(void *)&convolutionKernel); - filterWidth = (unsigned int) kernel->width; - filterHeight = (unsigned int) kernel->height; - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterWidth); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterHeight); - matte = (image->alpha_trait > CopyPixelTrait)?1:0; - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&matte); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(ChannelType),(void *)&image->channel_mask); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++, (localGroupSize[0] + kernel->width-1)*(localGroupSize[1] + kernel->height-1)*sizeof(CLPixelPacket),NULL); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++, kernel->width*kernel->height*sizeof(float),NULL); - if (clStatus != CL_SUCCESS) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clSetKernelArg failed.", "."); - goto cleanup; - } - - /* pad the global size to a multiple of the local work size dimension */ - global_work_size[0] = ((image->columns + localGroupSize[0] - 1)/localGroupSize[0] ) * localGroupSize[0] ; - global_work_size[1] = ((image->rows + localGroupSize[1] - 1)/localGroupSize[1]) * localGroupSize[1]; - - /* launch the kernel */ - clStatus = clEnv->library->clEnqueueNDRangeKernel(queue, clkernel, 2, NULL, global_work_size, localGroupSize, 0, NULL, &event); - if (clStatus != CL_SUCCESS) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clEnqueueNDRangeKernel failed.", "."); - goto cleanup; - } - RecordProfileData(device,clkernel,event); - } - else - { - /* get the OpenCL kernel */ - clkernel = AcquireOpenCLKernel(device,"Convolve"); - if (clkernel == NULL) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "AcquireOpenCLKernel failed.", "."); - goto cleanup; - } - - /* set the kernel arguments */ - i = 0; - clStatus =clEnv->library->clSetKernelArg(clkernel,i++,sizeof(cl_mem),(void *)&imageBuffer); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(cl_mem),(void *)&filteredImageBuffer); - imageWidth = (unsigned int) image->columns; - imageHeight = (unsigned int) image->rows; - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&imageWidth); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&imageHeight); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(cl_mem),(void *)&convolutionKernel); - filterWidth = (unsigned int) kernel->width; - filterHeight = (unsigned int) kernel->height; - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterWidth); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterHeight); - matte = (image->alpha_trait > CopyPixelTrait)?1:0; - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&matte); - clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(ChannelType),(void *)&image->channel_mask); - if (clStatus != CL_SUCCESS) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clSetKernelArg failed.", "."); - goto cleanup; - } - - localGroupSize[0] = 8; - localGroupSize[1] = 8; - global_work_size[0] = (image->columns + (localGroupSize[0]-1))/localGroupSize[0] * localGroupSize[0]; - global_work_size[1] = (image->rows + (localGroupSize[1]-1))/localGroupSize[1] * localGroupSize[1]; - clStatus = clEnv->library->clEnqueueNDRangeKernel(queue, clkernel, 2, NULL, global_work_size, localGroupSize, 0, NULL, &event); - - if (clStatus != CL_SUCCESS) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clEnqueueNDRangeKernel failed.", "."); - goto cleanup; - } - } - RecordProfileData(device,clkernel,event); - - if (ALIGNED(filteredPixels,CLPixelPacket)) - { - length = image->columns * image->rows; - clEnv->library->clEnqueueMapBuffer(queue, filteredImageBuffer, CL_TRUE, CL_MAP_READ|CL_MAP_WRITE, 0, length * sizeof(CLPixelPacket), 0, NULL, NULL, &clStatus); - } - else - { - length = image->columns * image->rows; - clStatus = clEnv->library->clEnqueueReadBuffer(queue, filteredImageBuffer, CL_TRUE, 0, length * sizeof(CLPixelPacket), filteredPixels, 0, NULL, NULL); - } - if (clStatus != CL_SUCCESS) - { - (void) OpenCLThrowMagickException(device,exception, GetMagickModule(), ResourceLimitWarning, "Reading output image from CL buffer failed.", "."); - goto cleanup; - } - - outputReady=SyncCacheViewAuthenticPixels(filteredImage_view,exception); - -cleanup: - - image_view=DestroyCacheView(image_view); - if (filteredImage_view != NULL) - filteredImage_view=DestroyCacheView(filteredImage_view); - if (imageBuffer != NULL) - clEnv->library->clReleaseMemObject(imageBuffer); - if (filteredImageBuffer != NULL) - clEnv->library->clReleaseMemObject(filteredImageBuffer); - if (convolutionKernel != NULL) - clEnv->library->clReleaseMemObject(convolutionKernel); - if (clkernel != NULL) - ReleaseOpenCLKernel(clkernel); - if (queue != NULL) - ReleaseOpenCLCommandQueue(device,queue); - if (device != NULL) - ReleaseOpenCLDevice(device); - if (outputReady == MagickFalse) - { - if (filteredImage != NULL) - { - DestroyImage(filteredImage); - filteredImage = NULL; - } - } - - return(filteredImage); -} - -MagickPrivate Image *AccelerateConvolveImage(const Image *image, - const KernelInfo *kernel,ExceptionInfo *exception) -{ - /* Temporary disabled due to access violation - - Image - *filteredImage; - - assert(image != NULL); - assert(kernel != (KernelInfo *) NULL); - assert(exception != (ExceptionInfo *) NULL); - if ((checkAccelerateConditionRGBA(image) == MagickFalse) || - (checkOpenCLEnvironment(exception) == MagickFalse)) - return((Image *) NULL); - - filteredImage=ComputeConvolveImage(image,kernel,exception); - return(filteredImage); - */ - magick_unreferenced(image); - magick_unreferenced(kernel); - magick_unreferenced(exception); - return((Image *)NULL); -} - /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -2281,6 +1727,7 @@ static MagickBooleanType ComputeEqualizeImage(Image *image,MagickCLEnv clEnv, queue; cl_int + channel_mask=get32BitChannelValue(image->channel_mask), clStatus; cl_mem_flags @@ -2610,7 +2057,7 @@ static MagickBooleanType ComputeEqualizeImage(Image *image,MagickCLEnv clEnv, /* set the kernel arguments */ i = 0; clStatus=clEnv->library->clSetKernelArg(equalizeKernel,i++,sizeof(cl_mem),(void *)&imageBuffer); - clStatus|=clEnv->library->clSetKernelArg(equalizeKernel,i++,sizeof(ChannelType),&image->channel_mask); + clStatus|=clEnv->library->clSetKernelArg(equalizeKernel,i++,sizeof(cl_int),&channel_mask); clStatus|=clEnv->library->clSetKernelArg(equalizeKernel,i++,sizeof(cl_mem),(void *)&equalizeMapBuffer); clStatus|=clEnv->library->clSetKernelArg(equalizeKernel,i++,sizeof(cl_float4),&white); clStatus|=clEnv->library->clSetKernelArg(equalizeKernel,i++,sizeof(cl_float4),&black); @@ -2726,6 +2173,7 @@ static MagickBooleanType ComputeFunctionImage(Image *image,MagickCLEnv clEnv, queue; cl_int + channel_mask=get32BitChannelValue(image->channel_mask), status; cl_kernel @@ -2777,7 +2225,7 @@ static MagickBooleanType ComputeFunctionImage(Image *image,MagickCLEnv clEnv, parametersBuffer=CreateOpenCLBuffer(device,CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,number_parameters*sizeof(*parametersBufferPtr), parametersBufferPtr); - parametersBufferPtr=RelinquishMagickMemory(parametersBufferPtr); + parametersBufferPtr=(float *) RelinquishMagickMemory(parametersBufferPtr); if (parametersBuffer == (cl_mem) NULL) { (void) OpenCLThrowMagickException(device,exception,GetMagickModule(), @@ -2799,7 +2247,7 @@ static MagickBooleanType ComputeFunctionImage(Image *image,MagickCLEnv clEnv, i=0; status =SetOpenCLKernelArg(functionKernel,i++,sizeof(cl_mem),(void *)&imageBuffer); status|=SetOpenCLKernelArg(functionKernel,i++,sizeof(cl_uint),(void *)&number_channels); - status|=SetOpenCLKernelArg(functionKernel,i++,sizeof(ChannelType),(void *)&image->channel_mask); + status|=SetOpenCLKernelArg(functionKernel,i++,sizeof(cl_int),&channel_mask); status|=SetOpenCLKernelArg(functionKernel,i++,sizeof(MagickFunction),(void *)&function); status|=SetOpenCLKernelArg(functionKernel,i++,sizeof(cl_uint),(void *)&number_params); status|=SetOpenCLKernelArg(functionKernel,i++,sizeof(cl_mem),(void *)¶metersBuffer); @@ -3584,6 +3032,7 @@ static Image* ComputeMotionBlurImage(const Image *image,MagickCLEnv clEnv, biasPixel; cl_int + channel_mask=get32BitChannelValue(image->channel_mask), clStatus; cl_kernel @@ -3840,7 +3289,7 @@ static Image* ComputeMotionBlurImage(const Image *image,MagickCLEnv clEnv, biasPixel.s[3] = bias.alpha; clStatus|=clEnv->library->clSetKernelArg(motionBlurKernel,i++,sizeof(cl_float4), &biasPixel); - clStatus|=clEnv->library->clSetKernelArg(motionBlurKernel,i++,sizeof(ChannelType), &image->channel_mask); + clStatus|=clEnv->library->clSetKernelArg(motionBlurKernel,i++,sizeof(cl_int),&channel_mask); matte = (image->alpha_trait > CopyPixelTrait)?1:0; clStatus|=clEnv->library->clSetKernelArg(motionBlurKernel,i++,sizeof(unsigned int), &matte); if (clStatus != CL_SUCCESS) @@ -4533,6 +3982,7 @@ static Image* ComputeRotationalBlurImage(const Image *image,MagickCLEnv clEnv, blurCenter; cl_int + channel_mask=get32BitChannelValue(image->channel_mask), status; cl_mem @@ -4601,13 +4051,13 @@ static Image* ComputeRotationalBlurImage(const Image *image,MagickCLEnv clEnv, cossin_theta_size=(unsigned int) fabs(4.0*DegreesToRadians(angle)*sqrt( (double) blurRadius)+2UL); - cosThetaPtr=AcquireQuantumMemory(cossin_theta_size,sizeof(float)); + cosThetaPtr=(float *) AcquireQuantumMemory(cossin_theta_size,sizeof(float)); if (cosThetaPtr == (float *) NULL) goto cleanup; - sinThetaPtr=AcquireQuantumMemory(cossin_theta_size,sizeof(float)); + sinThetaPtr=(float *) AcquireQuantumMemory(cossin_theta_size,sizeof(float)); if (sinThetaPtr == (float *) NULL) { - cosThetaPtr=RelinquishMagickMemory(cosThetaPtr); + cosThetaPtr=(float *) RelinquishMagickMemory(cosThetaPtr); goto cleanup; } @@ -4621,10 +4071,10 @@ static Image* ComputeRotationalBlurImage(const Image *image,MagickCLEnv clEnv, sinThetaBuffer=CreateOpenCLBuffer(device,CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,cossin_theta_size*sizeof(float),sinThetaPtr); - sinThetaPtr=RelinquishMagickMemory(sinThetaPtr); + sinThetaPtr=(float *) RelinquishMagickMemory(sinThetaPtr); cosThetaBuffer=CreateOpenCLBuffer(device,CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,cossin_theta_size*sizeof(float),cosThetaPtr); - cosThetaPtr=RelinquishMagickMemory(cosThetaPtr); + cosThetaPtr=(float *) RelinquishMagickMemory(cosThetaPtr); if ((sinThetaBuffer == (cl_mem) NULL) || (cosThetaBuffer == (cl_mem) NULL)) { (void) OpenCLThrowMagickException(device,exception,GetMagickModule(), @@ -4645,7 +4095,7 @@ static Image* ComputeRotationalBlurImage(const Image *image,MagickCLEnv clEnv, i=0; status =SetOpenCLKernelArg(rotationalBlurKernel,i++,sizeof(cl_mem),(void *)&imageBuffer); status|=SetOpenCLKernelArg(rotationalBlurKernel,i++,sizeof(cl_uint),&number_channels); - status|=SetOpenCLKernelArg(rotationalBlurKernel,i++,sizeof(ChannelType), &image->channel_mask); + status|=SetOpenCLKernelArg(rotationalBlurKernel,i++,sizeof(cl_int),&channel_mask); status|=SetOpenCLKernelArg(rotationalBlurKernel,i++,sizeof(cl_float2), &blurCenter); status|=SetOpenCLKernelArg(rotationalBlurKernel,i++,sizeof(cl_mem),(void *)&cosThetaBuffer); status|=SetOpenCLKernelArg(rotationalBlurKernel,i++,sizeof(cl_mem),(void *)&sinThetaBuffer); @@ -4731,6 +4181,7 @@ static Image *ComputeUnsharpMaskImage(const Image *image,MagickCLEnv clEnv, queue; cl_int + channel_mask=get32BitChannelValue(image->channel_mask), status; cl_kernel @@ -4835,7 +4286,7 @@ static Image *ComputeUnsharpMaskImage(const Image *image,MagickCLEnv clEnv, i=0; status =SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_mem),(void *)&imageBuffer); status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_uint),&number_channels); - status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(ChannelType),&image->channel_mask); + status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_int),&channel_mask); status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_mem),(void *)&imageKernelBuffer); status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_uint),(void *)&kernelWidth); status|=SetOpenCLKernelArg(blurRowKernel,i++,sizeof(cl_uint),(void *)&imageColumns); @@ -4865,7 +4316,7 @@ static Image *ComputeUnsharpMaskImage(const Image *image,MagickCLEnv clEnv, status =SetOpenCLKernelArg(unsharpMaskBlurColumnKernel,i++,sizeof(cl_mem),(void *)&imageBuffer); status|=SetOpenCLKernelArg(unsharpMaskBlurColumnKernel,i++,sizeof(cl_mem),(void *)&tempImageBuffer); status|=SetOpenCLKernelArg(unsharpMaskBlurColumnKernel,i++,sizeof(cl_uint),&number_channels); - status|=SetOpenCLKernelArg(unsharpMaskBlurColumnKernel,i++,sizeof(ChannelType),&image->channel_mask); + status|=SetOpenCLKernelArg(unsharpMaskBlurColumnKernel,i++,sizeof(cl_int),&channel_mask); status|=SetOpenCLKernelArg(unsharpMaskBlurColumnKernel,i++,sizeof(cl_uint),(void *)&imageColumns); status|=SetOpenCLKernelArg(unsharpMaskBlurColumnKernel,i++,sizeof(cl_uint),(void *)&imageRows); status|=SetOpenCLKernelArg(unsharpMaskBlurColumnKernel,i++,(chunkSize+kernelWidth-1)*sizeof(cl_float4),NULL); @@ -4922,6 +4373,7 @@ static Image *ComputeUnsharpMaskImageSingle(const Image *image, queue; cl_int + channel_mask=get32BitChannelValue(image->channel_mask), status; cl_kernel @@ -4997,7 +4449,7 @@ static Image *ComputeUnsharpMaskImageSingle(const Image *image, i=0; status =SetOpenCLKernelArg(unsharpMaskKernel,i++,sizeof(cl_mem),(void *)&imageBuffer); status|=SetOpenCLKernelArg(unsharpMaskKernel,i++,sizeof(cl_uint),(void *)&number_channels); - status|=SetOpenCLKernelArg(unsharpMaskKernel,i++,sizeof(ChannelType),(void *)&image->channel_mask); + status|=SetOpenCLKernelArg(unsharpMaskKernel,i++,sizeof(cl_int),&channel_mask); status|=SetOpenCLKernelArg(unsharpMaskKernel,i++,sizeof(cl_mem),(void *)&imageKernelBuffer); status|=SetOpenCLKernelArg(unsharpMaskKernel,i++,sizeof(cl_uint),(void *)&kernelWidth); status|=SetOpenCLKernelArg(unsharpMaskKernel,i++,sizeof(cl_uint),(void *)&imageColumns); diff --git a/ImageMagick-7.1.1-15/MagickCore/animate-private.h b/ImageMagick-7.1.1-16/MagickCore/animate-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/animate-private.h rename to ImageMagick-7.1.1-16/MagickCore/animate-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/animate.c b/ImageMagick-7.1.1-16/MagickCore/animate.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/animate.c rename to ImageMagick-7.1.1-16/MagickCore/animate.c index 73f6520a..e92ee77b 100644 --- a/ImageMagick-7.1.1-15/MagickCore/animate.c +++ b/ImageMagick-7.1.1-16/MagickCore/animate.c @@ -82,12 +82,12 @@ /* Animate state declarations. */ -#define AutoReverseAnimationState 0x0004 -#define ForwardAnimationState 0x0008 -#define HighlightState 0x0010 -#define PlayAnimationState 0x0020 -#define RepeatAnimationState 0x0040 -#define StepAnimationState 0x0080 +#define AutoReverseAnimationState 0x0004U +#define ForwardAnimationState 0x0008U +#define HighlightState 0x0010U +#define PlayAnimationState 0x0020U +#define RepeatAnimationState 0x0040U +#define StepAnimationState 0x0080U /* Static declarations. @@ -1130,7 +1130,7 @@ MagickExport void XAnimateBackgroundImage(Display *display, window_info.matte_pixmaps[scene]=window_info.matte_pixmap; if (image_list[scene]->alpha_trait) (void) XClearWindow(display,window_info.id); - delay=1000*image_list[scene]->delay/MagickMax( + delay=1000*image_list[scene]->delay/(size_t) MagickMax( image_list[scene]->ticks_per_second,1L); XDelay(display,resources.delay*(delay == 0 ? 10 : delay)); } @@ -1157,7 +1157,7 @@ MagickExport void XAnimateBackgroundImage(Display *display, window_info.pixmap); (void) XClearWindow(display,window_info.id); (void) XSync(display,MagickFalse); - delay=1000*image_list[scene]->delay/MagickMax( + delay=1000*image_list[scene]->delay/(size_t) MagickMax( image_list[scene]->ticks_per_second,1L); XDelay(display,resources.delay*(delay == 0 ? 10 : delay)); } @@ -1311,6 +1311,7 @@ MagickExport Image *XAnimateImages(Display *display, command[MagickPathExtent], *directory, geometry[MagickPathExtent], + *p, resource_name[MagickPathExtent]; CommandType @@ -1336,14 +1337,9 @@ MagickExport Image *XAnimateImages(Display *display, RectangleInfo geometry_info; - char - *p; - - ssize_t - i; - ssize_t first_scene, + i, iterations, scene; @@ -1744,9 +1740,9 @@ MagickExport Image *XAnimateImages(Display *display, */ windows->image.flags|=USPosition; windows->image.x=(XDisplayWidth(display,visual_info->screen)/2)- - (windows->image.width/2); + ((ssize_t) windows->image.width/2); windows->image.y=(XDisplayHeight(display,visual_info->screen)/2)- - (windows->image.height/2); + ((ssize_t) windows->image.height/2); } manager_hints->flags=IconWindowHint | InputHint | StateHint; manager_hints->icon_window=windows->icon.id; @@ -1949,7 +1945,7 @@ MagickExport Image *XAnimateImages(Display *display, ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage", image_list[scene]->filename); status=XMakeImage(display,resource_info,&windows->image,image_list[scene], - columns,rows,exception); + columns,rows,exception) == MagickFalse ? 0 : 1; if (status == MagickFalse) ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage", images->filename); @@ -2032,7 +2028,8 @@ MagickExport Image *XAnimateImages(Display *display, pause; pause=MagickFalse; - delay=1000*image->delay/MagickMax(image->ticks_per_second,1L); + delay=1000*image->delay/(size_t) MagickMax(image->ticks_per_second, + 1L); XDelay(display,resource_info->delay*(delay == 0 ? 10 : delay)); if (state & ForwardAnimationState) { @@ -2236,7 +2233,7 @@ MagickExport Image *XAnimateImages(Display *display, Convert Alt-Button3 to Button2. */ event.xbutton.button=Button2; - event.xbutton.state&=(~Mod1Mask); + event.xbutton.state&=(~(unsigned int) Mod1Mask); } if (event.xbutton.window == windows->backdrop.id) { @@ -2423,8 +2420,8 @@ MagickExport Image *XAnimateImages(Display *display, if (windows->command.geometry == (char *) NULL) if (windows->command.mapped == MagickFalse) { - windows->command.x= - event.xconfigure.x-windows->command.width-25; + windows->command.x=event.xconfigure.x- + (ssize_t) windows->command.width-25; windows->command.y=event.xconfigure.y; XConstrainWindowPosition(display,&windows->command); window_changes.x=windows->command.x; diff --git a/ImageMagick-7.1.1-15/MagickCore/animate.h b/ImageMagick-7.1.1-16/MagickCore/animate.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/animate.h rename to ImageMagick-7.1.1-16/MagickCore/animate.h diff --git a/ImageMagick-7.1.1-15/MagickCore/annotate-private.h b/ImageMagick-7.1.1-16/MagickCore/annotate-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/annotate-private.h rename to ImageMagick-7.1.1-16/MagickCore/annotate-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/annotate.c b/ImageMagick-7.1.1-16/MagickCore/annotate.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/annotate.c rename to ImageMagick-7.1.1-16/MagickCore/annotate.c index c89d047b..60c991df 100644 --- a/ImageMagick-7.1.1-15/MagickCore/annotate.c +++ b/ImageMagick-7.1.1-16/MagickCore/annotate.c @@ -119,7 +119,7 @@ #endif typedef struct _GraphemeInfo { - size_t + ssize_t index, x_offset, x_advance, @@ -487,7 +487,7 @@ MagickExport MagickBooleanType AnnotateImage(Image *image, default: break; } - if (draw_info->undercolor.alpha != TransparentAlpha) + if (draw_info->undercolor.alpha != (MagickRealType) TransparentAlpha) { DrawInfo *undercolor_info; @@ -509,7 +509,7 @@ MagickExport MagickBooleanType AnnotateImage(Image *image, annotate_info->affine.tx=offset.x; annotate_info->affine.ty=offset.y; pixel=annotate_info->fill; - if (annotate_info->stroke.alpha != TransparentAlpha) + if (annotate_info->stroke.alpha != (MagickRealType) TransparentAlpha) pixel=annotate_info->stroke; (void) QueryColorname(image,&pixel,AllCompliance,color,exception); (void) FormatLocaleString(primitive,MagickPathExtent,"stroke %s " @@ -612,18 +612,23 @@ static inline char *ReplaceSpaceWithNewline(char **caption,char *space) *target; size_t - length, + length; + + ssize_t offset; length=strlen(*caption); *space='\n'; offset=space-(*caption); - target=AcquireString(*caption); - CopyMagickString(target,*caption,offset+2); - ConcatenateMagickString(target,space+octets,length); - (void) DestroyString(*caption); - *caption=target; - space=(*caption)+offset; + if (offset >= 0) + { + target=AcquireString(*caption); + CopyMagickString(target,*caption,(size_t) offset+2); + ConcatenateMagickString(target,space+octets,length); + (void) DestroyString(*caption); + *caption=target; + space=(*caption)+offset; + } } return(space); } @@ -693,7 +698,7 @@ MagickExport ssize_t FormatMagickCaption(Image *image,DrawInfo *draw_info, *target; target=AcquireString(*caption); - CopyMagickString(target,*caption,n+1); + CopyMagickString(target,*caption,(size_t) n+1); ConcatenateMagickString(target,"\n",strlen(*caption)+1); ConcatenateMagickString(target,p,strlen(*caption)+2); (void) DestroyString(*caption); @@ -1252,7 +1257,8 @@ static size_t ComplexTextLayout(const DrawInfo *draw_info,const char *text, p=text; for (i=0; GetUTFCode(p) != 0; p+=GetUTFOctets(p), i++) { - (*grapheme)[i].index=(ssize_t) FT_Get_Char_Index(face,GetUTFCode(p)); + (*grapheme)[i].index=(ssize_t) FT_Get_Char_Index(face,(FT_ULong) + GetUTFCode(p)); (*grapheme)[i].x_offset=0; (*grapheme)[i].y_offset=0; if (((*grapheme)[i].index != 0) && (last_glyph != 0)) @@ -1275,7 +1281,7 @@ static size_t ComplexTextLayout(const DrawInfo *draw_info,const char *text, (void) FT_Load_Glyph(face,(FT_UInt) (*grapheme)[i].index,flags); (*grapheme)[i].x_advance=face->glyph->advance.x; (*grapheme)[i].y_advance=face->glyph->advance.y; - (*grapheme)[i].cluster=p-text; + (*grapheme)[i].cluster=(size_t) (p-text); last_glyph=(*grapheme)[i].index; } return((size_t) i); @@ -1402,19 +1408,23 @@ static inline const char *FreetypeErrorMessage( static void *FreetypeAlloc(FT_Memory magick_unused(memory),long size) { magick_unreferenced(memory); + if (size < 0) + return((void *) NULL); if ((size_t) size > GetMaxMemoryRequest()) return((void *) NULL); - return(AcquireMagickMemory(size)); + return(AcquireMagickMemory((size_t) size)); } static void *FreetypeRealloc(FT_Memory magick_unused(memory), - long magick_unused(cur_size),long new_size,void *block) + long magick_unused(cur_size),long size,void *block) { magick_unreferenced(memory); magick_unreferenced(cur_size); - if ((size_t) new_size > GetMaxMemoryRequest()) + if (size < 0) + return((void *) NULL); + if ((size_t) size > GetMaxMemoryRequest()) return((void *) NULL); - return(ResizeMagickMemory(block,new_size)); + return(ResizeMagickMemory(block,(size_t) size)); } static void FreetypeFree(FT_Memory magick_unused(memory),void *block) @@ -1628,8 +1638,9 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, */ stream=(FT_StreamRec *) AcquireCriticalMemory(sizeof(*stream)); (void) memset(stream,0,sizeof(*stream)); - (void) stat(args.pathname,&attributes); - stream->size=attributes.st_size; + if (stat(args.pathname,&attributes) == 0) + stream->size=attributes.st_size >= 0 ? (unsigned long) + attributes.st_size : 0; stream->descriptor.pointer=fopen_utf8(args.pathname,"rb"); stream->read=(&FreetypeReadStream); stream->close=(&FreetypeCloseStream); @@ -1886,7 +1897,7 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, metrics->bounds.x2=(double) bounds.xMax; if ((bounds.yMax > metrics->bounds.y2) && (bounds.yMax != 0)) metrics->bounds.y2=(double) bounds.yMax; - if (((draw_info->stroke.alpha != TransparentAlpha) || + if (((draw_info->stroke.alpha != (MagickRealType) TransparentAlpha) || (draw_info->stroke_pattern != (Image *) NULL)) && ((status != MagickFalse) && (draw_info->render != MagickFalse))) { @@ -1924,9 +1935,9 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, /* Rasterize the glyph. */ - transparent_fill=((draw_info->fill.alpha == TransparentAlpha) && + transparent_fill=((draw_info->fill.alpha == (MagickRealType) TransparentAlpha) && (draw_info->fill_pattern == (Image *) NULL) && - (draw_info->stroke.alpha == TransparentAlpha) && + (draw_info->stroke.alpha == (MagickRealType) TransparentAlpha) && (draw_info->stroke_pattern == (Image *) NULL)) ? MagickTrue : MagickFalse; image_view=AcquireAuthenticCacheView(image,exception); @@ -2010,9 +2021,10 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, Sa, Da; - Da=1.0-(QuantumScale*GetPixelAlpha(image,q)); + Da=1.0-(QuantumScale*(double) GetPixelAlpha(image,q)); Sa=fill_opacity; - fill_opacity=(1.0-RoundToUnity(Sa+Da-Sa*Da))*QuantumRange; + fill_opacity=(1.0-RoundToUnity(Sa+Da-Sa*Da))*(double) + QuantumRange; SetPixelAlpha(image,fill_opacity,q); } if (active == MagickFalse) @@ -2028,7 +2040,7 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, status=MagickFalse; } image_view=DestroyCacheView(image_view); - if (((draw_info->stroke.alpha != TransparentAlpha) || + if (((draw_info->stroke.alpha != (MagickRealType) TransparentAlpha) || (draw_info->stroke_pattern != (Image *) NULL)) && (status != MagickFalse)) { @@ -2353,7 +2365,7 @@ static MagickBooleanType RenderPostscript(Image *image, annotate_image=DestroyImage(annotate_image); return(MagickTrue); } - if (draw_info->fill.alpha != TransparentAlpha) + if (draw_info->fill.alpha != (MagickRealType) TransparentAlpha) { CacheView *annotate_view; diff --git a/ImageMagick-7.1.1-15/MagickCore/annotate.h b/ImageMagick-7.1.1-16/MagickCore/annotate.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/annotate.h rename to ImageMagick-7.1.1-16/MagickCore/annotate.h diff --git a/ImageMagick-7.1.1-15/MagickCore/artifact.c b/ImageMagick-7.1.1-16/MagickCore/artifact.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/artifact.c rename to ImageMagick-7.1.1-16/MagickCore/artifact.c diff --git a/ImageMagick-7.1.1-15/MagickCore/artifact.h b/ImageMagick-7.1.1-16/MagickCore/artifact.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/artifact.h rename to ImageMagick-7.1.1-16/MagickCore/artifact.h diff --git a/ImageMagick-7.1.1-15/MagickCore/attribute.c b/ImageMagick-7.1.1-16/MagickCore/attribute.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/attribute.c rename to ImageMagick-7.1.1-16/MagickCore/attribute.c index 9dfebb30..6f0cbd6e 100644 --- a/ImageMagick-7.1.1-15/MagickCore/attribute.c +++ b/ImageMagick-7.1.1-16/MagickCore/attribute.c @@ -555,8 +555,8 @@ MagickExport RectangleInfo GetImageBoundingBox(const Image *image, "GeometryDoesNotContainImage","`%s'",image->filename); else { - bounds.width-=(bounds.x-1); - bounds.height-=(bounds.y-1); + bounds.width-=(size_t) (bounds.x-1); + bounds.height-=(size_t) (bounds.y-1); } return(bounds); } @@ -1217,12 +1217,12 @@ MagickExport PointInfo *GetImageMinimumBoundingBox(Image *image, *bounding_box, *vertices; - ssize_t - i; - size_t number_hull_vertices; + ssize_t + i; + /* Generate the minimum bounding box with the "Rotating Calipers" algorithm. */ @@ -1269,12 +1269,12 @@ MagickExport PointInfo *GetImageMinimumBoundingBox(Image *image, for (j=0; j < (ssize_t) number_hull_vertices; j++) { diameter=fabs(getFeretDiameter(&vertices[i], - &vertices[(i+1) % number_hull_vertices],&vertices[j])); + &vertices[(i+1) % (ssize_t) number_hull_vertices],&vertices[j])); if (min_diameter < diameter) { min_diameter=diameter; p=i; - q=(i+1) % number_hull_vertices; + q=(i+1) % (ssize_t) number_hull_vertices; v=j; } } diff --git a/ImageMagick-7.1.1-15/MagickCore/attribute.h b/ImageMagick-7.1.1-16/MagickCore/attribute.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/attribute.h rename to ImageMagick-7.1.1-16/MagickCore/attribute.h diff --git a/ImageMagick-7.1.1-15/MagickCore/blob-private.h b/ImageMagick-7.1.1-16/MagickCore/blob-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/blob-private.h rename to ImageMagick-7.1.1-16/MagickCore/blob-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/blob.c b/ImageMagick-7.1.1-16/MagickCore/blob.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/blob.c rename to ImageMagick-7.1.1-16/MagickCore/blob.c index def33675..5150a563 100644 --- a/ImageMagick-7.1.1-15/MagickCore/blob.c +++ b/ImageMagick-7.1.1-16/MagickCore/blob.c @@ -370,7 +370,7 @@ MagickExport MagickBooleanType BlobToFile(char *filename,const void *blob, ThrowFileException(exception,BlobError,"UnableToWriteBlob",filename); return(MagickFalse); } - for (i=0; i < length; i+=count) + for (i=0; i < length; i+=(size_t) count) { count=write(file,(const char *) blob+i,MagickMin(length-i,(size_t) MAGICK_SSIZE_MAX)); @@ -1138,7 +1138,7 @@ MagickExport void DisassociateBlob(Image *image) MagickExport MagickBooleanType DiscardBlobBytes(Image *image, const MagickSizeType length) { - MagickOffsetType + MagickSizeType i; size_t @@ -1155,7 +1155,7 @@ MagickExport MagickBooleanType DiscardBlobBytes(Image *image, if (length != (MagickSizeType) ((MagickOffsetType) length)) return(MagickFalse); count=0; - for (i=0; i < (MagickOffsetType) length; i+=count) + for (i=0; i < length; i+=(MagickSizeType) count) { quantum=(size_t) MagickMin(length-i,sizeof(buffer)); (void) ReadBlobStream(image,quantum,buffer,&count); @@ -1166,7 +1166,7 @@ MagickExport MagickBooleanType DiscardBlobBytes(Image *image, break; } } - return(i < (MagickOffsetType) length ? MagickFalse : MagickTrue); + return(i < (MagickSizeType) length ? MagickFalse : MagickTrue); } /* @@ -1469,7 +1469,7 @@ MagickExport void *FileToBlob(const char *filename,const size_t extent, if ((fstat(file,&file_stats) == 0) && (file_stats.st_size > 0)) quantum=(size_t) MagickMin(file_stats.st_size,MagickMaxBufferExtent); blob=(unsigned char *) AcquireQuantumMemory(quantum,sizeof(*blob)); - for (i=0; blob != (unsigned char *) NULL; i+=count) + for (i=0; blob != (unsigned char *) NULL; i+=(size_t) count) { count=read(file,blob+i,quantum); if (count <= 0) @@ -1478,14 +1478,14 @@ MagickExport void *FileToBlob(const char *filename,const size_t extent, if (errno != EINTR) break; } - if (~((size_t) i) < (count+quantum+1)) + if (~i < ((size_t) count+quantum+1)) { blob=(unsigned char *) RelinquishMagickMemory(blob); break; } - blob=(unsigned char *) ResizeQuantumMemory(blob,i+count+quantum+1, - sizeof(*blob)); - if ((size_t) (i+count) >= extent) + blob=(unsigned char *) ResizeQuantumMemory(blob,i+(size_t) count+ + quantum+1,sizeof(*blob)); + if ((i+(size_t) count) >= extent) break; } if (LocaleCompare(filename,"-") != 0) @@ -1502,7 +1502,7 @@ MagickExport void *FileToBlob(const char *filename,const size_t extent, ThrowFileException(exception,BlobError,"UnableToReadBlob",filename); return(NULL); } - *length=(size_t) MagickMin(i+count,extent); + *length=(size_t) MagickMin(i+(size_t) count,extent); blob[*length]='\0'; return(blob); } @@ -1528,7 +1528,7 @@ MagickExport void *FileToBlob(const char *filename,const size_t extent, else { (void) lseek(file,0,SEEK_SET); - for (i=0; i < *length; i+=count) + for (i=0; i < *length; i+=(size_t) count) { count=read(file,blob+i,(size_t) MagickMin(*length-i,(size_t) MAGICK_SSIZE_MAX)); @@ -1610,7 +1610,7 @@ static inline ssize_t WriteBlobStream(Image *image,const size_t length, } q=blob_info->data+blob_info->offset; (void) memcpy(q,data,length); - blob_info->offset+=length; + blob_info->offset+=(MagickOffsetType) length; if (blob_info->offset >= (MagickOffsetType) blob_info->length) blob_info->length=(size_t) blob_info->offset; return((ssize_t) length); @@ -2057,7 +2057,7 @@ MagickExport void *ImageToBlob(const ImageInfo *image_info, if (magick_info == (const MagickInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), - MissingDelegateError,"NoDecodeDelegateForThisImageFormat","`%s'", + MissingDelegateError,"NoEncodeDelegateForThisImageFormat","`%s'", image->magick); blob_info=DestroyImageInfo(blob_info); return(blob); @@ -2089,6 +2089,8 @@ MagickExport void *ImageToBlob(const ImageInfo *image_info, else blob=ResizeQuantumMemory(blob,*length+1,sizeof(unsigned char)); } + else if (status == MagickFalse) + blob_info->blob=RelinquishMagickMemory(blob_info->blob); } } else @@ -2364,7 +2366,7 @@ MagickExport MagickBooleanType ImageToFile(Image *image,char *filename, for (i=0; count > 0; ) { length=(size_t) count; - for (i=0; i < length; i+=count) + for (i=0; i < length; i+=(size_t) count) { count=write(file,p+i,(size_t) (length-i)); if (count <= 0) @@ -2460,7 +2462,7 @@ MagickExport void *ImagesToBlob(const ImageInfo *image_info,Image *images, if (magick_info == (const MagickInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), - MissingDelegateError,"NoDecodeDelegateForThisImageFormat","`%s'", + MissingDelegateError,"NoEncodeDelegateForThisImageFormat","`%s'", images->magick); blob_info=DestroyImageInfo(blob_info); return(blob); @@ -2497,6 +2499,8 @@ MagickExport void *ImagesToBlob(const ImageInfo *image_info,Image *images, else blob=ResizeQuantumMemory(blob,*length+1,sizeof(unsigned char)); } + else if (status == MagickFalse) + blob_info->blob=RelinquishMagickMemory(blob_info->blob); } } else @@ -3848,10 +3852,10 @@ MagickExport ssize_t ReadBlob(Image *image,const size_t length,void *data) { default: { - ssize_t + size_t i; - for (i=0; i < (ssize_t) length; i+=count) + for (i=0; i < length; i+=(size_t) count) { count=(ssize_t) gzread(blob_info->file_info.gzfile,q+i, (unsigned int) MagickMin(length-i,MagickMaxBufferExtent)); @@ -3862,7 +3866,7 @@ MagickExport ssize_t ReadBlob(Image *image,const size_t length,void *data) break; } } - count=i; + count=(ssize_t) i; break; } case 4: @@ -3919,13 +3923,13 @@ MagickExport ssize_t ReadBlob(Image *image,const size_t length,void *data) int status; - ssize_t + size_t i; - for (i=0; i < (ssize_t) length; i+=count) + for (i=0; i < length; i+=(size_t) count) { - count=(ssize_t) BZ2_bzread(blob_info->file_info.bzfile,q+i, - (unsigned int) MagickMin(length-i,MagickMaxBufferExtent)); + count=(ssize_t) BZ2_bzread(blob_info->file_info.bzfile,q+i,(int) + MagickMin(length-i,MagickMaxBufferExtent)); if (count <= 0) { count=0; @@ -3933,7 +3937,7 @@ MagickExport ssize_t ReadBlob(Image *image,const size_t length,void *data) break; } } - count=i; + count=(ssize_t) i; status=BZ_OK; (void) BZ2_bzerror(blob_info->file_info.bzfile,&status); if ((count != (ssize_t) length) && (status != BZ_OK)) @@ -4887,7 +4891,7 @@ MagickExport char *ReadBlobString(Image *image,char *string) int c = -1; - ssize_t + size_t i = 0; assert(image != (Image *) NULL); @@ -5101,7 +5105,7 @@ MagickExport MagickOffsetType SeekBlob(Image *image, { if (((MagickOffsetType) blob_info->length+offset) < 0) return(-1); - blob_info->offset=blob_info->length+offset; + blob_info->offset=(MagickOffsetType) blob_info->length+offset; break; } } @@ -5234,7 +5238,7 @@ MagickExport MagickBooleanType SetBlobExtent(Image *image, file=fileno(blob_info->file_info.file); if ((file == -1) || (offset < 0)) return(MagickFalse); - (void) posix_fallocate(file,offset,extent-offset); + (void) posix_fallocate(file,offset,(MagickOffsetType) extent-offset); } #endif offset=SeekBlob(image,offset,SEEK_SET); @@ -5282,7 +5286,8 @@ MagickExport MagickBooleanType SetBlobExtent(Image *image, file=fileno(blob_info->file_info.file); if ((file == -1) || (offset < 0)) return(MagickFalse); - (void) posix_fallocate(file,offset,extent-offset); + (void) posix_fallocate(file,offset,(MagickOffsetType) extent- + offset); } #endif offset=SeekBlob(image,offset,SEEK_SET); @@ -5790,10 +5795,10 @@ MagickExport ssize_t WriteBlob(Image *image,const size_t length, { default: { - ssize_t + size_t i; - for (i=0; i < (ssize_t) length; i+=count) + for (i=0; i < length; i+=(size_t) count) { count=(ssize_t) gzwrite(blob_info->file_info.gzfile,q+i, (unsigned int) MagickMin(length-i,MagickMaxBufferExtent)); @@ -5804,7 +5809,7 @@ MagickExport ssize_t WriteBlob(Image *image,const size_t length, break; } } - count=i; + count=(ssize_t) i; break; } case 4: @@ -5855,10 +5860,10 @@ MagickExport ssize_t WriteBlob(Image *image,const size_t length, int status; - ssize_t + size_t i; - for (i=0; i < (ssize_t) length; i+=count) + for (i=0; i < length; i+=(size_t) count) { count=(ssize_t) BZ2_bzwrite(blob_info->file_info.bzfile,q+i, (int) MagickMin(length-i,MagickMaxBufferExtent)); @@ -5869,7 +5874,7 @@ MagickExport ssize_t WriteBlob(Image *image,const size_t length, break; } } - count=i; + count=(ssize_t) i; status=BZ_OK; (void) BZ2_bzerror(blob_info->file_info.bzfile,&status); if ((count != (ssize_t) length) && (status != BZ_OK)) @@ -5902,7 +5907,7 @@ MagickExport ssize_t WriteBlob(Image *image,const size_t length, } q=blob_info->data+blob_info->offset; (void) memcpy(q,p,length); - blob_info->offset+=length; + blob_info->offset+=(MagickOffsetType) length; if (blob_info->offset >= (MagickOffsetType) blob_info->length) blob_info->length=(size_t) blob_info->offset; count=(ssize_t) length; diff --git a/ImageMagick-7.1.1-15/MagickCore/blob.h b/ImageMagick-7.1.1-16/MagickCore/blob.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/blob.h rename to ImageMagick-7.1.1-16/MagickCore/blob.h diff --git a/ImageMagick-7.1.1-15/MagickCore/cache-private.h b/ImageMagick-7.1.1-16/MagickCore/cache-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/cache-private.h rename to ImageMagick-7.1.1-16/MagickCore/cache-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/cache-view.c b/ImageMagick-7.1.1-16/MagickCore/cache-view.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/cache-view.c rename to ImageMagick-7.1.1-16/MagickCore/cache-view.c diff --git a/ImageMagick-7.1.1-15/MagickCore/cache-view.h b/ImageMagick-7.1.1-16/MagickCore/cache-view.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/cache-view.h rename to ImageMagick-7.1.1-16/MagickCore/cache-view.h diff --git a/ImageMagick-7.1.1-15/MagickCore/cache.c b/ImageMagick-7.1.1-16/MagickCore/cache.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/cache.c rename to ImageMagick-7.1.1-16/MagickCore/cache.c index a4182cfa..da174016 100644 --- a/ImageMagick-7.1.1-15/MagickCore/cache.c +++ b/ImageMagick-7.1.1-16/MagickCore/cache.c @@ -459,7 +459,7 @@ static MagickBooleanType ClipPixelCacheNexus(Image *image, ssize_t i; - mask_alpha=QuantumScale*GetPixelWriteMask(image,p); + mask_alpha=QuantumScale*(double) GetPixelWriteMask(image,p); if (fabs(mask_alpha) >= MagickEpsilon) { for (i=0; i < (ssize_t) image->number_channels; i++) @@ -468,7 +468,7 @@ static MagickBooleanType ClipPixelCacheNexus(Image *image, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(MagickOver_((double) p[i],mask_alpha* + q[i]=ClampToQuantum(MagickOver_((double) p[i],mask_alpha*(double) GetPixelAlpha(image,p),(double) q[i],(double) GetPixelAlpha(image,q))); } @@ -650,7 +650,7 @@ static MagickBooleanType ClonePixelCacheOnDisk( number_bytes=write(clone_info->file,buffer,(size_t) count); if (number_bytes != count) break; - extent+=number_bytes; + extent+=(size_t) number_bytes; } buffer=(unsigned char *) RelinquishMagickMemory(buffer); if (extent != cache_info->length) @@ -734,7 +734,7 @@ static MagickBooleanType ClonePixelCacheRepository( status=MagickTrue; #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - cache_number_threads(cache_info,clone_info,cache_info->rows,1) + cache_number_threads(cache_info,clone_info,(int) cache_info->rows,1) #endif for (y=0; y < (ssize_t) cache_info->rows; y++) { @@ -815,7 +815,7 @@ static MagickBooleanType ClonePixelCacheRepository( clone_info->metacontent_extent); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - cache_number_threads(cache_info,clone_info,cache_info->rows,1) + cache_number_threads(cache_info,clone_info,(int) cache_info->rows,1) #endif for (y=0; y < (ssize_t) cache_info->rows; y++) { @@ -1701,7 +1701,7 @@ static Cache GetImagePixelCache(Image *image,const MagickBooleanType clone, status=MagickTrue; if (cpu_throttle == MagickResourceInfinity) cpu_throttle=GetMagickResourceLimit(ThrottleResource); - if ((cpu_throttle != 0) && ((cycles++ % 32) == 0)) + if ((cpu_throttle != 0) && ((cycles++ % 4096) == 0)) MagickDelay(cpu_throttle); if (cache_epoch == 0) { @@ -2694,6 +2694,18 @@ static inline ssize_t EdgeY(const ssize_t y,const size_t rows) return(y); } +static inline MagickBooleanType IsValidOffset(const ssize_t y, + const size_t columns) +{ + if (columns == 0) + return(MagickTrue); + if (y >= (MAGICK_SSIZE_MAX/(ssize_t) columns)) + return(MagickFalse); + if (y <= (MAGICK_SSIZE_MIN/(ssize_t) columns)) + return(MagickFalse); + return(MagickTrue); +} + static inline ssize_t RandomX(RandomInfo *random_info,const size_t columns) { return((ssize_t) (columns*GetPseudoRandomValue(random_info))); @@ -2788,15 +2800,16 @@ MagickPrivate const Quantum *GetVirtualPixelCacheNexus(const Image *image, nexus_info,exception); if (pixels == (Quantum *) NULL) return((const Quantum *) NULL); - q=pixels; - offset=(MagickOffsetType) nexus_info->region.y*cache_info->columns+ + if (IsValidOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) + return((const Quantum *) NULL); + offset=nexus_info->region.y*(MagickOffsetType) cache_info->columns+ nexus_info->region.x; length=(MagickSizeType) (nexus_info->region.height-1L)*cache_info->columns+ nexus_info->region.width-1L; number_pixels=(MagickSizeType) cache_info->columns*cache_info->rows; if ((offset >= 0) && (((MagickSizeType) offset+length) < number_pixels)) - if ((x >= 0) && ((ssize_t) (x+columns-1) < (ssize_t) cache_info->columns) && - (y >= 0) && ((ssize_t) (y+rows-1) < (ssize_t) cache_info->rows)) + if ((x >= 0) && ((x+(ssize_t) columns-1) < (ssize_t) cache_info->columns) && + (y >= 0) && ((y+(ssize_t) rows-1) < (ssize_t) cache_info->rows)) { MagickBooleanType status; @@ -2805,7 +2818,7 @@ MagickPrivate const Quantum *GetVirtualPixelCacheNexus(const Image *image, Pixel request is inside cache extents. */ if (nexus_info->authentic_pixel_cache != MagickFalse) - return(q); + return(pixels); status=ReadPixelCachePixels(cache_info,nexus_info,exception); if (status == MagickFalse) return((const Quantum *) NULL); @@ -2815,12 +2828,13 @@ MagickPrivate const Quantum *GetVirtualPixelCacheNexus(const Image *image, if (status == MagickFalse) return((const Quantum *) NULL); } - return(q); + return(pixels); } /* Pixel request is outside cache extents. */ virtual_nexus=nexus_info->virtual_nexus; + q=pixels; s=(unsigned char *) nexus_info->metacontent; (void) memset(virtual_pixel,0,cache_info->number_channels* sizeof(*virtual_pixel)); @@ -2914,13 +2928,14 @@ MagickPrivate const Quantum *GetVirtualPixelCacheNexus(const Image *image, if ((virtual_pixel_method == EdgeVirtualPixelMethod) || (virtual_pixel_method == UndefinedVirtualPixelMethod)) y_offset=EdgeY(y_offset,cache_info->rows); - for (u=0; u < (ssize_t) columns; u+=length) + for (u=0; u < (ssize_t) columns; u+=(ssize_t) length) { ssize_t x_offset; x_offset=x+u; - length=(MagickSizeType) MagickMin(cache_info->columns-x_offset,columns-u); + length=(MagickSizeType) MagickMin((ssize_t) cache_info->columns- + x_offset,(ssize_t) columns-u); if (((x_offset < 0) || (x_offset >= (ssize_t) cache_info->columns)) || ((y_offset < 0) || (y_offset >= (ssize_t) cache_info->rows)) || (length == 0)) @@ -3404,7 +3419,7 @@ static inline Quantum ApplyPixelCompositeMask(const Quantum p, double gamma; - if (fabs((double) (alpha-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) (alpha-(double) TransparentAlpha)) < MagickEpsilon) return(q); gamma=1.0-QuantumScale*QuantumScale*alpha*beta; gamma=PerceptibleReciprocal(gamma); @@ -3568,11 +3583,11 @@ static inline MagickOffsetType WritePixelCacheRegion( for (i=0; i < (MagickOffsetType) length; i+=count) { #if !defined(MAGICKCORE_HAVE_PWRITE) - count=write(cache_info->file,buffer+i,(size_t) MagickMin(length-i,(size_t) - MAGICK_SSIZE_MAX)); + count=write(cache_info->file,buffer+i,(size_t) MagickMin(length- + (MagickSizeType) i,MAGICK_SSIZE_MAX)); #else - count=pwrite(cache_info->file,buffer+i,(size_t) MagickMin(length-i,(size_t) - MAGICK_SSIZE_MAX),offset+i); + count=pwrite(cache_info->file,buffer+i,(size_t) MagickMin(length- + (MagickSizeType) i,MAGICK_SSIZE_MAX),offset+i); #endif if (count <= 0) { @@ -3697,9 +3712,11 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, ThrowBinaryException(ImageError,"WidthOrHeightExceedsLimit", image->filename); if (GetPixelChannels(image) >= MaxPixelChannels) - ThrowBinaryException(ImageError,"MaximumChannelsExceeded",image->filename); - if (GetPixelMetaChannels(image) > GetPixelChannels(image)) - ThrowBinaryException(ImageError,"MaximumChannelsExceeded",image->filename); + ThrowBinaryException(CorruptImageError,"MaximumChannelsExceeded", + image->filename); + if (GetPixelMetaChannels(image) >= (MaxPixelChannels-MetaPixelChannels)) + ThrowBinaryException(CorruptImageError,"MaximumChannelsExceeded", + image->filename); if (GetMagickResourceLimit(ListLengthResource) != MagickResourceInfinity) { length=GetImageListLength(image); @@ -4079,7 +4096,8 @@ MagickExport MagickBooleanType PersistPixelCache(Image *image, cache_info->offset=(*offset); if (OpenPixelCache(image,ReadMode,exception) == MagickFalse) return(MagickFalse); - *offset+=cache_info->length+page_size-(cache_info->length % page_size); + *offset=(*offset+(MagickOffsetType) cache_info->length+page_size- + ((MagickOffsetType) cache_info->length % page_size)); return(MagickTrue); } /* @@ -4112,7 +4130,8 @@ MagickExport MagickBooleanType PersistPixelCache(Image *image, status=OpenPixelCacheOnDisk(clone_info,WriteMode); if (status != MagickFalse) status=ClonePixelCacheRepository(clone_info,cache_info,exception); - *offset+=cache_info->length+page_size-(cache_info->length % page_size); + *offset=(*offset+(MagickOffsetType) cache_info->length+page_size- + ((MagickOffsetType) cache_info->length % page_size)); clone_info=(CacheInfo *) DestroyPixelCache(clone_info); return(status); } @@ -4189,11 +4208,14 @@ MagickPrivate Quantum *QueueAuthenticPixelCacheNexus(Image *image, "PixelsAreNotAuthentic","`%s'",image->filename); return((Quantum *) NULL); } - offset=(MagickOffsetType) y*cache_info->columns+x; + if (IsValidOffset(y,cache_info->columns) == MagickFalse) + return((Quantum *) NULL); + offset=y*(MagickOffsetType) cache_info->columns+x; if (offset < 0) return((Quantum *) NULL); number_pixels=(MagickSizeType) cache_info->columns*cache_info->rows; - offset+=(MagickOffsetType) (rows-1)*cache_info->columns+columns-1; + offset+=((MagickOffsetType) rows-1)*(MagickOffsetType) cache_info->columns+ + (MagickOffsetType) columns-1; if ((MagickSizeType) offset >= number_pixels) return((Quantum *) NULL); /* @@ -4396,11 +4418,11 @@ static inline MagickOffsetType ReadPixelCacheRegion( for (i=0; i < (MagickOffsetType) length; i+=count) { #if !defined(MAGICKCORE_HAVE_PREAD) - count=read(cache_info->file,buffer+i,(size_t) MagickMin(length-i,(size_t) - MAGICK_SSIZE_MAX)); + count=read(cache_info->file,buffer+i,(size_t) MagickMin(length- + (MagickSizeType) i,(size_t) MAGICK_SSIZE_MAX)); #else - count=pread(cache_info->file,buffer+i,(size_t) MagickMin(length-i,(size_t) - MAGICK_SSIZE_MAX),offset+i); + count=pread(cache_info->file,buffer+i,(size_t) MagickMin(length- + (MagickSizeType) i,(size_t) MAGICK_SSIZE_MAX),offset+i); #endif if (count <= 0) { @@ -4437,7 +4459,9 @@ static MagickBooleanType ReadPixelCacheMetacontent( return(MagickFalse); if (nexus_info->authentic_pixel_cache != MagickFalse) return(MagickTrue); - offset=(MagickOffsetType) nexus_info->region.y*cache_info->columns+ + if (IsValidOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) + return(MagickFalse); + offset=nexus_info->region.y*(MagickOffsetType) cache_info->columns+ nexus_info->region.x; length=(MagickSizeType) nexus_info->region.width* cache_info->metacontent_extent; @@ -4462,7 +4486,7 @@ static MagickBooleanType ReadPixelCacheMetacontent( length=extent; rows=1UL; } - p=(unsigned char *) cache_info->metacontent+offset* + p=(unsigned char *) cache_info->metacontent+offset*(MagickOffsetType) cache_info->metacontent_extent; for (y=0; y < (ssize_t) rows; y++) { @@ -4494,12 +4518,14 @@ static MagickBooleanType ReadPixelCacheMetacontent( extent=(MagickSizeType) cache_info->columns*cache_info->rows; for (y=0; y < (ssize_t) rows; y++) { - count=ReadPixelCacheRegion(cache_info,cache_info->offset+extent* - cache_info->number_channels*sizeof(Quantum)+offset* - cache_info->metacontent_extent,length,(unsigned char *) q); + count=ReadPixelCacheRegion(cache_info,cache_info->offset+ + (MagickOffsetType) extent*(MagickOffsetType) + cache_info->number_channels*(MagickOffsetType) sizeof(Quantum)+offset* + (MagickOffsetType) cache_info->metacontent_extent,length, + (unsigned char *) q); if (count != (MagickOffsetType) length) break; - offset+=cache_info->columns; + offset+=(MagickOffsetType) cache_info->columns; q+=cache_info->metacontent_extent*nexus_info->region.width; } if (IsFileDescriptorLimitExceeded() != MagickFalse) @@ -4598,17 +4624,19 @@ static MagickBooleanType ReadPixelCachePixels( Quantum *magick_restrict q; - ssize_t - y; - size_t number_channels, rows; + ssize_t + y; + if (nexus_info->authentic_pixel_cache != MagickFalse) return(MagickTrue); - offset=(MagickOffsetType) nexus_info->region.y*cache_info->columns; - if ((ssize_t) (offset/cache_info->columns) != nexus_info->region.y) + if (IsValidOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) + return(MagickFalse); + offset=nexus_info->region.y*(MagickOffsetType) cache_info->columns; + if ((offset/(MagickOffsetType) cache_info->columns) != nexus_info->region.y) return(MagickFalse); offset+=nexus_info->region.x; number_channels=cache_info->number_channels; @@ -4639,7 +4667,8 @@ static MagickBooleanType ReadPixelCachePixels( length=extent; rows=1UL; } - p=cache_info->pixels+cache_info->number_channels*offset; + p=cache_info->pixels+(MagickOffsetType) cache_info->number_channels* + offset; for (y=0; y < (ssize_t) rows; y++) { (void) memcpy(q,p,(size_t) length); @@ -4670,10 +4699,11 @@ static MagickBooleanType ReadPixelCachePixels( for (y=0; y < (ssize_t) rows; y++) { count=ReadPixelCacheRegion(cache_info,cache_info->offset+offset* - cache_info->number_channels*sizeof(*q),length,(unsigned char *) q); + (MagickOffsetType) cache_info->number_channels*(MagickOffsetType) + sizeof(*q),length,(unsigned char *) q); if (count != (MagickOffsetType) length) break; - offset+=cache_info->columns; + offset+=(MagickOffsetType) cache_info->columns; q+=cache_info->number_channels*nexus_info->region.width; } if (IsFileDescriptorLimitExceeded() != MagickFalse) @@ -5085,7 +5115,7 @@ static inline MagickBooleanType ValidatePixelOffset(const ssize_t x, { if ((x >= 0) && (x >= ((ssize_t) (MAGICK_SSIZE_MAX-MaxPixelChannels*a)))) return(MagickFalse); - if (x <= ((ssize_t) (MAGICK_SSIZE_MIN+MaxPixelChannels*a))) + if (x <= ((ssize_t) (MAGICK_SSIZE_MIN+MaxPixelChannels*(MagickOffsetType) a))) return(MagickFalse); return(MagickTrue); } @@ -5138,13 +5168,15 @@ static Quantum *SetPixelCacheNexusPixels( /* Pixels are accessed directly from memory. */ - offset=(MagickOffsetType) y*cache_info->columns+x; - nexus_info->pixels=cache_info->pixels+cache_info->number_channels* - offset; + if (IsValidOffset(y,cache_info->columns) == MagickFalse) + return((Quantum *) NULL); + offset=y*(MagickOffsetType) cache_info->columns+x; + nexus_info->pixels=cache_info->pixels+(MagickOffsetType) + cache_info->number_channels*offset; nexus_info->metacontent=(void *) NULL; if (cache_info->metacontent_extent != 0) nexus_info->metacontent=(unsigned char *) cache_info->metacontent+ - offset*cache_info->metacontent_extent; + offset*(MagickOffsetType) cache_info->metacontent_extent; nexus_info->region.width=width; nexus_info->region.height=height; nexus_info->region.x=x; @@ -5636,7 +5668,9 @@ static MagickBooleanType WritePixelCacheMetacontent(CacheInfo *cache_info, return(MagickTrue); if (nexus_info->metacontent == (unsigned char *) NULL) return(MagickFalse); - offset=(MagickOffsetType) nexus_info->region.y*cache_info->columns+ + if (IsValidOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) + return(MagickFalse); + offset=nexus_info->region.y*(MagickOffsetType) cache_info->columns+ nexus_info->region.x; length=(MagickSizeType) nexus_info->region.width* cache_info->metacontent_extent; @@ -5662,7 +5696,7 @@ static MagickBooleanType WritePixelCacheMetacontent(CacheInfo *cache_info, rows=1UL; } q=(unsigned char *) cache_info->metacontent+offset* - cache_info->metacontent_extent; + (MagickOffsetType) cache_info->metacontent_extent; for (y=0; y < (ssize_t) rows; y++) { (void) memcpy(q,p,(size_t) length); @@ -5693,13 +5727,15 @@ static MagickBooleanType WritePixelCacheMetacontent(CacheInfo *cache_info, extent=(MagickSizeType) cache_info->columns*cache_info->rows; for (y=0; y < (ssize_t) rows; y++) { - count=WritePixelCacheRegion(cache_info,cache_info->offset+extent* - cache_info->number_channels*sizeof(Quantum)+offset* - cache_info->metacontent_extent,length,(const unsigned char *) p); + count=WritePixelCacheRegion(cache_info,cache_info->offset+ + (MagickOffsetType) extent*(MagickOffsetType) + cache_info->number_channels*(MagickOffsetType) sizeof(Quantum)+offset* + (MagickOffsetType) cache_info->metacontent_extent,length, + (const unsigned char *) p); if (count != (MagickOffsetType) length) break; p+=cache_info->metacontent_extent*nexus_info->region.width; - offset+=cache_info->columns; + offset+=(MagickOffsetType) cache_info->columns; } if (IsFileDescriptorLimitExceeded() != MagickFalse) (void) ClosePixelCacheOnDisk(cache_info); @@ -5805,7 +5841,9 @@ static MagickBooleanType WritePixelCachePixels( if (nexus_info->authentic_pixel_cache != MagickFalse) return(MagickTrue); - offset=(MagickOffsetType) nexus_info->region.y*cache_info->columns+ + if (IsValidOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) + return(MagickFalse); + offset=nexus_info->region.y*(MagickOffsetType) cache_info->columns+ nexus_info->region.x; length=(MagickSizeType) cache_info->number_channels*nexus_info->region.width* sizeof(Quantum); @@ -5830,7 +5868,8 @@ static MagickBooleanType WritePixelCachePixels( length=extent; rows=1UL; } - q=cache_info->pixels+cache_info->number_channels*offset; + q=cache_info->pixels+(MagickOffsetType) cache_info->number_channels* + offset; for (y=0; y < (ssize_t) rows; y++) { (void) memcpy(q,p,(size_t) length); @@ -5861,12 +5900,12 @@ static MagickBooleanType WritePixelCachePixels( for (y=0; y < (ssize_t) rows; y++) { count=WritePixelCacheRegion(cache_info,cache_info->offset+offset* - cache_info->number_channels*sizeof(*p),length,(const unsigned char *) - p); + (MagickOffsetType) cache_info->number_channels*(MagickOffsetType) + sizeof(*p),length,(const unsigned char *) p); if (count != (MagickOffsetType) length) break; p+=cache_info->number_channels*nexus_info->region.width; - offset+=cache_info->columns; + offset+=(MagickOffsetType) cache_info->columns; } if (IsFileDescriptorLimitExceeded() != MagickFalse) (void) ClosePixelCacheOnDisk(cache_info); diff --git a/ImageMagick-7.1.1-15/MagickCore/cache.h b/ImageMagick-7.1.1-16/MagickCore/cache.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/cache.h rename to ImageMagick-7.1.1-16/MagickCore/cache.h diff --git a/ImageMagick-7.1.1-15/MagickCore/channel.c b/ImageMagick-7.1.1-16/MagickCore/channel.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/channel.c rename to ImageMagick-7.1.1-16/MagickCore/channel.c index c462135b..3ca1ecdd 100644 --- a/ImageMagick-7.1.1-15/MagickCore/channel.c +++ b/ImageMagick-7.1.1-16/MagickCore/channel.c @@ -411,7 +411,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, } } channel_mask=(ChannelType) (channel_mask | - (1UL << ParseChannelOption(token))); + (MagickLLConstant(1) << ParseChannelOption(token))); (void) GetNextToken(p,&p,MagickPathExtent,token); break; } @@ -442,7 +442,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, case ExtractChannelOp: { channel_mask=(ChannelType) (channel_mask | - (1UL << destination_channel)); + (MagickLLConstant(1) << destination_channel)); destination_channel=(PixelChannel) (destination_channel+1); break; } @@ -873,8 +873,8 @@ MagickExport Image *SeparateImages(const Image *image,ExceptionInfo *exception) PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits == UndefinedPixelTrait) || ((traits & UpdatePixelTrait) == 0)) continue; - separate_image=SeparateImage(image,(ChannelType) (1UL << channel), - exception); + separate_image=SeparateImage(image,(ChannelType) + (MagickLLConstant(1) << channel),exception); if (separate_image != (Image *) NULL) AppendImageToList(&images,separate_image); } @@ -968,7 +968,7 @@ static inline void FlattenPixelInfo(const Image *image,const PixelInfo *p, } case AlphaPixelChannel: { - composite[i]=ClampToQuantum(QuantumRange*(Sa*(-Da)+Sa+Da)); + composite[i]=ClampToQuantum((double) QuantumRange*(Sa*(-Da)+Sa+Da)); break; } default: @@ -1041,7 +1041,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, ssize_t i; - gamma=QuantumScale*GetPixelAlpha(image,q); + gamma=QuantumScale*(double) GetPixelAlpha(image,q); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { PixelChannel channel = GetPixelChannelChannel(image,i); @@ -1050,7 +1050,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, continue; if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(gamma*q[i]); + q[i]=ClampToQuantum(gamma*(double) q[i]); } q+=GetPixelChannels(image); } @@ -1162,7 +1162,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, ssize_t i; - Sa=QuantumScale*GetPixelAlpha(image,q); + Sa=QuantumScale*(double) GetPixelAlpha(image,q); gamma=PerceptibleReciprocal(Sa); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { @@ -1172,7 +1172,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, continue; if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(gamma*q[i]); + q[i]=ClampToQuantum(gamma*(double) q[i]); } q+=GetPixelChannels(image); } diff --git a/ImageMagick-7.1.1-15/MagickCore/channel.h b/ImageMagick-7.1.1-16/MagickCore/channel.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/channel.h rename to ImageMagick-7.1.1-16/MagickCore/channel.h diff --git a/ImageMagick-7.1.1-15/MagickCore/cipher.c b/ImageMagick-7.1.1-16/MagickCore/cipher.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/cipher.c rename to ImageMagick-7.1.1-16/MagickCore/cipher.c diff --git a/ImageMagick-7.1.1-15/MagickCore/cipher.h b/ImageMagick-7.1.1-16/MagickCore/cipher.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/cipher.h rename to ImageMagick-7.1.1-16/MagickCore/cipher.h diff --git a/ImageMagick-7.1.1-15/MagickCore/client.c b/ImageMagick-7.1.1-16/MagickCore/client.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/client.c rename to ImageMagick-7.1.1-16/MagickCore/client.c diff --git a/ImageMagick-7.1.1-15/MagickCore/client.h b/ImageMagick-7.1.1-16/MagickCore/client.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/client.h rename to ImageMagick-7.1.1-16/MagickCore/client.h diff --git a/ImageMagick-7.1.1-15/MagickCore/coder-private.h b/ImageMagick-7.1.1-16/MagickCore/coder-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/coder-private.h rename to ImageMagick-7.1.1-16/MagickCore/coder-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/coder.c b/ImageMagick-7.1.1-16/MagickCore/coder.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/coder.c rename to ImageMagick-7.1.1-16/MagickCore/coder.c index 93326849..1755ea8a 100644 --- a/ImageMagick-7.1.1-15/MagickCore/coder.c +++ b/ImageMagick-7.1.1-16/MagickCore/coder.c @@ -177,8 +177,8 @@ static SplayTreeInfo *AcquireCoderCache(ExceptionInfo *exception) coder_info->name=(char *) p->name; coder_info->exempt=MagickTrue; coder_info->signature=MagickCoreSignature; - status&=AddValueToSplayTree(cache,ConstantString(coder_info->magick), - coder_info); + status&=(MagickStatusType) AddValueToSplayTree(cache, + ConstantString(coder_info->magick),coder_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",coder_info->name); diff --git a/ImageMagick-7.1.1-15/MagickCore/coder.h b/ImageMagick-7.1.1-16/MagickCore/coder.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/coder.h rename to ImageMagick-7.1.1-16/MagickCore/coder.h diff --git a/ImageMagick-7.1.1-15/MagickCore/color-private.h b/ImageMagick-7.1.1-16/MagickCore/color-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/color-private.h rename to ImageMagick-7.1.1-16/MagickCore/color-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/color.c b/ImageMagick-7.1.1-16/MagickCore/color.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/color.c rename to ImageMagick-7.1.1-16/MagickCore/color.c index 070b0e72..318dd6ad 100644 --- a/ImageMagick-7.1.1-15/MagickCore/color.c +++ b/ImageMagick-7.1.1-16/MagickCore/color.c @@ -860,8 +860,8 @@ static LinkedListInfo *AcquireColorCache(const char *filename, option=(const StringInfo *) GetNextValueInLinkedList(options); while (option != (const StringInfo *) NULL) { - status&=LoadColorCache(cache,(const char *) GetStringInfoDatum(option), - GetStringInfoPath(option),0,exception); + status&=(MagickStatusType) LoadColorCache(cache,(const char *) + GetStringInfoDatum(option),GetStringInfoPath(option),0,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); } options=DestroyConfigureOptions(options); @@ -895,11 +895,11 @@ static LinkedListInfo *AcquireColorCache(const char *filename, color_info->color.red=(double) ScaleCharToQuantum(p->red); color_info->color.green=(double) ScaleCharToQuantum(p->green); color_info->color.blue=(double) ScaleCharToQuantum(p->blue); - color_info->color.alpha=((double) QuantumRange*p->alpha); + color_info->color.alpha=(double) QuantumRange*(double) p->alpha; color_info->compliance=(ComplianceType) p->compliance; color_info->exempt=MagickTrue; color_info->signature=MagickCoreSignature; - status&=AppendValueToLinkedList(cache,color_info); + status&=(MagickStatusType) AppendValueToLinkedList(cache,color_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",color_info->name); @@ -1230,10 +1230,10 @@ MagickExport void ConcatenateColorComponent(const PixelInfo *pixel, } if ((scale != 100.0f) || (pixel->colorspace == LabColorspace)) (void) FormatLocaleString(component,MagickPathExtent,"%.*g", - GetMagickPrecision(),(double) (scale*QuantumScale*color)); + GetMagickPrecision(),(double) scale*QuantumScale*(double) color); else (void) FormatLocaleString(component,MagickPathExtent,"%.*g%%", - GetMagickPrecision(),(double) (scale*QuantumScale*color)); + GetMagickPrecision(),(double) scale*QuantumScale*(double) color); (void) ConcatenateMagickString(tuple,component,MagickPathExtent); } @@ -2065,8 +2065,8 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *cache,const char *xml, file_xml=FileToXML(path,~0UL); if (file_xml != (char *) NULL) { - status&=LoadColorCache(cache,file_xml,path,depth+1, - exception); + status&=(MagickStatusType) LoadColorCache(cache,file_xml, + path,depth+1,exception); file_xml=DestroyString(file_xml); } } @@ -2347,13 +2347,13 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name, c=(*name++); pixel.blue<<=4; if ((c >= '0') && (c <= '9')) - pixel.blue|=(int) (c-'0'); + pixel.blue|=(unsigned int) (c-'0'); else if ((c >= 'A') && (c <= 'F')) - pixel.blue|=(int) c-((int) 'A'-10); + pixel.blue|=(unsigned int) (c-('A'-10)); else if ((c >= 'a') && (c <= 'f')) - pixel.blue|=(int) c-((int) 'a'-10); + pixel.blue|=(unsigned int) (c-('a'-10)); else return(MagickFalse); } @@ -2379,13 +2379,13 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name, c=(*name++); pixel.alpha<<=4; if ((c >= '0') && (c <= '9')) - pixel.alpha|=(int) (c-'0'); + pixel.alpha|=(unsigned int) (c-'0'); else if ((c >= 'A') && (c <= 'F')) - pixel.alpha|=(int) c-((int) 'A'-10); + pixel.alpha|=(unsigned int) c-('A'-10); else if ((c >= 'a') && (c <= 'f')) - pixel.alpha|=(int) c-((int) 'a'-10); + pixel.alpha|=(unsigned int) c-('a'-10); else return(MagickFalse); } @@ -2530,22 +2530,23 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name, geometry_info.psi)); else color->alpha=(double) ClampToQuantum((MagickRealType) ( - QuantumRange*geometry_info.psi)); + (double) QuantumRange*geometry_info.psi)); } } if (((flags & ChiValue) != 0) && (color->alpha_trait != UndefinedPixelTrait)) - color->alpha=(double) ClampToQuantum(QuantumRange*geometry_info.chi); + color->alpha=(double) ClampToQuantum((double) QuantumRange* + geometry_info.chi); if (color->colorspace == LabColorspace) { color->red=(MagickRealType) ClampToQuantum((MagickRealType) - (QuantumRange*geometry_info.rho/100.0)); + ((double) QuantumRange*geometry_info.rho/100.0)); if ((flags & SigmaValue) != 0) color->green=(MagickRealType) ClampToQuantum((MagickRealType) - (scale*geometry_info.sigma+(QuantumRange+1)/2.0)); + (scale*geometry_info.sigma+((double) QuantumRange+1)/2.0)); if ((flags & XiValue) != 0) color->blue=(MagickRealType) ClampToQuantum((MagickRealType) - (scale*geometry_info.xi+(QuantumRange+1)/2.0)); + (scale*geometry_info.xi+((double) QuantumRange+1)/2.0)); } if ((LocaleCompare(colorspace,"gray") == 0) || (LocaleCompare(colorspace,"lineargray") == 0)) @@ -2554,7 +2555,7 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name, color->blue=color->red; if (((flags & SigmaValue) != 0) && (color->alpha_trait != UndefinedPixelTrait)) - color->alpha=(double) ClampToQuantum(QuantumRange* + color->alpha=(double) ClampToQuantum((double) QuantumRange* geometry_info.sigma); } if ((LocaleCompare(colorspace,"HCL") == 0) || @@ -2627,7 +2628,7 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name, (LocaleNCompare(name,"grey",4) == 0)) color->colorspace=GRAYColorspace; color->depth=8; - color->alpha_trait=p->color.alpha != OpaqueAlpha ? BlendPixelTrait : + color->alpha_trait=p->color.alpha != (double) OpaqueAlpha ? BlendPixelTrait : UndefinedPixelTrait; color->red=(double) p->color.red; color->green=(double) p->color.green; @@ -2704,7 +2705,8 @@ MagickExport MagickBooleanType QueryColorname( name); if (IssRGBColorspace(pixel.colorspace) == MagickFalse) return(MagickFalse); - alpha=color->alpha_trait != UndefinedPixelTrait ? color->alpha : OpaqueAlpha; + alpha=color->alpha_trait != UndefinedPixelTrait ? (double) color->alpha : + (double) OpaqueAlpha; (void) GetColorInfo("*",exception); LockSemaphoreInfo(color_semaphore); p=GetHeadElementInLinkedList(color_cache); diff --git a/ImageMagick-7.1.1-15/MagickCore/color.h b/ImageMagick-7.1.1-16/MagickCore/color.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/color.h rename to ImageMagick-7.1.1-16/MagickCore/color.h diff --git a/ImageMagick-7.1.1-15/MagickCore/colormap-private.h b/ImageMagick-7.1.1-16/MagickCore/colormap-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/colormap-private.h rename to ImageMagick-7.1.1-16/MagickCore/colormap-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/colormap.c b/ImageMagick-7.1.1-16/MagickCore/colormap.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/colormap.c rename to ImageMagick-7.1.1-16/MagickCore/colormap.c index ba754bce..2a29441d 100644 --- a/ImageMagick-7.1.1-15/MagickCore/colormap.c +++ b/ImageMagick-7.1.1-16/MagickCore/colormap.c @@ -119,7 +119,7 @@ MagickExport MagickBooleanType AcquireImageColormap(Image *image, { image->colors=0; image->storage_class=DirectClass; - ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", + ThrowBinaryException(ResourceLimitError,"UnableToCreateColormap", image->filename); } image->colors=MagickMax(colors,1); @@ -142,7 +142,7 @@ MagickExport MagickBooleanType AcquireImageColormap(Image *image, pixel; GetPixelInfo(image,image->colormap+i); - pixel=(double) (i*(QuantumRange/MagickMax(colors-1,1))); + pixel=((double) i*(QuantumRange/MagickMax(colors-1,1))); image->colormap[i].red=pixel; image->colormap[i].green=pixel; image->colormap[i].blue=pixel; @@ -230,7 +230,8 @@ MagickExport MagickBooleanType CycleColormapImage(Image *image, } for (x=0; x < (ssize_t) image->columns; x++) { - index=(ssize_t) (GetPixelIndex(image,q)+displace) % image->colors; + index=(ssize_t) (GetPixelIndex(image,q)+displace) % (ssize_t) + image->colors; if (index < 0) index+=(ssize_t) image->colors; SetPixelIndex(image,(Quantum) index,q); diff --git a/ImageMagick-7.1.1-15/MagickCore/colormap.h b/ImageMagick-7.1.1-16/MagickCore/colormap.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/colormap.h rename to ImageMagick-7.1.1-16/MagickCore/colormap.h diff --git a/ImageMagick-7.1.1-15/MagickCore/colorspace-private.h b/ImageMagick-7.1.1-16/MagickCore/colorspace-private.h similarity index 88% rename from ImageMagick-7.1.1-15/MagickCore/colorspace-private.h rename to ImageMagick-7.1.1-16/MagickCore/colorspace-private.h index 5288e283..8a6ca081 100644 --- a/ImageMagick-7.1.1-15/MagickCore/colorspace-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/colorspace-private.h @@ -29,12 +29,12 @@ extern "C" { static inline void ConvertCMYKToRGB(PixelInfo *pixel) { - pixel->red=((QuantumRange-(QuantumScale*pixel->red*(QuantumRange- - pixel->black)+pixel->black))); - pixel->green=((QuantumRange-(QuantumScale*pixel->green*(QuantumRange- - pixel->black)+pixel->black))); - pixel->blue=((QuantumRange-(QuantumScale*pixel->blue*(QuantumRange- - pixel->black)+pixel->black))); + pixel->red=(((double) QuantumRange-(QuantumScale*pixel->red* + ((double) QuantumRange-pixel->black)+pixel->black))); + pixel->green=(((double) QuantumRange-(QuantumScale*pixel->green* + ((double) QuantumRange-pixel->black)+pixel->black))); + pixel->blue=(((double) QuantumRange-(QuantumScale*pixel->blue* + ((double) QuantumRange-pixel->black)+pixel->black))); } static inline void ConvertRGBToCMYK(PixelInfo *pixel) @@ -79,10 +79,10 @@ static inline void ConvertRGBToCMYK(PixelInfo *pixel) magenta=(MagickRealType) (PerceptibleReciprocal(1.0-black)*(magenta-black)); yellow=(MagickRealType) (PerceptibleReciprocal(1.0-black)*(yellow-black)); pixel->colorspace=CMYKColorspace; - pixel->red=QuantumRange*cyan; - pixel->green=QuantumRange*magenta; - pixel->blue=QuantumRange*yellow; - pixel->black=QuantumRange*black; + pixel->red=(MagickRealType) QuantumRange*cyan; + pixel->green=(MagickRealType) QuantumRange*magenta; + pixel->blue=(MagickRealType) QuantumRange*yellow; + pixel->black=(MagickRealType) QuantumRange*black; } static inline MagickBooleanType IsCMYKColorspace( diff --git a/ImageMagick-7.1.1-15/MagickCore/colorspace.c b/ImageMagick-7.1.1-16/MagickCore/colorspace.c similarity index 96% rename from ImageMagick-7.1.1-15/MagickCore/colorspace.c rename to ImageMagick-7.1.1-16/MagickCore/colorspace.c index b840c90d..864e5a03 100644 --- a/ImageMagick-7.1.1-15/MagickCore/colorspace.c +++ b/ImageMagick-7.1.1-16/MagickCore/colorspace.c @@ -208,9 +208,9 @@ static inline void ConvertProPhotoToRGB(const double r,const double g, static inline void ConvertRGBToCMY(const double red,const double green, const double blue,double *cyan,double *magenta,double *yellow) { - *cyan=QuantumScale*(QuantumRange-red); - *magenta=QuantumScale*(QuantumRange-green); - *yellow=QuantumScale*(QuantumRange-blue); + *cyan=QuantumScale*((double) QuantumRange-red); + *magenta=QuantumScale*((double) QuantumRange-green); + *yellow=QuantumScale*((double) QuantumRange-blue); } static void ConvertRGBToAdobe98(const double red,const double green, @@ -430,9 +430,9 @@ static inline void ConvertOklabToRGB(const double L,const double a, R=4.0767416621*l-3.3077115913*m+0.2309699292*s; G=(-1.2684380046)*l+2.6097574011*m-0.3413193965*s; B=(-0.0041960863)*l-0.7034186147*m+1.7076147010*s; - *red=EncodePixelGamma(QuantumRange*R); - *green=EncodePixelGamma(QuantumRange*G); - *blue=EncodePixelGamma(QuantumRange*B); + *red=EncodePixelGamma((double) QuantumRange*R); + *green=EncodePixelGamma((double) QuantumRange*G); + *blue=EncodePixelGamma((double) QuantumRange*B); } static void ConvertRGBToOklab(const double red,const double green, @@ -740,8 +740,8 @@ static MagickBooleanType sRGBTransformImage(Image *image, MagickRealType gray; - gray=0.212656*GetPixelRed(image,q)+0.715158*GetPixelGreen(image,q)+ - 0.072186*GetPixelBlue(image,q); + gray=0.212656*(double) GetPixelRed(image,q)+0.715158*(double) + GetPixelGreen(image,q)+0.072186*(double) GetPixelBlue(image,q); SetPixelGray(image,ClampToQuantum(gray),q); q+=GetPixelChannels(image); } @@ -982,9 +982,9 @@ static MagickBooleanType sRGBTransformImage(Image *image, break; } } - SetPixelRed(image,ClampToQuantum(QuantumRange*X),q); - SetPixelGreen(image,ClampToQuantum(QuantumRange*Y),q); - SetPixelBlue(image,ClampToQuantum(QuantumRange*Z),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*X),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*Y),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*Z),q); q+=GetPixelChannels(image); } sync=SyncCacheViewAuthenticPixels(image_view,exception); @@ -1756,9 +1756,9 @@ MagickExport MagickBooleanType TransformImageColorspace(Image *image, static inline void ConvertCMYToRGB(const double cyan,const double magenta, const double yellow,double *red,double *green,double *blue) { - *red=QuantumRange*(1.0-cyan); - *green=QuantumRange*(1.0-magenta); - *blue=QuantumRange*(1.0-yellow); + *red=(double) QuantumRange*(1.0-cyan); + *green=(double) QuantumRange*(1.0-magenta); + *blue=(double) QuantumRange*(1.0-yellow); } static inline void ConvertLMSToXYZ(const double L,const double M,const double S, @@ -1835,12 +1835,12 @@ static inline void ConvertxyYToRGB(const double low_x,const double low_y, static void ConvertYPbPrToRGB(const double Y,const double Pb,const double Pr, double *red,double *green,double *blue) { - *red=QuantumRange*(0.99999999999914679361*Y-1.2188941887145875e-06*(Pb-0.5)+ - 1.4019995886561440468*(Pr-0.5)); - *green=QuantumRange*(0.99999975910502514331*Y-0.34413567816504303521*(Pb-0.5)- - 0.71413649331646789076*(Pr-0.5)); - *blue=QuantumRange*(1.00000124040004623180*Y+1.77200006607230409200*(Pb-0.5)+ - 2.1453384174593273e-06*(Pr-0.5)); + *red=(double) QuantumRange*(0.99999999999914679361*Y-1.2188941887145875e-06* + (Pb-0.5)+1.4019995886561440468*(Pr-0.5)); + *green=(double) QuantumRange*(0.99999975910502514331*Y-0.34413567816504303521* + (Pb-0.5)-0.71413649331646789076*(Pr-0.5)); + *blue=(double) QuantumRange*(1.00000124040004623180*Y+1.77200006607230409200* + (Pb-0.5)+2.1453384174593273e-06*(Pr-0.5)); } static void ConvertYCbCrToRGB(const double Y,const double Cb, @@ -1852,34 +1852,34 @@ static void ConvertYCbCrToRGB(const double Y,const double Cb, static void ConvertYIQToRGB(const double Y,const double I,const double Q, double *red,double *green,double *blue) { - *red=QuantumRange*(Y+0.9562957197589482261*(I-0.5)+0.6210244164652610754* + *red=(double) QuantumRange*(Y+0.9562957197589482261*(I-0.5)+0.6210244164652610754* (Q-0.5)); - *green=QuantumRange*(Y-0.2721220993185104464*(I-0.5)-0.6473805968256950427* + *green=(double) QuantumRange*(Y-0.2721220993185104464*(I-0.5)-0.6473805968256950427* (Q-0.5)); - *blue=QuantumRange*(Y-1.1069890167364901945*(I-0.5)+1.7046149983646481374* + *blue=(double) QuantumRange*(Y-1.1069890167364901945*(I-0.5)+1.7046149983646481374* (Q-0.5)); } static void ConvertYDbDrToRGB(const double Y,const double Db,const double Dr, double *red,double *green,double *blue) { - *red=QuantumRange*(Y+9.2303716147657e-05*(Db-0.5)- + *red=(double) QuantumRange*(Y+9.2303716147657e-05*(Db-0.5)- 0.52591263066186533*(Dr-0.5)); - *green=QuantumRange*(Y-0.12913289889050927*(Db-0.5)+ + *green=(double) QuantumRange*(Y-0.12913289889050927*(Db-0.5)+ 0.26789932820759876*(Dr-0.5)); - *blue=QuantumRange*(Y+0.66467905997895482*(Db-0.5)- + *blue=(double) QuantumRange*(Y+0.66467905997895482*(Db-0.5)- 7.9202543533108e-05*(Dr-0.5)); } static void ConvertYUVToRGB(const double Y,const double U,const double V, double *red,double *green,double *blue) { - *red=QuantumRange*(Y-3.945707070708279e-05*(U-0.5)+1.1398279671717170825* - (V-0.5)); - *green=QuantumRange*(Y-0.3946101641414141437*(U-0.5)-0.5805003156565656797* - (V-0.5)); - *blue=QuantumRange*(Y+2.0319996843434342537*(U-0.5)-4.813762626262513e-04* - (V-0.5)); + *red=(double) QuantumRange*(Y-3.945707070708279e-05*(U-0.5)+ + 1.1398279671717170825*(V-0.5)); + *green=(double) QuantumRange*(Y-0.3946101641414141437*(U-0.5)- + 0.5805003156565656797*(V-0.5)); + *blue=(double) QuantumRange*(Y+2.0319996843434342537*(U-0.5)- + 4.813762626262513e-04*(V-0.5)); } static MagickBooleanType TransformsRGBImage(Image *image, @@ -2335,8 +2335,8 @@ static MagickBooleanType TransformsRGBImage(Image *image, MagickRealType gray; - gray=0.212656*GetPixelRed(image,q)+0.715158*GetPixelGreen(image,q)+ - 0.072186*GetPixelBlue(image,q); + gray=0.212656*(double) GetPixelRed(image,q)+0.715158*(double) + GetPixelGreen(image,q)+0.072186*(double) GetPixelBlue(image,q); SetPixelRed(image,ClampToQuantum(gray),q); SetPixelGreen(image,ClampToQuantum(gray),q); SetPixelBlue(image,ClampToQuantum(gray),q); @@ -2434,9 +2434,9 @@ static MagickBooleanType TransformsRGBImage(Image *image, Y, Z; - X=QuantumScale*GetPixelRed(image,q); - Y=QuantumScale*GetPixelGreen(image,q); - Z=QuantumScale*GetPixelBlue(image,q); + X=QuantumScale*(double) GetPixelRed(image,q); + Y=QuantumScale*(double) GetPixelGreen(image,q); + Z=QuantumScale*(double) GetPixelBlue(image,q); switch (image->colorspace) { case Adobe98Colorspace: @@ -2572,9 +2572,9 @@ static MagickBooleanType TransformsRGBImage(Image *image, } default: { - red=QuantumRange*X; - green=QuantumRange*Y; - blue=QuantumRange*Z; + red=(double) QuantumRange*X; + green=(double) QuantumRange*Y; + blue=(double) QuantumRange*Z; break; } } @@ -2638,11 +2638,11 @@ static MagickBooleanType TransformsRGBImage(Image *image, for (i=0; i <= (ssize_t) (reference_black*MaxMap/1024.0); i++) logmap[i]=(Quantum) 0; for ( ; i < (ssize_t) (reference_white*MaxMap/1024.0); i++) - logmap[i]=ClampToQuantum(QuantumRange/(1.0-black)* + logmap[i]=ClampToQuantum((double) QuantumRange/(1.0-black)* (pow(10.0,(1024.0*i/MaxMap-reference_white)*(gamma/density)*0.002* PerceptibleReciprocal(film_gamma))-black)); for ( ; i <= (ssize_t) MaxMap; i++) - logmap[i]=QuantumRange; + logmap[i]=(double) QuantumRange; if (image->storage_class == PseudoClass) { if (SyncImage(image,exception) == MagickFalse) @@ -2991,12 +2991,12 @@ static MagickBooleanType TransformsRGBImage(Image *image, pixel.blue=x_map[red].z+y_map[green].z+z_map[blue].z; if (image->colorspace == YCCColorspace) { - pixel.red=QuantumRange*YCCMap[RoundToYCC(1024.0*pixel.red/ - (double) MaxMap)]; - pixel.green=QuantumRange*YCCMap[RoundToYCC(1024.0*pixel.green/ - (double) MaxMap)]; - pixel.blue=QuantumRange*YCCMap[RoundToYCC(1024.0*pixel.blue/ - (double) MaxMap)]; + pixel.red=(double) QuantumRange*(double) + YCCMap[RoundToYCC(1024.0*pixel.red/(double) MaxMap)]; + pixel.green=(double) QuantumRange*(double) + YCCMap[RoundToYCC(1024.0*pixel.green/(double) MaxMap)]; + pixel.blue=(double) QuantumRange*(double) + YCCMap[RoundToYCC(1024.0*pixel.blue/(double) MaxMap)]; } else { @@ -3057,12 +3057,12 @@ static MagickBooleanType TransformsRGBImage(Image *image, pixel.blue=x_map[red].z+y_map[green].z+z_map[blue].z; if (image->colorspace == YCCColorspace) { - pixel.red=QuantumRange*YCCMap[RoundToYCC(1024.0*pixel.red/ - (double) MaxMap)]; - pixel.green=QuantumRange*YCCMap[RoundToYCC(1024.0*pixel.green/ - (double) MaxMap)]; - pixel.blue=QuantumRange*YCCMap[RoundToYCC(1024.0*pixel.blue/ - (double) MaxMap)]; + pixel.red=(double) QuantumRange*(double) YCCMap[RoundToYCC(1024.0* + pixel.red/(double) MaxMap)]; + pixel.green=(double) QuantumRange*(double) YCCMap[RoundToYCC(1024.0* + pixel.green/(double) MaxMap)]; + pixel.blue=(double) QuantumRange*(double) YCCMap[RoundToYCC(1024.0* + pixel.blue/(double) MaxMap)]; } else { diff --git a/ImageMagick-7.1.1-15/MagickCore/colorspace.h b/ImageMagick-7.1.1-16/MagickCore/colorspace.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/colorspace.h rename to ImageMagick-7.1.1-16/MagickCore/colorspace.h diff --git a/ImageMagick-7.1.1-15/MagickCore/compare.c b/ImageMagick-7.1.1-16/MagickCore/compare.c similarity index 95% rename from ImageMagick-7.1.1-15/MagickCore/compare.c rename to ImageMagick-7.1.1-16/MagickCore/compare.c index c7c361a8..eb52bbee 100644 --- a/ImageMagick-7.1.1-15/MagickCore/compare.c +++ b/ImageMagick-7.1.1-16/MagickCore/compare.c @@ -260,8 +260,8 @@ MagickExport Image *CompareImages(Image *image,const Image *reconstruct_image, continue; } difference=MagickFalse; - Sa=QuantumScale*GetPixelAlpha(image,p); - Da=QuantumScale*GetPixelAlpha(reconstruct_image,q); + Sa=QuantumScale*(double) GetPixelAlpha(image,p); + Da=QuantumScale*(double) GetPixelAlpha(reconstruct_image,q); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { double @@ -277,9 +277,11 @@ MagickExport Image *CompareImages(Image *image,const Image *reconstruct_image, ((reconstruct_traits & UpdatePixelTrait) == 0)) continue; if (channel == AlphaPixelChannel) - pixel=(double) p[i]-GetPixelChannel(reconstruct_image,channel,q); + pixel=(double) p[i]-(double) GetPixelChannel(reconstruct_image, + channel,q); else - pixel=Sa*p[i]-Da*GetPixelChannel(reconstruct_image,channel,q); + pixel=Sa*(double) p[i]-Da*(double) + GetPixelChannel(reconstruct_image,channel,q); distance=pixel*pixel; if (distance >= fuzz) { @@ -420,8 +422,8 @@ static MagickBooleanType GetAbsoluteDistortion(const Image *image, continue; } difference=MagickFalse; - Sa=QuantumScale*GetPixelAlpha(image,p); - Da=QuantumScale*GetPixelAlpha(reconstruct_image,q); + Sa=QuantumScale*(double) GetPixelAlpha(image,p); + Da=QuantumScale*(double) GetPixelAlpha(reconstruct_image,q); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { double @@ -437,9 +439,11 @@ static MagickBooleanType GetAbsoluteDistortion(const Image *image, ((reconstruct_traits & UpdatePixelTrait) == 0)) continue; if (channel == AlphaPixelChannel) - pixel=(double) p[i]-GetPixelChannel(reconstruct_image,channel,q); + pixel=(double) p[i]-(double) GetPixelChannel(reconstruct_image, + channel,q); else - pixel=Sa*p[i]-Da*GetPixelChannel(reconstruct_image,channel,q); + pixel=Sa*(double) p[i]-Da*(double) GetPixelChannel(reconstruct_image, + channel,q); distance=pixel*pixel; if (distance >= fuzz) { @@ -537,8 +541,8 @@ static MagickBooleanType GetFuzzDistortion(const Image *image, q+=GetPixelChannels(reconstruct_image); continue; } - Sa=QuantumScale*GetPixelAlpha(image,p); - Da=QuantumScale*GetPixelAlpha(reconstruct_image,q); + Sa=QuantumScale*(double) GetPixelAlpha(image,p); + Da=QuantumScale*(double) GetPixelAlpha(reconstruct_image,q); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { double @@ -553,11 +557,11 @@ static MagickBooleanType GetFuzzDistortion(const Image *image, ((reconstruct_traits & UpdatePixelTrait) == 0)) continue; if (channel == AlphaPixelChannel) - distance=QuantumScale*(p[i]-GetPixelChannel(reconstruct_image, - channel,q)); + distance=QuantumScale*((double) p[i]-(double) GetPixelChannel( + reconstruct_image,channel,q)); else - distance=QuantumScale*(Sa*p[i]-Da*GetPixelChannel(reconstruct_image, - channel,q)); + distance=QuantumScale*(Sa*(double) p[i]-Da*(double) GetPixelChannel( + reconstruct_image,channel,q)); channel_distortion[i]+=distance*distance; channel_distortion[CompositePixelChannel]+=distance*distance; } @@ -658,8 +662,8 @@ static MagickBooleanType GetMeanAbsoluteDistortion(const Image *image, q+=GetPixelChannels(reconstruct_image); continue; } - Sa=QuantumScale*GetPixelAlpha(image,p); - Da=QuantumScale*GetPixelAlpha(reconstruct_image,q); + Sa=QuantumScale*(double) GetPixelAlpha(image,p); + Da=QuantumScale*(double) GetPixelAlpha(reconstruct_image,q); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { double @@ -674,11 +678,11 @@ static MagickBooleanType GetMeanAbsoluteDistortion(const Image *image, ((reconstruct_traits & UpdatePixelTrait) == 0)) continue; if (channel == AlphaPixelChannel) - distance=QuantumScale*fabs((double) (p[i]-(double) - GetPixelChannel(reconstruct_image,channel,q))); + distance=QuantumScale*fabs((double) p[i]-(double) + GetPixelChannel(reconstruct_image,channel,q)); else - distance=QuantumScale*fabs((double) (Sa*p[i]-Da* - GetPixelChannel(reconstruct_image,channel,q))); + distance=QuantumScale*fabs(Sa*(double) p[i]-Da*(double) + GetPixelChannel(reconstruct_image,channel,q)); channel_distortion[i]+=distance; channel_distortion[CompositePixelChannel]+=distance; } @@ -766,8 +770,8 @@ static MagickBooleanType GetMeanErrorPerPixel(Image *image, q+=GetPixelChannels(reconstruct_image); continue; } - Sa=QuantumScale*GetPixelAlpha(image,p); - Da=QuantumScale*GetPixelAlpha(reconstruct_image,q); + Sa=QuantumScale*(double) GetPixelAlpha(image,p); + Da=QuantumScale*(double) GetPixelAlpha(reconstruct_image,q); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { double @@ -782,11 +786,11 @@ static MagickBooleanType GetMeanErrorPerPixel(Image *image, ((reconstruct_traits & UpdatePixelTrait) == 0)) continue; if (channel == AlphaPixelChannel) - distance=fabs((double) (p[i]-(double) - GetPixelChannel(reconstruct_image,channel,q))); + distance=fabs((double) p[i]-(double) + GetPixelChannel(reconstruct_image,channel,q)); else - distance=fabs((double) (Sa*p[i]-Da* - GetPixelChannel(reconstruct_image,channel,q))); + distance=fabs(Sa*(double) p[i]-Da*(double) + GetPixelChannel(reconstruct_image,channel,q)); distortion[i]+=distance; distortion[CompositePixelChannel]+=distance; mean_error+=distance*distance; @@ -879,8 +883,8 @@ static MagickBooleanType GetMeanSquaredDistortion(const Image *image, q+=GetPixelChannels(reconstruct_image); continue; } - Sa=QuantumScale*GetPixelAlpha(image,p); - Da=QuantumScale*GetPixelAlpha(reconstruct_image,q); + Sa=QuantumScale*(double) GetPixelAlpha(image,p); + Da=QuantumScale*(double) GetPixelAlpha(reconstruct_image,q); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { double @@ -895,11 +899,11 @@ static MagickBooleanType GetMeanSquaredDistortion(const Image *image, ((reconstruct_traits & UpdatePixelTrait) == 0)) continue; if (channel == AlphaPixelChannel) - distance=QuantumScale*(p[i]-GetPixelChannel(reconstruct_image, - channel,q)); + distance=QuantumScale*((double) p[i]-(double) GetPixelChannel( + reconstruct_image,channel,q)); else - distance=QuantumScale*(Sa*p[i]-Da*GetPixelChannel(reconstruct_image, - channel,q)); + distance=QuantumScale*(Sa*(double) p[i]-Da*(double) GetPixelChannel( + reconstruct_image,channel,q)); channel_distortion[i]+=distance*distance; channel_distortion[CompositePixelChannel]+=distance*distance; } @@ -1011,8 +1015,8 @@ static MagickBooleanType GetNormalizedCrossCorrelationDistortion( q+=GetPixelChannels(reconstruct_image); continue; } - Sa=QuantumScale*GetPixelAlpha(image,p); - Da=QuantumScale*GetPixelAlpha(reconstruct_image,q); + Sa=QuantumScale*(double) GetPixelAlpha(image,p); + Da=QuantumScale*(double) GetPixelAlpha(reconstruct_image,q); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { double @@ -1029,15 +1033,16 @@ static MagickBooleanType GetNormalizedCrossCorrelationDistortion( continue; if (channel == AlphaPixelChannel) { - alpha=QuantumScale*(p[i]-image_statistics[channel].mean); - beta=QuantumScale*(GetPixelChannel(reconstruct_image,channel,q)- - reconstruct_statistics[channel].mean); + alpha=QuantumScale*((double) p[i]-image_statistics[channel].mean); + beta=QuantumScale*((double) GetPixelChannel(reconstruct_image, + channel,q)-reconstruct_statistics[channel].mean); } else { - alpha=QuantumScale*(Sa*p[i]-image_statistics[channel].mean); - beta=QuantumScale*(Da*GetPixelChannel(reconstruct_image,channel,q)- - reconstruct_statistics[channel].mean); + alpha=QuantumScale*(Sa*(double) p[i]- + image_statistics[channel].mean); + beta=QuantumScale*(Da*(double) GetPixelChannel(reconstruct_image, + channel,q)-reconstruct_statistics[channel].mean); } distortion[i]+=alpha*beta; alpha_variance[i]+=alpha*alpha; @@ -1151,8 +1156,8 @@ static MagickBooleanType GetPeakAbsoluteDistortion(const Image *image, q+=GetPixelChannels(reconstruct_image); continue; } - Sa=QuantumScale*GetPixelAlpha(image,p); - Da=QuantumScale*GetPixelAlpha(reconstruct_image,q); + Sa=QuantumScale*(double) GetPixelAlpha(image,p); + Da=QuantumScale*(double) GetPixelAlpha(reconstruct_image,q); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { double @@ -1167,11 +1172,11 @@ static MagickBooleanType GetPeakAbsoluteDistortion(const Image *image, ((reconstruct_traits & UpdatePixelTrait) == 0)) continue; if (channel == AlphaPixelChannel) - distance=QuantumScale*fabs((double) (p[i]-(double) - GetPixelChannel(reconstruct_image,channel,q))); + distance=QuantumScale*fabs((double) p[i]-(double) + GetPixelChannel(reconstruct_image,channel,q)); else - distance=QuantumScale*fabs((double) (Sa*p[i]-Da* - GetPixelChannel(reconstruct_image,channel,q))); + distance=QuantumScale*fabs(Sa*(double) p[i]-Da*(double) + GetPixelChannel(reconstruct_image,channel,q)); if (distance > channel_distortion[i]) channel_distortion[i]=distance; if (distance > channel_distortion[CompositePixelChannel]) @@ -1467,10 +1472,10 @@ static MagickBooleanType GetStructuralSimilarityDistortion(const Image *image, (reconstruct_traits == UndefinedPixelTrait) || ((reconstruct_traits & UpdatePixelTrait) == 0)) continue; - x_pixel=QuantumScale*reference[i]; + x_pixel=QuantumScale*(double) reference[i]; x_pixel_mu[i]+=(*k)*x_pixel; x_pixel_sigma_squared[i]+=(*k)*x_pixel*x_pixel; - y_pixel=QuantumScale* + y_pixel=QuantumScale*(double) GetPixelChannel(reconstruct_image,channel,target); y_pixel_mu[i]+=(*k)*y_pixel; y_pixel_sigma_squared[i]+=(*k)*y_pixel*y_pixel; @@ -1900,8 +1905,8 @@ MagickExport MagickBooleanType IsImagesEqual(const Image *image, (reconstruct_traits == UndefinedPixelTrait) || ((reconstruct_traits & UpdatePixelTrait) == 0)) continue; - distance=fabs((double) (p[i]-(double) GetPixelChannel(reconstruct_image, - channel,q))); + distance=fabs((double) p[i]-(double) GetPixelChannel(reconstruct_image, + channel,q)); if (distance >= MagickEpsilon) break; } @@ -2033,8 +2038,8 @@ MagickExport MagickBooleanType SetImageColorMetric(Image *image, (reconstruct_traits == UndefinedPixelTrait) || ((reconstruct_traits & UpdatePixelTrait) == 0)) continue; - distance=fabs((double) (p[i]-(double) GetPixelChannel(reconstruct_image, - channel,q))); + distance=fabs((double) p[i]-(double) GetPixelChannel(reconstruct_image, + channel,q)); if (distance >= MagickEpsilon) { mean_error_per_pixel+=distance; @@ -2228,7 +2233,8 @@ static Image *NCCDivideImage(const Image *alpha_image,const Image *beta_image, if ((traits & UpdatePixelTrait) == 0) continue; if (fabs(p[i]) >= MagickEpsilon) - q[i]*=PerceptibleReciprocal(QuantumScale*p[i]); + q[i]=(Quantum) ((double) q[i]*PerceptibleReciprocal(QuantumScale* + (double) p[i])); } p+=GetPixelChannels(beta_image); q+=GetPixelChannels(divide_image); @@ -2294,7 +2300,7 @@ static MagickBooleanType NCCMaximaImage(const Image *image,double *maxima, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - sum+=p[i]; + sum+=(double) p[i]; channels++; } if ((channels != 0) && ((sum/channels) > *maxima)) @@ -2361,8 +2367,9 @@ static MagickBooleanType NCCMultiplyImage(Image *image,const double factor, if ((traits & UpdatePixelTrait) == 0) continue; if (channel_statistics != (const ChannelStatistics *) NULL) - q[i]*=QuantumScale*channel_statistics[channel].standard_deviation; - q[i]*=factor; + q[i]=(Quantum) ((double) q[i]*QuantumScale* + channel_statistics[channel].standard_deviation); + q[i]=(Quantum) ((double) q[i]*factor); } q+=GetPixelChannels(image); } @@ -2427,7 +2434,7 @@ static Image *NCCSquareImage(const Image *image,ExceptionInfo *exception) PixelTrait traits = GetPixelChannelTraits(square_image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - q[i]*=QuantumScale*q[i]; + q[i]=(Quantum) ((double) q[i]*QuantumScale*(double) q[i]); } q+=GetPixelChannels(square_image); } @@ -2508,7 +2515,7 @@ static Image *NCCSubtractImageMean(const Image *alpha_image, (y >= (ssize_t) beta_image->rows)) q[i]=(Quantum) 0; else - q[i]=p[i]-channel_statistics[channel].mean; + q[i]=(Quantum) ((double) p[i]-channel_statistics[channel].mean); } p+=GetPixelChannels(beta_image); q+=GetPixelChannels(gamma_image); @@ -2659,8 +2666,9 @@ static Image *NCCVarianceImage(Image *alpha_image,const Image *beta_image, PixelTrait traits = GetPixelChannelTraits(variance_image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum((QuantumRange*sqrt(fabs((double) QuantumScale* - (q[i]-p[i])))))/sqrt((double) QuantumRange); + q[i]=(Quantum) ((double) ClampToQuantum((double) QuantumRange*sqrt(fabs( + QuantumScale*((double) q[i]-(double) p[i]))))/ + sqrt((double) QuantumRange)); } p+=GetPixelChannels(beta_image); q+=GetPixelChannels(variance_image); @@ -2982,8 +2990,8 @@ MagickExport Image *SimilarityImage(const Image *image,const Image *reference, (similarity_traits == UndefinedPixelTrait) || ((similarity_traits & UpdatePixelTrait) == 0)) continue; - SetPixelChannel(similarity_image,channel,ClampToQuantum(QuantumRange- - QuantumRange*similarity),q); + SetPixelChannel(similarity_image,channel,ClampToQuantum((double) + QuantumRange-(double) QuantumRange*similarity),q); } q+=GetPixelChannels(similarity_image); } diff --git a/ImageMagick-7.1.1-15/MagickCore/compare.h b/ImageMagick-7.1.1-16/MagickCore/compare.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/compare.h rename to ImageMagick-7.1.1-16/MagickCore/compare.h diff --git a/ImageMagick-7.1.1-15/MagickCore/composite-private.h b/ImageMagick-7.1.1-16/MagickCore/composite-private.h similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/composite-private.h rename to ImageMagick-7.1.1-16/MagickCore/composite-private.h index 588ad940..97ef864e 100644 --- a/ImageMagick-7.1.1-15/MagickCore/composite-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/composite-private.h @@ -107,7 +107,8 @@ static inline void CompositePixelOver(const Image *image,const PixelInfo *p, } case AlphaPixelChannel: { - composite[i]=ClampToQuantum(QuantumRange*RoundToUnity(Sa+Da-Sa*Da)); + composite[i]=ClampToQuantum((double) QuantumRange* + RoundToUnity(Sa+Da-Sa*Da)); break; } default: diff --git a/ImageMagick-7.1.1-15/MagickCore/composite.c b/ImageMagick-7.1.1-16/MagickCore/composite.c similarity index 91% rename from ImageMagick-7.1.1-15/MagickCore/composite.c rename to ImageMagick-7.1.1-16/MagickCore/composite.c index f4049390..00f6d676 100644 --- a/ImageMagick-7.1.1-15/MagickCore/composite.c +++ b/ImageMagick-7.1.1-16/MagickCore/composite.c @@ -468,8 +468,8 @@ static Image *BlendSumImage(const Image *alpha_image,const Image *beta_image, (beta_traits == UndefinedPixelTrait) || ((beta_traits & UpdatePixelTrait) == 0)) continue; - r[i]=ClampToQuantum(attenuate*(p[i]+sign* - GetPixelChannel(beta_image,channel,q))); + r[i]=ClampToQuantum(attenuate*((double) p[i]+sign* + (double) GetPixelChannel(beta_image,channel,q))); } p+=GetPixelChannels(alpha_image); q+=GetPixelChannels(beta_image); @@ -726,7 +726,7 @@ static Image *BlendMeanImage(Image *image,const Image *mask_image, PixelTrait traits = GetPixelChannelTraits(image,channel); if (traits == UndefinedPixelTrait) continue; - mean[i]+=QuantumScale*p[i]; + mean[i]+=QuantumScale*(double) p[i]; } p+=GetPixelChannels(image); } @@ -872,8 +872,8 @@ static MagickBooleanType BlendRMSEResidual(const Image *alpha_image, q+=GetPixelChannels(beta_image); continue; } - Sa=QuantumScale*GetPixelAlpha(alpha_image,p); - Da=QuantumScale*GetPixelAlpha(beta_image,q); + Sa=QuantumScale*(double) GetPixelAlpha(alpha_image,p); + Da=QuantumScale*(double) GetPixelAlpha(beta_image,q); for (i=0; i < (ssize_t) GetPixelChannels(alpha_image); i++) { double @@ -887,10 +887,11 @@ static MagickBooleanType BlendRMSEResidual(const Image *alpha_image, ((beta_traits & UpdatePixelTrait) == 0)) continue; if (channel == AlphaPixelChannel) - distance=QuantumScale*(p[i]-GetPixelChannel(beta_image,channel,q)); + distance=QuantumScale*((double) p[i]-(double) GetPixelChannel( + beta_image,channel,q)); else - distance=QuantumScale*(Sa*p[i]-Da*GetPixelChannel(beta_image,channel, - q)); + distance=QuantumScale*(Sa*(double) p[i]-Da*(double) GetPixelChannel( + beta_image,channel,q)); channel_residual+=distance*distance; } local_area++; @@ -1115,8 +1116,8 @@ static MagickBooleanType CompositeOverImage(Image *image, Sa: normalized source alpha. Da: normalized canvas alpha. */ - Sa=QuantumScale*GetPixelAlpha(source_image,p); - Da=QuantumScale*GetPixelAlpha(image,q); + Sa=QuantumScale*(double) GetPixelAlpha(source_image,p); + Da=QuantumScale*(double) GetPixelAlpha(image,q); alpha=Sa+Da-Sa*Da; for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { @@ -1136,7 +1137,7 @@ static MagickBooleanType CompositeOverImage(Image *image, /* Set alpha channel. */ - pixel=QuantumRange*alpha; + pixel=(double) QuantumRange*alpha; q[i]=clamp != MagickFalse ? ClampPixel(pixel) : ClampToQuantum(pixel); continue; @@ -1163,7 +1164,7 @@ static MagickBooleanType CompositeOverImage(Image *image, Sca=QuantumScale*Sa*Sc; Dca=QuantumScale*Da*Dc; gamma=PerceptibleReciprocal(alpha); - pixel=QuantumRange*gamma*(Sca+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sca+Dca*(1.0-Sa)); q[i]=clamp != MagickFalse ? ClampPixel(pixel) : ClampToQuantum(pixel); } p+=GetPixelChannels(source_image); @@ -1254,9 +1255,9 @@ static void HCLComposite(const MagickRealType hue,const MagickRealType chroma, b=x; } m=luma-(0.298839*r+0.586811*g+0.114350*b); - *red=QuantumRange*(r+m); - *green=QuantumRange*(g+m); - *blue=QuantumRange*(b+m); + *red=(double) QuantumRange*(r+m); + *green=(double) QuantumRange*(g+m); + *blue=(double) QuantumRange*(b+m); } static MagickBooleanType SaliencyBlendImage(Image *image, @@ -1285,7 +1286,7 @@ static MagickBooleanType SaliencyBlendImage(Image *image, y_offset }; - ssize_t + size_t i; /* @@ -1337,7 +1338,7 @@ static MagickBooleanType SaliencyBlendImage(Image *image, verbose=IsStringTrue(GetImageArtifact(image,"verbose")); if (verbose != MagickFalse) (void) FormatLocaleFile(stderr,"saliency blending:\n"); - for (i=0; i < (ssize_t) iterations; i++) + for (i=0; i < iterations; i++) { double residual = 1.0; @@ -1417,7 +1418,7 @@ static MagickBooleanType SeamlessBlendImage(Image *image, y_offset }; - ssize_t + size_t i; /* @@ -1470,7 +1471,7 @@ static MagickBooleanType SeamlessBlendImage(Image *image, verbose=IsStringTrue(GetImageArtifact(image,"verbose")); if (verbose != MagickFalse) (void) FormatLocaleFile(stderr,"seamless blending:\n"); - for (i=0; i < (ssize_t) iterations; i++) + for (i=0; i < iterations; i++) { double residual = 1.0; @@ -1911,7 +1912,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, MagickRealType angle; - angle=angle_start+angle_range*QuantumScale* + angle=angle_start+angle_range*QuantumScale*(double) GetPixelBlue(source_image,p); blur.x1=width*cos(angle); blur.x2=width*sin(angle); @@ -1919,10 +1920,10 @@ MagickExport MagickBooleanType CompositeImage(Image *image, blur.y2=height*cos(angle); } ScaleResampleFilter(resample_filter, - blur.x1*QuantumScale*GetPixelRed(source_image,p), - blur.y1*QuantumScale*GetPixelGreen(source_image,p), - blur.x2*QuantumScale*GetPixelRed(source_image,p), - blur.y2*QuantumScale*GetPixelGreen(source_image,p) ); + blur.x1*QuantumScale*(double) GetPixelRed(source_image,p), + blur.y1*QuantumScale*(double) GetPixelGreen(source_image,p), + blur.x2*QuantumScale*(double) GetPixelRed(source_image,p), + blur.y2*QuantumScale*(double) GetPixelGreen(source_image,p) ); (void) ResamplePixelColor(resample_filter,(double) x_offset+x, (double) y_offset+y,&pixel,exception); SetPixelViaPixelInfo(canvas_image,&pixel,q); @@ -2080,14 +2081,14 @@ MagickExport MagickBooleanType CompositeImage(Image *image, /* Displace the offset. */ - offset.x=(double) (horizontal_scale*(GetPixelRed(source_image,p)- - (((MagickRealType) QuantumRange+1.0)/2.0)))/(((MagickRealType) - QuantumRange+1.0)/2.0)+center.x+((compose == DisplaceCompositeOp) ? - x : 0); - offset.y=(double) (vertical_scale*(GetPixelGreen(source_image,p)- - (((MagickRealType) QuantumRange+1.0)/2.0)))/(((MagickRealType) - QuantumRange+1.0)/2.0)+center.y+((compose == DisplaceCompositeOp) ? - y : 0); + offset.x=(double) (horizontal_scale*((double) GetPixelRed( + source_image,p)-(((MagickRealType) QuantumRange+1.0)/2.0)))/ + (((MagickRealType) QuantumRange+1.0)/2.0)+center.x+ + ((compose == DisplaceCompositeOp) ? x : 0); + offset.y=(double) (vertical_scale*((double) GetPixelGreen( + source_image,p)-(((MagickRealType) QuantumRange+1.0)/2.0)))/ + (((MagickRealType) QuantumRange+1.0)/2.0)+center.y+ + ((compose == DisplaceCompositeOp) ? y : 0); status=InterpolatePixelInfo(image,image_view, UndefinedInterpolatePixel,(double) offset.x,(double) offset.y, &pixel,exception); @@ -2097,7 +2098,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, Mask with the 'invalid pixel mask' in alpha channel. */ pixel.alpha=(MagickRealType) QuantumRange*(QuantumScale*pixel.alpha)* - (QuantumScale*GetPixelAlpha(source_image,p)); + (QuantumScale*(double) GetPixelAlpha(source_image,p)); SetPixelViaPixelInfo(canvas_image,&pixel,q); p+=GetPixelChannels(source_image); q+=GetPixelChannels(canvas_image); @@ -2253,7 +2254,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, if ((flags & SigmaValue) == 0) threshold=0.05f; } - threshold*=QuantumRange; + threshold*=(double) QuantumRange; break; } default: @@ -2424,7 +2425,8 @@ MagickExport MagickBooleanType CompositeImage(Image *image, case DissolveCompositeOp: { if (channel == AlphaPixelChannel) - pixel=canvas_dissolve*GetPixelAlpha(source_image,source); + pixel=canvas_dissolve*(double) GetPixelAlpha(source_image, + source); else pixel=(MagickRealType) source[channel]; break; @@ -2446,8 +2448,8 @@ MagickExport MagickBooleanType CompositeImage(Image *image, Sa: normalized source alpha. Da: normalized canvas alpha. */ - Sa=QuantumScale*GetPixelAlpha(source_image,p); - Da=QuantumScale*GetPixelAlpha(image,q); + Sa=QuantumScale*(double) GetPixelAlpha(source_image,p); + Da=QuantumScale*(double) GetPixelAlpha(image,q); switch (compose) { case BumpmapCompositeOp: @@ -2601,7 +2603,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, { case AlphaCompositeOp: { - pixel=QuantumRange*Sa; + pixel=(double) QuantumRange*Sa; break; } case AtopCompositeOp: @@ -2616,7 +2618,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, case DstCompositeOp: case NoCompositeOp: { - pixel=QuantumRange*Da; + pixel=(double) QuantumRange*Da; break; } case BumpmapCompositeOp: @@ -2629,7 +2631,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, if (IsFuzzyEquivalencePixel(source_image,p,image,q) != MagickFalse) pixel=(MagickRealType) TransparentAlpha; else - pixel=QuantumRange*Da; + pixel=(double) QuantumRange*Da; break; } case ClearCompositeOp: @@ -2643,22 +2645,22 @@ MagickExport MagickBooleanType CompositeImage(Image *image, case RMSECompositeOp: case SaturateCompositeOp: { - if (fabs((double) (QuantumRange*Sa-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Sa-(double) TransparentAlpha) < MagickEpsilon) { - pixel=QuantumRange*Da; + pixel=(double) QuantumRange*Da; break; } - if (fabs((double) (QuantumRange*Da-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Da-(double) TransparentAlpha) < MagickEpsilon) { - pixel=QuantumRange*Sa; + pixel=(double) QuantumRange*Sa; break; } if (Sa < Da) { - pixel=QuantumRange*Da; + pixel=(double) QuantumRange*Da; break; } - pixel=QuantumRange*Sa; + pixel=(double) QuantumRange*Sa; break; } case CopyAlphaCompositeOp: @@ -2666,7 +2668,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, if (source_image->alpha_trait == UndefinedPixelTrait) pixel=Si; else - pixel=QuantumRange*Sa; + pixel=(double) QuantumRange*Sa; break; } case BlurCompositeOp: @@ -2677,7 +2679,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, case ReplaceCompositeOp: case SrcCompositeOp: { - pixel=QuantumRange*Sa; + pixel=(double) QuantumRange*Sa; break; } case DarkenIntensityCompositeOp: @@ -2692,12 +2694,12 @@ MagickExport MagickBooleanType CompositeImage(Image *image, } case DifferenceCompositeOp: { - pixel=QuantumRange*fabs((double) (Sa-Da)); + pixel=(double) QuantumRange*fabs((double) (Sa-Da)); break; } case FreezeCompositeOp: { - pixel=QuantumRange*(1.0-(1.0-Sa)*(1.0-Sa)* + pixel=(double) QuantumRange*(1.0-(1.0-Sa)*(1.0-Sa)* PerceptibleReciprocal(Da)); if (pixel < 0.0) pixel=0.0; @@ -2705,7 +2707,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, } case InterpolateCompositeOp: { - pixel=QuantumRange*(0.5-0.25*cos(MagickPI*Sa)-0.25* + pixel=(double) QuantumRange*(0.5-0.25*cos(MagickPI*Sa)-0.25* cos(MagickPI*Da)); break; } @@ -2721,44 +2723,45 @@ MagickExport MagickBooleanType CompositeImage(Image *image, } case ModulateCompositeOp: { - pixel=QuantumRange*Da; + pixel=(double) QuantumRange*Da; break; } case MultiplyCompositeOp: { if (compose_sync == MagickFalse) { - pixel=QuantumRange*Sa*Da; + pixel=(double) QuantumRange*Sa*Da; break; } - pixel=QuantumRange*alpha; + pixel=(double) QuantumRange*alpha; break; } case NegateCompositeOp: { - pixel=QuantumRange*((1.0-Sa-Da)); + pixel=(double) QuantumRange*((1.0-Sa-Da)); break; } case ReflectCompositeOp: { - pixel=QuantumRange*(Sa*Sa*PerceptibleReciprocal(1.0-Da)); - if (pixel > QuantumRange) - pixel=QuantumRange; + pixel=(double) QuantumRange*(Sa*Sa* + PerceptibleReciprocal(1.0-Da)); + if (pixel > (double) QuantumRange) + pixel=(double) QuantumRange; break; } case StampCompositeOp: { - pixel=QuantumRange*(Sa+Da*Da-1.0); + pixel=(double) QuantumRange*(Sa+Da*Da-1.0); break; } case StereoCompositeOp: { - pixel=QuantumRange*(Sa+Da)/2; + pixel=(double) QuantumRange*(Sa+Da)/2; break; } default: { - pixel=QuantumRange*alpha; + pixel=(double) QuantumRange*alpha; break; } } @@ -2811,13 +2814,13 @@ MagickExport MagickBooleanType CompositeImage(Image *image, { case AlphaCompositeOp: { - pixel=QuantumRange*Sa; + pixel=(double) QuantumRange*Sa; break; } case AtopCompositeOp: case SrcAtopCompositeOp: { - pixel=QuantumRange*(Sca*Da+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*(Sca*Da+Dca*(1.0-Sa)); break; } case BlendCompositeOp: @@ -2829,7 +2832,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, case ReplaceCompositeOp: case SrcCompositeOp: { - pixel=QuantumRange*Sca; + pixel=(double) QuantumRange*Sca; break; } case BlurCompositeOp: @@ -2841,12 +2844,12 @@ MagickExport MagickBooleanType CompositeImage(Image *image, } case BumpmapCompositeOp: { - if (fabs((double) (QuantumRange*Sa-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Sa-(double) TransparentAlpha) < MagickEpsilon) { pixel=Dc; break; } - pixel=QuantumScale*Si*Dc; + pixel=(double) QuantumScale*Si*Dc; break; } case ChangeMaskCompositeOp: @@ -2863,35 +2866,36 @@ MagickExport MagickBooleanType CompositeImage(Image *image, { if ((Sca == 0.0) && (Dca == Da)) { - pixel=QuantumRange*gamma*(Sa*Da+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sa*Da+Dca*(1.0-Sa)); break; } if (Sca == 0.0) { - pixel=QuantumRange*gamma*(Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Dca*(1.0-Sa)); break; } - pixel=QuantumRange*gamma*(Sa*Da-Sa*Da*MagickMin(1.0,(1.0-DcaDa)* - SaSca)+Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sa*Da-Sa*Da*MagickMin(1.0, + (1.0-DcaDa)*SaSca)+Sca*(1.0-Da)+Dca*(1.0-Sa)); break; } case ColorDodgeCompositeOp: { if ((Sca*Da+Dca*Sa) >= Sa*Da) - pixel=QuantumRange*gamma*(Sa*Da+Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sa*Da+Sca*(1.0-Da)+Dca* + (1.0-Sa)); else - pixel=QuantumRange*gamma*(Dca*Sa*Sa*PerceptibleReciprocal(Sa-Sca)+ - Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Dca*Sa*Sa* + PerceptibleReciprocal(Sa-Sca)+Sca*(1.0-Da)+Dca*(1.0-Sa)); break; } case ColorizeCompositeOp: { - if (fabs((double) (QuantumRange*Sa-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Sa-(double) TransparentAlpha) < MagickEpsilon) { pixel=Dc; break; } - if (fabs((double) (QuantumRange*Da-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Da-(double) TransparentAlpha) < MagickEpsilon) { pixel=Sc; break; @@ -2956,10 +2960,10 @@ MagickExport MagickBooleanType CompositeImage(Image *image, } if ((Sca*Da) < (Dca*Sa)) { - pixel=QuantumRange*(Sca+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*(Sca+Dca*(1.0-Sa)); break; } - pixel=QuantumRange*(Dca+Sca*(1.0-Da)); + pixel=(double) QuantumRange*(Dca+Sca*(1.0-Da)); break; } case DarkenIntensityCompositeOp: @@ -2979,7 +2983,8 @@ MagickExport MagickBooleanType CompositeImage(Image *image, pixel=fabs((double) Sc-Dc); break; } - pixel=QuantumRange*gamma*(Sca+Dca-2.0*MagickMin(Sca*Da,Dca*Sa)); + pixel=(double) QuantumRange*gamma*(Sca+Dca-2.0*MagickMin(Sca*Da, + Dca*Sa)); break; } case DissolveCompositeOp: @@ -2992,79 +2997,83 @@ MagickExport MagickBooleanType CompositeImage(Image *image, { if (compose_sync == MagickFalse) { - pixel=QuantumRange*(Sc/PerceptibleReciprocal(Dc)); + pixel=(double) QuantumRange*(Sc/PerceptibleReciprocal(Dc)); break; } if ((fabs((double) Sca) < MagickEpsilon) && (fabs((double) Dca) < MagickEpsilon)) { - pixel=QuantumRange*gamma*(Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sca*(1.0-Da)+Dca*(1.0-Sa)); break; } if (fabs((double) Dca) < MagickEpsilon) { - pixel=QuantumRange*gamma*(Sa*Da+Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sa*Da+Sca*(1.0-Da)+Dca* + (1.0-Sa)); break; } - pixel=QuantumRange*gamma*(Sca*Da*Da/Dca+Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sca*Da*Da/Dca+Sca*(1.0-Da)+Dca* + (1.0-Sa)); break; } case DivideSrcCompositeOp: { if (compose_sync == MagickFalse) { - pixel=QuantumRange*(Dc/PerceptibleReciprocal(Sc)); + pixel=(double) QuantumRange*(Dc/PerceptibleReciprocal(Sc)); break; } if ((fabs((double) Dca) < MagickEpsilon) && (fabs((double) Sca) < MagickEpsilon)) { - pixel=QuantumRange*gamma*(Dca*(1.0-Sa)+Sca*(1.0-Da)); + pixel=(double) QuantumRange*gamma*(Dca*(1.0-Sa)+Sca*(1.0-Da)); break; } if (fabs((double) Sca) < MagickEpsilon) { - pixel=QuantumRange*gamma*(Da*Sa+Dca*(1.0-Sa)+Sca*(1.0-Da)); + pixel=(double) QuantumRange*gamma*(Da*Sa+Dca*(1.0-Sa)+Sca* + (1.0-Da)); break; } - pixel=QuantumRange*gamma*(Dca*Sa*SaSca+Dca*(1.0-Sa)+Sca*(1.0-Da)); + pixel=(double) QuantumRange*gamma*(Dca*Sa*SaSca+Dca*(1.0-Sa)+Sca* + (1.0-Da)); break; } case DstAtopCompositeOp: { - pixel=QuantumRange*(Dca*Sa+Sca*(1.0-Da)); + pixel=(double) QuantumRange*(Dca*Sa+Sca*(1.0-Da)); break; } case DstCompositeOp: case NoCompositeOp: { - pixel=QuantumRange*Dca; + pixel=(double) QuantumRange*Dca; break; } case DstInCompositeOp: { - pixel=QuantumRange*gamma*(Dca*Sa); + pixel=(double) QuantumRange*gamma*(Dca*Sa); break; } case DstOutCompositeOp: { - pixel=QuantumRange*gamma*(Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Dca*(1.0-Sa)); break; } case DstOverCompositeOp: { - pixel=QuantumRange*gamma*(Dca+Sca*(1.0-Da)); + pixel=(double) QuantumRange*gamma*(Dca+Sca*(1.0-Da)); break; } case ExclusionCompositeOp: { - pixel=QuantumRange*gamma*(Sca*Da+Dca*Sa-2.0*Sca*Dca+Sca*(1.0-Da)+ - Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sca*Da+Dca*Sa-2.0*Sca*Dca+Sca* + (1.0-Da)+Dca*(1.0-Sa)); break; } case FreezeCompositeOp: { - pixel=QuantumRange*gamma*(1.0-(1.0-Sca)*(1.0-Sca)* + pixel=(double) QuantumRange*gamma*(1.0-(1.0-Sca)*(1.0-Sca)* PerceptibleReciprocal(Dca)); if (pixel < 0.0) pixel=0.0; @@ -3074,27 +3083,27 @@ MagickExport MagickBooleanType CompositeImage(Image *image, { if ((2.0*Sca) < Sa) { - pixel=QuantumRange*gamma*(2.0*Sca*Dca+Sca*(1.0-Da)+Dca*(1.0- - Sa)); + pixel=(double) QuantumRange*gamma*(2.0*Sca*Dca+Sca*(1.0-Da)+Dca* + (1.0-Sa)); break; } - pixel=QuantumRange*gamma*(Sa*Da-2.0*(Da-Dca)*(Sa-Sca)+Sca*(1.0-Da)+ - Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sa*Da-2.0*(Da-Dca)*(Sa-Sca)+Sca* + (1.0-Da)+Dca*(1.0-Sa)); break; } case HardMixCompositeOp: { - pixel=gamma*(((Sca+Dca) < 1.0) ? 0.0 : QuantumRange); + pixel=gamma*(((Sca+Dca) < 1.0) ? 0.0 : (double) QuantumRange); break; } case HueCompositeOp: { - if (fabs((double) (QuantumRange*Sa-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Sa-(double) TransparentAlpha) < MagickEpsilon) { pixel=Dc; break; } - if (fabs((double) (QuantumRange*Da-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Da-(double) TransparentAlpha) < MagickEpsilon) { pixel=Sc; break; @@ -3116,12 +3125,12 @@ MagickExport MagickBooleanType CompositeImage(Image *image, case InCompositeOp: case SrcInCompositeOp: { - pixel=QuantumRange*(Sca*Da); + pixel=(double) QuantumRange*(Sca*Da); break; } case InterpolateCompositeOp: { - pixel=QuantumRange*(0.5-0.25*cos(MagickPI*Sca)-0.25* + pixel=(double) QuantumRange*(0.5-0.25*cos(MagickPI*Sca)-0.25* cos(MagickPI*Dca)); break; } @@ -3133,7 +3142,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, f(Sc,Dc) = Sc + Dc - 1 */ - pixel=QuantumRange*gamma*(Sca+Dca-Sa*Da); + pixel=(double) QuantumRange*gamma*(Sca+Dca-Sa*Da); break; } case LinearDodgeCompositeOp: @@ -3149,7 +3158,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, f(Sc,Dc) = Dc + 2*Sc - 1 */ - pixel=QuantumRange*gamma*((Sca-Sa)*Da+Sca+Dca); + pixel=(double) QuantumRange*gamma*((Sca-Sa)*Da+Sca+Dca); break; } case LightenCompositeOp: @@ -3161,10 +3170,10 @@ MagickExport MagickBooleanType CompositeImage(Image *image, } if ((Sca*Da) > (Dca*Sa)) { - pixel=QuantumRange*(Sca+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*(Sca+Dca*(1.0-Sa)); break; } - pixel=QuantumRange*(Dca+Sca*(1.0-Da)); + pixel=(double) QuantumRange*(Dca+Sca*(1.0-Da)); break; } case LightenIntensityCompositeOp: @@ -3184,12 +3193,12 @@ MagickExport MagickBooleanType CompositeImage(Image *image, } case LuminizeCompositeOp: { - if (fabs((double) (QuantumRange*Sa-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Sa-(double) TransparentAlpha) < MagickEpsilon) { pixel=Dc; break; } - if (fabs((double) (QuantumRange*Da-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Da-(double) TransparentAlpha) < MagickEpsilon) { pixel=Sc; break; @@ -3235,7 +3244,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, geometry_info.xi*Dc+geometry_info.psi; break; } - pixel=QuantumRange*gamma*(geometry_info.rho*Sca*Dca+ + pixel=(double) QuantumRange*gamma*(geometry_info.rho*Sca*Dca+ geometry_info.sigma*Sca*Da+geometry_info.xi*Dca*Sa+ geometry_info.psi*Sa*Da+Sca*(1.0-Da)+Dca*(1.0-Sa)); break; @@ -3270,7 +3279,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, ssize_t offset; - if (fabs((double) (QuantumRange*Sa-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Sa-(double) TransparentAlpha) < MagickEpsilon) { pixel=Dc; break; @@ -3304,10 +3313,10 @@ MagickExport MagickBooleanType CompositeImage(Image *image, } if ((Sca+Dca) <= 1.0) { - pixel=QuantumRange*(Sca+Dca); + pixel=(double) QuantumRange*(Sca+Dca); break; } - pixel=QuantumRange*((Sca+Dca)-1.0); + pixel=(double) QuantumRange*((Sca+Dca)-1.0); break; } case ModulusSubtractCompositeOp: @@ -3319,49 +3328,50 @@ MagickExport MagickBooleanType CompositeImage(Image *image, } if ((Sca-Dca) >= 0.0) { - pixel=QuantumRange*(Sca-Dca); + pixel=(double) QuantumRange*(Sca-Dca); break; } - pixel=QuantumRange*((Sca-Dca)+1.0); + pixel=(double) QuantumRange*((Sca-Dca)+1.0); break; } case MultiplyCompositeOp: { if (compose_sync == MagickFalse) { - pixel=QuantumScale*Dc*Sc; + pixel=(double) QuantumScale*Dc*Sc; break; } - pixel=QuantumRange*gamma*(Sca*Dca+Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sca*Dca+Sca*(1.0-Da)+Dca* + (1.0-Sa)); break; } case NegateCompositeOp: { - pixel=QuantumRange*(1.0-fabs(1.0-Sca-Dca)); + pixel=(double) QuantumRange*(1.0-fabs(1.0-Sca-Dca)); break; } case OutCompositeOp: case SrcOutCompositeOp: { - pixel=QuantumRange*(Sca*(1.0-Da)); + pixel=(double) QuantumRange*(Sca*(1.0-Da)); break; } case OverCompositeOp: case SrcOverCompositeOp: { - pixel=QuantumRange*gamma*(Sca+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sca+Dca*(1.0-Sa)); break; } case OverlayCompositeOp: { if ((2.0*Dca) < Da) { - pixel=QuantumRange*gamma*(2.0*Dca*Sca+Dca*(1.0-Sa)+Sca*(1.0- - Da)); + pixel=(double) QuantumRange*gamma*(2.0*Dca*Sca+Dca*(1.0-Sa)+ + Sca*(1.0-Da)); break; } - pixel=QuantumRange*gamma*(Da*Sa-2.0*(Sa-Sca)*(Da-Dca)+Dca*(1.0-Sa)+ - Sca*(1.0-Da)); + pixel=(double) QuantumRange*gamma*(Da*Sa-2.0*(Sa-Sca)*(Da-Dca)+Dca* + (1.0-Sa)+Sca*(1.0-Da)); break; } case PegtopLightCompositeOp: @@ -3376,11 +3386,11 @@ MagickExport MagickBooleanType CompositeImage(Image *image, */ if (fabs((double) Da) < MagickEpsilon) { - pixel=QuantumRange*gamma*Sca; + pixel=(double) QuantumRange*gamma*Sca; break; } - pixel=QuantumRange*gamma*(Dca*Dca*(Sa-2.0*Sca)/Da+Sca*(2.0*Dca+1.0- - Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Dca*Dca*(Sa-2.0*Sca)/Da+Sca* + (2.0*Dca+1.0-Da)+Dca*(1.0-Sa)); break; } case PinLightCompositeOp: @@ -3393,15 +3403,16 @@ MagickExport MagickBooleanType CompositeImage(Image *image, */ if ((Dca*Sa) < (Da*(2.0*Sca-Sa))) { - pixel=QuantumRange*gamma*(Sca*(Da+1.0)-Sa*Da+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sca*(Da+1.0)-Sa*Da+Dca* + (1.0-Sa)); break; } if ((Dca*Sa) > (2.0*Sca*Da)) { - pixel=QuantumRange*gamma*(Sca*Da+Sca+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sca*Da+Sca+Dca*(1.0-Sa)); break; } - pixel=QuantumRange*gamma*(Sca*(1.0-Da)+Dca); + pixel=(double) QuantumRange*gamma*(Sca*(1.0-Da)+Dca); break; } case PlusCompositeOp: @@ -3411,14 +3422,15 @@ MagickExport MagickBooleanType CompositeImage(Image *image, pixel=(Dc+Sc); break; } - pixel=QuantumRange*(Sca+Dca); + pixel=(double) QuantumRange*(Sca+Dca); break; } case ReflectCompositeOp: { - pixel=QuantumRange*gamma*(Sca*Sca*PerceptibleReciprocal(1.0-Dca)); - if (pixel > QuantumRange) - pixel=QuantumRange; + pixel=(double) QuantumRange*gamma*(Sca*Sca* + PerceptibleReciprocal(1.0-Dca)); + if (pixel > (double) QuantumRange) + pixel=(double) QuantumRange; break; } case RMSECompositeOp: @@ -3426,12 +3438,12 @@ MagickExport MagickBooleanType CompositeImage(Image *image, double gray; - if (fabs((double) (QuantumRange*Sa-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Sa-(double) TransparentAlpha) < MagickEpsilon) { pixel=Dc; break; } - if (fabs((double) (QuantumRange*Da-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Da-(double) TransparentAlpha) < MagickEpsilon) { pixel=Sc; break; @@ -3454,12 +3466,12 @@ MagickExport MagickBooleanType CompositeImage(Image *image, } case SaturateCompositeOp: { - if (fabs((double) (QuantumRange*Sa-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Sa-(double) TransparentAlpha) < MagickEpsilon) { pixel=Dc; break; } - if (fabs((double) (QuantumRange*Da-TransparentAlpha)) < MagickEpsilon) + if (fabs((double) QuantumRange*Da-(double) TransparentAlpha) < MagickEpsilon) { pixel=Sc; break; @@ -3490,24 +3502,26 @@ MagickExport MagickBooleanType CompositeImage(Image *image, pixel=Sc+Dc-Sc*Dc; break; } - pixel=QuantumRange*gamma*(Sca+Dca-Sca*Dca); + pixel=(double) QuantumRange*gamma*(Sca+Dca-Sca*Dca); break; } case SoftBurnCompositeOp: { if ((Sca+Dca) < 1.0) - pixel=QuantumRange*gamma*(0.5*Dca*PerceptibleReciprocal(1.0-Sca)); + pixel=(double) QuantumRange*gamma*(0.5*Dca* + PerceptibleReciprocal(1.0-Sca)); else - pixel=QuantumRange*gamma*(1.0-0.5*(1.0-Sca)* + pixel=(double) QuantumRange*gamma*(1.0-0.5*(1.0-Sca)* PerceptibleReciprocal(Dca)); break; } case SoftDodgeCompositeOp: { if ((Sca+Dca) < 1.0) - pixel=QuantumRange*gamma*(0.5*Sca*PerceptibleReciprocal(1.0-Dca)); + pixel=(double) QuantumRange*gamma*(0.5*Sca* + PerceptibleReciprocal(1.0-Dca)); else - pixel=QuantumRange*gamma*(1.0-0.5*(1.0-Dca)* + pixel=(double) QuantumRange*gamma*(1.0-0.5*(1.0-Dca)* PerceptibleReciprocal(Sca)); break; } @@ -3515,24 +3529,24 @@ MagickExport MagickBooleanType CompositeImage(Image *image, { if ((2.0*Sca) < Sa) { - pixel=QuantumRange*gamma*(Dca*(Sa+(2.0*Sca-Sa)*(1.0-DcaDa))+ - Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Dca*(Sa+(2.0*Sca-Sa)* + (1.0-DcaDa))+Sca*(1.0-Da)+Dca*(1.0-Sa)); break; } if (((2.0*Sca) > Sa) && ((4.0*Dca) <= Da)) { - pixel=QuantumRange*gamma*(Dca*Sa+Da*(2.0*Sca-Sa)*(4.0*DcaDa* - (4.0*DcaDa+1.0)*(DcaDa-1.0)+7.0*DcaDa)+Sca*(1.0-Da)+ - Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Dca*Sa+Da*(2.0*Sca-Sa)* + (4.0*DcaDa*(4.0*DcaDa+1.0)*(DcaDa-1.0)+7.0*DcaDa)+Sca* + (1.0-Da)+Dca*(1.0-Sa)); break; } - pixel=QuantumRange*gamma*(Dca*Sa+Da*(2.0*Sca-Sa)*(pow(DcaDa,0.5)- - DcaDa)+Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Dca*Sa+Da*(2.0*Sca-Sa)* + (pow(DcaDa,0.5)-DcaDa)+Sca*(1.0-Da)+Dca*(1.0-Sa)); break; } case StampCompositeOp: { - pixel=QuantumRange*(Sca+Dca*Dca-1.0); + pixel=(double) QuantumRange*(Sca+Dca*Dca-1.0); break; } case StereoCompositeOp: @@ -3566,22 +3580,23 @@ MagickExport MagickBooleanType CompositeImage(Image *image, if ((fabs((double) Sa) < MagickEpsilon) || (fabs((double) (Sca-Sa)) < MagickEpsilon)) { - pixel=QuantumRange*gamma*(Sa*Da+Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Sa*Da+Sca*(1.0-Da)+Dca* + (1.0-Sa)); break; } if ((2.0*Sca) <= Sa) { - pixel=QuantumRange*gamma*(Sa*(Da+Sa*(Dca-Da)* + pixel=(double) QuantumRange*gamma*(Sa*(Da+Sa*(Dca-Da)* PerceptibleReciprocal(2.0*Sca))+Sca*(1.0-Da)+Dca*(1.0-Sa)); break; } - pixel=QuantumRange*gamma*(Dca*Sa*Sa*PerceptibleReciprocal(2.0* - (Sa-Sca))+Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*gamma*(Dca*Sa*Sa* + PerceptibleReciprocal(2.0*(Sa-Sca))+Sca*(1.0-Da)+Dca*(1.0-Sa)); break; } case XorCompositeOp: { - pixel=QuantumRange*(Sca*(1.0-Da)+Dca*(1.0-Sa)); + pixel=(double) QuantumRange*(Sca*(1.0-Da)+Dca*(1.0-Sa)); break; } default: @@ -3758,7 +3773,7 @@ MagickExport MagickBooleanType TextureImage(Image *image,const Image *texture, if (status == MagickFalse) continue; pixels=GetCacheViewVirtualPixels(texture_view,texture_image->tile_offset.x, - (y+texture_image->tile_offset.y) % texture_image->rows, + (y+texture_image->tile_offset.y) % (ssize_t) texture_image->rows, texture_image->columns,1,exception); q=QueueCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception); if ((pixels == (const Quantum *) NULL) || (q == (Quantum *) NULL)) @@ -3774,7 +3789,7 @@ MagickExport MagickBooleanType TextureImage(Image *image,const Image *texture, p=pixels; width=texture_image->columns; if ((x+(ssize_t) width) > (ssize_t) image->columns) - width=image->columns-x; + width=image->columns-(size_t) x; for (j=0; j < (ssize_t) width; j++) { ssize_t diff --git a/ImageMagick-7.1.1-15/MagickCore/composite.h b/ImageMagick-7.1.1-16/MagickCore/composite.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/composite.h rename to ImageMagick-7.1.1-16/MagickCore/composite.h diff --git a/ImageMagick-7.1.1-15/MagickCore/compress.c b/ImageMagick-7.1.1-16/MagickCore/compress.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/compress.c rename to ImageMagick-7.1.1-16/MagickCore/compress.c index 170726aa..2efa6ccd 100644 --- a/ImageMagick-7.1.1-15/MagickCore/compress.c +++ b/ImageMagick-7.1.1-16/MagickCore/compress.c @@ -233,13 +233,11 @@ static inline void Ascii85Tuple(Ascii85Info *ascii85_info, { #define MaxLineExtent 36L - ssize_t - i, - x; - size_t code, - quantum; + i, + quantum, + x; code=((((size_t) data[0] << 8) | (size_t) data[1]) << 16) | ((size_t) data[2] << 8) | (size_t) data[3]; @@ -252,7 +250,7 @@ static inline void Ascii85Tuple(Ascii85Info *ascii85_info, quantum=85UL*85UL*85UL*85UL; for (i=0; i < 4; i++) { - x=(ssize_t) (code/quantum); + x=(code/quantum); code-=quantum*x; ascii85_info->tuple[i]=(char) (x+(int) '!'); quantum/=85L; @@ -408,7 +406,8 @@ MagickExport MagickBooleanType HuffmanDecodeImage(Image *image, **mw_hash; int - byte; + byte, + mask; MagickBooleanType proceed; @@ -416,25 +415,20 @@ MagickExport MagickBooleanType HuffmanDecodeImage(Image *image, Quantum index; - ssize_t - i; - - unsigned char - *p; - size_t bit, code, - mask, length, null_lines, runlength; ssize_t count, + i, y; unsigned char + *p, *scanline; unsigned int diff --git a/ImageMagick-7.1.1-15/MagickCore/compress.h b/ImageMagick-7.1.1-16/MagickCore/compress.h similarity index 96% rename from ImageMagick-7.1.1-15/MagickCore/compress.h rename to ImageMagick-7.1.1-16/MagickCore/compress.h index 194831a0..0b9b954a 100644 --- a/ImageMagick-7.1.1-15/MagickCore/compress.h +++ b/ImageMagick-7.1.1-16/MagickCore/compress.h @@ -51,7 +51,8 @@ typedef enum DWAACompression, DWABCompression, BC7Compression, - BC5Compression + BC5Compression, + LERCCompression /* https://github.com/Esri/lerc */ } CompressionType; typedef struct _Ascii85Info diff --git a/ImageMagick-7.1.1-15/MagickCore/configure-private.h b/ImageMagick-7.1.1-16/MagickCore/configure-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/configure-private.h rename to ImageMagick-7.1.1-16/MagickCore/configure-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/configure.c b/ImageMagick-7.1.1-16/MagickCore/configure.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/configure.c rename to ImageMagick-7.1.1-16/MagickCore/configure.c index b07046cd..8c46187d 100644 --- a/ImageMagick-7.1.1-15/MagickCore/configure.c +++ b/ImageMagick-7.1.1-16/MagickCore/configure.c @@ -1245,8 +1245,8 @@ static MagickBooleanType LoadConfigureCache(LinkedListInfo *cache, file_xml=FileToXML(path,~0UL); if (file_xml != (char *) NULL) { - status&=LoadConfigureCache(cache,file_xml,path,depth+1, - exception); + status&=(MagickStatusType) LoadConfigureCache(cache, + file_xml,path,depth+1,exception); file_xml=DestroyString(file_xml); } } diff --git a/ImageMagick-7.1.1-15/MagickCore/configure.h b/ImageMagick-7.1.1-16/MagickCore/configure.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/configure.h rename to ImageMagick-7.1.1-16/MagickCore/configure.h diff --git a/ImageMagick-7.1.1-15/MagickCore/constitute-private.h b/ImageMagick-7.1.1-16/MagickCore/constitute-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/constitute-private.h rename to ImageMagick-7.1.1-16/MagickCore/constitute-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/constitute.c b/ImageMagick-7.1.1-16/MagickCore/constitute.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/constitute.c rename to ImageMagick-7.1.1-16/MagickCore/constitute.c index acf92d9e..08a3fa8c 100644 --- a/ImageMagick-7.1.1-15/MagickCore/constitute.c +++ b/ImageMagick-7.1.1-16/MagickCore/constitute.c @@ -1573,7 +1573,7 @@ MagickExport MagickBooleanType WriteImages(const ImageInfo *image_info, if (number_images != 1) progress_monitor=SetImageProgressMonitor(p,(MagickProgressMonitor) NULL, p->client_data); - status&=WriteImage(write_info,p,exception); + status&=(MagickStatusType) WriteImage(write_info,p,exception); if (number_images != 1) (void) SetImageProgressMonitor(p,progress_monitor,p->client_data); if (write_info->adjoin != MagickFalse) diff --git a/ImageMagick-7.1.1-15/MagickCore/constitute.h b/ImageMagick-7.1.1-16/MagickCore/constitute.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/constitute.h rename to ImageMagick-7.1.1-16/MagickCore/constitute.h diff --git a/ImageMagick-7.1.1-15/MagickCore/decorate.c b/ImageMagick-7.1.1-16/MagickCore/decorate.c similarity index 84% rename from ImageMagick-7.1.1-15/MagickCore/decorate.c rename to ImageMagick-7.1.1-16/MagickCore/decorate.c index 3711dde7..6f01be86 100644 --- a/ImageMagick-7.1.1-15/MagickCore/decorate.c +++ b/ImageMagick-7.1.1-16/MagickCore/decorate.c @@ -191,16 +191,14 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, shadow, trough; - ssize_t - x_offset, - y_offset; - size_t bevel_width, height; ssize_t - y; + x_offset, + y, + y_offset; /* Check frame geometry. @@ -213,8 +211,8 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, if ((frame_info->outer_bevel < 0) || (frame_info->inner_bevel < 0)) ThrowImageException(OptionError,"FrameIsLessThanImageSize"); bevel_width=(size_t) (frame_info->outer_bevel+frame_info->inner_bevel); - x_offset=(ssize_t) frame_info->width-frame_info->x-bevel_width; - y_offset=(ssize_t) frame_info->height-frame_info->y-bevel_width; + x_offset=(ssize_t) frame_info->width-frame_info->x-(ssize_t) bevel_width; + y_offset=(ssize_t) frame_info->height-frame_info->y-(ssize_t) bevel_width; if ((x_offset < (ssize_t) image->columns) || (y_offset < (ssize_t) image->rows)) ThrowImageException(OptionError,"FrameIsLessThanImageSize"); @@ -247,53 +245,61 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, */ matte=image->matte_color; accentuate=matte; - accentuate.red=(QuantumScale*((QuantumRange-(double) AccentuateModulate)* - matte.red+(QuantumRange*(double) AccentuateModulate))); - accentuate.green=(QuantumScale*((QuantumRange-(double) AccentuateModulate)* - matte.green+(QuantumRange*(double) AccentuateModulate))); - accentuate.blue=(QuantumScale*((QuantumRange-(double) AccentuateModulate)* - matte.blue+(QuantumRange*(double) AccentuateModulate))); - accentuate.black=(QuantumScale*((QuantumRange-(double) AccentuateModulate)* - matte.black+(QuantumRange*(double) AccentuateModulate))); + accentuate.red=(QuantumScale*(((double) QuantumRange-(double) + AccentuateModulate)*matte.red+((double) QuantumRange*(double) + AccentuateModulate))); + accentuate.green=(QuantumScale*(((double) QuantumRange-(double) + AccentuateModulate)*matte.green+((double) QuantumRange*(double) + AccentuateModulate))); + accentuate.blue=(QuantumScale*(((double) QuantumRange-(double) + AccentuateModulate)*matte.blue+((double) QuantumRange*(double) + AccentuateModulate))); + accentuate.black=(QuantumScale*(((double) QuantumRange-(double) + AccentuateModulate)*matte.black+((double) QuantumRange*(double) + AccentuateModulate))); accentuate.alpha=matte.alpha; highlight=matte; - highlight.red=(QuantumScale*((QuantumRange-(double) HighlightModulate)* - matte.red+(QuantumRange*(double) HighlightModulate))); - highlight.green=(QuantumScale*((QuantumRange-(double) HighlightModulate)* - matte.green+(QuantumRange*(double) HighlightModulate))); - highlight.blue=(QuantumScale*((QuantumRange-(double) HighlightModulate)* - matte.blue+(QuantumRange*(double) HighlightModulate))); - highlight.black=(QuantumScale*((QuantumRange-(double) HighlightModulate)* - matte.black+(QuantumRange*(double) HighlightModulate))); + highlight.red=(QuantumScale*(((double) QuantumRange-(double) + HighlightModulate)*matte.red+((double) QuantumRange*(double) + HighlightModulate))); + highlight.green=(QuantumScale*(((double) QuantumRange-(double) + HighlightModulate)*matte.green+((double) QuantumRange*(double) + HighlightModulate))); + highlight.blue=(QuantumScale*(((double) QuantumRange-(double) + HighlightModulate)*matte.blue+((double) QuantumRange*(double) + HighlightModulate))); + highlight.black=(QuantumScale*(((double) QuantumRange-(double) + HighlightModulate)*matte.black+((double) QuantumRange*(double) + HighlightModulate))); highlight.alpha=matte.alpha; shadow=matte; - shadow.red=QuantumScale*matte.red*ShadowModulate; - shadow.green=QuantumScale*matte.green*ShadowModulate; - shadow.blue=QuantumScale*matte.blue*ShadowModulate; - shadow.black=QuantumScale*matte.black*ShadowModulate; + shadow.red=QuantumScale*matte.red*(double) ShadowModulate; + shadow.green=QuantumScale*matte.green*(double) ShadowModulate; + shadow.blue=QuantumScale*matte.blue*(double) ShadowModulate; + shadow.black=QuantumScale*matte.black*(double) ShadowModulate; shadow.alpha=matte.alpha; trough=matte; - trough.red=QuantumScale*matte.red*TroughModulate; - trough.green=QuantumScale*matte.green*TroughModulate; - trough.blue=QuantumScale*matte.blue*TroughModulate; - trough.black=QuantumScale*matte.black*TroughModulate; + trough.red=QuantumScale*matte.red*(double) TroughModulate; + trough.green=QuantumScale*matte.green*(double) TroughModulate; + trough.blue=QuantumScale*matte.blue*(double) TroughModulate; + trough.black=QuantumScale*matte.black*(double) TroughModulate; trough.alpha=matte.alpha; status=MagickTrue; progress=0; image_view=AcquireVirtualCacheView(image,exception); frame_view=AcquireAuthenticCacheView(frame_image,exception); - height=(size_t) (frame_info->outer_bevel+(frame_info->y-bevel_width)+ - frame_info->inner_bevel); + height=(size_t) (frame_info->outer_bevel+(frame_info->y-(ssize_t) + bevel_width)+frame_info->inner_bevel); if (height != 0) { - size_t - width; + Quantum + *magick_restrict q; ssize_t x; - Quantum - *magick_restrict q; + size_t + width; /* Draw top of ornamental border. @@ -307,7 +313,7 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, */ for (y=0; y < (ssize_t) frame_info->outer_bevel; y++) { - for (x=0; x < (ssize_t) (frame_image->columns-y); x++) + for (x=0; x < ((ssize_t) frame_image->columns-y); x++) { if (x < y) SetPixelViaPixelInfo(frame_image,&highlight,q); @@ -321,14 +327,14 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, q+=GetPixelChannels(frame_image); } } - for (y=0; y < (ssize_t) (frame_info->y-bevel_width); y++) + for (y=0; y < (frame_info->y-(ssize_t) bevel_width); y++) { for (x=0; x < (ssize_t) frame_info->outer_bevel; x++) { SetPixelViaPixelInfo(frame_image,&highlight,q); q+=GetPixelChannels(frame_image); } - width=frame_image->columns-2*frame_info->outer_bevel; + width=frame_image->columns-2*(size_t) frame_info->outer_bevel; for (x=0; x < (ssize_t) width; x++) { SetPixelViaPixelInfo(frame_image,&matte,q); @@ -347,13 +353,13 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, SetPixelViaPixelInfo(frame_image,&highlight,q); q+=GetPixelChannels(frame_image); } - for (x=0; x < (ssize_t) (frame_info->x-bevel_width); x++) + for (x=0; x < (frame_info->x-(ssize_t) bevel_width); x++) { SetPixelViaPixelInfo(frame_image,&matte,q); q+=GetPixelChannels(frame_image); } width=image->columns+((size_t) frame_info->inner_bevel << 1)- - y; + (size_t) y; for (x=0; x < (ssize_t) width; x++) { if (x < y) @@ -362,12 +368,13 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, SetPixelViaPixelInfo(frame_image,&trough,q); q+=GetPixelChannels(frame_image); } - for ( ; x < (ssize_t) (image->columns+2*frame_info->inner_bevel); x++) + for ( ; x < ((ssize_t) image->columns+2*frame_info->inner_bevel); x++) { SetPixelViaPixelInfo(frame_image,&highlight,q); q+=GetPixelChannels(frame_image); } - width=frame_info->width-frame_info->x-image->columns-bevel_width; + width=frame_info->width-(size_t) frame_info->x- + image->columns-bevel_width; for (x=0; x < (ssize_t) width; x++) { SetPixelViaPixelInfo(frame_image,&matte,q); @@ -417,7 +424,7 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, SetPixelViaPixelInfo(frame_image,&highlight,q); q+=GetPixelChannels(frame_image); } - for (x=0; x < (ssize_t) (frame_info->x-bevel_width); x++) + for (x=0; x < (frame_info->x-(ssize_t) bevel_width); x++) { SetPixelViaPixelInfo(frame_image,&matte,q); q+=GetPixelChannels(frame_image); @@ -440,7 +447,7 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, SetPixelViaPixelInfo(frame_image,&highlight,q); q+=GetPixelChannels(frame_image); } - width=frame_info->width-frame_info->x-image->columns-bevel_width; + width=frame_info->width-(size_t) frame_info->x-image->columns-bevel_width; for (x=0; x < (ssize_t) width; x++) { SetPixelViaPixelInfo(frame_image,&matte,q); @@ -467,8 +474,9 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, status=MagickFalse; } } - height=(size_t) (frame_info->inner_bevel+frame_info->height- - frame_info->y-image->rows-bevel_width+frame_info->outer_bevel); + height=(size_t) (frame_info->inner_bevel+(ssize_t) frame_info->height- + frame_info->y-(ssize_t) image->rows-(ssize_t) bevel_width+ + frame_info->outer_bevel); if (height != 0) { size_t @@ -497,7 +505,7 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, SetPixelViaPixelInfo(frame_image,&highlight,q); q+=GetPixelChannels(frame_image); } - for (x=0; x < (ssize_t) (frame_info->x-bevel_width); x++) + for (x=0; x < (frame_info->x-(ssize_t) bevel_width); x++) { SetPixelViaPixelInfo(frame_image,&matte,q); q+=GetPixelChannels(frame_image); @@ -507,15 +515,16 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, SetPixelViaPixelInfo(frame_image,&shadow,q); q+=GetPixelChannels(frame_image); } - for ( ; x < (ssize_t) (image->columns+2*frame_info->inner_bevel); x++) + for ( ; x < ((ssize_t) image->columns+2*frame_info->inner_bevel); x++) { - if (x >= (ssize_t) (image->columns+2*frame_info->inner_bevel-y)) + if (x >= ((ssize_t) image->columns+2*frame_info->inner_bevel-y)) SetPixelViaPixelInfo(frame_image,&highlight,q); else SetPixelViaPixelInfo(frame_image,&accentuate,q); q+=GetPixelChannels(frame_image); } - width=frame_info->width-frame_info->x-image->columns-bevel_width; + width=(size_t) ((ssize_t) frame_info->width-frame_info->x- + (ssize_t) image->columns-(ssize_t) bevel_width); for (x=0; x < (ssize_t) width; x++) { SetPixelViaPixelInfo(frame_image,&matte,q); @@ -527,7 +536,8 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, q+=GetPixelChannels(frame_image); } } - height=frame_info->height-frame_info->y-image->rows-bevel_width; + height=(size_t) ((ssize_t) frame_info->height-frame_info->y-(ssize_t) + image->rows-(ssize_t) bevel_width); for (y=0; y < (ssize_t) height; y++) { for (x=0; x < (ssize_t) frame_info->outer_bevel; x++) @@ -535,7 +545,8 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, SetPixelViaPixelInfo(frame_image,&highlight,q); q+=GetPixelChannels(frame_image); } - width=frame_image->columns-2*frame_info->outer_bevel; + width=(size_t) ((ssize_t) frame_image->columns-2*(ssize_t) + frame_info->outer_bevel); for (x=0; x < (ssize_t) width; x++) { SetPixelViaPixelInfo(frame_image,&matte,q); @@ -556,7 +567,7 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, } for ( ; x < (ssize_t) frame_image->columns; x++) { - if (x >= (ssize_t) (frame_image->columns-y)) + if (x >= ((ssize_t) frame_image->columns-y)) SetPixelViaPixelInfo(frame_image,&shadow,q); else SetPixelViaPixelInfo(frame_image,&trough,q); @@ -568,10 +579,10 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, } frame_view=DestroyCacheView(frame_view); image_view=DestroyCacheView(image_view); - x_offset=(ssize_t) (frame_info->outer_bevel+(frame_info->x-bevel_width)+ - frame_info->inner_bevel); - y_offset=(ssize_t) (frame_info->outer_bevel+(frame_info->y-bevel_width)+ - frame_info->inner_bevel); + x_offset=frame_info->outer_bevel+(frame_info->x-(ssize_t) bevel_width)+ + frame_info->inner_bevel; + y_offset=frame_info->outer_bevel+(frame_info->y-(ssize_t) bevel_width)+ + frame_info->inner_bevel; if (status != MagickFalse) status=CompositeImage(frame_image,image,compose,MagickTrue,x_offset, y_offset,exception); @@ -693,12 +704,13 @@ MagickExport MagickBooleanType RaiseImage(Image *image, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(QuantumScale*((double) q[i]*HighlightFactor+(double) - foreground*(QuantumRange-HighlightFactor))); + q[i]=ClampToQuantum(QuantumScale*((double) q[i]*(double) + HighlightFactor+(double) foreground*((double) QuantumRange-(double) + HighlightFactor))); } q+=GetPixelChannels(image); } - for ( ; x < (ssize_t) (image->columns-y); x++) + for ( ; x < ((ssize_t) image->columns-y); x++) { for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { @@ -706,8 +718,9 @@ MagickExport MagickBooleanType RaiseImage(Image *image, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(QuantumScale*((double) q[i]*AccentuateFactor+ - (double) foreground*(QuantumRange-AccentuateFactor))); + q[i]=ClampToQuantum(QuantumScale*((double) q[i]*(double) + AccentuateFactor+(double) foreground*((double) QuantumRange-(double) + AccentuateFactor))); } q+=GetPixelChannels(image); } @@ -719,8 +732,8 @@ MagickExport MagickBooleanType RaiseImage(Image *image, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(QuantumScale*((double) q[i]*ShadowFactor+(double) - background*(QuantumRange-ShadowFactor))); + q[i]=ClampToQuantum(QuantumScale*((double) q[i]*(double) ShadowFactor+ + (double) background*((double) QuantumRange-(double) ShadowFactor))); } q+=GetPixelChannels(image); } @@ -769,8 +782,9 @@ MagickExport MagickBooleanType RaiseImage(Image *image, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(QuantumScale*((double) q[i]*HighlightFactor+(double) - foreground*(QuantumRange-HighlightFactor))); + q[i]=ClampToQuantum(QuantumScale*((double) q[i]*(double) + HighlightFactor+(double) foreground*((double) QuantumRange-(double) + HighlightFactor))); } q+=GetPixelChannels(image); } @@ -784,8 +798,8 @@ MagickExport MagickBooleanType RaiseImage(Image *image, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(QuantumScale*((double) q[i]*ShadowFactor+(double) - background*(QuantumRange-ShadowFactor))); + q[i]=ClampToQuantum(QuantumScale*((double) q[i]*(double) ShadowFactor+ + (double) background*((double) QuantumRange-(double) ShadowFactor))); } q+=GetPixelChannels(image); } @@ -826,7 +840,7 @@ MagickExport MagickBooleanType RaiseImage(Image *image, status=MagickFalse; continue; } - for (x=0; x < (ssize_t) (image->rows-y); x++) + for (x=0; x < ((ssize_t) image->rows-y); x++) { for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { @@ -834,12 +848,13 @@ MagickExport MagickBooleanType RaiseImage(Image *image, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(QuantumScale*((double) q[i]*HighlightFactor+(double) - foreground*(QuantumRange-HighlightFactor))); + q[i]=ClampToQuantum(QuantumScale*((double) q[i]*(double) + HighlightFactor+(double) foreground*((double) QuantumRange- + (double) HighlightFactor))); } q+=GetPixelChannels(image); } - for ( ; x < (ssize_t) (image->columns-(image->rows-y)); x++) + for ( ; x < ((ssize_t) image->columns-((ssize_t) image->rows-y)); x++) { for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { @@ -847,8 +862,8 @@ MagickExport MagickBooleanType RaiseImage(Image *image, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(QuantumScale*((double) q[i]*TroughFactor+ - (double) background*(QuantumRange-TroughFactor))); + q[i]=ClampToQuantum(QuantumScale*((double) q[i]*(double) TroughFactor+ + (double) background*((double) QuantumRange-(double) TroughFactor))); } q+=GetPixelChannels(image); } @@ -860,8 +875,8 @@ MagickExport MagickBooleanType RaiseImage(Image *image, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(QuantumScale*((double) q[i]*ShadowFactor+(double) - background*(QuantumRange-ShadowFactor))); + q[i]=ClampToQuantum(QuantumScale*((double) q[i]*(double) ShadowFactor+ + (double) background*((double) QuantumRange-(double) ShadowFactor))); } q+=GetPixelChannels(image); } diff --git a/ImageMagick-7.1.1-15/MagickCore/decorate.h b/ImageMagick-7.1.1-16/MagickCore/decorate.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/decorate.h rename to ImageMagick-7.1.1-16/MagickCore/decorate.h diff --git a/ImageMagick-7.1.1-15/MagickCore/delegate-private.h b/ImageMagick-7.1.1-16/MagickCore/delegate-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/delegate-private.h rename to ImageMagick-7.1.1-16/MagickCore/delegate-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/delegate.c b/ImageMagick-7.1.1-16/MagickCore/delegate.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/delegate.c rename to ImageMagick-7.1.1-16/MagickCore/delegate.c index 1c0572ee..9421641e 100644 --- a/ImageMagick-7.1.1-15/MagickCore/delegate.c +++ b/ImageMagick-7.1.1-16/MagickCore/delegate.c @@ -120,7 +120,7 @@ static const char " " " " " " - " " + " " " " " " " " @@ -130,8 +130,8 @@ static const char " " " " " " - " " - " " + " " + " " " " " " " " @@ -147,7 +147,7 @@ static const char " " " " " " - " " + " " " " " " " " @@ -919,7 +919,7 @@ static char *InterpretDelegateProperties(ImageInfo *image_info, #define ExtendInterpretText(string_length) \ { \ size_t length=(string_length); \ - if ((size_t) (q-interpret_text+length+1) >= extent) \ + if ((size_t) (q-interpret_text+(ssize_t) length+1) >= extent) \ { \ extent+=length; \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ @@ -948,7 +948,7 @@ static char *InterpretDelegateProperties(ImageInfo *image_info, #define AppendString2Text(string) \ { \ size_t length=strlen((string)); \ - if ((size_t) (q-interpret_text+length+1) >= extent) \ + if ((size_t) (q-interpret_text+(ssize_t) length+1) >= extent) \ { \ extent+=length; \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ @@ -1635,16 +1635,14 @@ static MagickBooleanType CopyDelegateFile(const char *source, MagickBooleanType status; - size_t + ssize_t + count, i; size_t length, quantum; - ssize_t - count; - struct stat attributes; @@ -1682,7 +1680,7 @@ static MagickBooleanType CopyDelegateFile(const char *source, return(MagickFalse); } length=0; - for (i=0; ; i+=count) + for (i=0; ; i+=(ssize_t) count) { count=(ssize_t) read(source_file,buffer,quantum); if (count <= 0) @@ -1828,6 +1826,7 @@ MagickExport MagickBooleanType InvokeDelegate(ImageInfo *image_info, { (void) FormatLocaleString(p->filename,MagickPathExtent,"%s:%s", delegate_info->decode,clone_info->filename); + (void) SetImageOption(clone_info,"quantum:format","floating-point"); status=WriteImage(clone_info,p,exception); if (status == MagickFalse) { @@ -2160,8 +2159,8 @@ static MagickBooleanType LoadDelegateCache(LinkedListInfo *cache, file_xml=FileToXML(path,~0UL); if (file_xml != (char *) NULL) { - status&=LoadDelegateCache(cache,file_xml,path, - depth+1,exception); + status&=(MagickStatusType) LoadDelegateCache(cache, + file_xml,path,depth+1,exception); file_xml=DestroyString(file_xml); } } diff --git a/ImageMagick-7.1.1-15/MagickCore/delegate.h b/ImageMagick-7.1.1-16/MagickCore/delegate.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/delegate.h rename to ImageMagick-7.1.1-16/MagickCore/delegate.h diff --git a/ImageMagick-7.1.1-15/MagickCore/deprecate.c b/ImageMagick-7.1.1-16/MagickCore/deprecate.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/deprecate.c rename to ImageMagick-7.1.1-16/MagickCore/deprecate.c diff --git a/ImageMagick-7.1.1-15/MagickCore/deprecate.h b/ImageMagick-7.1.1-16/MagickCore/deprecate.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/deprecate.h rename to ImageMagick-7.1.1-16/MagickCore/deprecate.h diff --git a/ImageMagick-7.1.1-15/MagickCore/display-private.h b/ImageMagick-7.1.1-16/MagickCore/display-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/display-private.h rename to ImageMagick-7.1.1-16/MagickCore/display-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/display.c b/ImageMagick-7.1.1-16/MagickCore/display.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/display.c rename to ImageMagick-7.1.1-16/MagickCore/display.c index 51d23348..3f23fd89 100644 --- a/ImageMagick-7.1.1-15/MagickCore/display.c +++ b/ImageMagick-7.1.1-16/MagickCore/display.c @@ -1630,12 +1630,12 @@ MagickExport MagickBooleanType DisplayImages(const ImageInfo *image_info, Image *image; - ssize_t - i; - size_t state; + ssize_t + i; + XrmDatabase resource_database; @@ -1670,7 +1670,7 @@ MagickExport MagickBooleanType DisplayImages(const ImageInfo *image_info, { if ((images->iterations != 0) && (i >= (ssize_t) images->iterations)) break; - image=GetImageFromList(images,i % GetImageListLength(images)); + image=GetImageFromList(images,i % (ssize_t) GetImageListLength(images)); (void) XDisplayImage(display,&resource_info,argv,1,&image,&state,exception); } (void) SetErrorHandler((ErrorHandler) NULL); @@ -1824,6 +1824,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display, char command[MagickPathExtent], + *p, text[MagickPathExtent]; const char @@ -1845,8 +1846,8 @@ static MagickBooleanType XAnnotateEditImage(Display *display, KeySym key_symbol; - char - *p; + size_t + state; ssize_t i; @@ -1855,9 +1856,6 @@ static MagickBooleanType XAnnotateEditImage(Display *display, height, width; - size_t - state; - XAnnotateInfo *annotate_info, *previous_info; @@ -2183,14 +2181,14 @@ static MagickBooleanType XAnnotateEditImage(Display *display, y=event.xmotion.y; if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id, windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); break; } @@ -2236,11 +2234,11 @@ static MagickBooleanType XAnnotateEditImage(Display *display, annotate_info->stencil=BackgroundStencil; else annotate_info->stencil=ForegroundStencil; - annotate_info->height=(unsigned int) font_info->ascent+font_info->descent; + annotate_info->height=(unsigned int) (font_info->ascent+font_info->descent); annotate_info->degrees=degrees; annotate_info->font_info=font_info; - annotate_info->text=(char *) AcquireQuantumMemory((size_t) - windows->image.width/MagickMax((ssize_t) font_info->min_bounds.width,1)+2UL, + annotate_info->text=(char *) AcquireQuantumMemory((size_t) + windows->image.width/(size_t) MagickMax(font_info->min_bounds.width,1)+2UL, sizeof(*annotate_info->text)); if (annotate_info->text == (char *) NULL) return(MagickFalse); @@ -2420,7 +2418,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display, */ annotate_info=annotate_info->previous; p=annotate_info->text; - x=annotate_info->x+annotate_info->width; + x=annotate_info->x+(int) annotate_info->width; y=annotate_info->y; if (annotate_info->width != 0) p+=strlen(annotate_info->text); @@ -2514,12 +2512,12 @@ static MagickBooleanType XAnnotateEditImage(Display *display, *annotate_info->next=(*annotate_info); annotate_info->next->previous=annotate_info; annotate_info=annotate_info->next; - annotate_info->text=(char *) AcquireQuantumMemory((size_t) - windows->image.width/MagickMax((ssize_t) - font_info->min_bounds.width,1)+2UL,sizeof(*annotate_info->text)); + annotate_info->text=(char *) AcquireQuantumMemory((size_t) ( + (ssize_t) windows->image.width/MagickMax((ssize_t) + font_info->min_bounds.width,1)+2L),sizeof(*annotate_info->text)); if (annotate_info->text == (char *) NULL) return(MagickFalse); - annotate_info->y+=annotate_info->height; + annotate_info->y+=(ssize_t) annotate_info->height; if (annotate_info->y > (int) windows->image.height) annotate_info->y=(int) annotate_info->height; annotate_info->next=(XAnnotateInfo *) NULL; @@ -2538,7 +2536,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display, */ (void) XLookupString((XKeyEvent *) &event.xkey,command,(int) sizeof(command),&key_symbol,(XComposeStatus *) NULL); - state&=(~ModifierState); + state&=(size_t) (~ModifierState); break; } case SelectionNotify: @@ -2610,11 +2608,11 @@ static MagickBooleanType XAnnotateEditImage(Display *display, annotate_info->next->previous=annotate_info; annotate_info=annotate_info->next; annotate_info->text=(char *) AcquireQuantumMemory((size_t) - windows->image.width/MagickMax((ssize_t) - font_info->min_bounds.width,1)+2UL,sizeof(*annotate_info->text)); + (windows->image.width/MagickMax((ssize_t) + font_info->min_bounds.width,1)+2L),sizeof(*annotate_info->text)); if (annotate_info->text == (char *) NULL) return(MagickFalse); - annotate_info->y+=annotate_info->height; + annotate_info->y+=(ssize_t) annotate_info->height; if (annotate_info->y > (int) windows->image.height) annotate_info->y=(int) annotate_info->height; annotate_info->next=(XAnnotateInfo *) NULL; @@ -2687,14 +2685,15 @@ static MagickBooleanType XAnnotateEditImage(Display *display, annotate_info->y=(int) height*(annotate_info->y-font_info->ascent+ windows->image.y)/windows->image.ximage->height; (void) FormatLocaleString(annotate_info->geometry,MagickPathExtent, - "%ux%u%+d%+d",width*annotate_info->width/windows->image.ximage->width, - height*annotate_info->height/windows->image.ximage->height, - annotate_info->x+x,annotate_info->y+y); + "%gx%g%+g%+g",(double) width*annotate_info->width/ + windows->image.ximage->width,(double) height*annotate_info->height/ + windows->image.ximage->height,(double) annotate_info->x+x,(double) + annotate_info->y+y); /* Annotate image with text. */ status=XAnnotateImage(display,windows->pixel_info,annotate_info,image, - exception); + exception) == MagickFalse ? 0 : 1; if (status == 0) return(MagickFalse); /* @@ -2784,7 +2783,7 @@ static MagickBooleanType XBackgroundImage(Display *display, background_resources.window_id=window_id; background_resources.backdrop=status != 0 ? MagickTrue : MagickFalse; status=XDisplayBackgroundImage(display,&background_resources,*image, - exception); + exception) == MagickFalse ? 0 : 1; if (status != MagickFalse) XClientMessage(display,windows->image.id,windows->im_protocols, windows->im_retain_colors,CurrentTime); @@ -2858,6 +2857,9 @@ static MagickBooleanType XChopImage(Display *display, char text[MagickPathExtent]; + double + scale_factor; + Image *chop_image; @@ -2866,20 +2868,17 @@ static MagickBooleanType XChopImage(Display *display, x, y; - double - scale_factor; - RectangleInfo chop_info; + size_t + state; + unsigned int distance, height, width; - size_t - state; - XEvent event; @@ -3046,14 +3045,14 @@ static MagickBooleanType XChopImage(Display *display, y=event.xmotion.y; if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id, windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); } } @@ -3149,10 +3148,10 @@ static MagickBooleanType XChopImage(Display *display, if (direction == HorizontalChopCommand) { chop_info.width=(size_t) (segment_info.x2-segment_info.x1+1); - chop_info.x=(ssize_t) windows->image.x+segment_info.x1; chop_info.height=0; + chop_info.x=(ssize_t) windows->image.x+segment_info.x1; chop_info.y=0; - if (segment_info.x1 > (int) segment_info.x2) + if (segment_info.x1 > segment_info.x2) { chop_info.width=(size_t) (segment_info.x1-segment_info.x2+1); chop_info.x=(ssize_t) windows->image.x+segment_info.x2; @@ -3183,9 +3182,9 @@ static MagickBooleanType XChopImage(Display *display, XSetCursorState(display,windows,MagickTrue); XCheckRefreshWindows(display,windows); windows->image.window_changes.width=windows->image.ximage->width- - (unsigned int) chop_info.width; + (int) chop_info.width; windows->image.window_changes.height=windows->image.ximage->height- - (unsigned int) chop_info.height; + (int) chop_info.height; width=(unsigned int) (*image)->columns; height=(unsigned int) (*image)->rows; x=0; @@ -3307,6 +3306,9 @@ static MagickBooleanType XColorEditImage(Display *display, Quantum *q; + size_t + state; + ssize_t i; @@ -3314,9 +3316,6 @@ static MagickBooleanType XColorEditImage(Display *display, height, width; - size_t - state; - XColor color; @@ -3581,7 +3580,7 @@ static MagickBooleanType XColorEditImage(Display *display, (void) XConfigureImage(display,resource_info,windows,*image,exception); XInfoWidget(display,windows,text); (void) XCheckDefineCursor(display,windows->image.id,cursor); - state&=(~UpdateConfigurationState); + state&=(size_t) (~UpdateConfigurationState); break; } case Expose: @@ -3641,14 +3640,14 @@ static MagickBooleanType XColorEditImage(Display *display, y=event.xmotion.y; if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id, windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); break; } @@ -3685,10 +3684,10 @@ static MagickBooleanType XColorEditImage(Display *display, if (windows->image.crop_geometry != (char *) NULL) (void) XParseGeometry(windows->image.crop_geometry,&x,&y, &width,&height); - x_offset=(int) - (width*(windows->image.x+x_offset)/windows->image.ximage->width+x); - y_offset=(int) - (height*(windows->image.y+y_offset)/windows->image.ximage->height+y); + x_offset=((int) width*(windows->image.x+x_offset)/(int) + windows->image.ximage->width+x); + y_offset=((int) height*(windows->image.y+y_offset)/(int) + windows->image.ximage->height+y); if ((x_offset < 0) || (y_offset < 0)) continue; if ((x_offset >= (int) (*image)->columns) || @@ -3829,7 +3828,7 @@ static MagickBooleanType XColorEditImage(Display *display, } } image_view=DestroyCacheView(image_view); - state&=(~UpdateConfigurationState); + state&=(~0x0080U); } } while ((state & ExitState) == 0); (void) XSelectInput(display,windows->image.id, @@ -4200,14 +4199,14 @@ static MagickBooleanType XCompositeImage(Display *display, y=event.xmotion.y; if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id, windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); composite_info.x=(ssize_t) windows->image.x+x; composite_info.y=(ssize_t) windows->image.y+y; @@ -4414,9 +4413,9 @@ static MagickBooleanType XConfigureImage(Display *display, width*windows->magnify.x/windows->image.ximage->width; windows->magnify.y=(int) height*windows->magnify.y/windows->image.ximage->height; - windows->image.x=(int) (width*windows->image.x/windows->image.ximage->width); - windows->image.y=(int) - (height*windows->image.y/windows->image.ximage->height); + windows->image.x=((int) width*windows->image.x/windows->image.ximage->width); + windows->image.y=((int) height*windows->image.y/ + windows->image.ximage->height); status=XMakeImage(display,resource_info,&windows->image,image, (unsigned int) width,(unsigned int) height,exception); if (status == MagickFalse) @@ -4443,10 +4442,10 @@ static MagickBooleanType XConfigureImage(Display *display, if (resource_info->backdrop) { mask|=CWX | CWY; - window_changes.x=(int) - ((XDisplayWidth(display,windows->image.screen)/2)-(width/2)); - window_changes.y=(int) - ((XDisplayHeight(display,windows->image.screen)/2)-(height/2)); + window_changes.x=((XDisplayWidth(display,windows->image.screen)/2)- + ((int) width/2)); + window_changes.y=((XDisplayHeight(display,windows->image.screen)/2)- + ((int) height/2)); } (void) XReconfigureWMWindow(display,windows->image.id,windows->image.screen, (unsigned int) mask,&window_changes); @@ -4802,14 +4801,14 @@ static MagickBooleanType XCropImage(Display *display, y=event.xmotion.y; if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id, windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); crop_info.x=(ssize_t) windows->image.x+x; crop_info.y=(ssize_t) windows->image.y+y; @@ -5042,33 +5041,33 @@ static MagickBooleanType XCropImage(Display *display, (y < (int) (crop_info.y+RoiDelta)) && (y > (int) (crop_info.y-RoiDelta))) { - crop_info.x=(ssize_t) (crop_info.x+crop_info.width); - crop_info.y=(ssize_t) (crop_info.y+crop_info.height); + crop_info.x=crop_info.x+(ssize_t) crop_info.width; + crop_info.y=crop_info.y+(ssize_t) crop_info.height; state|=UpdateConfigurationState; break; } if ((x < (int) (crop_info.x+RoiDelta)) && (x > (int) (crop_info.x-RoiDelta)) && - (y < (int) (crop_info.y+crop_info.height+RoiDelta)) && - (y > (int) (crop_info.y+crop_info.height-RoiDelta))) + (y < (crop_info.y+(int) crop_info.height+RoiDelta)) && + (y > (crop_info.y+(int) crop_info.height-RoiDelta))) { - crop_info.x=(ssize_t) (crop_info.x+crop_info.width); + crop_info.x=(crop_info.x+(int) crop_info.width); state|=UpdateConfigurationState; break; } - if ((x < (int) (crop_info.x+crop_info.width+RoiDelta)) && - (x > (int) (crop_info.x+crop_info.width-RoiDelta)) && + if ((x < (crop_info.x+(int) crop_info.width+RoiDelta)) && + (x > (crop_info.x+(int) crop_info.width-RoiDelta)) && (y < (int) (crop_info.y+RoiDelta)) && (y > (int) (crop_info.y-RoiDelta))) { - crop_info.y=(ssize_t) (crop_info.y+crop_info.height); + crop_info.y=(crop_info.y+(ssize_t) crop_info.height); state|=UpdateConfigurationState; break; } - if ((x < (int) (crop_info.x+crop_info.width+RoiDelta)) && - (x > (int) (crop_info.x+crop_info.width-RoiDelta)) && - (y < (int) (crop_info.y+crop_info.height+RoiDelta)) && - (y > (int) (crop_info.y+crop_info.height-RoiDelta))) + if ((x < (crop_info.x+(int) crop_info.width+RoiDelta)) && + (x > (crop_info.x+(int) crop_info.width-RoiDelta)) && + (y < (crop_info.y+(int) crop_info.height+RoiDelta)) && + (y > (crop_info.y+(int) crop_info.height-RoiDelta))) { state|=UpdateConfigurationState; break; @@ -5212,14 +5211,14 @@ static MagickBooleanType XCropImage(Display *display, y=event.xmotion.y; if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id, windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); crop_info.x=(ssize_t) windows->image.x+event.xmotion.x; crop_info.y=(ssize_t) windows->image.y+event.xmotion.y; @@ -5869,14 +5868,14 @@ static MagickBooleanType XDrawEditImage(Display *display, y=event.xmotion.y; if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id, windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); break; } @@ -6235,11 +6234,11 @@ static MagickBooleanType XDrawEditImage(Display *display, y=0; if (windows->image.crop_geometry != (char *) NULL) (void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width,&height); - draw_info.x+=windows->image.x-(line_width/2); + draw_info.x+=windows->image.x-((int) line_width/2); if (draw_info.x < 0) draw_info.x=0; - draw_info.x=(int) (width*draw_info.x/windows->image.ximage->width); - draw_info.y+=windows->image.y-(line_width/2); + draw_info.x=(int) width*draw_info.x/windows->image.ximage->width; + draw_info.y+=windows->image.y-((int) line_width/2); if (draw_info.y < 0) draw_info.y=0; draw_info.y=(int) height*draw_info.y/windows->image.ximage->height; @@ -6250,8 +6249,8 @@ static MagickBooleanType XDrawEditImage(Display *display, if (draw_info.height > (unsigned int) (*image)->rows) draw_info.height=(unsigned int) (*image)->rows; (void) FormatLocaleString(draw_info.geometry,MagickPathExtent,"%ux%u%+d%+d", - width*draw_info.width/windows->image.ximage->width, - height*draw_info.height/windows->image.ximage->height, + width*draw_info.width/(unsigned int) windows->image.ximage->width, + height*draw_info.height/(unsigned int) windows->image.ximage->height, draw_info.x+x,draw_info.y+y); /* Initialize drawing attributes. @@ -6265,8 +6264,10 @@ static MagickBooleanType XDrawEditImage(Display *display, draw_info.line_info.x1=(short) line_width/2; if (line_info.y1 > (int) (line_width/2)) draw_info.line_info.y1=(short) line_width/2; - draw_info.line_info.x2=(short) (line_info.x2-line_info.x1+(line_width/2)); - draw_info.line_info.y2=(short) (line_info.y2-line_info.y1+(line_width/2)); + draw_info.line_info.x2=(short) (line_info.x2-line_info.x1+ + ((int) line_width/2)); + draw_info.line_info.y2=(short) (line_info.y2-line_info.y1+ + ((int) line_width/2)); if ((draw_info.line_info.x2 < 0) && (draw_info.line_info.y2 < 0)) { draw_info.line_info.x2=(-draw_info.line_info.x2); @@ -6529,10 +6530,10 @@ static void XImageCache(Display *display,XResourceInfo *resource_info, Image *previous_image; - ssize_t + size_t bytes; - bytes=(ssize_t) ((*image)->columns*(*image)->rows*sizeof(PixelInfo)); + bytes=(*image)->columns*(*image)->rows*sizeof(PixelInfo); if (undo_image != (Image *) NULL) { /* @@ -6543,7 +6544,7 @@ static void XImageCache(Display *display,XResourceInfo *resource_info, { bytes+=previous_image->list->columns*previous_image->list->rows* sizeof(PixelInfo); - if (bytes <= (ssize_t) (resource_info->undo_cache << 20)) + if (bytes <= (resource_info->undo_cache << 20)) { previous_image=GetPreviousImageInList(previous_image); continue; @@ -6567,7 +6568,7 @@ static void XImageCache(Display *display,XResourceInfo *resource_info, cache_image=DestroyImage(cache_image); } } - if (bytes > (ssize_t) (resource_info->undo_cache << 20)) + if (bytes > (resource_info->undo_cache << 20)) break; /* Save image before transformations are applied. @@ -6994,33 +6995,31 @@ static CommandType XImageWindowCommand(Display *display, { if (resource_info->quantum >= (int) crop_info.height) resource_info->quantum=(int) crop_info.height-1; - crop_info.height-=resource_info->quantum; + crop_info.height-=(size_t) resource_info->quantum; } if ((key_symbol == XK_Down) || (key_symbol == XK_KP_Down)) { - if (resource_info->quantum >= (int) (crop_info.height-crop_info.y)) - resource_info->quantum=(int) (crop_info.height-crop_info.y-1); + if (resource_info->quantum >= ((int) crop_info.height-crop_info.y)) + resource_info->quantum=(int) crop_info.height-crop_info.y-1; crop_info.y+=resource_info->quantum; - crop_info.height-=resource_info->quantum; + crop_info.height-=(size_t) resource_info->quantum; } if ((key_symbol == XK_Left) || (key_symbol == XK_KP_Left)) { if (resource_info->quantum >= (int) crop_info.width) resource_info->quantum=(int) crop_info.width-1; - crop_info.width-=resource_info->quantum; + crop_info.width-=(size_t) resource_info->quantum; } if ((key_symbol == XK_Right) || (key_symbol == XK_KP_Right)) { - if (resource_info->quantum >= (int) (crop_info.width-crop_info.x)) - resource_info->quantum=(int) (crop_info.width-crop_info.x-1); + if (resource_info->quantum >= ((int) crop_info.width-crop_info.x)) + resource_info->quantum=(int) crop_info.width-crop_info.x-1; crop_info.x+=resource_info->quantum; - crop_info.width-=resource_info->quantum; + crop_info.width-=(size_t) resource_info->quantum; } - if ((int) (windows->image.x+windows->image.width) > - (int) crop_info.width) + if ((windows->image.x+(int) windows->image.width) > (int) crop_info.width) windows->image.x=(int) (crop_info.width-windows->image.width); - if ((int) (windows->image.y+windows->image.height) > - (int) crop_info.height) + if ((windows->image.y+(int) windows->image.height) > (int) crop_info.height) windows->image.y=(int) (crop_info.height-windows->image.height); XSetCropGeometry(display,windows,&crop_info,*image); windows->image.window_changes.width=(int) crop_info.width; @@ -7229,7 +7228,8 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, if (*filename == '\0') break; status=ShredFile(filename); - status|=remove_utf8(filename); + if (remove_utf8(filename) < 0) + status=MagickTrue; if (status != MagickFalse) XNoticeWidget(display,windows,"Unable to delete image file:",filename); break; @@ -7692,7 +7692,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, Query user for the fuzz factor. */ (void) FormatLocaleString(fuzz,MagickPathExtent,"%g%%",100.0* - (*image)->fuzz/(QuantumRange+1.0)); + (*image)->fuzz/((double) QuantumRange+1.0)); (void) XDialogWidget(display,windows,"Trim","Enter fuzz factor:",fuzz); if (*fuzz == '\0') break; @@ -7911,9 +7911,9 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, XCheckRefreshWindows(display,windows); flags=ParseGeometry(levels,&geometry_info); if ((flags & SigmaValue) == 0) - geometry_info.sigma=1.0*QuantumRange/2.0; + geometry_info.sigma=1.0*(double) QuantumRange/2.0; if ((flags & PercentValue) != 0) - geometry_info.sigma=1.0*QuantumRange*geometry_info.sigma/100.0; + geometry_info.sigma=1.0*(double) QuantumRange*geometry_info.sigma/100.0; (void) SigmoidalContrastImage(*image,MagickTrue,geometry_info.rho, geometry_info.sigma,exception); XSetCursorState(display,windows,MagickFalse); @@ -9344,13 +9344,13 @@ static void XMagnifyImage(Display *display,XWindows *windows,XEvent *event, */ if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id,windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); if (windows->info.mapped != MagickFalse) { @@ -9476,28 +9476,28 @@ static void XMagnifyWindowCommand(Display *display,XWindows *windows, case XK_KP_Left: { if (windows->magnify.x > 0) - windows->magnify.x-=quantum; + windows->magnify.x-=(int) quantum; break; } case XK_Up: case XK_KP_Up: { if (windows->magnify.y > 0) - windows->magnify.y-=quantum; + windows->magnify.y-=(int) quantum; break; } case XK_Right: case XK_KP_Right: { if (windows->magnify.x < (int) (windows->image.ximage->width-1)) - windows->magnify.x+=quantum; + windows->magnify.x+=(int) quantum; break; } case XK_Down: case XK_KP_Down: { if (windows->magnify.y < (int) (windows->image.ximage->height-1)) - windows->magnify.y+=quantum; + windows->magnify.y+=(int) quantum; break; } case XK_0: @@ -9870,16 +9870,15 @@ static MagickBooleanType XMatteEditImage(Display *display, break; if (entry != 2) { - (void) FormatLocaleString(matte,MagickPathExtent,QuantumFormat, - OpaqueAlpha); + (void) FormatLocaleString(matte,MagickPathExtent,"%g", + (double) OpaqueAlpha); if (LocaleCompare(MatteMenu[entry],"Transparent") == 0) - (void) FormatLocaleString(matte,MagickPathExtent, - QuantumFormat,(Quantum) TransparentAlpha); + (void) FormatLocaleString(matte,MagickPathExtent,"%g", + (double) TransparentAlpha); break; } (void) FormatLocaleString(message,MagickPathExtent, - "Enter matte value (0 - " QuantumFormat "):",(Quantum) - QuantumRange); + "Enter matte value (0 - " "%g" "):",(double) QuantumRange); (void) XDialogWidget(display,windows,"Matte",message,matte); if (*matte == '\0') break; @@ -9947,7 +9946,7 @@ static MagickBooleanType XMatteEditImage(Display *display, (void) XConfigureImage(display,resource_info,windows,*image,exception); XInfoWidget(display,windows,text); (void) XCheckDefineCursor(display,windows->image.id,cursor); - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); break; } case Expose: @@ -10010,14 +10009,14 @@ static MagickBooleanType XMatteEditImage(Display *display, y=event.xmotion.y; if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id, windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); break; } @@ -10054,9 +10053,9 @@ static MagickBooleanType XMatteEditImage(Display *display, if (windows->image.crop_geometry != (char *) NULL) (void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width, &height); - x_offset=(int) (width*(windows->image.x+x_offset)/ + x_offset=((int) width*(windows->image.x+x_offset)/ windows->image.ximage->width+x); - y_offset=(int) (height*(windows->image.y+y_offset)/ + y_offset=((int) height*(windows->image.y+y_offset)/ windows->image.ximage->height+y); if ((x_offset < 0) || (y_offset < 0)) continue; @@ -10179,7 +10178,7 @@ static MagickBooleanType XMatteEditImage(Display *display, } } image_view=DestroyCacheView(image_view); - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); } } while ((state & ExitState) == 0); (void) XSelectInput(display,windows->image.id, @@ -10443,9 +10442,9 @@ static void XPanImage(Display *display,XWindows *windows,XEvent *event, x_factor=(double) windows->image.ximage->width/windows->pan.width; y_factor=(double) windows->image.ximage->height/windows->pan.height; pan_info.width=windows->pan.width*windows->image.width/ - windows->image.ximage->width; + (unsigned int) windows->image.ximage->width; pan_info.height=windows->pan.height*windows->image.height/ - windows->image.ximage->height; + (unsigned int) windows->image.ximage->height; pan_info.x=0; pan_info.y=0; state=UpdateConfigurationState; @@ -10490,25 +10489,24 @@ static void XPanImage(Display *display,XWindows *windows,XEvent *event, if (pan_info.x < (ssize_t) (pan_info.width/2)) pan_info.x=0; else - pan_info.x=(ssize_t) (x_factor*(pan_info.x-(pan_info.width/2))); + pan_info.x=(x_factor*(pan_info.x-((int) pan_info.width/2))); if (pan_info.x < 0) pan_info.x=0; else if ((int) (pan_info.x+windows->image.width) > windows->image.ximage->width) - pan_info.x=(ssize_t) - (windows->image.ximage->width-windows->image.width); + pan_info.x=windows->image.ximage->width-(int) windows->image.width; if (pan_info.y < (ssize_t) (pan_info.height/2)) pan_info.y=0; else - pan_info.y=(ssize_t) (y_factor*(pan_info.y-(pan_info.height/2))); + pan_info.y=(y_factor*(pan_info.y-((int) pan_info.height/2))); if (pan_info.y < 0) pan_info.y=0; else if ((int) (pan_info.y+windows->image.height) > windows->image.ximage->height) - pan_info.y=(ssize_t) - (windows->image.ximage->height-windows->image.height); + pan_info.y=windows->image.ximage->height-(int) + windows->image.height; if ((windows->image.x != (int) pan_info.x) || (windows->image.y != (int) pan_info.y)) { @@ -10527,7 +10525,7 @@ static void XPanImage(Display *display,XWindows *windows,XEvent *event, XDrawPanRectangle(display,windows); XRefreshWindow(display,&windows->image,(XEvent *) NULL); } - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); } /* Wait for next event. @@ -10853,14 +10851,14 @@ static MagickBooleanType XPasteImage(Display *display, y=event.xmotion.y; if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id, windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); paste_info.x=(ssize_t) windows->image.x+x; paste_info.y=(ssize_t) windows->image.y+y; @@ -11444,14 +11442,14 @@ static MagickBooleanType XROIImage(Display *display, y=event.xmotion.y; if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id, windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); roi_info.x=(ssize_t) windows->image.x+x; roi_info.y=(ssize_t) windows->image.y+y; @@ -11679,7 +11677,7 @@ static MagickBooleanType XROIImage(Display *display, XInfoWidget(display,windows,text); (void) XSetFunction(display,windows->image.highlight_context, GXinvert); - state&=(~UpdateRegionState); + state&=(unsigned int) (~UpdateRegionState); } XHighlightRectangle(display,windows->image.id, windows->image.highlight_context,&highlight_info); @@ -11757,33 +11755,33 @@ static MagickBooleanType XROIImage(Display *display, (y < (int) (roi_info.y+RoiDelta)) && (y > (int) (roi_info.y-RoiDelta))) { - roi_info.x=(ssize_t) (roi_info.x+roi_info.width); - roi_info.y=(ssize_t) (roi_info.y+roi_info.height); + roi_info.x=roi_info.x+(int) roi_info.width; + roi_info.y=roi_info.y+(int) roi_info.height; state|=UpdateConfigurationState; break; } if ((x < (int) (roi_info.x+RoiDelta)) && (x > (int) (roi_info.x-RoiDelta)) && - (y < (int) (roi_info.y+roi_info.height+RoiDelta)) && - (y > (int) (roi_info.y+roi_info.height-RoiDelta))) + (y < (roi_info.y+(int) roi_info.height+RoiDelta)) && + (y > (roi_info.y+(int) roi_info.height-RoiDelta))) { - roi_info.x=(ssize_t) (roi_info.x+roi_info.width); + roi_info.x=roi_info.x+(int) roi_info.width; state|=UpdateConfigurationState; break; } - if ((x < (int) (roi_info.x+roi_info.width+RoiDelta)) && - (x > (int) (roi_info.x+roi_info.width-RoiDelta)) && + if ((x < (roi_info.x+(int) roi_info.width+RoiDelta)) && + (x > (roi_info.x+(int) roi_info.width-RoiDelta)) && (y < (int) (roi_info.y+RoiDelta)) && (y > (int) (roi_info.y-RoiDelta))) { - roi_info.y=(ssize_t) (roi_info.y+roi_info.height); + roi_info.y=roi_info.y+(int) roi_info.height; state|=UpdateConfigurationState; break; } - if ((x < (int) (roi_info.x+roi_info.width+RoiDelta)) && - (x > (int) (roi_info.x+roi_info.width-RoiDelta)) && - (y < (int) (roi_info.y+roi_info.height+RoiDelta)) && - (y > (int) (roi_info.y+roi_info.height-RoiDelta))) + if ((x < (roi_info.x+(int) roi_info.width+RoiDelta)) && + (x > (roi_info.x+(int) roi_info.width-RoiDelta)) && + (y < (roi_info.y+(int) roi_info.height+RoiDelta)) && + (y > (roi_info.y+(int) roi_info.height-RoiDelta))) { state|=UpdateConfigurationState; break; @@ -11916,14 +11914,14 @@ static MagickBooleanType XROIImage(Display *display, y=event.xmotion.y; if (windows->info.mapped != MagickFalse) { - if ((x < (int) (windows->info.x+windows->info.width)) && - (y < (int) (windows->info.y+windows->info.height))) + if ((x < (windows->info.x+(int) windows->info.width)) && + (y < (windows->info.y+(int) windows->info.height))) (void) XWithdrawWindow(display,windows->info.id, windows->info.screen); } else - if ((x > (int) (windows->info.x+windows->info.width)) || - (y > (int) (windows->info.y+windows->info.height))) + if ((x > (windows->info.x+(int) windows->info.width)) || + (y > (windows->info.y+(int) windows->info.height))) (void) XMapWindow(display,windows->info.id); roi_info.x=(ssize_t) windows->image.x+event.xmotion.x; roi_info.y=(ssize_t) windows->image.y+event.xmotion.y; @@ -12375,8 +12373,8 @@ static MagickBooleanType XRotateImage(Display *display, */ degrees=0.0; distance=(unsigned int) - ((rotate_info.x2-rotate_info.x1+1)*(rotate_info.x2-rotate_info.x1+1))+ - ((rotate_info.y2-rotate_info.y1+1)*(rotate_info.y2-rotate_info.y1+1)); + (((rotate_info.x2-rotate_info.x1+1)*(rotate_info.x2-rotate_info.x1+1))+ + ((rotate_info.y2-rotate_info.y1+1)*(rotate_info.y2-rotate_info.y1+1))); if (distance > 9) degrees=RadiansToDegrees(-atan2((double) (rotate_info.y2- rotate_info.y1),(double) (rotate_info.x2-rotate_info.x1))); @@ -12747,7 +12745,7 @@ static void XScreenEvent(Display *display,XWindows *windows,XEvent *event, Convert Alt-Button3 to Button2. */ event->xbutton.button=Button2; - event->xbutton.state&=(~Mod1Mask); + event->xbutton.state&=(unsigned int) (~Mod1Mask); } if (event->xbutton.window == windows->backdrop.id) { @@ -13149,8 +13147,8 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info, x=0; y=0; (void) XParseGeometry(image->montage,&x,&y,&width,&height); - tile=((event->xbutton.y-y)/height)*(((int) image->columns-x)/width)+ - (event->xbutton.x-x)/width; + tile=((event->xbutton.y-y)/(int) height)*(((int) image->columns-x)/(int) + width)+(event->xbutton.x-x)/(int) width; if (tile < 0) { /* @@ -13241,7 +13239,7 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info, status=XConfirmWidget(display,windows,"Really delete tile",filename); if (status <= 0) break; - status=ShredFile(filename); + status=ShredFile(filename) == MagickFalse ? 0 : 1; status|=remove_utf8(filename); if (status != MagickFalse) { @@ -13289,8 +13287,10 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info, /* Overwrite tile with background color. */ - x_offset=(int) (width*(tile % (((int) image->columns-x)/width))+x); - y_offset=(int) (height*(tile/(((int) image->columns-x)/width))+y); + x_offset=((int) width*(tile % (((int) image->columns-x)/(int) width))+ + x); + y_offset=((int) height*(tile/(((int) image->columns-x)/(int) width))+ + y); image_view=AcquireAuthenticCacheView(image,exception); (void) GetOneCacheViewVirtualPixelInfo(image_view,0,0,&pixel,exception); for (i=0; i < (int) height; i++) @@ -13389,27 +13389,27 @@ static void XTranslateImage(Display *display,XWindows *windows, case XK_Left: case XK_KP_Left: { - windows->image.x-=x_offset; + windows->image.x-=(int) x_offset; break; } case XK_Next: case XK_Up: case XK_KP_Up: { - windows->image.y-=y_offset; + windows->image.y-=(int) y_offset; break; } case XK_Right: case XK_KP_Right: { - windows->image.x+=x_offset; + windows->image.x+=(int) x_offset; break; } case XK_Prior: case XK_Down: case XK_KP_Down: { - windows->image.y+=y_offset; + windows->image.y+=(int) y_offset; break; } default: @@ -13421,15 +13421,14 @@ static void XTranslateImage(Display *display,XWindows *windows, if (windows->image.x < 0) windows->image.x=0; else - if ((int) (windows->image.x+windows->image.width) > - windows->image.ximage->width) - windows->image.x=(int) windows->image.ximage->width-windows->image.width; + if ((windows->image.x+(int) windows->image.width) > windows->image.ximage->width) + windows->image.x=windows->image.ximage->width-(int) windows->image.width; if (windows->image.y < 0) windows->image.y=0; else - if ((int) (windows->image.y+windows->image.height) > - windows->image.ximage->height) - windows->image.y=(int) windows->image.ximage->height-windows->image.height; + if ((windows->image.y+(int) windows->image.height) > windows->image.ximage->height) + windows->image.y=windows->image.ximage->height-(int) + windows->image.height; /* Refresh Image window. */ @@ -13566,7 +13565,7 @@ static MagickBooleanType XTrimImage(Display *display, if (x < windows->image.ximage->width) break; } - trim_info.height=(size_t) y-trim_info.y+1; + trim_info.height=(size_t) (y-trim_info.y+1); if (((unsigned int) trim_info.width != windows->image.width) || ((unsigned int) trim_info.height != windows->image.height)) { @@ -13960,7 +13959,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display, window_info.x=(int) geometry_info.x; window_info.y=(int) geometry_info.y; status=XMakeImage(display,&resources,&window_info,image,window_info.width, - window_info.height,exception); + window_info.height,exception) == MagickFalse ? 0 : 1; if (status == MagickFalse) ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage", image->filename); @@ -14045,7 +14044,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display, window_info.width,(unsigned int) window_info.height); (void) XSetWindowBackgroundPixmap(display,window_info.id,window_info.pixmap); (void) XClearWindow(display,window_info.id); - delay=1000*image->delay/MagickMax(image->ticks_per_second,1L); + delay=1000*image->delay/(size_t) MagickMax(image->ticks_per_second,1L); XDelay(display,delay == 0UL ? 10UL : delay); (void) XSync(display,MagickFalse); return(window_info.id == root_window ? MagickTrue : MagickFalse); @@ -14816,9 +14815,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, */ windows->image.flags|=USPosition; windows->image.x=(XDisplayWidth(display,visual_info->screen)/2)- - (windows->image.width/2); + ((int) windows->image.width/2); windows->image.y=(XDisplayHeight(display,visual_info->screen)/2)- - (windows->image.height/2); + ((int) windows->image.height/2); } manager_hints->flags=IconWindowHint | InputHint | StateHint; manager_hints->icon_window=windows->icon.id; @@ -15085,8 +15084,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, /* Respond to events. */ - delay=display_image->delay/MagickMax(display_image->ticks_per_second,1L); - timer=GetMagickTime()+(delay == 0 ? 1 : delay)+1; + delay=display_image->delay/(size_t) + MagickMax(display_image->ticks_per_second,1L); + timer=GetMagickTime()+(time_t) (delay == 0 ? 1 : delay)+1; update_time=0; if (resource_info->update != MagickFalse) { @@ -15100,9 +15100,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, if (status != MagickFalse) update_time=attributes.st_mtime; } - *state&=(~FormerImageState); - *state&=(~MontageImageState); - *state&=(~NextImageState); + *state&=(unsigned int) (~FormerImageState); + *state&=(unsigned int) (~MontageImageState); + *state&=(unsigned int) (~NextImageState); do { /* @@ -15138,9 +15138,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, if (nexus != (Image *) NULL) *state|=NextImageState | ExitState; } - delay=display_image->delay/MagickMax( + delay=display_image->delay/(size_t) MagickMax( display_image->ticks_per_second,1L); - timer=GetMagickTime()+(delay == 0 ? 1 : delay)+1; + timer=GetMagickTime()+(time_t) (delay == 0 ? 1 : delay)+1; } } if (XEventsQueued(display,QueuedAfterFlush) == 0) @@ -15205,7 +15205,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, Convert Alt-Button3 to Button2. */ event.xbutton.button=Button2; - event.xbutton.state&=(~Mod1Mask); + event.xbutton.state&=(unsigned int) (~Mod1Mask); } if (event.xbutton.window == windows->backdrop.id) { @@ -15382,9 +15382,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, } break; } - delay=display_image->delay/MagickMax(display_image->ticks_per_second, - 1L); - timer=GetMagickTime()+(delay == 0 ? 1 : delay)+1; + delay=display_image->delay/(size_t) + MagickMax(display_image->ticks_per_second,1L); + timer=GetMagickTime()+(time_t) (delay == 0 ? 1 : delay)+1; break; } case ButtonRelease: @@ -15581,7 +15581,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, if (windows->command.geometry == (char *) NULL) if (windows->command.mapped == MagickFalse) { - windows->command.x=event.xconfigure.x- + windows->command.x=event.xconfigure.x-(int) windows->command.width-25; windows->command.y=event.xconfigure.y; XConstrainWindowPosition(display,&windows->command); @@ -15621,9 +15621,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, if (windows->pan.geometry == (char *) NULL) if (windows->pan.mapped == MagickFalse) { - windows->pan.x=event.xconfigure.x+ + windows->pan.x=event.xconfigure.x+(int) event.xconfigure.width+25; - windows->pan.y=event.xconfigure.y+ + windows->pan.y=event.xconfigure.y+(int) windows->magnify.height+50; XConstrainWindowPosition(display,&windows->pan); window_changes.x=windows->pan.x; @@ -15774,9 +15774,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, windows->image.mapped != MagickFalse) { XRefreshWindow(display,&windows->image,&event); - delay=display_image->delay/MagickMax( + delay=display_image->delay/(size_t) MagickMax( display_image->ticks_per_second,1L); - timer=GetMagickTime()+(delay == 0 ? 1 : delay)+1; + timer=GetMagickTime()+(time_t) (delay == 0 ? 1 : delay)+1; break; } if ((event.xexpose.window == windows->magnify.id) && @@ -15835,9 +15835,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, else XTranslateImage(display,windows,*image,key_symbol); } - delay=display_image->delay/MagickMax( + delay=display_image->delay/(size_t) MagickMax( display_image->ticks_per_second,1L); - timer=GetMagickTime()+(delay == 0 ? 1 : delay)+1; + timer=GetMagickTime()+(time_t) (delay == 0 ? 1 : delay)+1; break; } case KeyRelease: @@ -16100,7 +16100,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, status=XConfirmWidget(display,windows,"Your image changed.", "Do you want to save it"); if (status == 0) - *state&=(~ExitState); + *state&=(unsigned int) (~ExitState); else if (status > 0) (void) XMagickCommand(display,resource_info,windows,SaveCommand, @@ -16140,7 +16140,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, XSetCursorState(display,windows,MagickTrue); XCheckRefreshWindows(display,windows); if (((*state & FormerImageState) != 0) || ((*state & NextImageState) != 0)) - *state&=(~ExitState); + *state&=(unsigned int) (~ExitState); if (*state & ExitState) { /* diff --git a/ImageMagick-7.1.1-15/MagickCore/display.h b/ImageMagick-7.1.1-16/MagickCore/display.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/display.h rename to ImageMagick-7.1.1-16/MagickCore/display.h diff --git a/ImageMagick-7.1.1-15/MagickCore/distort.c b/ImageMagick-7.1.1-16/MagickCore/distort.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/distort.c rename to ImageMagick-7.1.1-16/MagickCore/distort.c index 7571276b..6651c691 100644 --- a/ImageMagick-7.1.1-15/MagickCore/distort.c +++ b/ImageMagick-7.1.1-16/MagickCore/distort.c @@ -18,7 +18,7 @@ % June 2007 % % % % % -% Copyright @ 2007 ImageMagick Studio LLC, a non-profit organization % +% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % @@ -2245,7 +2245,7 @@ MagickExport Image *DistortImage(const Image *image, DistortMethod method, { if ((i != 0) && (i%4 == 0)) (void) FormatLocaleFile(stderr,"\n "); - (void) FormatLocaleFile(stderr," %+lf%s",coeff[2+i+nterms], + (void) FormatLocaleFile(stderr," %+lf%s",coeff[2+i+(int) nterms], poly_basis_str(i)); } (void) FormatLocaleFile(stderr,";\n %s' \\\n", lookup); @@ -3396,17 +3396,22 @@ MagickExport Image *SparseColorImage(const Image *image, } /* set the color directly back into the source image */ if ((GetPixelRedTraits(sparse_image) & UpdatePixelTrait) != 0) - pixel.red=(MagickRealType) ClampPixel(QuantumRange*pixel.red); + pixel.red=(MagickRealType) ClampPixel((double) QuantumRange* + pixel.red); if ((GetPixelGreenTraits(sparse_image) & UpdatePixelTrait) != 0) - pixel.green=(MagickRealType) ClampPixel(QuantumRange*pixel.green); + pixel.green=(MagickRealType) ClampPixel((double) QuantumRange* + pixel.green); if ((GetPixelBlueTraits(sparse_image) & UpdatePixelTrait) != 0) - pixel.blue=(MagickRealType) ClampPixel(QuantumRange*pixel.blue); + pixel.blue=(MagickRealType) ClampPixel((double) QuantumRange* + pixel.blue); if (((GetPixelBlackTraits(sparse_image) & UpdatePixelTrait) != 0) && (image->colorspace == CMYKColorspace)) - pixel.black=(MagickRealType) ClampPixel(QuantumRange*pixel.black); + pixel.black=(MagickRealType) ClampPixel((double) QuantumRange* + pixel.black); if (((GetPixelAlphaTraits(sparse_image) & UpdatePixelTrait) != 0) && (image->alpha_trait != UndefinedPixelTrait)) - pixel.alpha=(MagickRealType) ClampPixel(QuantumRange*pixel.alpha); + pixel.alpha=(MagickRealType) ClampPixel((double) QuantumRange* + pixel.alpha); SetPixelViaPixelInfo(sparse_image,&pixel,q); q+=GetPixelChannels(sparse_image); } diff --git a/ImageMagick-7.1.1-15/MagickCore/distort.h b/ImageMagick-7.1.1-16/MagickCore/distort.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/distort.h rename to ImageMagick-7.1.1-16/MagickCore/distort.h diff --git a/ImageMagick-7.1.1-15/MagickCore/distribute-cache-private.h b/ImageMagick-7.1.1-16/MagickCore/distribute-cache-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/distribute-cache-private.h rename to ImageMagick-7.1.1-16/MagickCore/distribute-cache-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/distribute-cache.c b/ImageMagick-7.1.1-16/MagickCore/distribute-cache.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/distribute-cache.c rename to ImageMagick-7.1.1-16/MagickCore/distribute-cache.c index c7702f50..88d87751 100644 --- a/ImageMagick-7.1.1-15/MagickCore/distribute-cache.c +++ b/ImageMagick-7.1.1-16/MagickCore/distribute-cache.c @@ -162,11 +162,12 @@ static inline MagickOffsetType dpc_read(int file,const MagickSizeType length, ssize_t count; + count=0; for (i=0; i < (MagickOffsetType) length; i+=count) { - count=recv(file,(char *) message+i,(LENGTH_TYPE) MagickMin(length-i, - (MagickSizeType) MAGICK_SSIZE_MAX),0); + count=recv(file,(char *) message+i,(LENGTH_TYPE) MagickMin(length- + (MagickSizeType) i,(MagickSizeType) MAGICK_SSIZE_MAX),0); if (count <= 0) { count=0; @@ -181,7 +182,7 @@ static inline MagickOffsetType dpc_read(int file,const MagickSizeType length, #if defined(MAGICKCORE_HAVE_WINSOCK2) static void InitializeWinsock2(MagickBooleanType use_lock) { - if (use_lock) + if (use_lock != MagickFalse) { if (winsock2_semaphore == (SemaphoreInfo *) NULL) ActivateSemaphoreInfo(&winsock2_semaphore); @@ -193,7 +194,7 @@ static void InitializeWinsock2(MagickBooleanType use_lock) if (WSAStartup(MAKEWORD(2,2),wsaData) != 0) ThrowFatalException(CacheFatalError,"WSAStartup failed"); } - if (use_lock) + if (use_lock != MagickFalse) UnlockSemaphoreInfo(winsock2_semaphore); } #endif @@ -337,7 +338,7 @@ static char *GetHostname(int *port,ExceptionInfo *exception) *port=DPCPort; return(AcquireString(DPCHostname)); } - hosts=AcquireString(hostlist[(id++ % (argc-1))+1]); + hosts=AcquireString(hostlist[(id++ % ((size_t) argc-1))+1]); for (i=0; i < (ssize_t) argc; i++) hostlist[i]=DestroyString(hostlist[i]); hostlist=(char **) RelinquishMagickMemory(hostlist); @@ -475,9 +476,11 @@ static inline MagickOffsetType dpc_send(int file,const MagickSizeType length, const void *magick_restrict message) { MagickOffsetType - count, i; + ssize_t + count; + /* Ensure a complete message is sent. */ @@ -485,7 +488,8 @@ static inline MagickOffsetType dpc_send(int file,const MagickSizeType length, for (i=0; i < (MagickOffsetType) length; i+=count) { count=(MagickOffsetType) send(file,(char *) message+i,(LENGTH_TYPE) - MagickMin(length-i,(MagickSizeType) MAGICK_SSIZE_MAX),MSG_NOSIGNAL); + MagickMin(length-(MagickSizeType) i,(MagickSizeType) MAGICK_SSIZE_MAX), + MSG_NOSIGNAL); if (count <= 0) { count=0; @@ -1238,7 +1242,7 @@ MagickPrivate MagickBooleanType OpenDistributePixelCache( p+=MaxPixelChannels*sizeof(*image->channel_map); (void) memcpy(p,&image->metacontent_extent,sizeof(image->metacontent_extent)); p+=sizeof(image->metacontent_extent); - count=dpc_send(server_info->file,p-message,message); + count=dpc_send(server_info->file,(MagickSizeType) (p-message),message); if (count != (MagickOffsetType) (p-message)) return(MagickFalse); status=MagickFalse; @@ -1315,7 +1319,7 @@ MagickPrivate MagickOffsetType ReadDistributePixelCacheMetacontent( p+=sizeof(region->y); (void) memcpy(p,&length,sizeof(length)); p+=sizeof(length); - count=dpc_send(server_info->file,p-message,message); + count=dpc_send(server_info->file,(MagickSizeType) (p-message),message); if (count != (MagickOffsetType) (p-message)) return(-1); return(dpc_read(server_info->file,length,metacontent)); @@ -1388,7 +1392,7 @@ MagickPrivate MagickOffsetType ReadDistributePixelCachePixels( p+=sizeof(region->y); (void) memcpy(p,&length,sizeof(length)); p+=sizeof(length); - count=dpc_send(server_info->file,p-message,message); + count=dpc_send(server_info->file,(MagickSizeType) (p-message),message); if (count != (MagickOffsetType) (p-message)) return(-1); return(dpc_read(server_info->file,length,pixels)); @@ -1440,7 +1444,7 @@ MagickPrivate MagickBooleanType RelinquishDistributePixelCache( *p++='d'; (void) memcpy(p,&server_info->session_key,sizeof(server_info->session_key)); p+=sizeof(server_info->session_key); - count=dpc_send(server_info->file,p-message,message); + count=dpc_send(server_info->file,(MagickSizeType) (p-message),message); if (count != (MagickOffsetType) (p-message)) return(MagickFalse); status=MagickFalse; @@ -1517,7 +1521,7 @@ MagickPrivate MagickOffsetType WriteDistributePixelCacheMetacontent( p+=sizeof(region->y); (void) memcpy(p,&length,sizeof(length)); p+=sizeof(length); - count=dpc_send(server_info->file,p-message,message); + count=dpc_send(server_info->file,(MagickSizeType) (p-message),message); if (count != (MagickOffsetType) (p-message)) return(-1); return(dpc_send(server_info->file,length,metacontent)); @@ -1591,7 +1595,7 @@ MagickPrivate MagickOffsetType WriteDistributePixelCachePixels( p+=sizeof(region->y); (void) memcpy(p,&length,sizeof(length)); p+=sizeof(length); - count=dpc_send(server_info->file,p-message,message); + count=dpc_send(server_info->file,(MagickSizeType) (p-message),message); if (count != (MagickOffsetType) (p-message)) return(-1); return(dpc_send(server_info->file,length,pixels)); diff --git a/ImageMagick-7.1.1-15/MagickCore/distribute-cache.h b/ImageMagick-7.1.1-16/MagickCore/distribute-cache.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/distribute-cache.h rename to ImageMagick-7.1.1-16/MagickCore/distribute-cache.h diff --git a/ImageMagick-7.1.1-15/MagickCore/draw-private.h b/ImageMagick-7.1.1-16/MagickCore/draw-private.h similarity index 92% rename from ImageMagick-7.1.1-15/MagickCore/draw-private.h rename to ImageMagick-7.1.1-16/MagickCore/draw-private.h index ede0bad6..37081d7f 100644 --- a/ImageMagick-7.1.1-15/MagickCore/draw-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/draw-private.h @@ -41,7 +41,7 @@ static inline void GetFillColor(const DrawInfo *draw_info,const ssize_t x, pattern=draw_info->fill_pattern; (void) GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+ pattern->tile_offset.x,y+pattern->tile_offset.y,fill,exception); - if (fabs(draw_info->fill_alpha-TransparentAlpha) >= MagickEpsilon) + if (fabs(draw_info->fill_alpha-(double) TransparentAlpha) >= MagickEpsilon) fill->alpha*=QuantumScale*draw_info->fill_alpha; } } @@ -61,7 +61,7 @@ static inline void GetStrokeColor(const DrawInfo *draw_info,const ssize_t x, pattern=draw_info->stroke_pattern; (void) GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+ pattern->tile_offset.x,y+pattern->tile_offset.y,stroke,exception); - if (fabs(draw_info->stroke_alpha-TransparentAlpha) >= MagickEpsilon) + if (fabs(draw_info->stroke_alpha-(double) TransparentAlpha) >= MagickEpsilon) stroke->alpha*=QuantumScale*draw_info->stroke_alpha; } } diff --git a/ImageMagick-7.1.1-15/MagickCore/draw.c b/ImageMagick-7.1.1-16/MagickCore/draw.c similarity index 96% rename from ImageMagick-7.1.1-15/MagickCore/draw.c rename to ImageMagick-7.1.1-16/MagickCore/draw.c index d88729d9..de67f746 100644 --- a/ImageMagick-7.1.1-15/MagickCore/draw.c +++ b/ImageMagick-7.1.1-16/MagickCore/draw.c @@ -504,10 +504,10 @@ static void ReversePoints(PointInfo *points,const size_t number_points) PointInfo point; - ssize_t + size_t i; - for (i=0; i < (ssize_t) (number_points >> 1); i++) + for (i=0; i < (number_points >> 1); i++) { point=points[i]; points[i]=points[number_points-(i+1)]; @@ -850,12 +850,12 @@ static PathInfo *ConvertPrimitiveToPath(const PrimitiveInfo *primitive_info, q; ssize_t - i, - n; + n, + start; - ssize_t + size_t coordinates, - start; + i; /* Converts a PrimitiveInfo structure into a vector path structure. @@ -896,7 +896,7 @@ static PathInfo *ConvertPrimitiveToPath(const PrimitiveInfo *primitive_info, /* New subpath. */ - coordinates=(ssize_t) primitive_info[i].coordinates; + coordinates=primitive_info[i].coordinates; p=primitive_info[i].point; start=n; code=MoveToCode; @@ -1247,7 +1247,7 @@ MagickExport MagickBooleanType DrawAffineImage(Image *image, image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(source,image,stop-start,1) + magick_number_threads(source,image,(size_t) (stop-start),1) #endif for (y=start; y <= stop; y++) { @@ -1443,7 +1443,7 @@ static MagickBooleanType DrawBoundingRectangles(Image *image, end.x=(double) (polygon_info->edges[i].bounds.x2+mid); end.y=(double) (polygon_info->edges[i].bounds.y2+mid); primitive_info[0].primitive=RectanglePrimitive; - status&=TraceRectangle(primitive_info,start,end); + status&=(MagickStatusType) TraceRectangle(primitive_info,start,end); primitive_info[0].method=ReplaceMethod; coordinates=(ssize_t) primitive_info[0].coordinates; primitive_info[coordinates].primitive=UndefinedPrimitive; @@ -1469,7 +1469,7 @@ static MagickBooleanType DrawBoundingRectangles(Image *image, end.x=(double) (bounds.x2+mid); end.y=(double) (bounds.y2+mid); primitive_info[0].primitive=RectanglePrimitive; - status&=TraceRectangle(primitive_info,start,end); + status&=(MagickStatusType) TraceRectangle(primitive_info,start,end); primitive_info[0].method=ReplaceMethod; coordinates=(ssize_t) primitive_info[0].coordinates; primitive_info[coordinates].primitive=UndefinedPrimitive; @@ -1617,7 +1617,7 @@ static Image *DrawClippingMask(Image *image,const DrawInfo *draw_info, { clip_mask=DestroyImage(clip_mask); clip_mask=separate_mask; - status&=NegateImage(clip_mask,MagickFalse,exception); + status&=(MagickStatusType) NegateImage(clip_mask,MagickFalse,exception); } if (status == MagickFalse) clip_mask=DestroyImage(clip_mask); @@ -1867,7 +1867,8 @@ static MagickBooleanType DrawDashPolygon(const DrawInfo *draw_info, j++; dash_polygon[0].coordinates=(size_t) j; dash_polygon[j].primitive=UndefinedPrimitive; - status&=DrawStrokePolygon(image,clone_info,dash_polygon,exception); + status&=(MagickStatusType) DrawStrokePolygon(image,clone_info, + dash_polygon,exception); if (status == MagickFalse) break; } @@ -1894,7 +1895,8 @@ static MagickBooleanType DrawDashPolygon(const DrawInfo *draw_info, j++; dash_polygon[0].coordinates=(size_t) j; dash_polygon[j].primitive=UndefinedPrimitive; - status&=DrawStrokePolygon(image,clone_info,dash_polygon,exception); + status&=(MagickStatusType) DrawStrokePolygon(image,clone_info, + dash_polygon,exception); } dash_polygon=(PrimitiveInfo *) RelinquishMagickMemory(dash_polygon); clone_info=DestroyDrawInfo(clone_info); @@ -2053,7 +2055,7 @@ MagickExport MagickBooleanType DrawGradientImage(Image *image, image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,image,bounding_box.height-bounding_box.y,1) + magick_number_threads(image,image,(bounding_box.height-(size_t) bounding_box.y),1) #endif for (y=bounding_box.y; y < (ssize_t) bounding_box.height; y++) { @@ -2292,7 +2294,8 @@ static MagickBooleanType CheckPrimitiveExtent(MVGInfo *mvg_info, return(MagickFalse); if (mvg_info->offset > 0) { - text=(char **) AcquireQuantumMemory(mvg_info->offset,sizeof(*text)); + text=(char **) AcquireQuantumMemory((size_t) mvg_info->offset, + sizeof(*text)); if (text == (char **) NULL) return(MagickFalse); for (i=0; i < mvg_info->offset; i++) @@ -2719,7 +2722,7 @@ static MagickBooleanType RenderMVGContent(Image *image, if (LocaleCompare("border-color",keyword) == 0) { (void) GetNextToken(q,&q,extent,token); - status&=QueryColorCompliance(token,AllCompliance, + status&=(MagickStatusType) QueryColorCompliance(token,AllCompliance, &graphic_context[n]->border_color,exception); break; } @@ -2797,8 +2800,9 @@ static MagickBooleanType RenderMVGContent(Image *image, if (clip_path != (const char *) NULL) (void) SetImageArtifact(image, graphic_context[n]->clip_mask,clip_path); - status&=DrawClipPath(image,graphic_context[n], - graphic_context[n]->clip_mask,exception); + status&=(MagickStatusType) DrawClipPath(image, + graphic_context[n],graphic_context[n]->clip_mask, + exception); } } break; @@ -2957,9 +2961,9 @@ static MagickBooleanType RenderMVGContent(Image *image, &graphic_context[n]->fill_pattern,exception); break; } - status&=QueryColorCompliance(token,AllCompliance, + status&=(MagickStatusType) QueryColorCompliance(token,AllCompliance, &graphic_context[n]->fill,exception); - if (graphic_context[n]->fill_alpha != OpaqueAlpha) + if (graphic_context[n]->fill_alpha != (double) OpaqueAlpha) graphic_context[n]->fill.alpha=graphic_context[n]->fill_alpha; break; } @@ -2979,12 +2983,12 @@ static MagickBooleanType RenderMVGContent(Image *image, if (graphic_context[n]->compliance == SVGCompliance) graphic_context[n]->fill_alpha*=opacity; else - graphic_context[n]->fill_alpha=QuantumRange*opacity; - if (graphic_context[n]->fill.alpha != TransparentAlpha) + graphic_context[n]->fill_alpha=(double) QuantumRange*opacity; + if (graphic_context[n]->fill.alpha != (double) TransparentAlpha) graphic_context[n]->fill.alpha=graphic_context[n]->fill_alpha; else graphic_context[n]->fill.alpha=(MagickRealType) - ClampToQuantum(QuantumRange*opacity); + ClampToQuantum((double) QuantumRange*opacity); graphic_context[n]->fill.alpha_trait=BlendPixelTrait; break; } @@ -3162,7 +3166,8 @@ static MagickBooleanType RenderMVGContent(Image *image, break; clone_info=CloneDrawInfo((ImageInfo *) NULL,graphic_context[n]); clone_info->text=AcquireString(" "); - status&=GetTypeMetrics(image,clone_info,&metrics,exception); + status&=(MagickStatusType) GetTypeMetrics(image,clone_info,&metrics, + exception); graphic_context[n]->kerning=metrics.width* GetDrawValue(token,&next_token); clone_info=DestroyDrawInfo(clone_info); @@ -3235,8 +3240,8 @@ static MagickBooleanType RenderMVGContent(Image *image, } else { - graphic_context[n]->fill_alpha=QuantumRange*opacity; - graphic_context[n]->stroke_alpha=QuantumRange*opacity; + graphic_context[n]->fill_alpha=(double) QuantumRange*opacity; + graphic_context[n]->stroke_alpha=(double) QuantumRange*opacity; } break; } @@ -3643,8 +3648,8 @@ static MagickBooleanType RenderMVGContent(Image *image, break; } (void) GetNextToken(q,&q,extent,token); - status&=QueryColorCompliance(token,AllCompliance,&stop_color, - exception); + status&=(MagickStatusType) QueryColorCompliance(token,AllCompliance, + &stop_color,exception); stops[number_stops-1].color=stop_color; (void) GetNextToken(q,&q,extent,token); factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0; @@ -3676,9 +3681,9 @@ static MagickBooleanType RenderMVGContent(Image *image, &graphic_context[n]->stroke_pattern,exception); break; } - status&=QueryColorCompliance(token,AllCompliance, + status&=(MagickStatusType) QueryColorCompliance(token,AllCompliance, &graphic_context[n]->stroke,exception); - if (graphic_context[n]->stroke_alpha != OpaqueAlpha) + if (graphic_context[n]->stroke_alpha != (double) OpaqueAlpha) graphic_context[n]->stroke.alpha= graphic_context[n]->stroke_alpha; break; @@ -3806,12 +3811,12 @@ static MagickBooleanType RenderMVGContent(Image *image, if (graphic_context[n]->compliance == SVGCompliance) graphic_context[n]->stroke_alpha*=opacity; else - graphic_context[n]->stroke_alpha=QuantumRange*opacity; - if (graphic_context[n]->stroke.alpha != TransparentAlpha) + graphic_context[n]->stroke_alpha=(double) QuantumRange*opacity; + if (graphic_context[n]->stroke.alpha != (double) TransparentAlpha) graphic_context[n]->stroke.alpha=graphic_context[n]->stroke_alpha; else graphic_context[n]->stroke.alpha=(MagickRealType) - ClampToQuantum(QuantumRange*opacity); + ClampToQuantum((double) QuantumRange*opacity); graphic_context[n]->stroke.alpha_trait=BlendPixelTrait; break; } @@ -3878,7 +3883,7 @@ static MagickBooleanType RenderMVGContent(Image *image, if (LocaleCompare("text-undercolor",keyword) == 0) { (void) GetNextToken(q,&q,extent,token); - status&=QueryColorCompliance(token,AllCompliance, + status&=(MagickStatusType) QueryColorCompliance(token,AllCompliance, &graphic_context[n]->undercolor,exception); break; } @@ -4064,7 +4069,8 @@ static MagickBooleanType RenderMVGContent(Image *image, mvg_info.offset=i; if (i < (ssize_t) number_points) continue; - status&=CheckPrimitiveExtent(&mvg_info,(double) number_points); + status&=(MagickStatusType) CheckPrimitiveExtent(&mvg_info,(double) + number_points); primitive_info=(*mvg_info.primitive_info); } if (status == MagickFalse) @@ -4172,10 +4178,12 @@ static MagickBooleanType RenderMVGContent(Image *image, break; } mvg_info.offset=i; - status&=CheckPrimitiveExtent(&mvg_info,(double) number_points); + status&=(MagickStatusType) CheckPrimitiveExtent(&mvg_info,(double) + number_points); primitive_info=(*mvg_info.primitive_info); } - status&=CheckPrimitiveExtent(&mvg_info,PrimitiveExtentPad); + status&=(MagickStatusType) CheckPrimitiveExtent(&mvg_info, + PrimitiveExtentPad); primitive_info=(*mvg_info.primitive_info); if (status == MagickFalse) break; @@ -4190,9 +4198,10 @@ static MagickBooleanType RenderMVGContent(Image *image, status=MagickFalse; break; } - status&=TracePoint(primitive_info+j,primitive_info[j].point); + status&=(MagickStatusType) TracePoint(primitive_info+j, + primitive_info[j].point); primitive_info=(*mvg_info.primitive_info); - i=(ssize_t) (j+primitive_info[j].coordinates); + i=j+(ssize_t) primitive_info[j].coordinates; break; } case LinePrimitive: @@ -4202,10 +4211,10 @@ static MagickBooleanType RenderMVGContent(Image *image, status=MagickFalse; break; } - status&=TraceLine(primitive_info+j,primitive_info[j].point, - primitive_info[j+1].point); + status&=(MagickStatusType) TraceLine(primitive_info+j, + primitive_info[j].point,primitive_info[j+1].point); primitive_info=(*mvg_info.primitive_info); - i=(ssize_t) (j+primitive_info[j].coordinates); + i=j+(ssize_t) primitive_info[j].coordinates; break; } case RectanglePrimitive: @@ -4215,10 +4224,10 @@ static MagickBooleanType RenderMVGContent(Image *image, status=MagickFalse; break; } - status&=TraceRectangle(primitive_info+j,primitive_info[j].point, - primitive_info[j+1].point); + status&=(MagickStatusType) TraceRectangle(primitive_info+j, + primitive_info[j].point,primitive_info[j+1].point); primitive_info=(*mvg_info.primitive_info); - i=(ssize_t) (j+primitive_info[j].coordinates); + i=j+(ssize_t) primitive_info[j].coordinates; break; } case RoundRectanglePrimitive: @@ -4244,10 +4253,11 @@ static MagickBooleanType RenderMVGContent(Image *image, status=MagickFalse; break; } - status&=TraceRoundRectangle(&mvg_info,primitive_info[j].point, - primitive_info[j+1].point,primitive_info[j+2].point); + status&=(MagickStatusType) TraceRoundRectangle(&mvg_info, + primitive_info[j].point,primitive_info[j+1].point, + primitive_info[j+2].point); primitive_info=(*mvg_info.primitive_info); - i=(ssize_t) (j+primitive_info[j].coordinates); + i=j+(ssize_t) primitive_info[j].coordinates; break; } case ArcPrimitive: @@ -4257,10 +4267,10 @@ static MagickBooleanType RenderMVGContent(Image *image, status=MagickFalse; break; } - status&=TraceArc(&mvg_info,primitive_info[j].point, + status&=(MagickStatusType) TraceArc(&mvg_info,primitive_info[j].point, primitive_info[j+1].point,primitive_info[j+2].point); primitive_info=(*mvg_info.primitive_info); - i=(ssize_t) (j+primitive_info[j].coordinates); + i=j+(ssize_t) primitive_info[j].coordinates; break; } case EllipsePrimitive: @@ -4276,10 +4286,11 @@ static MagickBooleanType RenderMVGContent(Image *image, status=MagickFalse; break; } - status&=TraceEllipse(&mvg_info,primitive_info[j].point, - primitive_info[j+1].point,primitive_info[j+2].point); + status&=(MagickStatusType) TraceEllipse(&mvg_info, + primitive_info[j].point,primitive_info[j+1].point, + primitive_info[j+2].point); primitive_info=(*mvg_info.primitive_info); - i=(ssize_t) (j+primitive_info[j].coordinates); + i=j+(ssize_t) primitive_info[j].coordinates; break; } case CirclePrimitive: @@ -4289,10 +4300,10 @@ static MagickBooleanType RenderMVGContent(Image *image, status=MagickFalse; break; } - status&=TraceCircle(&mvg_info,primitive_info[j].point, - primitive_info[j+1].point); + status&=(MagickStatusType) TraceCircle(&mvg_info, + primitive_info[j].point,primitive_info[j+1].point); primitive_info=(*mvg_info.primitive_info); - i=(ssize_t) (j+primitive_info[j].coordinates); + i=j+(ssize_t) primitive_info[j].coordinates; break; } case PolylinePrimitive: @@ -4325,9 +4336,10 @@ static MagickBooleanType RenderMVGContent(Image *image, status=MagickFalse; break; } - status&=TraceBezier(&mvg_info,primitive_info[j].coordinates); + status&=(MagickStatusType) TraceBezier(&mvg_info, + primitive_info[j].coordinates); primitive_info=(*mvg_info.primitive_info); - i=(ssize_t) (j+primitive_info[j].coordinates); + i=j+(ssize_t) primitive_info[j].coordinates; break; } case PathPrimitive: @@ -4390,7 +4402,8 @@ static MagickBooleanType RenderMVGContent(Image *image, } clone_info->render=MagickFalse; clone_info->text=AcquireString(token); - status&=GetTypeMetrics(image,clone_info,&metrics,exception); + status&=(MagickStatusType) GetTypeMetrics(image,clone_info, + &metrics,exception); clone_info=DestroyDrawInfo(clone_info); cursor+=metrics.width; if (graphic_context[n]->compliance != SVGCompliance) @@ -4418,12 +4431,12 @@ static MagickBooleanType RenderMVGContent(Image *image, /* Sanity check. */ - status&=CheckPrimitiveExtent(&mvg_info,ExpandAffine( + status&=(MagickStatusType) CheckPrimitiveExtent(&mvg_info,ExpandAffine( &graphic_context[n]->affine)); primitive_info=(*mvg_info.primitive_info); if (status == 0) break; - status&=CheckPrimitiveExtent(&mvg_info,(double) + status&=(MagickStatusType) CheckPrimitiveExtent(&mvg_info,(double) graphic_context[n]->stroke_width); primitive_info=(*mvg_info.primitive_info); if (status == 0) @@ -4469,11 +4482,11 @@ static MagickBooleanType RenderMVGContent(Image *image, if (clip_path != (const char *) NULL) (void) SetImageArtifact(image,graphic_context[n]->clip_mask, clip_path); - status&=DrawClipPath(image,graphic_context[n], + status&=(MagickStatusType) DrawClipPath(image,graphic_context[n], graphic_context[n]->clip_mask,exception); } - status&=DrawPrimitive(image,graphic_context[n],primitive_info, - exception); + status&=(MagickStatusType) DrawPrimitive(image,graphic_context[n], + primitive_info,exception); } proceed=SetImageProgress(image,RenderImageTag,q-primitive,(MagickSizeType) primitive_extent); @@ -4753,7 +4766,7 @@ static size_t DestroyEdge(PolygonInfo *polygon_info,const ssize_t edge) polygon_info->number_edges--; if (edge < (ssize_t) polygon_info->number_edges) (void) memmove(polygon_info->edges+edge,polygon_info->edges+edge+1, - (size_t) (polygon_info->number_edges-edge)*sizeof(*polygon_info->edges)); + (polygon_info->number_edges-(size_t) edge)*sizeof(*polygon_info->edges)); return(polygon_info->number_edges); } @@ -5040,8 +5053,8 @@ static MagickBooleanType DrawPolygonPrimitive(Image *image, poly_extent.y1=CastDoubleToLong(ceil(bounds.y1-0.5)); poly_extent.x2=CastDoubleToLong(floor(bounds.x2+0.5)); poly_extent.y2=CastDoubleToLong(floor(bounds.y2+0.5)); - number_threads=GetMagickNumberThreads(image,image,poly_extent.y2- - poly_extent.y1+1,1); + number_threads=(size_t) GetMagickNumberThreads(image,image,(size_t) + (poly_extent.y2-poly_extent.y1+1),1); status=ClonePolygonEdgesTLS(polygon_info,number_threads,exception); if (status == MagickFalse) { @@ -5057,7 +5070,7 @@ static MagickBooleanType DrawPolygonPrimitive(Image *image, */ #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - num_threads(number_threads) + num_threads((int) number_threads) #endif for (y=poly_extent.y1; y <= poly_extent.y2; y++) { @@ -5107,7 +5120,7 @@ static MagickBooleanType DrawPolygonPrimitive(Image *image, */ #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - num_threads(number_threads) + num_threads((int) number_threads) #endif for (y=poly_extent.y1; y <= poly_extent.y2; y++) { @@ -5330,13 +5343,14 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, if ((IsGrayColorspace(image->colorspace) != MagickFalse) && ((IsPixelInfoGray(&draw_info->fill) == MagickFalse) || (IsPixelInfoGray(&draw_info->stroke) == MagickFalse))) - status&=SetImageColorspace(image,sRGBColorspace,exception); + status&=(MagickStatusType) SetImageColorspace(image,sRGBColorspace, + exception); if (draw_info->compliance == SVGCompliance) { - status&=SetImageMask(image,WritePixelMask,draw_info->clipping_mask, - exception); - status&=SetImageMask(image,CompositePixelMask,draw_info->composite_mask, - exception); + status&=(MagickStatusType) SetImageMask(image,WritePixelMask, + draw_info->clipping_mask,exception); + status&=(MagickStatusType) SetImageMask(image,CompositePixelMask, + draw_info->composite_mask,exception); } x=CastDoubleToLong(ceil(primitive_info->point.x-0.5)); y=CastDoubleToLong(ceil(primitive_info->point.y-0.5)); @@ -5346,7 +5360,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, case AlphaPrimitive: { if ((image->alpha_trait & BlendPixelTrait) == 0) - status&=SetImageAlphaChannel(image,OpaqueAlphaChannel,exception); + status&=(MagickStatusType) SetImageAlphaChannel(image, + OpaqueAlphaChannel,exception); switch (primitive_info->method) { case PointMethod: @@ -5363,7 +5378,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, break; GetFillColor(draw_info,x,y,&pixel,exception); SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q); - status&=SyncCacheViewAuthenticPixels(image_view,exception); + status&=(MagickStatusType) SyncCacheViewAuthenticPixels(image_view, + exception); break; } case ReplaceMethod: @@ -5372,8 +5388,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, pixel, target; - status&=GetOneCacheViewVirtualPixelInfo(image_view,x,y,&target, - exception); + status&=(MagickStatusType) GetOneCacheViewVirtualPixelInfo(image_view, + x,y,&target,exception); GetPixelInfo(image,&pixel); for (y=0; y < (ssize_t) image->rows; y++) { @@ -5396,7 +5412,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q); q+=GetPixelChannels(image); } - status&=SyncCacheViewAuthenticPixels(image_view,exception); + status&=(MagickStatusType) SyncCacheViewAuthenticPixels(image_view, + exception); if (status == MagickFalse) break; } @@ -5411,8 +5428,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, PixelInfo target; - status&=GetOneVirtualPixelInfo(image,TileVirtualPixelMethod,x,y, - &target,exception); + status&=(MagickStatusType) GetOneVirtualPixelInfo(image, + TileVirtualPixelMethod,x,y,&target,exception); if (primitive_info->method == FillToBorderMethod) { target.red=(double) draw_info->border_color.red; @@ -5420,9 +5437,9 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, target.blue=(double) draw_info->border_color.blue; } channel_mask=SetImageChannelMask(image,AlphaChannel); - status&=FloodfillPaintImage(image,draw_info,&target,x,y, - primitive_info->method == FloodfillMethod ? MagickFalse : - MagickTrue,exception); + status&=(MagickStatusType) FloodfillPaintImage(image,draw_info, + &target,x,y,primitive_info->method == FloodfillMethod ? + MagickFalse : MagickTrue,exception); (void) SetImageChannelMask(image,channel_mask); break; } @@ -5446,7 +5463,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q); q+=GetPixelChannels(image); } - status&=SyncCacheViewAuthenticPixels(image_view,exception); + status&=(MagickStatusType) SyncCacheViewAuthenticPixels(image_view, + exception); if (status == MagickFalse) break; } @@ -5474,7 +5492,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, GetPixelInfo(image,&pixel); GetFillColor(draw_info,x,y,&pixel,exception); SetPixelViaPixelInfo(image,&pixel,q); - status&=SyncCacheViewAuthenticPixels(image_view,exception); + status&=(MagickStatusType) SyncCacheViewAuthenticPixels(image_view, + exception); break; } case ReplaceMethod: @@ -5483,8 +5502,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, pixel, target; - status&=GetOneCacheViewVirtualPixelInfo(image_view,x,y,&target, - exception); + status&=(MagickStatusType) GetOneCacheViewVirtualPixelInfo(image_view, + x,y,&target,exception); for (y=0; y < (ssize_t) image->rows; y++) { Quantum @@ -5506,7 +5525,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, SetPixelViaPixelInfo(image,&pixel,q); q+=GetPixelChannels(image); } - status&=SyncCacheViewAuthenticPixels(image_view,exception); + status&=(MagickStatusType) SyncCacheViewAuthenticPixels(image_view, + exception); if (status == MagickFalse) break; } @@ -5518,17 +5538,17 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, PixelInfo target; - status&=GetOneVirtualPixelInfo(image,TileVirtualPixelMethod,x,y, - &target,exception); + status&=(MagickStatusType) GetOneVirtualPixelInfo(image, + TileVirtualPixelMethod,x,y,&target,exception); if (primitive_info->method == FillToBorderMethod) { target.red=(double) draw_info->border_color.red; target.green=(double) draw_info->border_color.green; target.blue=(double) draw_info->border_color.blue; } - status&=FloodfillPaintImage(image,draw_info,&target,x,y, - primitive_info->method == FloodfillMethod ? MagickFalse : - MagickTrue,exception); + status&=(MagickStatusType) FloodfillPaintImage(image,draw_info, + &target,x,y,primitive_info->method == FloodfillMethod ? + MagickFalse : MagickTrue,exception); break; } case ResetMethod: @@ -5552,7 +5572,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, SetPixelViaPixelInfo(image,&pixel,q); q+=GetPixelChannels(image); } - status&=SyncCacheViewAuthenticPixels(image_view,exception); + status&=(MagickStatusType) SyncCacheViewAuthenticPixels(image_view, + exception); if (status == MagickFalse) break; } @@ -5664,14 +5685,15 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, (void) FormatLocaleString(composite_geometry,MagickPathExtent, "%gx%g!",primitive_info[1].point.x,primitive_info[1].point.y); composite_image->filter=image->filter; - status&=TransformImage(&composite_image,(char *) NULL, - composite_geometry,exception); + status&=(MagickStatusType) TransformImage(&composite_image, + (char *) NULL,composite_geometry,exception); } if (composite_image->alpha_trait == UndefinedPixelTrait) - status&=SetImageAlphaChannel(composite_image,OpaqueAlphaChannel, - exception); + status&=(MagickStatusType) SetImageAlphaChannel(composite_image, + OpaqueAlphaChannel,exception); if (draw_info->alpha != OpaqueAlpha) - status&=SetImageAlpha(composite_image,draw_info->alpha,exception); + status&=(MagickStatusType) SetImageAlpha(composite_image, + draw_info->alpha,exception); SetGeometry(image,&geometry); image->gravity=draw_info->gravity; geometry.x=x; @@ -5686,10 +5708,11 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, composite_image->interpolate=image->interpolate; if ((draw_info->compose == OverCompositeOp) || (draw_info->compose == SrcOverCompositeOp)) - status&=DrawAffineImage(image,composite_image,&affine,exception); + status&=(MagickStatusType) DrawAffineImage(image,composite_image, + &affine,exception); else - status&=CompositeImage(image,composite_image,draw_info->compose, - MagickTrue,geometry.x,geometry.y,exception); + status&=(MagickStatusType) CompositeImage(image,composite_image, + draw_info->compose,MagickTrue,geometry.x,geometry.y,exception); composite_image=DestroyImage(composite_image); break; } @@ -5711,7 +5734,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, GetFillColor(draw_info,x,y,&fill_color,exception); CompositePixelOver(image,&fill_color,(double) fill_color.alpha,q,(double) GetPixelAlpha(image,q),q); - status&=SyncCacheViewAuthenticPixels(image_view,exception); + status&=(MagickStatusType) SyncCacheViewAuthenticPixels(image_view, + exception); break; } case TextPrimitive: @@ -5729,7 +5753,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, (void) FormatLocaleString(geometry,MagickPathExtent,"%+f%+f", primitive_info->point.x,primitive_info->point.y); (void) CloneString(&clone_info->geometry,geometry); - status&=AnnotateImage(image,clone_info,exception); + status&=(MagickStatusType) AnnotateImage(image,clone_info,exception); clone_info=DestroyDrawInfo(clone_info); break; } @@ -5748,7 +5772,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, if ((draw_info->dash_pattern != (double *) NULL) && (fabs(draw_info->dash_pattern[0]) >= MagickEpsilon) && (fabs(scale*draw_info->stroke_width) >= MagickEpsilon) && - (draw_info->stroke.alpha != (Quantum) TransparentAlpha)) + (draw_info->stroke.alpha != (double) TransparentAlpha)) { /* Draw dash polygon. @@ -5756,16 +5780,17 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); clone_info->stroke_width=0.0; clone_info->stroke.alpha=(MagickRealType) TransparentAlpha; - status&=DrawPolygonPrimitive(image,clone_info,primitive_info, - exception); + status&=(MagickStatusType) DrawPolygonPrimitive(image,clone_info, + primitive_info,exception); clone_info=DestroyDrawInfo(clone_info); if (status != MagickFalse) - status&=DrawDashPolygon(draw_info,primitive_info,image,exception); + status&=(MagickStatusType) DrawDashPolygon(draw_info,primitive_info, + image,exception); break; } mid=ExpandAffine(&draw_info->affine)*draw_info->stroke_width/2.0; if ((mid > 1.0) && - ((draw_info->stroke.alpha != (Quantum) TransparentAlpha) || + ((draw_info->stroke.alpha != (double) TransparentAlpha) || (draw_info->stroke_pattern != (Image *) NULL))) { double @@ -5789,29 +5814,33 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, (draw_info->linejoin == RoundJoin)) || (primitive_info[i].primitive != UndefinedPrimitive)) { - status&=DrawPolygonPrimitive(image,draw_info,primitive_info, - exception); + status&=(MagickStatusType) DrawPolygonPrimitive(image,draw_info, + primitive_info,exception); break; } clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); clone_info->stroke_width=0.0; clone_info->stroke.alpha=(MagickRealType) TransparentAlpha; - status&=DrawPolygonPrimitive(image,clone_info,primitive_info, - exception); + status&=(MagickStatusType) DrawPolygonPrimitive(image,clone_info, + primitive_info,exception); clone_info=DestroyDrawInfo(clone_info); if (status != MagickFalse) - status&=DrawStrokePolygon(image,draw_info,primitive_info,exception); + status&=(MagickStatusType) DrawStrokePolygon(image,draw_info, + primitive_info,exception); break; } - status&=DrawPolygonPrimitive(image,draw_info,primitive_info,exception); + status&=(MagickStatusType) DrawPolygonPrimitive(image,draw_info, + primitive_info,exception); break; } } image_view=DestroyCacheView(image_view); if (draw_info->compliance == SVGCompliance) { - status&=SetImageMask(image,WritePixelMask,(Image *) NULL,exception); - status&=SetImageMask(image,CompositePixelMask,(Image *) NULL,exception); + status&=(MagickStatusType) SetImageMask(image,WritePixelMask, + (Image *) NULL,exception); + status&=(MagickStatusType) SetImageMask(image,CompositePixelMask, + (Image *) NULL,exception); } if (draw_info->debug != MagickFalse) (void) LogMagickEvent(DrawEvent,GetMagickModule()," end draw-primitive"); @@ -5906,7 +5935,7 @@ static MagickBooleanType DrawStrokePolygon(Image *image, clone_info->stroke_width=0.0; clone_info->fill_rule=NonZeroRule; status=MagickTrue; - for (p=primitive_info; p->primitive != UndefinedPrimitive; p+=p->coordinates) + for (p=primitive_info; p->primitive != UndefinedPrimitive; p+=(ssize_t) p->coordinates) { if (p->coordinates == 1) continue; @@ -5916,7 +5945,8 @@ static MagickBooleanType DrawStrokePolygon(Image *image, status=0; break; } - status&=DrawPolygonPrimitive(image,clone_info,stroke_polygon,exception); + status&=(MagickStatusType) DrawPolygonPrimitive(image,clone_info, + stroke_polygon,exception); stroke_polygon=(PrimitiveInfo *) RelinquishMagickMemory(stroke_polygon); if (status == 0) break; @@ -5924,8 +5954,10 @@ static MagickBooleanType DrawStrokePolygon(Image *image, closed_path=p->closed_subpath; if ((draw_info->linecap == RoundCap) && (closed_path == MagickFalse)) { - status&=DrawRoundLinecap(image,draw_info,p,exception); - status&=DrawRoundLinecap(image,draw_info,q,exception); + status&=(MagickStatusType) DrawRoundLinecap(image,draw_info,p, + exception); + status&=(MagickStatusType) DrawRoundLinecap(image,draw_info,q, + exception); } } clone_info=DestroyDrawInfo(clone_info); @@ -6306,12 +6338,12 @@ static MagickBooleanType TraceArcPath(MVGInfo *mvg_info,const PointInfo start, points[2].y); if (i == (ssize_t) (arc_segments-1)) (p+3)->point=end; - status&=TraceBezier(mvg_info,4); + status&=(MagickStatusType) TraceBezier(mvg_info,4); if (status == 0) break; p=(*mvg_info->primitive_info)+mvg_info->offset; - mvg_info->offset+=p->coordinates; - p+=p->coordinates; + mvg_info->offset+=(ssize_t) p->coordinates; + p+=(ssize_t) p->coordinates; } if (status == 0) return(MagickFalse); @@ -6442,7 +6474,7 @@ static MagickBooleanType TraceBezier(MVGInfo *mvg_info, coefficients=(double *) RelinquishMagickMemory(coefficients); return(MagickFalse); } - p+=p->coordinates; + p+=(ssize_t) p->coordinates; } if (TracePoint(p,end) == MagickFalse) { @@ -6450,7 +6482,7 @@ static MagickBooleanType TraceBezier(MVGInfo *mvg_info, coefficients=(double *) RelinquishMagickMemory(coefficients); return(MagickFalse); } - p+=p->coordinates; + p+=(ssize_t) p->coordinates; primitive_info->coordinates=(size_t) (p-primitive_info); primitive_info->closed_subpath=MagickFalse; for (i=0; i < (ssize_t) primitive_info->coordinates; i++) @@ -6534,13 +6566,13 @@ static MagickBooleanType TraceEllipse(MVGInfo *mvg_info,const PointInfo center, point.y=sin(fmod(angle.x,DegreesToRadians(360.0)))*radii.y+center.y; if (TracePoint(p,point) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ssize_t) p->coordinates; } point.x=cos(fmod(angle.y,DegreesToRadians(360.0)))*radii.x+center.x; point.y=sin(fmod(angle.y,DegreesToRadians(360.0)))*radii.y+center.y; if (TracePoint(p,point) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ssize_t) p->coordinates; primitive_info->coordinates=(size_t) (p-primitive_info); primitive_info->closed_subpath=MagickFalse; x=fabs(primitive_info[0].point.x- @@ -6699,8 +6731,8 @@ static ssize_t TracePath(MVGInfo *mvg_info,const char *path, if (TraceArcPath(mvg_info,point,end,arc,angle,large_arc,sweep) == MagickFalse) return(-1); q=(*mvg_info->primitive_info)+mvg_info->offset; - mvg_info->offset+=q->coordinates; - q+=q->coordinates; + mvg_info->offset+=(ssize_t) q->coordinates; + q+=(ssize_t) q->coordinates; point=end; while (isspace((int) ((unsigned char) *p)) != 0) p++; @@ -6741,8 +6773,8 @@ static ssize_t TracePath(MVGInfo *mvg_info,const char *path, if (TraceBezier(mvg_info,4) == MagickFalse) return(-1); q=(*mvg_info->primitive_info)+mvg_info->offset; - mvg_info->offset+=q->coordinates; - q+=q->coordinates; + mvg_info->offset+=(ssize_t) q->coordinates; + q+=(ssize_t) q->coordinates; point=end; while (isspace((int) ((unsigned char) *p)) != 0) p++; @@ -6768,8 +6800,8 @@ static ssize_t TracePath(MVGInfo *mvg_info,const char *path, q=(*mvg_info->primitive_info)+mvg_info->offset; if (TracePoint(q,point) == MagickFalse) return(-1); - mvg_info->offset+=q->coordinates; - q+=q->coordinates; + mvg_info->offset+=(ssize_t) q->coordinates; + q+=(ssize_t) q->coordinates; while (isspace((int) ((unsigned char) *p)) != 0) p++; if (*p == ',') @@ -6804,8 +6836,8 @@ static ssize_t TracePath(MVGInfo *mvg_info,const char *path, q=(*mvg_info->primitive_info)+mvg_info->offset; if (TracePoint(q,point) == MagickFalse) return(-1); - mvg_info->offset+=q->coordinates; - q+=q->coordinates; + mvg_info->offset+=(ssize_t) q->coordinates; + q+=(ssize_t) q->coordinates; while (isspace((int) ((unsigned char) *p)) != 0) p++; if (*p == ',') @@ -6852,8 +6884,8 @@ static ssize_t TracePath(MVGInfo *mvg_info,const char *path, q=(*mvg_info->primitive_info)+mvg_info->offset; if (TracePoint(q,point) == MagickFalse) return(-1); - mvg_info->offset+=q->coordinates; - q+=q->coordinates; + mvg_info->offset+=(ssize_t) q->coordinates; + q+=(ssize_t) q->coordinates; while (isspace((int) ((unsigned char) *p)) != 0) p++; if (*p == ',') @@ -6895,8 +6927,8 @@ static ssize_t TracePath(MVGInfo *mvg_info,const char *path, if (TraceBezier(mvg_info,3) == MagickFalse) return(-1); q=(*mvg_info->primitive_info)+mvg_info->offset; - mvg_info->offset+=q->coordinates; - q+=q->coordinates; + mvg_info->offset+=(ssize_t) q->coordinates; + q+=(ssize_t) q->coordinates; point=end; while (isspace((int) ((unsigned char) *p)) != 0) p++; @@ -6946,8 +6978,8 @@ static ssize_t TracePath(MVGInfo *mvg_info,const char *path, if (TraceBezier(mvg_info,4) == MagickFalse) return(-1); q=(*mvg_info->primitive_info)+mvg_info->offset; - mvg_info->offset+=q->coordinates; - q+=q->coordinates; + mvg_info->offset+=(ssize_t) q->coordinates; + q+=(ssize_t) q->coordinates; point=end; last_attribute=attribute; while (isspace((int) ((unsigned char) *p)) != 0) @@ -6998,8 +7030,8 @@ static ssize_t TracePath(MVGInfo *mvg_info,const char *path, if (TraceBezier(mvg_info,3) == MagickFalse) return(-1); q=(*mvg_info->primitive_info)+mvg_info->offset; - mvg_info->offset+=q->coordinates; - q+=q->coordinates; + mvg_info->offset+=(ssize_t) q->coordinates; + q+=(ssize_t) q->coordinates; point=end; last_attribute=attribute; while (isspace((int) ((unsigned char) *p)) != 0) @@ -7029,8 +7061,8 @@ static ssize_t TracePath(MVGInfo *mvg_info,const char *path, q=(*mvg_info->primitive_info)+mvg_info->offset; if (TracePoint(q,point) == MagickFalse) return(-1); - mvg_info->offset+=q->coordinates; - q+=q->coordinates; + mvg_info->offset+=(ssize_t) q->coordinates; + q+=(ssize_t) q->coordinates; while (isspace((int) ((unsigned char) *p)) != 0) p++; if (*p == ',') @@ -7050,8 +7082,8 @@ static ssize_t TracePath(MVGInfo *mvg_info,const char *path, q=(*mvg_info->primitive_info)+mvg_info->offset; if (TracePoint(q,point) == MagickFalse) return(-1); - mvg_info->offset+=q->coordinates; - q+=q->coordinates; + mvg_info->offset+=(ssize_t) q->coordinates; + q+=(ssize_t) q->coordinates; primitive_info=(*mvg_info->primitive_info)+subpath_offset; primitive_info->coordinates=(size_t) (q-primitive_info); primitive_info->closed_subpath=MagickTrue; @@ -7099,23 +7131,23 @@ static MagickBooleanType TraceRectangle(PrimitiveInfo *primitive_info, p=primitive_info; if (TracePoint(p,start) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ssize_t) p->coordinates; point.x=start.x; point.y=end.y; if (TracePoint(p,point) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ssize_t) p->coordinates; if (TracePoint(p,end) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ssize_t) p->coordinates; point.x=end.x; point.y=start.y; if (TracePoint(p,point) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ssize_t) p->coordinates; if (TracePoint(p,start) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ssize_t) p->coordinates; primitive_info->coordinates=(size_t) (p-primitive_info); primitive_info->closed_subpath=MagickTrue; for (i=0; i < (ssize_t) primitive_info->coordinates; i++) @@ -7165,7 +7197,7 @@ static MagickBooleanType TraceRoundRectangle(MVGInfo *mvg_info, if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; - mvg_info->offset+=p->coordinates; + mvg_info->offset+=(ssize_t) p->coordinates; point.x=start.x+segment.x-arc.x; point.y=start.y+segment.y-arc.y; degrees.x=0.0; @@ -7173,7 +7205,7 @@ static MagickBooleanType TraceRoundRectangle(MVGInfo *mvg_info, if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; - mvg_info->offset+=p->coordinates; + mvg_info->offset+=(ssize_t) p->coordinates; point.x=start.x+arc.x; point.y=start.y+segment.y-arc.y; degrees.x=90.0; @@ -7181,7 +7213,7 @@ static MagickBooleanType TraceRoundRectangle(MVGInfo *mvg_info, if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; - mvg_info->offset+=p->coordinates; + mvg_info->offset+=(ssize_t) p->coordinates; point.x=start.x+arc.x; point.y=start.y+arc.y; degrees.x=180.0; @@ -7189,13 +7221,13 @@ static MagickBooleanType TraceRoundRectangle(MVGInfo *mvg_info, if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; - mvg_info->offset+=p->coordinates; + mvg_info->offset+=(ssize_t) p->coordinates; if (CheckPrimitiveExtent(mvg_info,PrimitiveExtentPad) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; if (TracePoint(p,(*mvg_info->primitive_info+offset)->point) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ssize_t) p->coordinates; mvg_info->offset=offset; primitive_info=(*mvg_info->primitive_info)+offset; primitive_info->coordinates=(size_t) (p-primitive_info); @@ -7266,7 +7298,7 @@ static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info, if ((pad_p) > MaxBezierCoordinates) \ stroke_p=(PointInfo *) RelinquishMagickMemory(stroke_p); \ else \ - if ((ssize_t) (p+(pad_p)) >= (ssize_t) extent_p) \ + if ((p+(ssize_t) (pad_p)) >= (ssize_t) extent_p) \ { \ if (~extent_p < (pad_p)) \ stroke_p=(PointInfo *) RelinquishMagickMemory(stroke_p); \ @@ -7280,7 +7312,7 @@ static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info, if ((pad_q) > MaxBezierCoordinates) \ stroke_q=(PointInfo *) RelinquishMagickMemory(stroke_q); \ else \ - if ((ssize_t) (q+(pad_q)) >= (ssize_t) extent_q) \ + if ((q+(ssize_t) (pad_q)) >= (ssize_t) extent_q) \ { \ if (~extent_q < (pad_q)) \ stroke_q=(PointInfo *) RelinquishMagickMemory(stroke_q); \ @@ -7723,7 +7755,7 @@ static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info, Trace stroked polygon. */ stroke_polygon=(PrimitiveInfo *) AcquireQuantumMemory((size_t) - (p+q+2UL*closed_path+2UL),sizeof(*stroke_polygon)); + (p+q+2L*closed_path+2L),sizeof(*stroke_polygon)); if (stroke_polygon == (PrimitiveInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), diff --git a/ImageMagick-7.1.1-15/MagickCore/draw.h b/ImageMagick-7.1.1-16/MagickCore/draw.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/draw.h rename to ImageMagick-7.1.1-16/MagickCore/draw.h diff --git a/ImageMagick-7.1.1-15/MagickCore/effect.c b/ImageMagick-7.1.1-16/MagickCore/effect.c similarity index 96% rename from ImageMagick-7.1.1-15/MagickCore/effect.c rename to ImageMagick-7.1.1-16/MagickCore/effect.c index d4ac1c93..b387a728 100644 --- a/ImageMagick-7.1.1-15/MagickCore/effect.c +++ b/ImageMagick-7.1.1-16/MagickCore/effect.c @@ -213,11 +213,11 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,const double radius, v; kernel[w]=(double *) MagickAssumeAligned(AcquireAlignedMemory( - (size_t) (width-w),(width-w)*sizeof(**kernel))); + (width-(size_t) w),(width-(size_t) w)*sizeof(**kernel))); if (kernel[w] == (double *) NULL) break; normalize=0.0; - j=(ssize_t) (width-w-1)/2; + j=((ssize_t) width-w-1)/2; k=0; for (v=(-j); v <= j; v++) { @@ -296,12 +296,12 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,const double radius, j=(ssize_t) width; if ((j & 0x01) != 0) j--; - p=GetCacheViewVirtualPixels(image_view,x-((ssize_t) (width-j)/2L),y- - (ssize_t) ((width-j)/2L),width-j,width-j,exception); + p=GetCacheViewVirtualPixels(image_view,x-((ssize_t) width-j)/2L,y- + ((ssize_t) width-j)/2L,width-(size_t) j,width-(size_t) j,exception); if (p == (const Quantum *) NULL) break; - center=(ssize_t) GetPixelChannels(image)*(width-j)*((width-j)/2L)+ - GetPixelChannels(image)*((width-j)/2); + center=(ssize_t) (GetPixelChannels(image)*(width-(size_t) j)* + ((width-(size_t) j)/2L)+GetPixelChannels(image)*((width-(size_t) j)/2)); for (i=0; i < (ssize_t) GetPixelChannels(blur_image); i++) { double @@ -348,11 +348,11 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,const double radius, /* No alpha blending. */ - for (v=0; v < (ssize_t) (width-j); v++) + for (v=0; v < ((ssize_t) width-j); v++) { - for (u=0; u < (ssize_t) (width-j); u++) + for (u=0; u < ((ssize_t) width-j); u++) { - pixel+=(*k)*pixels[i]; + pixel+=(*k)*(double) pixels[i]; gamma+=(*k); k++; pixels+=GetPixelChannels(image); @@ -365,12 +365,12 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,const double radius, /* Alpha blending. */ - for (v=0; v < (ssize_t) (width-j); v++) + for (v=0; v < ((ssize_t) width-j); v++) { - for (u=0; u < (ssize_t) (width-j); u++) + for (u=0; u < ((ssize_t) width-j); u++) { - alpha=(double) (QuantumScale*GetPixelAlpha(image,pixels)); - pixel+=(*k)*alpha*pixels[i]; + alpha=(double) (QuantumScale*(double) GetPixelAlpha(image,pixels)); + pixel+=(*k)*alpha*(double) pixels[i]; gamma+=(*k)*alpha; k++; pixels+=GetPixelChannels(image); @@ -534,11 +534,11 @@ MagickExport Image *AdaptiveSharpenImage(const Image *image,const double radius, v; kernel[w]=(double *) MagickAssumeAligned(AcquireAlignedMemory((size_t) - (width-w),(width-w)*sizeof(**kernel))); + (width-(size_t) w),(width-(size_t) w)*sizeof(**kernel))); if (kernel[w] == (double *) NULL) break; normalize=0.0; - j=(ssize_t) (width-w-1)/2; + j=((ssize_t) width-w-1)/2; k=0; for (v=(-j); v <= j; v++) { @@ -617,12 +617,12 @@ MagickExport Image *AdaptiveSharpenImage(const Image *image,const double radius, j=(ssize_t) width; if ((j & 0x01) != 0) j--; - p=GetCacheViewVirtualPixels(image_view,x-((ssize_t) (width-j)/2L),y- - (ssize_t) ((width-j)/2L),width-j,width-j,exception); + p=GetCacheViewVirtualPixels(image_view,x-(((ssize_t) width-j)/2L),y- + (((ssize_t) width-j)/2L),width-(size_t) j,width-(size_t) j,exception); if (p == (const Quantum *) NULL) break; - center=(ssize_t) GetPixelChannels(image)*(width-j)*((width-j)/2L)+ - GetPixelChannels(image)*((width-j)/2); + center=(ssize_t) (GetPixelChannels(image)*(width-(size_t) j)* + ((width-(size_t) j)/2L)+GetPixelChannels(image)*((width-(size_t) j)/2)); for (i=0; i < (ssize_t) GetPixelChannels(sharp_image); i++) { double @@ -669,11 +669,11 @@ MagickExport Image *AdaptiveSharpenImage(const Image *image,const double radius, /* No alpha blending. */ - for (v=0; v < (ssize_t) (width-j); v++) + for (v=0; v < ((ssize_t) width-j); v++) { - for (u=0; u < (ssize_t) (width-j); u++) + for (u=0; u < ((ssize_t) width-j); u++) { - pixel+=(*k)*pixels[i]; + pixel+=(*k)*(double) pixels[i]; gamma+=(*k); k++; pixels+=GetPixelChannels(image); @@ -686,12 +686,12 @@ MagickExport Image *AdaptiveSharpenImage(const Image *image,const double radius, /* Alpha blending. */ - for (v=0; v < (ssize_t) (width-j); v++) + for (v=0; v < ((ssize_t) width-j); v++) { - for (u=0; u < (ssize_t) (width-j); u++) + for (u=0; u < ((ssize_t) width-j); u++) { - alpha=(double) (QuantumScale*GetPixelAlpha(image,pixels)); - pixel+=(*k)*alpha*pixels[i]; + alpha=(double) (QuantumScale*(double) GetPixelAlpha(image,pixels)); + pixel+=(*k)*alpha*(double) pixels[i]; gamma+=(*k)*alpha; k++; pixels+=GetPixelChannels(image); @@ -859,7 +859,7 @@ static inline double BlurGaussian(const double x,const double sigma) PerceptibleReciprocal(Magick2PI*sigma*sigma)); } -static double **DestroyBilateralTLS(const ssize_t number_threads, +static double **DestroyBilateralTLS(const size_t number_threads, double **weights) { ssize_t @@ -923,8 +923,10 @@ MagickExport Image *BilateralBlurImage(const Image *image,const size_t width, OffsetInfo mid; + size_t + number_threads; + ssize_t - number_threads, w, y; @@ -1004,20 +1006,18 @@ MagickExport Image *BilateralBlurImage(const Image *image,const size_t width, } for (x=0; x < (ssize_t) blur_image->columns; x++) { - double - gamma, - pixel; - const Quantum *magick_restrict p, *magick_restrict r; - ssize_t - i, - u; + double + gamma, + pixel; ssize_t + i, n, + u, v; /* @@ -1027,8 +1027,8 @@ MagickExport Image *BilateralBlurImage(const Image *image,const size_t width, MagickMax(height,1),exception); if (p == (const Quantum *) NULL) break; - p+=(ssize_t) GetPixelChannels(image)*MagickMax(width,1)*mid.y+ - GetPixelChannels(image)*mid.x; + p+=(ssize_t) (GetPixelChannels(image)*MagickMax(width,1)*(size_t) mid.y+ + GetPixelChannels(image)*(size_t) mid.x); n=0; for (v=0; v < (ssize_t) MagickMax(height,1); v++) { @@ -1037,8 +1037,8 @@ MagickExport Image *BilateralBlurImage(const Image *image,const size_t width, double intensity; - r=p+(ssize_t) GetPixelChannels(image)*(ssize_t) MagickMax(width,1)* - (mid.y-v)+GetPixelChannels(image)*(mid.x-u); + r=p+(ssize_t) (GetPixelChannels(image)*MagickMax(width,1)* + (size_t) (mid.y-v)+GetPixelChannels(image)*(size_t) (mid.x-u)); intensity=ScaleQuantumToChar(GetPixelIntensity(image,r))- (double) ScaleQuantumToChar(GetPixelIntensity(image,p)); if ((intensity >= -MaxIntensity) && (intensity <= MaxIntensity)) @@ -1082,9 +1082,9 @@ MagickExport Image *BilateralBlurImage(const Image *image,const size_t width, { for (u=0; u < (ssize_t) MagickMax(width,1); u++) { - r=p+(ssize_t) GetPixelChannels(image)*MagickMax(width,1)* - (mid.y-v)+GetPixelChannels(image)*(mid.x-u); - pixel+=weights[id][n]*r[i]; + r=p+GetPixelChannels(image)*MagickMax(width,1)*(size_t) + (mid.y-v)+GetPixelChannels(image)*(size_t) (mid.x-u); + pixel+=weights[id][n]*(double) r[i]; gamma+=weights[id][n]; n++; } @@ -1104,11 +1104,11 @@ MagickExport Image *BilateralBlurImage(const Image *image,const size_t width, alpha, beta; - r=p+(ssize_t) GetPixelChannels(image)*MagickMax(width,1)*(mid.y-v)+ - GetPixelChannels(image)*(mid.x-u); - alpha=(double) (QuantumScale*GetPixelAlpha(image,p)); - beta=(double) (QuantumScale*GetPixelAlpha(image,r)); - pixel+=weights[id][n]*r[i]; + r=p+GetPixelChannels(image)*MagickMax(width,1)*(size_t) (mid.y-v)+ + GetPixelChannels(image)*(size_t) (mid.x-u); + alpha=(double) (QuantumScale*(double) GetPixelAlpha(image,p)); + beta=(double) (QuantumScale*(double) GetPixelAlpha(image,r)); + pixel+=weights[id][n]*(double) r[i]; gamma+=weights[id][n]*alpha*beta; n++; } @@ -1177,12 +1177,6 @@ MagickExport Image *ConvolveImage(const Image *image, Image *convolve_image; -#if defined(MAGICKCORE_OPENCL_SUPPORT) - convolve_image=AccelerateConvolveImage(image,kernel_info,exception); - if (convolve_image != (Image *) NULL) - return(convolve_image); -#endif - convolve_image=MorphologyImage(image,ConvolveMorphology,1,kernel_info, exception); return(convolve_image); @@ -1253,13 +1247,13 @@ static void Hull(const Image *image,const ssize_t x_offset, i, x; - i=(2*y+1)+y*columns; + i=(2*y+1)+y*(ssize_t) columns; if (polarity > 0) for (x=0; x < (ssize_t) columns; x++) { v=(MagickRealType) p[i]; - if ((MagickRealType) r[i] >= (v+ScaleCharToQuantum(2))) - v+=ScaleCharToQuantum(1); + if ((MagickRealType) r[i] >= (v+(double) ScaleCharToQuantum(2))) + v+=(double) ScaleCharToQuantum(1); q[i]=(Quantum) v; i++; } @@ -1267,8 +1261,8 @@ static void Hull(const Image *image,const ssize_t x_offset, for (x=0; x < (ssize_t) columns; x++) { v=(MagickRealType) p[i]; - if ((MagickRealType) r[i] <= (v-ScaleCharToQuantum(2))) - v-=ScaleCharToQuantum(1); + if ((MagickRealType) r[i] <= (v-(double) ScaleCharToQuantum(2))) + v-=(double) ScaleCharToQuantum(1); q[i]=(Quantum) v; i++; } @@ -1290,14 +1284,14 @@ static void Hull(const Image *image,const ssize_t x_offset, MagickRealType v; - i=(2*y+1)+y*columns; + i=(2*y+1)+y*(ssize_t) columns; if (polarity > 0) for (x=0; x < (ssize_t) columns; x++) { v=(MagickRealType) q[i]; - if (((MagickRealType) s[i] >= (v+ScaleCharToQuantum(2))) && + if (((MagickRealType) s[i] >= (v+(double) ScaleCharToQuantum(2))) && ((MagickRealType) r[i] > v)) - v+=ScaleCharToQuantum(1); + v+=(double) ScaleCharToQuantum(1); p[i]=(Quantum) v; i++; } @@ -1305,9 +1299,9 @@ static void Hull(const Image *image,const ssize_t x_offset, for (x=0; x < (ssize_t) columns; x++) { v=(MagickRealType) q[i]; - if (((MagickRealType) s[i] <= (v-ScaleCharToQuantum(2))) && + if (((MagickRealType) s[i] <= (v-(double) ScaleCharToQuantum(2))) && ((MagickRealType) r[i] < v)) - v-=ScaleCharToQuantum(1); + v-=(double) ScaleCharToQuantum(1); p[i]=(Quantum) v; i++; } @@ -1776,9 +1770,9 @@ MagickExport Image *GaussianBlurImage(const Image *image,const double radius, static inline MagickRealType GetMeanLuma(const Image *magick_restrict image, const double *magick_restrict pixel) { - return(0.212656f*pixel[image->channel_map[RedPixelChannel].offset]+ - 0.715158f*pixel[image->channel_map[GreenPixelChannel].offset]+ - 0.072186f*pixel[image->channel_map[BluePixelChannel].offset]); /* Rec709 */ + return(0.212656*pixel[image->channel_map[RedPixelChannel].offset]+ + 0.715158*pixel[image->channel_map[GreenPixelChannel].offset]+ + 0.072186*pixel[image->channel_map[BluePixelChannel].offset]); /* Rec709 */ } MagickExport Image *KuwaharaImage(const Image *image,const double radius, @@ -2028,10 +2022,12 @@ MagickExport Image *LocalContrastImage(const Image *image,const double radius, *image_view, *contrast_view; + double + totalWeight; + float *interImage, - *scanline, - totalWeight; + *scanline; Image *contrast_image; @@ -2072,10 +2068,10 @@ MagickExport Image *LocalContrastImage(const Image *image,const double radius, image_view=AcquireVirtualCacheView(image,exception); contrast_view=AcquireAuthenticCacheView(contrast_image,exception); scanLineSize=(ssize_t) MagickMax(image->columns,image->rows); - width=(ssize_t) scanLineSize*0.002f*fabs(radius); + width=(ssize_t) scanLineSize*0.002*fabs(radius); scanLineSize+=(2*width); - scanline_info=AcquireVirtualMemory((size_t) GetOpenMPMaximumThreads()* - scanLineSize,sizeof(*scanline)); + scanline_info=AcquireVirtualMemory(GetOpenMPMaximumThreads()* + (size_t) scanLineSize,sizeof(*scanline)); if (scanline_info == (MemoryInfo *) NULL) { contrast_view=DestroyCacheView(contrast_view); @@ -2087,8 +2083,8 @@ MagickExport Image *LocalContrastImage(const Image *image,const double radius, /* Create intermediate buffer. */ - interImage_info=AcquireVirtualMemory(image->rows*(image->columns+(2*width)), - sizeof(*interImage)); + interImage_info=AcquireVirtualMemory(image->rows*(image->columns+(size_t) + (2*width)),sizeof(*interImage)); if (interImage_info == (MemoryInfo *) NULL) { scanline_info=RelinquishVirtualMemory(scanline_info); @@ -2135,8 +2131,8 @@ MagickExport Image *LocalContrastImage(const Image *image,const double radius, pixels=scanline; pixels+=id*scanLineSize; pix=pixels; - p=GetCacheViewVirtualPixels(image_view,x,-width,1,image->rows+(2*width), - exception); + p=GetCacheViewVirtualPixels(image_view,x,-(ssize_t) width,1, + image->rows+(size_t) (2*width),exception); if (p == (const Quantum *) NULL) { status=MagickFalse; @@ -2150,32 +2146,32 @@ MagickExport Image *LocalContrastImage(const Image *image,const double radius, out=interImage+x+width; for (y=0; y < (ssize_t) image->rows; y++) { - float + double sum, weight; - weight=1.0f; + weight=1.0; sum=0; pix=pixels+y; for (i=0; i < width; i++) { - sum+=weight*(*pix++); - weight+=1.0f; + sum+=weight*((double) *pix++); + weight+=1.0; } for (i=width+1; i < (2*width); i++) { - sum+=weight*(*pix++); - weight-=1.0f; + sum+=weight*((double) *pix++); + weight-=1.0; } /* write to output */ *out=sum/totalWeight; /* mirror into padding */ - if (x <= width && x != 0) + if ((x <= width) && (x != 0)) *(out-(x*2))=*out; if ((x > (ssize_t) image->columns-width-2) && (x != (ssize_t) image->columns-1)) - *(out+((image->columns-x-1)*2))=*out; - out+=image->columns+(width*2); + *(out+((image->columns-(size_t) x-1)*2))=*out; + out+=image->columns+(size_t) (width*2); } } } @@ -2206,11 +2202,9 @@ MagickExport Image *LocalContrastImage(const Image *image,const double radius, *magick_restrict q; ssize_t + i, x; - ssize_t - i; - if (status == MagickFalse) continue; pixels=scanline; @@ -2223,11 +2217,11 @@ MagickExport Image *LocalContrastImage(const Image *image,const double radius, status=MagickFalse; continue; } - memcpy(pixels,interImage+(y*(image->columns+(2*width))),(image->columns+ - (2*width))*sizeof(float)); + memcpy(pixels,interImage+((size_t) y*(image->columns+(size_t) (2*width))), + (image->columns+(size_t) (2*width))*sizeof(float)); for (x=0; x < (ssize_t) image->columns; x++) { - float + double mult, srcVal, sum, @@ -2236,22 +2230,24 @@ MagickExport Image *LocalContrastImage(const Image *image,const double radius, PixelTrait traits; - weight=1.0f; + weight=1.0; sum=0; pix=pixels+x; for (i=0; i < width; i++) { - sum+=weight*(*pix++); - weight+=1.0f; + sum+=weight*((double) *pix++); + weight+=1.0; } for (i=width+1; i < (2*width); i++) { - sum+=weight*(*pix++); - weight-=1.0f; + sum+=weight*((double) *pix++); + weight-=1.0; } - /* Apply and write */ + /* + Apply and write. + */ srcVal=(float) GetPixelLuma(image,p); - mult=(srcVal-(sum/totalWeight))*(strength/100.0f); + mult=(srcVal-(sum/totalWeight))*(strength/100.0); mult=(srcVal+mult)/srcVal; traits=GetPixelChannelTraits(image,RedPixelChannel); if ((traits & UpdatePixelTrait) != 0) @@ -2519,7 +2515,7 @@ MagickExport Image *MotionBlurImage(const Image *image,const double radius, status=MagickFalse; continue; } - pixel+=(*k)*r[i]; + pixel+=(*k)*(double) r[i]; k++; } SetPixelChannel(blur_image,channel,ClampToQuantum(pixel),q); @@ -2534,8 +2530,8 @@ MagickExport Image *MotionBlurImage(const Image *image,const double radius, status=MagickFalse; continue; } - alpha=(double) (QuantumScale*GetPixelAlpha(image,r)); - pixel+=(*k)*alpha*r[i]; + alpha=QuantumScale*(double) GetPixelAlpha(image,r); + pixel+=(*k)*alpha*(double) r[i]; gamma+=(*k)*alpha; k++; } @@ -2703,8 +2699,8 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview, } case RollPreview: { - x=(ssize_t) ((i+1)*thumbnail->columns)/NumberTiles; - y=(ssize_t) ((i+1)*thumbnail->rows)/NumberTiles; + x=((i+1)*(ssize_t) thumbnail->columns)/NumberTiles; + y=((i+1)*(ssize_t) thumbnail->rows)/NumberTiles; preview_image=RollImage(thumbnail,x,y,exception); (void) FormatLocaleString(label,MagickPathExtent,"roll %+.20gx%+.20g", (double) x,(double) y); @@ -2748,7 +2744,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview, preview_image=CloneImage(thumbnail,0,0,MagickTrue,exception); if (preview_image == (Image *) NULL) break; - gamma+=0.4f; + gamma+=0.4; (void) GammaImage(preview_image,gamma,exception); (void) FormatLocaleString(label,MagickPathExtent,"gamma %g",gamma); break; @@ -2915,7 +2911,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview, (void) SolarizeImage(preview_image,(double) QuantumRange*percentage/ 100.0,exception); (void) FormatLocaleString(label,MagickPathExtent,"solarize %g", - (QuantumRange*percentage)/100.0); + ((double) QuantumRange*percentage)/100.0); break; } case ShadePreview: @@ -2950,7 +2946,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview, preview_image=CloneImage(thumbnail,0,0,MagickTrue,exception); if (preview_image == (Image *) NULL) break; - threshold+=0.4f; + threshold+=0.4; (void) SegmentImage(preview_image,sRGBColorspace,MagickFalse,threshold, threshold,exception); (void) FormatLocaleString(label,MagickPathExtent,"segment %gx%g", @@ -2967,7 +2963,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview, } case ImplodePreview: { - degrees+=0.1f; + degrees+=0.1; preview_image=ImplodeImage(thumbnail,degrees,image->interpolate, exception); (void) FormatLocaleString(label,MagickPathExtent,"implode %g",degrees); @@ -2975,7 +2971,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview, } case WavePreview: { - degrees+=5.0f; + degrees+=5.0; preview_image=WaveImage(thumbnail,0.5*degrees,2.0*degrees, image->interpolate,exception); (void) FormatLocaleString(label,MagickPathExtent,"wave %gx%g",0.5* @@ -3318,7 +3314,7 @@ MagickExport Image *RotationalBlurImage(const Image *image,const double angle, status=MagickFalse; continue; } - pixel+=r[i]; + pixel+=(double) r[i]; gamma++; } gamma=PerceptibleReciprocal(gamma); @@ -3339,8 +3335,8 @@ MagickExport Image *RotationalBlurImage(const Image *image,const double angle, status=MagickFalse; continue; } - alpha=(double) QuantumScale*GetPixelAlpha(image,r); - pixel+=alpha*r[i]; + alpha=QuantumScale*(double) GetPixelAlpha(image,r); + pixel+=alpha*(double) r[i]; gamma+=alpha; } gamma=PerceptibleReciprocal(gamma); @@ -3637,7 +3633,7 @@ MagickExport Image *SelectiveBlurImage(const Image *image,const double radius, intensity; if (fabs(contrast) < threshold) { - pixel+=(*k)*pixels[i]; + pixel+=(*k)*(double) pixels[i]; gamma+=(*k); } k++; @@ -3664,8 +3660,8 @@ MagickExport Image *SelectiveBlurImage(const Image *image,const double radius, contrast=GetPixelIntensity(image,pixels)-intensity; if (fabs(contrast) < threshold) { - alpha=(double) (QuantumScale*GetPixelAlpha(image,pixels)); - pixel+=(*k)*alpha*pixels[i]; + alpha=QuantumScale*(double) GetPixelAlpha(image,pixels); + pixel+=(*k)*alpha*(double) pixels[i]; gamma+=(*k)*alpha; } k++; @@ -3927,8 +3923,8 @@ MagickExport Image *ShadeImage(const Image *image,const MagickBooleanType gray, SetPixelChannel(shade_image,channel,ClampToQuantum(shade),q); continue; } - SetPixelChannel(shade_image,channel,ClampToQuantum(QuantumScale*shade* - center[i]),q); + SetPixelChannel(shade_image,channel,ClampToQuantum(QuantumScale* + shade*(double) center[i]),q); } p+=GetPixelChannels(linear_image); q+=GetPixelChannels(shade_image); @@ -4363,7 +4359,7 @@ MagickExport Image *UnsharpMaskImage(const Image *image,const double radius, SetPixelChannel(unsharp_image,channel,p[i],q); continue; } - pixel=p[i]-(double) GetPixelChannel(unsharp_image,channel,q); + pixel=(double) p[i]-(double) GetPixelChannel(unsharp_image,channel,q); if (fabs(2.0*pixel) < quantum_threshold) pixel=(double) p[i]; else diff --git a/ImageMagick-7.1.1-15/MagickCore/effect.h b/ImageMagick-7.1.1-16/MagickCore/effect.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/effect.h rename to ImageMagick-7.1.1-16/MagickCore/effect.h diff --git a/ImageMagick-7.1.1-15/MagickCore/enhance.c b/ImageMagick-7.1.1-16/MagickCore/enhance.c similarity index 95% rename from ImageMagick-7.1.1-15/MagickCore/enhance.c rename to ImageMagick-7.1.1-16/MagickCore/enhance.c index 15259a03..1d43dae7 100644 --- a/ImageMagick-7.1.1-15/MagickCore/enhance.c +++ b/ImageMagick-7.1.1-16/MagickCore/enhance.c @@ -150,7 +150,8 @@ MagickExport MagickBooleanType AutoGammaImage(Image *image, channel_mask=SetImageChannelMask(image,(ChannelType) (1UL << i)); status=GetImageMean(image,&mean,&sans,exception); gamma=log(mean*QuantumScale)/log_mean; - status&=LevelImage(image,0.0,(double) QuantumRange,gamma,exception); + status&=(MagickStatusType) LevelImage(image,0.0,(double) QuantumRange,gamma, + exception); (void) SetImageChannelMask(image,channel_mask); if (status == MagickFalse) break; @@ -304,16 +305,12 @@ static void ClipCLAHEHistogram(const double clip_limit,const size_t number_bins, #define NumberCLAHEGrays (65536) ssize_t - i; - - size_t cumulative_excess, + excess, + i, previous_excess, step; - ssize_t - excess; - /* Compute total number of excess pixels. */ @@ -329,7 +326,7 @@ static void ClipCLAHEHistogram(const double clip_limit,const size_t number_bins, /* Clip histogram and redistribute excess pixels across all bins. */ - step=cumulative_excess/number_bins; + step=cumulative_excess/(ssize_t) number_bins; excess=(ssize_t) (clip_limit-step); for (i=0; i < (ssize_t) number_bins; i++) { @@ -338,13 +335,13 @@ static void ClipCLAHEHistogram(const double clip_limit,const size_t number_bins, else if ((ssize_t) histogram[i] > excess) { - cumulative_excess-=histogram[i]-excess; + cumulative_excess-=(ssize_t) histogram[i]-excess; histogram[i]=(size_t) clip_limit; } else { cumulative_excess-=step; - histogram[i]+=step; + histogram[i]+=(size_t) step; } } /* @@ -363,7 +360,7 @@ static void ClipCLAHEHistogram(const double clip_limit,const size_t number_bins, q=histogram+number_bins; while ((cumulative_excess != 0) && (p < q)) { - step=number_bins/cumulative_excess; + step=(ssize_t) number_bins/cumulative_excess; if (step < 1) step=1; for (p=histogram; (p < q) && (cumulative_excess != 0); p+=step) @@ -428,9 +425,9 @@ static void InterpolateCLAHE(const RectangleInfo *clahe_info,const size_t *Q12, { intensity=lut[*pixels]; *pixels++=(unsigned short) (PerceptibleReciprocal((double) tile->width* - tile->height)*(y*((double) x*Q12[intensity]+(tile->width-x)* - Q22[intensity])+(tile->height-y)*((double) x*Q11[intensity]+ - (tile->width-x)*Q21[intensity]))); + tile->height)*(y*((double) x*Q12[intensity]+((double) tile->width-x)* + Q22[intensity])+((double) tile->height-y)*((double) x*Q11[intensity]+ + ((double) tile->width-x)*Q21[intensity]))); } pixels+=(clahe_info->width-tile->width); } @@ -503,7 +500,7 @@ static MagickBooleanType CLAHE(const RectangleInfo *clahe_info, if (clip_limit == 1.0) return(MagickTrue); tile_cache=AcquireVirtualMemory((size_t) clahe_info->x*number_bins, - clahe_info->y*sizeof(*tiles)); + (size_t) clahe_info->y*sizeof(*tiles)); if (tile_cache == (MemoryInfo *) NULL) return(MagickFalse); lut=(unsigned short *) AcquireQuantumMemory(NumberCLAHEGrays,sizeof(*lut)); @@ -531,7 +528,7 @@ static MagickBooleanType CLAHE(const RectangleInfo *clahe_info, size_t *histogram; - histogram=tiles+(number_bins*(y*clahe_info->x+x)); + histogram=tiles+((ssize_t) number_bins*(y*clahe_info->x+x)); GenerateCLAHEHistogram(clahe_info,tile_info,number_bins,lut,p,histogram); ClipCLAHEHistogram((double) limit,number_bins,histogram); MapCLAHEHistogram(range_info,number_bins,tile_info->width* @@ -602,10 +599,10 @@ static MagickBooleanType CLAHE(const RectangleInfo *clahe_info, offset.x=tile.x; } InterpolateCLAHE(clahe_info, - tiles+(number_bins*(tile.y*clahe_info->x+tile.x)), /* Q12 */ - tiles+(number_bins*(tile.y*clahe_info->x+offset.x)), /* Q22 */ - tiles+(number_bins*(offset.y*clahe_info->x+tile.x)), /* Q11 */ - tiles+(number_bins*(offset.y*clahe_info->x+offset.x)), /* Q21 */ + tiles+((ssize_t) number_bins*(tile.y*clahe_info->x+tile.x)), /* Q12 */ + tiles+((ssize_t) number_bins*(tile.y*clahe_info->x+offset.x)), /* Q22 */ + tiles+((ssize_t) number_bins*(offset.y*clahe_info->x+tile.x)), /* Q11 */ + tiles+((ssize_t) number_bins*(offset.y*clahe_info->x+offset.x)), /* Q21 */ &tile,lut,p); p+=tile.width; } @@ -670,14 +667,14 @@ MagickExport MagickBooleanType CLAHEImage(Image *image,const size_t width, tile_info.height=image->rows >> 3; tile_info.x=0; if ((image->columns % tile_info.width) != 0) - tile_info.x=(ssize_t) tile_info.width-(image->columns % tile_info.width); + tile_info.x=(ssize_t) (tile_info.width-(image->columns % tile_info.width)); tile_info.y=0; if ((image->rows % tile_info.height) != 0) - tile_info.y=(ssize_t) tile_info.height-(image->rows % tile_info.height); - clahe_info.width=image->columns+tile_info.x; - clahe_info.height=image->rows+tile_info.y; - clahe_info.x=(ssize_t) clahe_info.width/tile_info.width; - clahe_info.y=(ssize_t) clahe_info.height/tile_info.height; + tile_info.y=(ssize_t) (tile_info.height-(image->rows % tile_info.height)); + clahe_info.width=(size_t) ((ssize_t) image->columns+tile_info.x); + clahe_info.height=(size_t) ((ssize_t) image->rows+tile_info.y); + clahe_info.x=(ssize_t) (clahe_info.width/tile_info.width); + clahe_info.y=(ssize_t) (clahe_info.height/tile_info.height); pixel_cache=AcquireVirtualMemory(clahe_info.width,clahe_info.height* sizeof(*pixels)); if (pixel_cache == (MemoryInfo *) NULL) @@ -741,7 +738,7 @@ MagickExport MagickBooleanType CLAHEImage(Image *image,const size_t width, Push CLAHE pixels to CLAHE image. */ image_view=AcquireAuthenticCacheView(image,exception); - n=clahe_info.width*(tile_info.y >> 1); + n=clahe_info.width*(size_t) (tile_info.y/2); for (y=0; y < (ssize_t) image->rows; y++) { Quantum @@ -758,13 +755,14 @@ MagickExport MagickBooleanType CLAHEImage(Image *image,const size_t width, status=MagickFalse; continue; } - n+=tile_info.x >> 1; + n+=(size_t) (tile_info.x/2); for (x=0; x < (ssize_t) image->columns; x++) { q[0]=ScaleShortToQuantum(pixels[n++]); q+=GetPixelChannels(image); } - n+=(clahe_info.width-image->columns-(tile_info.x >> 1)); + n+=(size_t) ((ssize_t) clahe_info.width-(ssize_t) image->columns- + (tile_info.x/2)); if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) status=MagickFalse; if (image->progress_monitor != (MagickProgressMonitor) NULL) @@ -880,8 +878,8 @@ MagickExport MagickBooleanType ClutImage(Image *image,const Image *clut_image, { GetPixelInfo(clut_image,clut_map+i); status=InterpolatePixelInfo(clut_image,clut_view,method,(double) i* - (clut_image->columns-adjust)/MaxMap,(double) i*(clut_image->rows-adjust)/ - MaxMap,clut_map+i,exception); + ((double) clut_image->columns-adjust)/MaxMap,(double) i* + ((double) clut_image->rows-adjust)/MaxMap,clut_map+i,exception); if (status == MagickFalse) break; } @@ -1267,8 +1265,8 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image, double luma; - luma=0.21267f*image->colormap[i].red+0.71526*image->colormap[i].green+ - 0.07217f*image->colormap[i].blue; + luma=0.21267*image->colormap[i].red+0.71526*image->colormap[i].green+ + 0.07217*image->colormap[i].blue; image->colormap[i].red=luma+color_correction.saturation*cdl_map[ ScaleQuantumToMap(ClampToQuantum(image->colormap[i].red))].red-luma; image->colormap[i].green=luma+color_correction.saturation*cdl_map[ @@ -1307,8 +1305,8 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image, } for (x=0; x < (ssize_t) image->columns; x++) { - luma=0.21267f*GetPixelRed(image,q)+0.71526*GetPixelGreen(image,q)+ - 0.07217f*GetPixelBlue(image,q); + luma=0.21267*(double) GetPixelRed(image,q)+0.71526*(double) + GetPixelGreen(image,q)+0.07217*(double) GetPixelBlue(image,q); SetPixelRed(image,ClampToQuantum(luma+color_correction.saturation* (cdl_map[ScaleQuantumToMap(GetPixelRed(image,q))].red-luma)),q); SetPixelGreen(image,ClampToQuantum(luma+color_correction.saturation* @@ -1642,7 +1640,7 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image, if (image->channel_mask != AllChannels) pixel=(double) p[i]; histogram[GetPixelChannels(image)*ScaleQuantumToMap( - ClampToQuantum(pixel))+i]++; + ClampToQuantum(pixel))+(size_t) i]++; } p+=GetPixelChannels(image); } @@ -1664,7 +1662,7 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image, intensity=0.0; for (j=0; j <= (ssize_t) MaxMap; j++) { - intensity+=histogram[GetPixelChannels(image)*j+i]; + intensity+=histogram[(ssize_t) GetPixelChannels(image)*j+i]; if (intensity > black_point) break; } @@ -1672,7 +1670,7 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image, intensity=0.0; for (j=(ssize_t) MaxMap; j != 0; j--) { - intensity+=histogram[GetPixelChannels(image)*j+i]; + intensity+=histogram[(ssize_t) GetPixelChannels(image)*j+i]; if (intensity > ((double) image->columns*image->rows-white_point)) break; } @@ -1696,14 +1694,14 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image, gamma=PerceptibleReciprocal(white[i]-black[i]); if (j < (ssize_t) black[i]) - stretch_map[GetPixelChannels(image)*j+i]=0.0; + stretch_map[(ssize_t) GetPixelChannels(image)*j+i]=0.0; else if (j > (ssize_t) white[i]) - stretch_map[GetPixelChannels(image)*j+i]=QuantumRange; + stretch_map[(ssize_t) GetPixelChannels(image)*j+i]=QuantumRange; else if (black[i] != white[i]) - stretch_map[GetPixelChannels(image)*j+i]=ScaleMapToQuantum((double) - (MaxMap*gamma*(j-black[i]))); + stretch_map[(ssize_t) GetPixelChannels(image)*j+i]= + ScaleMapToQuantum((double) (MaxMap*gamma*(j-(double) black[i]))); } } if (image->storage_class == PseudoClass) @@ -1721,28 +1719,28 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image, i=GetPixelChannelOffset(image,RedPixelChannel); image->colormap[j].red=(MagickRealType) stretch_map[ GetPixelChannels(image)*ScaleQuantumToMap(ClampToQuantum( - image->colormap[j].red))+i]; + image->colormap[j].red))+(size_t) i]; } if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0) { i=GetPixelChannelOffset(image,GreenPixelChannel); image->colormap[j].green=(MagickRealType) stretch_map[ GetPixelChannels(image)*ScaleQuantumToMap(ClampToQuantum( - image->colormap[j].green))+i]; + image->colormap[j].green))+(size_t) i]; } if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0) { i=GetPixelChannelOffset(image,BluePixelChannel); image->colormap[j].blue=(MagickRealType) stretch_map[ GetPixelChannels(image)*ScaleQuantumToMap(ClampToQuantum( - image->colormap[j].blue))+i]; + image->colormap[j].blue))+(size_t) i]; } if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) { i=GetPixelChannelOffset(image,AlphaPixelChannel); image->colormap[j].alpha=(MagickRealType) stretch_map[ GetPixelChannels(image)*ScaleQuantumToMap(ClampToQuantum( - image->colormap[j].alpha))+i]; + image->colormap[j].alpha))+(size_t) i]; } } } @@ -1786,7 +1784,7 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image, if (black[j] == white[j]) continue; q[j]=ClampToQuantum(stretch_map[GetPixelChannels(image)* - ScaleQuantumToMap(q[j])+j]); + ScaleQuantumToMap(q[j])+(size_t) j]); } q+=GetPixelChannels(image); } @@ -1865,11 +1863,11 @@ MagickExport Image *EnhanceImage(const Image *image,ExceptionInfo *exception) distance_squared+=(5.0-mean)*distance*distance; \ if (distance_squared < 0.069) \ { \ - aggregate.red+=(weight)*GetPixelRed(image,r); \ - aggregate.green+=(weight)*GetPixelGreen(image,r); \ - aggregate.blue+=(weight)*GetPixelBlue(image,r); \ - aggregate.black+=(weight)*GetPixelBlack(image,r); \ - aggregate.alpha+=(weight)*GetPixelAlpha(image,r); \ + aggregate.red+=(weight)*(double) GetPixelRed(image,r); \ + aggregate.green+=(weight)*(double) GetPixelGreen(image,r); \ + aggregate.blue+=(weight)*(double) GetPixelBlue(image,r); \ + aggregate.black+=(weight)*(double) GetPixelBlack(image,r); \ + aggregate.alpha+=(weight)*(double) GetPixelAlpha(image,r); \ total_weight+=(weight); \ } \ r+=GetPixelChannels(image); @@ -1946,7 +1944,7 @@ MagickExport Image *EnhanceImage(const Image *image,ExceptionInfo *exception) status=MagickFalse; continue; } - center=(ssize_t) GetPixelChannels(image)*(2*(image->columns+4)+2); + center=(ssize_t) GetPixelChannels(image)*(2*((ssize_t) image->columns+4)+2); GetPixelInfo(image,&pixel); for (x=0; x < (ssize_t) image->columns; x++) { @@ -2128,7 +2126,7 @@ MagickExport MagickBooleanType EqualizeImage(Image *image, if ((image->channel_mask & SyncChannels) != 0) intensity=GetPixelIntensity(image,p); histogram[GetPixelChannels(image)*ScaleQuantumToMap( - ClampToQuantum(intensity))+i]++; + ClampToQuantum(intensity))+(size_t) i]++; } p+=GetPixelChannels(image); } @@ -2148,8 +2146,8 @@ MagickExport MagickBooleanType EqualizeImage(Image *image, intensity=0.0; for (j=0; j <= (ssize_t) MaxMap; j++) { - intensity+=histogram[GetPixelChannels(image)*j+i]; - map[GetPixelChannels(image)*j+i]=intensity; + intensity+=histogram[(ssize_t) GetPixelChannels(image)*j+i]; + map[(ssize_t) GetPixelChannels(image)*j+i]=intensity; } } (void) memset(equalize_map,0,(MaxMap+1)*GetPixelChannels(image)* @@ -2162,12 +2160,12 @@ MagickExport MagickBooleanType EqualizeImage(Image *image, j; black[i]=map[i]; - white[i]=map[GetPixelChannels(image)*MaxMap+i]; + white[i]=map[GetPixelChannels(image)*MaxMap+(size_t) i]; if (black[i] != white[i]) for (j=0; j <= (ssize_t) MaxMap; j++) - equalize_map[GetPixelChannels(image)*j+i]=(double) - ScaleMapToQuantum((double) ((MaxMap*(map[ - GetPixelChannels(image)*j+i]-black[i]))/(white[i]-black[i]))); + equalize_map[GetPixelChannels(image)*(size_t) j+(size_t) i]=(double) + ScaleMapToQuantum((double) ((MaxMap*(map[GetPixelChannels(image)* + (size_t) j+(size_t) i]-black[i]))/(white[i]-black[i]))); } histogram=(double *) RelinquishMagickMemory(histogram); map=(double *) RelinquishMagickMemory(map); @@ -2186,36 +2184,36 @@ MagickExport MagickBooleanType EqualizeImage(Image *image, PixelChannel channel = GetPixelChannelChannel(image, RedPixelChannel); if (black[channel] != white[channel]) - image->colormap[j].red=equalize_map[GetPixelChannels(image)* - ScaleQuantumToMap(ClampToQuantum(image->colormap[j].red))+ - channel]; + image->colormap[j].red=equalize_map[(ssize_t) + GetPixelChannels(image)*ScaleQuantumToMap( + ClampToQuantum(image->colormap[j].red))+channel]; } if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0) { PixelChannel channel = GetPixelChannelChannel(image, GreenPixelChannel); if (black[channel] != white[channel]) - image->colormap[j].green=equalize_map[GetPixelChannels(image)* - ScaleQuantumToMap(ClampToQuantum(image->colormap[j].green))+ - channel]; + image->colormap[j].green=equalize_map[(ssize_t) + GetPixelChannels(image)*ScaleQuantumToMap( + ClampToQuantum(image->colormap[j].green))+channel]; } if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0) { PixelChannel channel = GetPixelChannelChannel(image, BluePixelChannel); if (black[channel] != white[channel]) - image->colormap[j].blue=equalize_map[GetPixelChannels(image)* - ScaleQuantumToMap(ClampToQuantum(image->colormap[j].blue))+ - channel]; + image->colormap[j].blue=equalize_map[(ssize_t) + GetPixelChannels(image)*ScaleQuantumToMap( + ClampToQuantum(image->colormap[j].blue))+channel]; } if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) { PixelChannel channel = GetPixelChannelChannel(image, AlphaPixelChannel); if (black[channel] != white[channel]) - image->colormap[j].alpha=equalize_map[GetPixelChannels(image)* - ScaleQuantumToMap(ClampToQuantum(image->colormap[j].alpha))+ - channel]; + image->colormap[j].alpha=equalize_map[(ssize_t) + GetPixelChannels(image)*ScaleQuantumToMap( + ClampToQuantum(image->colormap[j].alpha))+channel]; } } } @@ -2256,7 +2254,7 @@ MagickExport MagickBooleanType EqualizeImage(Image *image, if (((traits & UpdatePixelTrait) == 0) || (black[j] == white[j])) continue; q[j]=ClampToQuantum(equalize_map[GetPixelChannels(image)* - ScaleQuantumToMap(q[j])+j]); + ScaleQuantumToMap(q[j])+(size_t) j]); } q+=GetPixelChannels(image); } @@ -2784,9 +2782,9 @@ MagickExport MagickBooleanType HaldClutImage(Image *image, pixel3 = zero, pixel4 = zero; - point.x=QuantumScale*(level-1.0)*GetPixelRed(image,q); - point.y=QuantumScale*(level-1.0)*GetPixelGreen(image,q); - point.z=QuantumScale*(level-1.0)*GetPixelBlue(image,q); + point.x=QuantumScale*(level-1.0)*(double) GetPixelRed(image,q); + point.y=QuantumScale*(level-1.0)*(double) GetPixelGreen(image,q); + point.z=QuantumScale*(level-1.0)*(double) GetPixelBlue(image,q); offset=point.x+level*floor(point.y)+cube_size*floor(point.z); point.x-=floor(point.x); point.y-=floor(point.y); @@ -2907,8 +2905,8 @@ static inline double LevelPixel(const double black_point, scale; scale=PerceptibleReciprocal(white_point-black_point); - level_pixel=QuantumRange*gamma_pow(scale*((double) pixel-black_point), - PerceptibleReciprocal(gamma)); + level_pixel=(double) QuantumRange*gamma_pow(scale*((double) pixel-(double) + black_point),PerceptibleReciprocal(gamma)); return(level_pixel); } @@ -3067,7 +3065,7 @@ MagickExport MagickBooleanType LevelizeImage(Image *image, { #define LevelizeImageTag "Levelize/Image" #define LevelizeValue(x) ClampToQuantum(((MagickRealType) gamma_pow((double) \ - (QuantumScale*(x)),gamma))*(white_point-black_point)+black_point) + (QuantumScale*((double) x)),gamma))*(white_point-black_point)+black_point) CacheView *image_view; @@ -3237,38 +3235,38 @@ MagickExport MagickBooleanType LevelImageColors(Image *image, if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0) { channel_mask=SetImageChannelMask(image,RedChannel); - status&=LevelImage(image,black_color->red,white_color->red,1.0, - exception); + status&=(MagickStatusType) LevelImage(image,black_color->red, + white_color->red,1.0,exception); (void) SetImageChannelMask(image,channel_mask); } if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0) { channel_mask=SetImageChannelMask(image,GreenChannel); - status&=LevelImage(image,black_color->green,white_color->green,1.0, - exception); + status&=(MagickStatusType) LevelImage(image,black_color->green, + white_color->green,1.0,exception); (void) SetImageChannelMask(image,channel_mask); } if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0) { channel_mask=SetImageChannelMask(image,BlueChannel); - status&=LevelImage(image,black_color->blue,white_color->blue,1.0, - exception); + status&=(MagickStatusType) LevelImage(image,black_color->blue, + white_color->blue,1.0,exception); (void) SetImageChannelMask(image,channel_mask); } if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) && (image->colorspace == CMYKColorspace)) { channel_mask=SetImageChannelMask(image,BlackChannel); - status&=LevelImage(image,black_color->black,white_color->black,1.0, - exception); + status&=(MagickStatusType) LevelImage(image,black_color->black, + white_color->black,1.0,exception); (void) SetImageChannelMask(image,channel_mask); } if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) && (image->alpha_trait != UndefinedPixelTrait)) { channel_mask=SetImageChannelMask(image,AlphaChannel); - status&=LevelImage(image,black_color->alpha,white_color->alpha,1.0, - exception); + status&=(MagickStatusType) LevelImage(image,black_color->alpha, + white_color->alpha,1.0,exception); (void) SetImageChannelMask(image,channel_mask); } } @@ -3277,38 +3275,38 @@ MagickExport MagickBooleanType LevelImageColors(Image *image, if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0) { channel_mask=SetImageChannelMask(image,RedChannel); - status&=LevelizeImage(image,black_color->red,white_color->red,1.0, - exception); + status&=(MagickStatusType) LevelizeImage(image,black_color->red, + white_color->red,1.0,exception); (void) SetImageChannelMask(image,channel_mask); } if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0) { channel_mask=SetImageChannelMask(image,GreenChannel); - status&=LevelizeImage(image,black_color->green,white_color->green,1.0, - exception); + status&=(MagickStatusType) LevelizeImage(image,black_color->green, + white_color->green,1.0,exception); (void) SetImageChannelMask(image,channel_mask); } if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0) { channel_mask=SetImageChannelMask(image,BlueChannel); - status&=LevelizeImage(image,black_color->blue,white_color->blue,1.0, - exception); + status&=(MagickStatusType) LevelizeImage(image,black_color->blue, + white_color->blue,1.0,exception); (void) SetImageChannelMask(image,channel_mask); } if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) && (image->colorspace == CMYKColorspace)) { channel_mask=SetImageChannelMask(image,BlackChannel); - status&=LevelizeImage(image,black_color->black,white_color->black,1.0, - exception); + status&=(MagickStatusType) LevelizeImage(image,black_color->black, + white_color->black,1.0,exception); (void) SetImageChannelMask(image,channel_mask); } if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) && (image->alpha_trait != UndefinedPixelTrait)) { channel_mask=SetImageChannelMask(image,AlphaChannel); - status&=LevelizeImage(image,black_color->alpha,white_color->alpha,1.0, - exception); + status&=(MagickStatusType) LevelizeImage(image,black_color->alpha, + white_color->alpha,1.0,exception); (void) SetImageChannelMask(image,channel_mask); } } @@ -3974,11 +3972,11 @@ MagickExport MagickBooleanType NegateImage(Image *image, (image->colormap[i].green != image->colormap[i].blue)) continue; if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0) - image->colormap[i].red=QuantumRange-image->colormap[i].red; + image->colormap[i].red=(double) QuantumRange-image->colormap[i].red; if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0) - image->colormap[i].green=QuantumRange-image->colormap[i].green; + image->colormap[i].green=(double) QuantumRange-image->colormap[i].green; if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0) - image->colormap[i].blue=QuantumRange-image->colormap[i].blue; + image->colormap[i].blue=(double) QuantumRange-image->colormap[i].blue; } /* Negate image. @@ -4271,10 +4269,11 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image, ExceptionInfo *exception) { #define SigmoidalContrastImageTag "SigmoidalContrast/Image" -#define ScaledSig(x) ( ClampToQuantum(QuantumRange* \ - ScaledSigmoidal(contrast,QuantumScale*midpoint,QuantumScale*(x))) ) -#define InverseScaledSig(x) ( ClampToQuantum(QuantumRange* \ - InverseScaledSigmoidal(contrast,QuantumScale*midpoint,QuantumScale*(x))) ) +#define ScaledSig(x) (ClampToQuantum((double) QuantumRange* \ + ScaledSigmoidal(contrast,QuantumScale*midpoint,QuantumScale*((double) x))) ) +#define InverseScaledSig(x) (ClampToQuantum((double) QuantumRange* \ + InverseScaledSigmoidal(contrast,QuantumScale*midpoint,QuantumScale* \ + ((double) x))) ) CacheView *image_view; @@ -4488,8 +4487,8 @@ MagickExport MagickBooleanType WhiteBalanceImage(Image *image, } for (x=0; x < (ssize_t) image->columns; x++) { - a_mean+=QuantumScale*GetPixela(image,p)-0.5; - b_mean+=QuantumScale*GetPixelb(image,p)-0.5; + a_mean+=QuantumScale*(double) GetPixela(image,p)-0.5; + b_mean+=QuantumScale*(double) GetPixelb(image,p)-0.5; p+=GetPixelChannels(image); } } @@ -4525,8 +4524,8 @@ MagickExport MagickBooleanType WhiteBalanceImage(Image *image, /* Scale the chroma distance shifted according to amount of luminance. */ - a=(double) GetPixela(image,q)-1.1*GetPixelL(image,q)*a_mean; - b=(double) GetPixelb(image,q)-1.1*GetPixelL(image,q)*b_mean; + a=(double) GetPixela(image,q)-1.1*(double) GetPixelL(image,q)*a_mean; + b=(double) GetPixelb(image,q)-1.1*(double) GetPixelL(image,q)*b_mean; SetPixela(image,ClampToQuantum(a),q); SetPixelb(image,ClampToQuantum(b),q); q+=GetPixelChannels(image); @@ -4570,13 +4569,14 @@ MagickExport MagickBooleanType WhiteBalanceImage(Image *image, if ((flags & RhoValue) != 0) black_point=geometry_info.rho; if ((flags & PercentValue) != 0) - black_point*=(double) (QuantumRange/100.0); + black_point*=((double) QuantumRange/100.0); channel_mask=SetImageChannelMask(image,(ChannelType) (aChannel | bChannel)); - status&=LevelImage(image,black_point,(double) QuantumRange-black_point, - 1.0,exception); + status&=(MagickStatusType) LevelImage(image,black_point,(double) + QuantumRange-black_point,1.0,exception); (void) SetImageChannelMask(image,channel_mask); } - status&=TransformImageColorspace(image,sRGBColorspace,exception); + status&=(MagickStatusType) TransformImageColorspace(image,sRGBColorspace, + exception); return(status != 0 ? MagickTrue : MagickFalse); } diff --git a/ImageMagick-7.1.1-15/MagickCore/enhance.h b/ImageMagick-7.1.1-16/MagickCore/enhance.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/enhance.h rename to ImageMagick-7.1.1-16/MagickCore/enhance.h diff --git a/ImageMagick-7.1.1-15/MagickCore/exception-private.h b/ImageMagick-7.1.1-16/MagickCore/exception-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/exception-private.h rename to ImageMagick-7.1.1-16/MagickCore/exception-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/exception.c b/ImageMagick-7.1.1-16/MagickCore/exception.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/exception.c rename to ImageMagick-7.1.1-16/MagickCore/exception.c diff --git a/ImageMagick-7.1.1-15/MagickCore/exception.h b/ImageMagick-7.1.1-16/MagickCore/exception.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/exception.h rename to ImageMagick-7.1.1-16/MagickCore/exception.h diff --git a/ImageMagick-7.1.1-15/MagickCore/feature.c b/ImageMagick-7.1.1-16/MagickCore/feature.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/feature.c rename to ImageMagick-7.1.1-16/MagickCore/feature.c index d7de2eeb..fb91b905 100644 --- a/ImageMagick-7.1.1-15/MagickCore/feature.c +++ b/ImageMagick-7.1.1-16/MagickCore/feature.c @@ -937,7 +937,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, v=0; while (grays[u].red != ScaleQuantumToMap(GetPixelRed(image,p))) u++; - while (grays[v].red != ScaleQuantumToMap(GetPixelRed(image,p+offset*GetPixelChannels(image)))) + while (grays[v].red != ScaleQuantumToMap(GetPixelRed(image,p+offset*(ssize_t) GetPixelChannels(image)))) v++; cooccurrence[u][v].direction[i].red++; cooccurrence[v][u].direction[i].red++; @@ -945,7 +945,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, v=0; while (grays[u].green != ScaleQuantumToMap(GetPixelGreen(image,p))) u++; - while (grays[v].green != ScaleQuantumToMap(GetPixelGreen(image,p+offset*GetPixelChannels(image)))) + while (grays[v].green != ScaleQuantumToMap(GetPixelGreen(image,p+offset*(ssize_t) GetPixelChannels(image)))) v++; cooccurrence[u][v].direction[i].green++; cooccurrence[v][u].direction[i].green++; @@ -953,7 +953,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, v=0; while (grays[u].blue != ScaleQuantumToMap(GetPixelBlue(image,p))) u++; - while (grays[v].blue != ScaleQuantumToMap(GetPixelBlue(image,p+offset*GetPixelChannels(image)))) + while (grays[v].blue != ScaleQuantumToMap(GetPixelBlue(image,p+offset*(ssize_t) GetPixelChannels(image)))) v++; cooccurrence[u][v].direction[i].blue++; cooccurrence[v][u].direction[i].blue++; @@ -963,7 +963,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, v=0; while (grays[u].black != ScaleQuantumToMap(GetPixelBlack(image,p))) u++; - while (grays[v].black != ScaleQuantumToMap(GetPixelBlack(image,p+offset*GetPixelChannels(image)))) + while (grays[v].black != ScaleQuantumToMap(GetPixelBlack(image,p+offset*(ssize_t) GetPixelChannels(image)))) v++; cooccurrence[u][v].direction[i].black++; cooccurrence[v][u].direction[i].black++; @@ -974,7 +974,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, v=0; while (grays[u].alpha != ScaleQuantumToMap(GetPixelAlpha(image,p))) u++; - while (grays[v].alpha != ScaleQuantumToMap(GetPixelAlpha(image,p+offset*GetPixelChannels(image)))) + while (grays[v].alpha != ScaleQuantumToMap(GetPixelAlpha(image,p+offset*(ssize_t) GetPixelChannels(image)))) v++; cooccurrence[u][v].direction[i].alpha++; cooccurrence[v][u].direction[i].alpha++; @@ -1921,7 +1921,7 @@ MagickExport Image *HoughLineImage(const Image *image,const size_t width, } for (x=0; x < (ssize_t) image->columns; x++) { - if (GetPixelIntensity(image,p) > (QuantumRange/2.0)) + if (GetPixelIntensity(image,p) > ((double) QuantumRange/2.0)) { ssize_t i; diff --git a/ImageMagick-7.1.1-15/MagickCore/feature.h b/ImageMagick-7.1.1-16/MagickCore/feature.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/feature.h rename to ImageMagick-7.1.1-16/MagickCore/feature.h diff --git a/ImageMagick-7.1.1-15/MagickCore/fourier.c b/ImageMagick-7.1.1-16/MagickCore/fourier.c similarity index 92% rename from ImageMagick-7.1.1-15/MagickCore/fourier.c rename to ImageMagick-7.1.1-16/MagickCore/fourier.c index 93482717..2a3e330a 100644 --- a/ImageMagick-7.1.1-15/MagickCore/fourier.c +++ b/ImageMagick-7.1.1-16/MagickCore/fourier.c @@ -61,11 +61,12 @@ #include "MagickCore/resource_.h" #include "MagickCore/string-private.h" #include "MagickCore/thread-private.h" -#if defined(MAGICKCORE_FFTW_DELEGATE) +#if defined(MAGICKCORE_FFTW_DELEGATE) && !defined(__cplusplus) && !defined(c_plusplus) #if defined(MAGICKCORE_HAVE_COMPLEX_H) #include #endif #include +#if !defined(MAGICKCORE_CHANNEL_MASK_DEPTH) #if !defined(MAGICKCORE_HAVE_CABS) #define cabs(z) (sqrt(z[0]*z[0]+z[1]*z[1])) #endif @@ -79,6 +80,7 @@ #define creal(z) (z[0]) #endif #endif +#endif /* Typedef declarations. @@ -282,10 +284,10 @@ MagickExport Image *ComplexImages(const Image *images,const ComplexOperator op, for (i=0; i < (ssize_t) number_channels; i++) { double - ai = QuantumScale*Ai[i], - ar = QuantumScale*Ar[i], - bi = QuantumScale*Bi[i], - br = QuantumScale*Br[i], + ai = QuantumScale*(double) Ai[i], + ar = QuantumScale*(double) Ar[i], + bi = QuantumScale*(double) Bi[i], + br = QuantumScale*(double) Br[i], ci, cr; @@ -335,8 +337,8 @@ MagickExport Image *ComplexImages(const Image *images,const ComplexOperator op, break; } } - Cr[i]=QuantumRange*cr; - Ci[i]=QuantumRange*ci; + Cr[i]=(double) QuantumRange*cr; + Ci[i]=(double) QuantumRange*ci; } Ar+=GetPixelChannels(Ar_image); Ai+=GetPixelChannels(Ai_image); @@ -405,7 +407,7 @@ MagickExport Image *ComplexImages(const Image *images,const ComplexOperator op, % */ -#if defined(MAGICKCORE_FFTW_DELEGATE) +#if defined(MAGICKCORE_FFTW_DELEGATE) && !defined(__cplusplus) && !defined(c_plusplus) static MagickBooleanType RollFourier(const size_t width,const size_t height, const ssize_t x_offset,const ssize_t y_offset,double *roll_pixels) @@ -418,11 +420,9 @@ static MagickBooleanType RollFourier(const size_t width,const size_t height, ssize_t i, - x; - - ssize_t u, v, + x, y; /* @@ -447,7 +447,7 @@ static MagickBooleanType RollFourier(const size_t width,const size_t height, else u=((x+x_offset) > ((ssize_t) width-1L)) ? x+x_offset-(ssize_t) width : x+x_offset; - source_pixels[v*width+u]=roll_pixels[i++]; + source_pixels[v*(ssize_t) width+u]=roll_pixels[i++]; } } (void) memcpy(roll_pixels,source_pixels,height*width*sizeof(*source_pixels)); @@ -461,11 +461,9 @@ static MagickBooleanType ForwardQuadrantSwap(const size_t width, MagickBooleanType status; - ssize_t - x; - ssize_t center, + x, y; /* @@ -478,13 +476,14 @@ static MagickBooleanType ForwardQuadrantSwap(const size_t width, return(MagickFalse); for (y=0L; y < (ssize_t) height; y++) for (x=0L; x < (ssize_t) (width/2L); x++) - forward_pixels[y*width+x+width/2L]=source_pixels[y*center+x]; + forward_pixels[y*(ssize_t) width+x+(ssize_t) width/2L]= + source_pixels[y*center+x]; for (y=1; y < (ssize_t) height; y++) for (x=0L; x < (ssize_t) (width/2L); x++) - forward_pixels[(height-y)*width+width/2L-x-1L]= + forward_pixels[((ssize_t) height-y)*(ssize_t) width+(ssize_t) width/2L-x-1L]= source_pixels[y*center+x+1L]; for (x=0L; x < (ssize_t) (width/2L); x++) - forward_pixels[width/2L-x-1L]=source_pixels[x+1L]; + forward_pixels[(ssize_t) width/2L-x-1L]=source_pixels[x+1L]; return(MagickTrue); } @@ -492,14 +491,12 @@ static void CorrectPhaseLHS(const size_t width,const size_t height, double *fourier_pixels) { ssize_t - x; - - ssize_t + x, y; for (y=0L; y < (ssize_t) height; y++) for (x=0L; x < (ssize_t) (width/2L); x++) - fourier_pixels[y*width+x]*=(-1.0); + fourier_pixels[y*(ssize_t) width+x]*=(-1.0); } static MagickBooleanType ForwardFourier(const FourierInfo *fourier_info, @@ -527,11 +524,9 @@ static MagickBooleanType ForwardFourier(const FourierInfo *fourier_info, Quantum *q; - ssize_t - x; - ssize_t i, + x, y; magnitude_image=GetFirstImageInList(image); @@ -598,31 +593,31 @@ static MagickBooleanType ForwardFourier(const FourierInfo *fourier_info, case RedPixelChannel: default: { - SetPixelRed(magnitude_image,ClampToQuantum(QuantumRange* + SetPixelRed(magnitude_image,ClampToQuantum((double) QuantumRange* magnitude_pixels[i]),q); break; } case GreenPixelChannel: { - SetPixelGreen(magnitude_image,ClampToQuantum(QuantumRange* + SetPixelGreen(magnitude_image,ClampToQuantum((double) QuantumRange* magnitude_pixels[i]),q); break; } case BluePixelChannel: { - SetPixelBlue(magnitude_image,ClampToQuantum(QuantumRange* + SetPixelBlue(magnitude_image,ClampToQuantum((double) QuantumRange* magnitude_pixels[i]),q); break; } case BlackPixelChannel: { - SetPixelBlack(magnitude_image,ClampToQuantum(QuantumRange* + SetPixelBlack(magnitude_image,ClampToQuantum((double) QuantumRange* magnitude_pixels[i]),q); break; } case AlphaPixelChannel: { - SetPixelAlpha(magnitude_image,ClampToQuantum(QuantumRange* + SetPixelAlpha(magnitude_image,ClampToQuantum((double) QuantumRange* magnitude_pixels[i]),q); break; } @@ -650,31 +645,31 @@ static MagickBooleanType ForwardFourier(const FourierInfo *fourier_info, case RedPixelChannel: default: { - SetPixelRed(phase_image,ClampToQuantum(QuantumRange* + SetPixelRed(phase_image,ClampToQuantum((double) QuantumRange* phase_pixels[i]),q); break; } case GreenPixelChannel: { - SetPixelGreen(phase_image,ClampToQuantum(QuantumRange* + SetPixelGreen(phase_image,ClampToQuantum((double) QuantumRange* phase_pixels[i]),q); break; } case BluePixelChannel: { - SetPixelBlue(phase_image,ClampToQuantum(QuantumRange* + SetPixelBlue(phase_image,ClampToQuantum((double) QuantumRange* phase_pixels[i]),q); break; } case BlackPixelChannel: { - SetPixelBlack(phase_image,ClampToQuantum(QuantumRange* + SetPixelBlack(phase_image,ClampToQuantum((double) QuantumRange* phase_pixels[i]),q); break; } case AlphaPixelChannel: { - SetPixelAlpha(phase_image,ClampToQuantum(QuantumRange* + SetPixelAlpha(phase_image,ClampToQuantum((double) QuantumRange* phase_pixels[i]),q); break; } @@ -702,6 +697,9 @@ static MagickBooleanType ForwardFourierTransform(FourierInfo *fourier_info, const char *value; + const Quantum + *p; + double *source_pixels; @@ -715,14 +713,9 @@ static MagickBooleanType ForwardFourierTransform(FourierInfo *fourier_info, *forward_info, *source_info; - const Quantum - *p; - ssize_t i, - x; - - ssize_t + x, y; /* @@ -760,27 +753,27 @@ static MagickBooleanType ForwardFourierTransform(FourierInfo *fourier_info, case RedPixelChannel: default: { - source_pixels[i]=QuantumScale*GetPixelRed(image,p); + source_pixels[i]=QuantumScale*(double) GetPixelRed(image,p); break; } case GreenPixelChannel: { - source_pixels[i]=QuantumScale*GetPixelGreen(image,p); + source_pixels[i]=QuantumScale*(double) GetPixelGreen(image,p); break; } case BluePixelChannel: { - source_pixels[i]=QuantumScale*GetPixelBlue(image,p); + source_pixels[i]=QuantumScale*(double) GetPixelBlue(image,p); break; } case BlackPixelChannel: { - source_pixels[i]=QuantumScale*GetPixelBlack(image,p); + source_pixels[i]=QuantumScale*(double) GetPixelBlack(image,p); break; } case AlphaPixelChannel: { - source_pixels[i]=QuantumScale*GetPixelAlpha(image,p); + source_pixels[i]=QuantumScale*(double) GetPixelAlpha(image,p); break; } } @@ -920,7 +913,7 @@ MagickExport Image *ForwardFourierTransformImage(const Image *image, *fourier_image; fourier_image=NewImageList(); -#if !defined(MAGICKCORE_FFTW_DELEGATE) +#if !defined(MAGICKCORE_FFTW_DELEGATE) || defined(__cplusplus) || defined(c_plusplus) (void) modulus; (void) ThrowMagickException(exception,GetMagickModule(), MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn","`%s' (FFTW)", @@ -1088,15 +1081,13 @@ MagickExport Image *ForwardFourierTransformImage(const Image *image, % */ -#if defined(MAGICKCORE_FFTW_DELEGATE) +#if defined(MAGICKCORE_FFTW_DELEGATE) && !defined(__cplusplus) && !defined(c_plusplus) static MagickBooleanType InverseQuadrantSwap(const size_t width, const size_t height,const double *source,double *destination) { - ssize_t - x; - ssize_t center, + x, y; /* @@ -1105,12 +1096,13 @@ static MagickBooleanType InverseQuadrantSwap(const size_t width, center=(ssize_t) (width/2L)+1L; for (y=1L; y < (ssize_t) height; y++) for (x=0L; x < (ssize_t) (width/2L+1L); x++) - destination[(height-y)*center-x+width/2L]=source[y*width+x]; + destination[((ssize_t) height-y)*center-x+(ssize_t) width/2L]= + source[y*(ssize_t) width+x]; for (y=0L; y < (ssize_t) height; y++) - destination[y*center]=source[y*width+width/2L]; + destination[y*center]=source[y*(ssize_t) width+(ssize_t) width/2L]; for (x=0L; x < center; x++) destination[x]=source[center-x-1L]; - return(RollFourier(center,height,0L,(ssize_t) height/-2L,destination)); + return(RollFourier((size_t) center,height,0L,(ssize_t) height/-2L,destination)); } static MagickBooleanType InverseFourier(FourierInfo *fourier_info, @@ -1121,6 +1113,9 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info, *magnitude_view, *phase_view; + const Quantum + *p; + double *inverse_pixels, *magnitude_pixels, @@ -1134,14 +1129,9 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info, *magnitude_info, *phase_info; - const Quantum - *p; - ssize_t i, - x; - - ssize_t + x, y; /* @@ -1186,27 +1176,32 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info, case RedPixelChannel: default: { - magnitude_pixels[i]=QuantumScale*GetPixelRed(magnitude_image,p); + magnitude_pixels[i]=QuantumScale*(double) + GetPixelRed(magnitude_image,p); break; } case GreenPixelChannel: { - magnitude_pixels[i]=QuantumScale*GetPixelGreen(magnitude_image,p); + magnitude_pixels[i]=QuantumScale*(double) + GetPixelGreen(magnitude_image,p); break; } case BluePixelChannel: { - magnitude_pixels[i]=QuantumScale*GetPixelBlue(magnitude_image,p); + magnitude_pixels[i]=QuantumScale*(double) + GetPixelBlue(magnitude_image,p); break; } case BlackPixelChannel: { - magnitude_pixels[i]=QuantumScale*GetPixelBlack(magnitude_image,p); + magnitude_pixels[i]=QuantumScale*(double) + GetPixelBlack(magnitude_image,p); break; } case AlphaPixelChannel: { - magnitude_pixels[i]=QuantumScale*GetPixelAlpha(magnitude_image,p); + magnitude_pixels[i]=QuantumScale*(double) + GetPixelAlpha(magnitude_image,p); break; } } @@ -1218,7 +1213,7 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info, status=InverseQuadrantSwap(fourier_info->width,fourier_info->height, magnitude_pixels,inverse_pixels); (void) memcpy(magnitude_pixels,inverse_pixels,fourier_info->height* - fourier_info->center*sizeof(*magnitude_pixels)); + (size_t) fourier_info->center*sizeof(*magnitude_pixels)); i=0L; phase_view=AcquireVirtualCacheView(phase_image,exception); for (y=0L; y < (ssize_t) fourier_info->height; y++) @@ -1234,27 +1229,27 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info, case RedPixelChannel: default: { - phase_pixels[i]=QuantumScale*GetPixelRed(phase_image,p); + phase_pixels[i]=QuantumScale*(double) GetPixelRed(phase_image,p); break; } case GreenPixelChannel: { - phase_pixels[i]=QuantumScale*GetPixelGreen(phase_image,p); + phase_pixels[i]=QuantumScale*(double) GetPixelGreen(phase_image,p); break; } case BluePixelChannel: { - phase_pixels[i]=QuantumScale*GetPixelBlue(phase_image,p); + phase_pixels[i]=QuantumScale*(double) GetPixelBlue(phase_image,p); break; } case BlackPixelChannel: { - phase_pixels[i]=QuantumScale*GetPixelBlack(phase_image,p); + phase_pixels[i]=QuantumScale*(double) GetPixelBlack(phase_image,p); break; } case AlphaPixelChannel: { - phase_pixels[i]=QuantumScale*GetPixelAlpha(phase_image,p); + phase_pixels[i]=QuantumScale*(double) GetPixelAlpha(phase_image,p); break; } } @@ -1279,7 +1274,7 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info, status=InverseQuadrantSwap(fourier_info->width,fourier_info->height, phase_pixels,inverse_pixels); (void) memcpy(phase_pixels,inverse_pixels,fourier_info->height* - fourier_info->center*sizeof(*phase_pixels)); + (size_t) fourier_info->center*sizeof(*phase_pixels)); inverse_info=RelinquishVirtualMemory(inverse_info); /* Merge two sets. @@ -1290,7 +1285,7 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info, for (x=0L; x < (ssize_t) fourier_info->center; x++) { #if defined(MAGICKCORE_HAVE_COMPLEX_H) - fourier_pixels[i]=magnitude_pixels[i]*cos(phase_pixels[i])+I* + fourier_pixels[i]=magnitude_pixels[i]*cos(phase_pixels[i])+(double) I* magnitude_pixels[i]*sin(phase_pixels[i]); #else fourier_pixels[i][0]=magnitude_pixels[i]*cos(phase_pixels[i]); @@ -1303,7 +1298,7 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info, for (x=0L; x < (ssize_t) fourier_info->center; x++) { #if defined(MAGICKCORE_HAVE_COMPLEX_H) - fourier_pixels[i]=magnitude_pixels[i]+I*phase_pixels[i]; + fourier_pixels[i]=magnitude_pixels[i]+(double) I*phase_pixels[i]; #else fourier_pixels[i][0]=magnitude_pixels[i]; fourier_pixels[i][1]=phase_pixels[i]; @@ -1338,9 +1333,7 @@ static MagickBooleanType InverseFourierTransform(FourierInfo *fourier_info, ssize_t i, - x; - - ssize_t + x, y; /* @@ -1410,31 +1403,32 @@ static MagickBooleanType InverseFourierTransform(FourierInfo *fourier_info, case RedPixelChannel: default: { - SetPixelRed(image,ClampToQuantum(QuantumRange*source_pixels[i]),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange* + source_pixels[i]),q); break; } case GreenPixelChannel: { - SetPixelGreen(image,ClampToQuantum(QuantumRange*source_pixels[i]), - q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange* + source_pixels[i]),q); break; } case BluePixelChannel: { - SetPixelBlue(image,ClampToQuantum(QuantumRange*source_pixels[i]), - q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange* + source_pixels[i]),q); break; } case BlackPixelChannel: { - SetPixelBlack(image,ClampToQuantum(QuantumRange*source_pixels[i]), - q); + SetPixelBlack(image,ClampToQuantum((double) QuantumRange* + source_pixels[i]),q); break; } case AlphaPixelChannel: { - SetPixelAlpha(image,ClampToQuantum(QuantumRange*source_pixels[i]), - q); + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange* + source_pixels[i]),q); break; } } @@ -1518,7 +1512,7 @@ MagickExport Image *InverseFourierTransformImage(const Image *magnitude_image, "ImageSequenceRequired","`%s'",magnitude_image->filename); return((Image *) NULL); } -#if !defined(MAGICKCORE_FFTW_DELEGATE) +#if !defined(MAGICKCORE_FFTW_DELEGATE) || defined(__cplusplus) || defined(c_plusplus) fourier_image=(Image *) NULL; (void) modulus; (void) ThrowMagickException(exception,GetMagickModule(), diff --git a/ImageMagick-7.1.1-15/MagickCore/fourier.h b/ImageMagick-7.1.1-16/MagickCore/fourier.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/fourier.h rename to ImageMagick-7.1.1-16/MagickCore/fourier.h diff --git a/ImageMagick-7.1.1-15/MagickCore/fx-private.h b/ImageMagick-7.1.1-16/MagickCore/fx-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/fx-private.h rename to ImageMagick-7.1.1-16/MagickCore/fx-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/fx.c b/ImageMagick-7.1.1-16/MagickCore/fx.c similarity index 95% rename from ImageMagick-7.1.1-15/MagickCore/fx.c rename to ImageMagick-7.1.1-16/MagickCore/fx.c index 85445be1..aac9d705 100644 --- a/ImageMagick-7.1.1-15/MagickCore/fx.c +++ b/ImageMagick-7.1.1-16/MagickCore/fx.c @@ -853,7 +853,7 @@ static int FindUserSymbol (FxInfo * pfx, char * name) static MagickBooleanType ExtendUserSymbols (FxInfo * pfx) { pfx->numUserSymbols = (int) ceil (pfx->numUserSymbols * (1 + TableExtend)); - pfx->UserSymbols = (UserSymbolT*) ResizeMagickMemory (pfx->UserSymbols, pfx->numUserSymbols * sizeof(UserSymbolT)); + pfx->UserSymbols = (UserSymbolT*) ResizeMagickMemory (pfx->UserSymbols, (size_t) pfx->numUserSymbols * sizeof(UserSymbolT)); if (!pfx->UserSymbols) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), ResourceLimitFatalError, @@ -885,10 +885,10 @@ static void DumpTables (FILE * fh) for (i=0; i <= rNull; i++) { const char * str = ""; if ( i < oNull) str = Operators[i].str; - if (i >= (int) FirstFunc && i < fNull) str = Functions[i-FirstFunc].str; - if (i >= (int) FirstImgAttr && i < aNull) str = ImgAttrs[i-FirstImgAttr].str; - if (i >= (int) FirstSym && i < sNull) str = Symbols[i-FirstSym].str; - if (i >= (int) FirstCont && i < rNull) str = Controls[i-FirstCont].str; + if (i >= (int) FirstFunc && i < fNull) str = Functions[i-(int) FirstFunc].str; + if (i >= (int) FirstImgAttr && i < aNull) str = ImgAttrs[i-(int) FirstImgAttr].str; + if (i >= (int) FirstSym && i < sNull) str = Symbols[i-(int) FirstSym].str; + if (i >= (int) FirstCont && i < rNull) str = Controls[i-(int) FirstCont].str; if (i==0 ) fprintf (stderr, "Operators:\n "); else if (i==oNull) fprintf (stderr, "\nFunctions:\n "); else if (i==fNull) fprintf (stderr, "\nImage attributes:\n "); @@ -922,7 +922,7 @@ static MagickBooleanType BuildRPN (FxInfo * pfx) { pfx->numUserSymbols = InitNumUserSymbols; pfx->usedUserSymbols = 0; - pfx->UserSymbols = (UserSymbolT*) AcquireMagickMemory (pfx->numUserSymbols * sizeof(UserSymbolT)); + pfx->UserSymbols = (UserSymbolT*) AcquireMagickMemory ((size_t) pfx->numUserSymbols * sizeof(UserSymbolT)); if (!pfx->UserSymbols) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), ResourceLimitFatalError, @@ -935,7 +935,7 @@ static MagickBooleanType BuildRPN (FxInfo * pfx) pfx->usedElements = 0; pfx->Elements = NULL; - pfx->Elements = (ElementT*) AcquireMagickMemory (pfx->numElements * sizeof(ElementT)); + pfx->Elements = (ElementT*) AcquireMagickMemory ((size_t) pfx->numElements * sizeof(ElementT)); if (!pfx->Elements) { (void) ThrowMagickException ( @@ -948,7 +948,7 @@ static MagickBooleanType BuildRPN (FxInfo * pfx) pfx->usedOprStack = 0; pfx->maxUsedOprStack = 0; pfx->numOprStack = InitNumOprStack; - pfx->OperatorStack = (OperatorE*) AcquireMagickMemory (pfx->numOprStack * sizeof(OperatorE)); + pfx->OperatorStack = (OperatorE*) AcquireMagickMemory ((size_t) pfx->numOprStack * sizeof(OperatorE)); if (!pfx->OperatorStack) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), ResourceLimitFatalError, @@ -973,7 +973,7 @@ static MagickBooleanType AllocFxRt (FxInfo * pfx, fxRtT * pfxrt) pfxrt->usedValStack = 0; pfxrt->numValStack = 2 * pfx->maxUsedOprStack; if (pfxrt->numValStack < MinValStackSize) pfxrt->numValStack = MinValStackSize; - pfxrt->ValStack = (fxFltType*) AcquireMagickMemory (pfxrt->numValStack * sizeof(fxFltType)); + pfxrt->ValStack = (fxFltType*) AcquireMagickMemory ((size_t) pfxrt->numValStack * sizeof(fxFltType)); if (!pfxrt->ValStack) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), ResourceLimitFatalError, @@ -985,7 +985,7 @@ static MagickBooleanType AllocFxRt (FxInfo * pfx, fxRtT * pfxrt) pfxrt->UserSymVals = NULL; if (pfx->usedUserSymbols) { - pfxrt->UserSymVals = (fxFltType*) AcquireMagickMemory (pfx->usedUserSymbols * sizeof(fxFltType)); + pfxrt->UserSymVals = (fxFltType*) AcquireMagickMemory ((size_t) pfx->usedUserSymbols * sizeof(fxFltType)); if (!pfxrt->UserSymVals) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), ResourceLimitFatalError, @@ -1001,7 +1001,7 @@ static MagickBooleanType AllocFxRt (FxInfo * pfx, fxRtT * pfxrt) static MagickBooleanType ExtendRPN (FxInfo * pfx) { pfx->numElements = (int) ceil (pfx->numElements * (1 + TableExtend)); - pfx->Elements = (ElementT*) ResizeMagickMemory (pfx->Elements, pfx->numElements * sizeof(ElementT)); + pfx->Elements = (ElementT*) ResizeMagickMemory (pfx->Elements, (size_t) pfx->numElements * sizeof(ElementT)); if (!pfx->Elements) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), ResourceLimitFatalError, @@ -1022,10 +1022,10 @@ static const char * OprStr (int oprNum) const char * str; if (oprNum < 0) str = "bad OprStr"; else if (oprNum <= oNull) str = Operators[oprNum].str; - else if (oprNum <= fNull) str = Functions[oprNum-FirstFunc].str; - else if (oprNum <= aNull) str = ImgAttrs[oprNum-FirstImgAttr].str; - else if (oprNum <= sNull) str = Symbols[oprNum-FirstSym].str; - else if (oprNum <= rNull) str = Controls[oprNum-FirstCont].str; + else if (oprNum <= fNull) str = Functions[oprNum-(int) FirstFunc].str; + else if (oprNum <= aNull) str = ImgAttrs[oprNum-(int) FirstImgAttr].str; + else if (oprNum <= sNull) str = Symbols[oprNum-(int) FirstSym].str; + else if (oprNum <= rNull) str = Controls[oprNum-(int) FirstCont].str; else { str = "bad OprStr"; } @@ -1085,7 +1085,7 @@ static MagickBooleanType DumpRPN (FxInfo * pfx, FILE * fh) pel->DoPush ? "push" : "NO push"); if (pel->ImgAttrQual != aNull) - fprintf (fh, " ia=%s", OprStr(pel->ImgAttrQual)); + fprintf (fh, " ia=%s", OprStr((int) pel->ImgAttrQual)); if (pel->ChannelQual != NO_CHAN_QUAL) { if (pel->ChannelQual == THIS_CHANNEL) fprintf (stderr, " ch=this"); @@ -1216,10 +1216,10 @@ static MagickBooleanType AddElement (FxInfo * pfx, fxFltType val, int oprNum) pel->lenExp = 0; if (oprNum <= oNull) pel->nArgs = Operators[oprNum].nArgs; - else if (oprNum <= fNull) pel->nArgs = Functions[oprNum-FirstFunc].nArgs; + else if (oprNum <= fNull) pel->nArgs = Functions[oprNum-(int) FirstFunc].nArgs; else if (oprNum <= aNull) pel->nArgs = 0; else if (oprNum <= sNull) pel->nArgs = 0; - else pel->nArgs = Controls[oprNum-FirstCont].nArgs; + else pel->nArgs = Controls[oprNum-(int) FirstCont].nArgs; return MagickTrue; } @@ -1309,7 +1309,7 @@ static int MaybeXYWH (FxInfo * pfx, ImgAttrE * pop) "Invalid 'x' or 'y' or 'width' or 'height' token=", "'%s' at '%s'", pfx->token, SetShortExp(pfx)); - if (*pop == aPage) (*pop) = (ImgAttrE) (*pop + ret); + if (*pop == aPage) (*pop) = (ImgAttrE) ((int) *pop + ret); else { if (ret > 2) { (void) ThrowMagickException ( @@ -1317,7 +1317,7 @@ static int MaybeXYWH (FxInfo * pfx, ImgAttrE * pop) "Invalid 'width' or 'height' token=", "'%s' at '%s'", pfx->token, SetShortExp(pfx)); } else { - (*pop) = (ImgAttrE) (*pop + ret); + (*pop) = (ImgAttrE) ((int) *pop + ret); } } pfx->pex+=pfx->lenToken; @@ -1328,7 +1328,7 @@ static int MaybeXYWH (FxInfo * pfx, ImgAttrE * pop) static MagickBooleanType ExtendOperatorStack (FxInfo * pfx) { pfx->numOprStack = (int) ceil (pfx->numOprStack * (1 + TableExtend)); - pfx->OperatorStack = (OperatorE*) ResizeMagickMemory (pfx->OperatorStack, pfx->numOprStack * sizeof(OperatorE)); + pfx->OperatorStack = (OperatorE*) ResizeMagickMemory (pfx->OperatorStack, (size_t) pfx->numOprStack * sizeof(OperatorE)); if (!pfx->OperatorStack) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), ResourceLimitFatalError, @@ -1444,10 +1444,10 @@ static ImgAttrE GetImgAttrToken (FxInfo * pfx) ImgAttrE ia = aNull; const char * iaStr; for (ia = FirstImgAttr; ia < aNull; ia=(ImgAttrE) (ia+1)) { - iaStr = ImgAttrs[ia-FirstImgAttr].str; + iaStr = ImgAttrs[ia-(int) FirstImgAttr].str; if (LocaleCompare (iaStr, pfx->token)==0) { pfx->pex += strlen(pfx->token); - if (ImgAttrs[ia-FirstImgAttr].NeedStats == 1) pfx->NeedStats = MagickTrue; + if (ImgAttrs[ia-(int) FirstImgAttr].NeedStats == 1) pfx->NeedStats = MagickTrue; MaybeXYWH (pfx, &ia); break; } @@ -1621,9 +1621,9 @@ static inline ssize_t GetConstantColour (FxInfo * pfx, fxFltType *v0, fxFltType } (void) CopyMagickString (sFunc, pfx->pex, lenfun+1); if (QueryColorCompliance (sFunc, AllCompliance, &colour, dummy_exception)) { - *v0 = colour.red / QuantumRange; - *v1 = colour.green / QuantumRange; - *v2 = colour.blue / QuantumRange; + *v0 = QuantumScale*colour.red; + *v1 = QuantumScale*colour.green; + *v2 = QuantumScale*colour.blue; dummy_exception = DestroyExceptionInfo (dummy_exception); return (ssize_t)lenfun; } @@ -1642,9 +1642,9 @@ static inline ssize_t GetConstantColour (FxInfo * pfx, fxFltType *v0, fxFltType } } - *v0 = colour.red / QuantumRange; - *v1 = colour.green / QuantumRange; - *v2 = colour.blue / QuantumRange; + *v0 = QuantumScale*colour.red; + *v1 = QuantumScale*colour.green; + *v2 = QuantumScale*colour.blue; dummy_exception = DestroyExceptionInfo (dummy_exception); return (ssize_t)strlen (pfx->token); @@ -1693,9 +1693,9 @@ static inline ssize_t GetHexColour (FxInfo * pfx, fxFltType *v0, fxFltType *v1, return -1; } - *v0 = colour.red / QuantumRange; - *v1 = colour.green / QuantumRange; - *v2 = colour.blue / QuantumRange; + *v0 = QuantumScale*colour.red; + *v1 = QuantumScale*colour.green; + *v2 = QuantumScale*colour.blue; return (ssize_t) len; } @@ -1704,8 +1704,8 @@ static MagickBooleanType GetFunction (FxInfo * pfx, FunctionE fe) { /* A function, so get open-parens, n args, close-parens */ - const char * funStr = Functions[fe-FirstFunc].str; - int nArgs = Functions[fe-FirstFunc].nArgs; + const char * funStr = Functions[fe-(int) FirstFunc].str; + int nArgs = Functions[fe-(int) FirstFunc].nArgs; char chLimit = ')'; char expChLimit = ')'; const char *strLimit = ",)"; @@ -1764,7 +1764,7 @@ static MagickBooleanType GetFunction (FxInfo * pfx, FunctionE fe) } else { if (!ExpectChar (pfx, '(')) return MagickFalse; } - if (!PushOperatorStack (pfx, pushOp)) return MagickFalse; + if (!PushOperatorStack (pfx, (int) pushOp)) return MagickFalse; pExpStart = pfx->pex; ndx0 = pfx->usedElements; @@ -1867,35 +1867,35 @@ static MagickBooleanType GetFunction (FxInfo * pfx, FunctionE fe) } if (fe == fP || fe == fS || fe == fU || fe == fChannel) { - while (FndArgs < Functions[fe-FirstFunc].nArgs) { + while (FndArgs < Functions[fe-(int) FirstFunc].nArgs) { (void) AddElement (pfx, (fxFltType) 0, oNull); FndArgs++; } } - if (FndArgs > Functions[fe-FirstFunc].nArgs) + if (FndArgs > Functions[fe-(int) FirstFunc].nArgs) { if (fe==fChannel) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), OptionError, "For function", "'%s' expected up to %i arguments, found '%i' at '%s'", - funStr, Functions[fe-FirstFunc].nArgs, FndArgs, SetShortExp(pfx)); + funStr, Functions[fe-(int) FirstFunc].nArgs, FndArgs, SetShortExp(pfx)); } else { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), OptionError, "For function", "'%s' expected %i arguments, found '%i' at '%s'", - funStr, Functions[fe-FirstFunc].nArgs, FndArgs, SetShortExp(pfx)); + funStr, Functions[fe-(int) FirstFunc].nArgs, FndArgs, SetShortExp(pfx)); } return MagickFalse; } - if (FndArgs < Functions[fe-FirstFunc].nArgs) { + if (FndArgs < Functions[fe-(int) FirstFunc].nArgs) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), OptionError, "For function", "'%s' expected %i arguments, found too few (%i) at '%s'", - funStr, Functions[fe-FirstFunc].nArgs, FndArgs, SetShortExp(pfx)); + funStr, Functions[fe-(int) FirstFunc].nArgs, FndArgs, SetShortExp(pfx)); return MagickFalse; } - if (fe != fS && fe != fV && FndArgs == 0 && Functions[fe-FirstFunc].nArgs == 0) { + if (fe != fS && fe != fV && FndArgs == 0 && Functions[fe-(int) FirstFunc].nArgs == 0) { /* This is for "rand()" and similar. */ chLimit = expChLimit; if (!ExpectChar (pfx, ')')) return MagickFalse; @@ -1920,7 +1920,7 @@ static MagickBooleanType GetFunction (FxInfo * pfx, FunctionE fe) if (fe == fU || fe == fV || fe == fS) { - coordQual = (GetCoordQualifier (pfx, fe) == 1) ? MagickTrue : MagickFalse; + coordQual = (GetCoordQualifier (pfx, (int) fe) == 1) ? MagickTrue : MagickFalse; if (coordQual) { @@ -1939,7 +1939,7 @@ static MagickBooleanType GetFunction (FxInfo * pfx, FunctionE fe) if (fe == fU) fe = fUP; else if (fe == fV) fe = fVP; else if (fe == fS) fe = fSP; - funStr = Functions[fe-FirstFunc].str; + funStr = Functions[fe-(int) FirstFunc].str; } } @@ -1947,15 +1947,15 @@ static MagickBooleanType GetFunction (FxInfo * pfx, FunctionE fe) (fe == fP || fe == fS || fe == fSP || fe == fU || fe == fUP || fe == fV || fe == fVP) ) { - chQual = GetChannelQualifier (pfx, fe); + chQual = GetChannelQualifier (pfx, (int) fe); } if (chQual == NO_CHAN_QUAL && (fe == fU || fe == fV || fe == fS)) { /* Note: we don't allow "p.mean" etc. */ - iaQual = GetImgAttrQualifier (pfx, fe); + iaQual = GetImgAttrQualifier (pfx, (int) fe); } if (IsQualifier (pfx) && chQual == NO_CHAN_QUAL && iaQual != aNull) { - chQual = GetChannelQualifier (pfx, fe); + chQual = GetChannelQualifier (pfx, (int) fe); } if (coordQual && iaQual != aNull) { (void) ThrowMagickException ( @@ -1993,11 +1993,11 @@ static MagickBooleanType GetFunction (FxInfo * pfx, FunctionE fe) } if (iaQual != aNull && chQual != NO_CHAN_QUAL) { - if (ImgAttrs[iaQual-FirstImgAttr].NeedStats==0) { + if (ImgAttrs[iaQual-(int) FirstImgAttr].NeedStats==0) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), OptionError, "Can't have image attribute ", "'%s' with channel qualifier '%s' at '%s'", - ImgAttrs[iaQual-FirstImgAttr].str, + ImgAttrs[iaQual-(int) FirstImgAttr].str, pfx->token, SetShortExp(pfx)); return MagickFalse; } else { @@ -2005,7 +2005,7 @@ static MagickBooleanType GetFunction (FxInfo * pfx, FunctionE fe) (void) ThrowMagickException ( pfx->exception, GetMagickModule(), OptionError, "Can't have statistical image attribute ", "'%s' with virtual channel qualifier '%s' at '%s'", - ImgAttrs[iaQual-FirstImgAttr].str, + ImgAttrs[iaQual-(int) FirstImgAttr].str, pfx->token, SetShortExp(pfx)); return MagickFalse; } @@ -2030,7 +2030,7 @@ static MagickBooleanType GetFunction (FxInfo * pfx, FunctionE fe) fe = fU0; } } - (void) AddElement (pfx, (fxFltType) 0, fe); + (void) AddElement (pfx, (fxFltType) 0, (int) fe); if (fe == fP || fe == fU || fe == fU0 || fe == fUP || fe == fV || fe == fVP || fe == fS || fe == fSP) { @@ -2082,7 +2082,7 @@ static MagickBooleanType GetOperand ( OperatorE op = GetLeadingOp (pfx); if (op==oOpenParen) { char chLimit = '\0'; - if (!PushOperatorStack (pfx, op)) return MagickFalse; + if (!PushOperatorStack (pfx, (int) op)) return MagickFalse; pfx->pex++; if (!TranslateExpression (pfx, ")", &chLimit, needPopAll)) { (void) ThrowMagickException ( @@ -2108,7 +2108,7 @@ static MagickBooleanType GetOperand ( } return MagickTrue; } else if (OprIsUnaryPrefix (op)) { - if (!PushOperatorStack (pfx, op)) return MagickFalse; + if (!PushOperatorStack (pfx, (int) op)) return MagickFalse; pfx->pex++; SkipSpaces (pfx); if (!*pfx->pex) return MagickFalse; @@ -2224,7 +2224,7 @@ static MagickBooleanType GetOperand ( { FunctionE fe; for (fe = FirstFunc; fe < fNull; fe=(FunctionE) (fe+1)) { - const char * feStr = Functions[fe-FirstFunc].str; + const char * feStr = Functions[fe-(int) FirstFunc].str; if (LocaleCompare (feStr, pfx->token)==0) { break; } @@ -2238,7 +2238,7 @@ static MagickBooleanType GetOperand ( return MagickFalse; } - if (IsStealth (fe)) { + if (IsStealth ((int) fe)) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), OptionError, "Function", "'%s' not permitted at '%s'", @@ -2258,11 +2258,11 @@ static MagickBooleanType GetOperand ( ImgAttrE ia = GetImgAttrToken (pfx); if (ia != aNull) { fxFltType val = 0; - (void) AddElement (pfx, val, ia); + (void) AddElement (pfx, val, (int) ia); - if (ImgAttrs[ia-FirstImgAttr].NeedStats==1) { + if (ImgAttrs[ia-(int) FirstImgAttr].NeedStats==1) { if (IsQualifier (pfx)) { - PixelChannel chQual = GetChannelQualifier (pfx, ia); + PixelChannel chQual = GetChannelQualifier (pfx, (int) ia); ElementT * pel; if (chQual == NO_CHAN_QUAL) { (void) ThrowMagickException ( @@ -2285,14 +2285,14 @@ static MagickBooleanType GetOperand ( { SymbolE se; for (se = FirstSym; se < sNull; se=(SymbolE) (se+1)) { - const char * seStr = Symbols[se-FirstSym].str; + const char * seStr = Symbols[se-(int) FirstSym].str; if (LocaleCompare (seStr, pfx->token)==0) { break; } } if (se != sNull) { fxFltType val = 0; - (void) AddElement (pfx, val, se); + (void) AddElement (pfx, val, (int) se); pfx->pex += pfx->lenToken; if (se==sHue || se==sSaturation || se==sLightness) pfx->NeedHsl = MagickTrue; @@ -2447,7 +2447,7 @@ static MagickBooleanType GetOperator ( } *Assign = (op==oAssign) ? MagickTrue : MagickFalse; - *Update = OprInPlace (op); + *Update = OprInPlace ((int) op); *IncrDecr = (op == oPlusPlus || op == oSubSub) ? MagickTrue : MagickFalse; /* while top of OperatorStack is not empty and is not open-parens or assign, @@ -2458,14 +2458,14 @@ static MagickBooleanType GetOperator ( while (pfx->usedOprStack > 0) { OperatorE top = pfx->OperatorStack[pfx->usedOprStack-1]; int precTop, precNew; - if (top == oOpenParen || top == oAssign || OprInPlace (top)) break; + if (top == oOpenParen || top == oAssign || OprInPlace ((int) top)) break; precTop = Operators[top].precedence; precNew = Operators[op].precedence; /* Assume left associativity. If right assoc, this would be "<=". */ if (precTop < precNew) break; - (void) AddElement (pfx, (fxFltType) 0, top); + (void) AddElement (pfx, (fxFltType) 0, (int) top); pfx->usedOprStack--; } @@ -2493,7 +2493,7 @@ static MagickBooleanType GetOperator ( } if (!DoneIt) { - if (!PushOperatorStack (pfx, op)) return MagickFalse; + if (!PushOperatorStack (pfx, (int) op)) return MagickFalse; } pfx->pex += len; @@ -2615,7 +2615,7 @@ static MagickBooleanType TranslateExpression ( if (UserSymbol) { while (TopOprIsUnaryPrefix (pfx)) { OperatorE op = pfx->OperatorStack[pfx->usedOprStack-1]; - (void) AddElement (pfx, (fxFltType) 0, op); + (void) AddElement (pfx, (fxFltType) 0, (int) op); pfx->usedOprStack--; } } @@ -2693,11 +2693,11 @@ static MagickBooleanType TranslateExpression ( if (op == oOpenParen || op == oOpenBracket || op == oOpenBrace) { break; } - if ( (op==oAssign && !Assign) || (OprInPlace(op) && !Update) ) { + if ( (op==oAssign && !Assign) || (OprInPlace((int) op) && !Update) ) { break; } pfx->usedOprStack--; - (void) AddElement (pfx, (fxFltType) 0, op); + (void) AddElement (pfx, (fxFltType) 0, (int) op); if (op == oAssign) { if (UserSymNdx0 < 0) { (void) ThrowMagickException ( @@ -2711,7 +2711,7 @@ static MagickBooleanType TranslateExpression ( pfx->usedElements--; (void) AddAddressingElement (pfx, rCopyTo, UserSymNdx0); break; - } else if (OprInPlace (op)) { + } else if (OprInPlace ((int) op)) { if (UserSymNdx0 < 0) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), OptionError, @@ -2828,7 +2828,7 @@ static MagickBooleanType CollectStatistics (FxInfo * pfx) size_t imgNum=0; - pfx->statistics = (ChannelStatistics**) AcquireMagickMemory (pfx->ImgListLen * sizeof (ChannelStatistics *)); + pfx->statistics = (ChannelStatistics**) AcquireMagickMemory ((size_t) pfx->ImgListLen * sizeof (ChannelStatistics *)); if (!pfx->statistics) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), ResourceLimitFatalError, @@ -3022,8 +3022,8 @@ static inline ssize_t ChkImgNum (FxInfo * pfx, fxFltType f) /* Returns -1 if f is too large. */ { ssize_t i = (ssize_t) floor ((double) f + 0.5); - if (i < 0) i += pfx->ImgListLen; - if (i < 0 || i >= (ssize_t)pfx->ImgListLen) { + if (i < 0) i += (ssize_t) pfx->ImgListLen; + if (i < 0 || i >= (ssize_t) pfx->ImgListLen) { (void) ThrowMagickException ( pfx->exception, GetMagickModule(), OptionError, "ImgNum", "%lu bad for ImgListLen %lu", @@ -3537,7 +3537,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res if ((int) pel->ChannelQual < 0) { if (pel->ChannelQual == NO_CHAN_QUAL || pel->ChannelQual == THIS_CHANNEL) { if (pfx->ImgNum==0) { - regA = QuantumScale * p[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; + regA = QuantumScale * (double) p[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; } else { const Quantum * pv = GetCacheViewVirtualPixels ( pfx->Imgs[0].View, imgx, imgy, 1,1, pfx->exception); @@ -3547,7 +3547,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res "fU can't get cache", "%lu", (unsigned long) ImgNum); break; } - regA = QuantumScale * pv[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; + regA = QuantumScale * (double) pv[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; } } else if (pel->ChannelQual == HUE_CHANNEL || pel->ChannelQual == SAT_CHANNEL || pel->ChannelQual == LIGHT_CHANNEL) { @@ -3559,7 +3559,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res } } else { if (pfx->ImgNum==0) { - regA = QuantumScale * p[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; + regA = QuantumScale * (double) p[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; } else { const Quantum * pv = GetCacheViewVirtualPixels ( pfx->Imgs[0].View, imgx, imgy, 1,1, pfx->exception); @@ -3569,7 +3569,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res "fU can't get cache", "%lu", (unsigned long) ImgNum); break; } - regA = QuantumScale * pv[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; + regA = QuantumScale * (double) pv[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; } } } else { @@ -3601,8 +3601,8 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res "fU can't get cache", "%lu", (unsigned long) ImgNum); break; } - regA = QuantumScale * - pv[pfx->Images[ImgNum]->channel_map[WHICH_NON_ATTR_CHAN].offset]; + regA = QuantumScale * (double) + pv[pfx->Images[ImgNum]->channel_map[WHICH_NON_ATTR_CHAN].offset]; } else { regA = ImageStat (pfx, ImgNum, WHICH_ATTR_CHAN, pel->ImgAttrQual); } @@ -3618,7 +3618,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res if (pel->ChannelQual == NO_CHAN_QUAL || pel->ChannelQual == THIS_CHANNEL) { if (pfx->ImgNum==0) { - regA = QuantumScale * p[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; + regA = QuantumScale * (double) p[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; } else { const Quantum * pv = GetCacheViewVirtualPixels ( pfx->Imgs[0].View, imgx, imgy, 1,1, pfx->exception); @@ -3628,7 +3628,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res "fU0 can't get cache", "%i", 0); break; } - regA = QuantumScale * pv[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; + regA = QuantumScale * (double) pv[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; } } else if (pel->ChannelQual == HUE_CHANNEL || pel->ChannelQual == SAT_CHANNEL || @@ -3640,7 +3640,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res } } else { if (pfx->ImgNum==0) { - regA = QuantumScale * p[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; + regA = QuantumScale * (double) p[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; } else { const Quantum * pv = GetCacheViewVirtualPixels ( pfx->Imgs[0].View, imgx, imgy, 1,1, pfx->exception); @@ -3650,7 +3650,7 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res "fU0 can't get cache", "%i", 0); break; } - regA = QuantumScale * pv[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; + regA = QuantumScale * (double) pv[pimg->channel_map[WHICH_NON_ATTR_CHAN].offset]; } } break; @@ -3724,8 +3724,8 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res } } - regA = QuantumScale * - pv[pfx->Images[ImgNum]->channel_map[WHICH_NON_ATTR_CHAN].offset]; + regA = QuantumScale * (double) + pv[pfx->Images[ImgNum]->channel_map[WHICH_NON_ATTR_CHAN].offset]; } else { regA = ImageStat (pfx, ImgNum, WHICH_ATTR_CHAN, pel->ImgAttrQual); } @@ -3872,24 +3872,24 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res break; case sLuma: /* calculation */ case sLuminance: /* as Luma */ - regA = QuantumScale * (0.212656 * GetPixelRed (img,p) + - 0.715158 * GetPixelGreen (img,p) + - 0.072186 * GetPixelBlue (img,p)); + regA = QuantumScale * (0.212656 * (double) GetPixelRed (img,p) + + 0.715158 * (double) GetPixelGreen (img,p) + + 0.072186 * (double) GetPixelBlue (img,p)); break; case sSaturation: /* from conversion to HSL */ regA = saturation; break; case sA: /* alpha */ - regA = QuantumScale * GetPixelAlpha (img, p); + regA = QuantumScale * (double) GetPixelAlpha (img, p); break; case sB: /* blue */ - regA = QuantumScale * GetPixelBlue (img, p); + regA = QuantumScale * (double) GetPixelBlue (img, p); break; case sC: /* red (ie cyan) */ - regA = QuantumScale * GetPixelCyan (img, p); + regA = QuantumScale * (double) GetPixelCyan (img, p); break; case sG: /* green */ - regA = QuantumScale * GetPixelGreen (img, p); + regA = QuantumScale * (double) GetPixelGreen (img, p); break; case sI: /* current x-coordinate */ regA = (fxFltType) imgx; @@ -3898,19 +3898,19 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res regA = (fxFltType) imgy; break; case sK: /* black of CMYK */ - regA = QuantumScale * GetPixelBlack (img, p); + regA = QuantumScale * (double) GetPixelBlack (img, p); break; case sM: /* green (ie magenta) */ - regA = QuantumScale * GetPixelGreen (img, p); + regA = QuantumScale * (double) GetPixelGreen (img, p); break; case sO: /* alpha */ - regA = QuantumScale * GetPixelAlpha (img, p); + regA = QuantumScale * (double) GetPixelAlpha (img, p); break; case sR: - regA = QuantumScale * GetPixelRed (img, p); + regA = QuantumScale * (double) GetPixelRed (img, p); break; case sY: - regA = QuantumScale * GetPixelYellow (img, p); + regA = QuantumScale * (double) GetPixelYellow (img, p); break; case sNull: break; diff --git a/ImageMagick-7.1.1-15/MagickCore/fx.h b/ImageMagick-7.1.1-16/MagickCore/fx.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/fx.h rename to ImageMagick-7.1.1-16/MagickCore/fx.h diff --git a/ImageMagick-7.1.1-15/MagickCore/gem-private.h b/ImageMagick-7.1.1-16/MagickCore/gem-private.h similarity index 86% rename from ImageMagick-7.1.1-15/MagickCore/gem-private.h rename to ImageMagick-7.1.1-16/MagickCore/gem-private.h index 366fdf87..ec0dd686 100644 --- a/ImageMagick-7.1.1-15/MagickCore/gem-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/gem-private.h @@ -103,9 +103,6 @@ static inline void ConvertAdobe98ToXYZ(const double red,const double green, /* Convert Adobe '98 to XYZ colorspace. */ - assert(X != (double *) NULL); - assert(Y != (double *) NULL); - assert(Z != (double *) NULL); r=QuantumScale*DecodePixelGamma(red); g=QuantumScale*DecodePixelGamma(green); b=QuantumScale*DecodePixelGamma(blue); @@ -125,9 +122,6 @@ static inline void ConvertDisplayP3ToXYZ(const double red,const double green, /* Convert Display P3 to XYZ colorspace. */ - assert(X != (double *) NULL); - assert(Y != (double *) NULL); - assert(Z != (double *) NULL); r=QuantumScale*DecodePixelGamma(red); g=QuantumScale*DecodePixelGamma(green); b=QuantumScale*DecodePixelGamma(blue); @@ -144,9 +138,6 @@ static inline void ConvertLabToXYZ(const double L,const double a,const double b, y, z; - assert(X != (double *) NULL); - assert(Y != (double *) NULL); - assert(Z != (double *) NULL); y=(L+16.0)/116.0; x=y+a/500.0; z=y-b/200.0; @@ -173,9 +164,6 @@ static inline void ConvertLuvToXYZ(const double L,const double u,const double v, double gamma; - assert(X != (double *) NULL); - assert(Y != (double *) NULL); - assert(Z != (double *) NULL); if (L > (CIEK*CIEEpsilon)) *Y=(double) pow((L+16.0)/116.0,3.0); else @@ -208,9 +196,6 @@ static inline void ConvertProPhotoToXYZ(const double red,const double green, /* Convert ProPhoto to XYZ colorspace. */ - assert(X != (double *) NULL); - assert(Y != (double *) NULL); - assert(Z != (double *) NULL); r=QuantumScale*DecodePixelGamma(red); g=QuantumScale*DecodePixelGamma(green); b=QuantumScale*DecodePixelGamma(blue); @@ -230,9 +215,6 @@ static inline void ConvertRGBToXYZ(const double red,const double green, /* Convert RGB to XYZ colorspace. */ - assert(X != (double *) NULL); - assert(Y != (double *) NULL); - assert(Z != (double *) NULL); r=QuantumScale*DecodePixelGamma(red); g=QuantumScale*DecodePixelGamma(green); b=QuantumScale*DecodePixelGamma(blue); @@ -249,15 +231,12 @@ static inline void ConvertXYZToAdobe98(const double X,const double Y, g, r; - assert(red != (double *) NULL); - assert(green != (double *) NULL); - assert(blue != (double *) NULL); r=2.041587903810746500*X-0.56500697427885960*Y-0.34473135077832956*Z; g=(-0.969243636280879500)*X+1.87596750150772020*Y+0.04155505740717557*Z; b=0.013444280632031142*X-0.11836239223101838*Y+1.01517499439120540*Z; - *red=EncodePixelGamma(QuantumRange*r); - *green=EncodePixelGamma(QuantumRange*g); - *blue=EncodePixelGamma(QuantumRange*b); + *red=EncodePixelGamma((double) QuantumRange*r); + *green=EncodePixelGamma((double) QuantumRange*g); + *blue=EncodePixelGamma((double) QuantumRange*b); } static inline void ConvertXYZToDisplayP3(const double X,const double Y, @@ -268,15 +247,12 @@ static inline void ConvertXYZToDisplayP3(const double X,const double Y, g, r; - assert(red != (double *) NULL); - assert(green != (double *) NULL); - assert(blue != (double *) NULL); r=2.49349691194142500*X-0.93138361791912390*Y-0.402710784450716840*Z; g=(-0.82948896956157470)*X+1.76266406031834630*Y+0.023624685841943577*Z; b=0.03584583024378447*X-0.07617238926804182*Y+0.956884524007687200*Z; - *red=EncodePixelGamma(QuantumRange*r); - *green=EncodePixelGamma(QuantumRange*g); - *blue=EncodePixelGamma(QuantumRange*b); + *red=EncodePixelGamma((double) QuantumRange*r); + *green=EncodePixelGamma((double) QuantumRange*g); + *blue=EncodePixelGamma((double) QuantumRange*b); } static inline void ConvertXYZToLab(const double X,const double Y,const double Z, @@ -287,9 +263,6 @@ static inline void ConvertXYZToLab(const double X,const double Y,const double Z, y, z; - assert(L != (double *) NULL); - assert(a != (double *) NULL); - assert(b != (double *) NULL); if ((X/illuminant_tristimulus[illuminant].x) > CIEEpsilon) x=pow(X/illuminant_tristimulus[illuminant].x,1.0/3.0); else @@ -313,9 +286,6 @@ static inline void ConvertXYZToLuv(const double X,const double Y,const double Z, double alpha; - assert(L != (double *) NULL); - assert(u != (double *) NULL); - assert(v != (double *) NULL); if ((Y/illuminant_tristimulus[illuminant].y) > CIEEpsilon) *L=(double) (116.0*pow(Y/illuminant_tristimulus[illuminant].y, 1.0/3.0)-16.0); @@ -343,15 +313,12 @@ static inline void ConvertXYZToProPhoto(const double X,const double Y, g, r; - assert(red != (double *) NULL); - assert(green != (double *) NULL); - assert(blue != (double *) NULL); r=1.3457989731028281*X-0.25558010007997534*Y-0.05110628506753401*Z; g=(-0.5446224939028347)*X+1.50823274131327810*Y+0.02053603239147973*Z; b=0.0000000000000000*X+0.0000000000000000*Y+1.21196754563894540*Z; - *red=EncodePixelGamma(QuantumRange*r); - *green=EncodePixelGamma(QuantumRange*g); - *blue=EncodePixelGamma(QuantumRange*b); + *red=EncodePixelGamma((double) QuantumRange*r); + *green=EncodePixelGamma((double) QuantumRange*g); + *blue=EncodePixelGamma((double) QuantumRange*b); } static inline void ConvertXYZToRGB(const double X,const double Y,const double Z, @@ -362,15 +329,12 @@ static inline void ConvertXYZToRGB(const double X,const double Y,const double Z, g, r; - assert(red != (double *) NULL); - assert(green != (double *) NULL); - assert(blue != (double *) NULL); r=3.2404542*X-1.5371385*Y-0.4985314*Z; g=(-0.9692660)*X+1.8760108*Y+0.0415560*Z; b=0.0556434*X-0.2040259*Y+1.0572252*Z; - *red=EncodePixelGamma(QuantumRange*r); - *green=EncodePixelGamma(QuantumRange*g); - *blue=EncodePixelGamma(QuantumRange*b); + *red=EncodePixelGamma((double) QuantumRange*r); + *green=EncodePixelGamma((double) QuantumRange*g); + *blue=EncodePixelGamma((double) QuantumRange*b); } #if defined(__cplusplus) || defined(c_plusplus) diff --git a/ImageMagick-7.1.1-15/MagickCore/gem.c b/ImageMagick-7.1.1-16/MagickCore/gem.c similarity index 93% rename from ImageMagick-7.1.1-15/MagickCore/gem.c rename to ImageMagick-7.1.1-16/MagickCore/gem.c index c8f9ca04..4a70afc1 100644 --- a/ImageMagick-7.1.1-15/MagickCore/gem.c +++ b/ImageMagick-7.1.1-16/MagickCore/gem.c @@ -144,9 +144,9 @@ MagickPrivate void ConvertHCLToRGB(const double hue,const double chroma, b=x; } m=luma-(0.298839*r+0.586811*g+0.114350*b); - *red=QuantumRange*(r+m); - *green=QuantumRange*(g+m); - *blue=QuantumRange*(b+m); + *red=(double) QuantumRange*(r+m); + *green=(double) QuantumRange*(g+m); + *blue=(double) QuantumRange*(b+m); } /* @@ -250,9 +250,9 @@ MagickPrivate void ConvertHCLpToRGB(const double hue,const double chroma, z=(1.0-luma)/(m+c-luma); m=1.0-z*c; } - *red=QuantumRange*(z*r+m); - *green=QuantumRange*(z*g+m); - *blue=QuantumRange*(z*b+m); + *red=(double) QuantumRange*(z*r+m); + *green=(double) QuantumRange*(z*g+m); + *blue=(double) QuantumRange*(z*b+m); } /* @@ -300,7 +300,7 @@ MagickPrivate void ConvertHSBToRGB(const double hue,const double saturation, assert(blue != (double *) NULL); if (fabs(saturation) < MagickEpsilon) { - *red=QuantumRange*brightness; + *red=(double) QuantumRange*brightness; *green=(*red); *blue=(*red); return; @@ -315,44 +315,44 @@ MagickPrivate void ConvertHSBToRGB(const double hue,const double saturation, case 0: default: { - *red=QuantumRange*brightness; - *green=QuantumRange*t; - *blue=QuantumRange*p; + *red=(double) QuantumRange*brightness; + *green=(double) QuantumRange*t; + *blue=(double) QuantumRange*p; break; } case 1: { - *red=QuantumRange*q; - *green=QuantumRange*brightness; - *blue=QuantumRange*p; + *red=(double) QuantumRange*q; + *green=(double) QuantumRange*brightness; + *blue=(double) QuantumRange*p; break; } case 2: { - *red=QuantumRange*p; - *green=QuantumRange*brightness; - *blue=QuantumRange*t; + *red=(double) QuantumRange*p; + *green=(double) QuantumRange*brightness; + *blue=(double) QuantumRange*t; break; } case 3: { - *red=QuantumRange*p; - *green=QuantumRange*q; - *blue=QuantumRange*brightness; + *red=(double) QuantumRange*p; + *green=(double) QuantumRange*q; + *blue=(double) QuantumRange*brightness; break; } case 4: { - *red=QuantumRange*t; - *green=QuantumRange*p; - *blue=QuantumRange*brightness; + *red=(double) QuantumRange*t; + *green=(double) QuantumRange*p; + *blue=(double) QuantumRange*brightness; break; } case 5: { - *red=QuantumRange*brightness; - *green=QuantumRange*p; - *blue=QuantumRange*q; + *red=(double) QuantumRange*brightness; + *green=(double) QuantumRange*p; + *blue=(double) QuantumRange*q; break; } } @@ -426,9 +426,9 @@ MagickPrivate void ConvertHSIToRGB(const double hue,const double saturation, (MagickPI/180.0))); r=3.0*intensity-g-b; } - *red=QuantumRange*r; - *green=QuantumRange*g; - *blue=QuantumRange*b; + *red=(double) QuantumRange*r; + *green=(double) QuantumRange*g; + *blue=(double) QuantumRange*b; } /* @@ -485,53 +485,48 @@ MagickExport void ConvertHSLToRGB(const double hue,const double saturation, switch ((int) floor(h)) { case 0: + default: { - *red=QuantumRange*(min+c); - *green=QuantumRange*(min+x); - *blue=QuantumRange*min; + *red=(double) QuantumRange*(min+c); + *green=(double) QuantumRange*(min+x); + *blue=(double) QuantumRange*min; break; } case 1: { - *red=QuantumRange*(min+x); - *green=QuantumRange*(min+c); - *blue=QuantumRange*min; + *red=(double) QuantumRange*(min+x); + *green=(double) QuantumRange*(min+c); + *blue=(double) QuantumRange*min; break; } case 2: { - *red=QuantumRange*min; - *green=QuantumRange*(min+c); - *blue=QuantumRange*(min+x); + *red=(double) QuantumRange*min; + *green=(double) QuantumRange*(min+c); + *blue=(double) QuantumRange*(min+x); break; } case 3: { - *red=QuantumRange*min; - *green=QuantumRange*(min+x); - *blue=QuantumRange*(min+c); + *red=(double) QuantumRange*min; + *green=(double) QuantumRange*(min+x); + *blue=(double) QuantumRange*(min+c); break; } case 4: { - *red=QuantumRange*(min+x); - *green=QuantumRange*min; - *blue=QuantumRange*(min+c); + *red=(double) QuantumRange*(min+x); + *green=(double) QuantumRange*min; + *blue=(double) QuantumRange*(min+c); break; } case 5: { - *red=QuantumRange*(min+c); - *green=QuantumRange*min; - *blue=QuantumRange*(min+x); + *red=(double) QuantumRange*(min+c); + *green=(double) QuantumRange*min; + *blue=(double) QuantumRange*(min+x); break; } - default: - { - *red=0.0; - *green=0.0; - *blue=0.0; - } } } @@ -586,53 +581,48 @@ MagickPrivate void ConvertHSVToRGB(const double hue,const double saturation, switch ((int) floor(h)) { case 0: + default: { - *red=QuantumRange*(min+c); - *green=QuantumRange*(min+x); - *blue=QuantumRange*min; + *red=(double) QuantumRange*(min+c); + *green=(double) QuantumRange*(min+x); + *blue=(double) QuantumRange*min; break; } case 1: { - *red=QuantumRange*(min+x); - *green=QuantumRange*(min+c); - *blue=QuantumRange*min; + *red=(double) QuantumRange*(min+x); + *green=(double) QuantumRange*(min+c); + *blue=(double) QuantumRange*min; break; } case 2: { - *red=QuantumRange*min; - *green=QuantumRange*(min+c); - *blue=QuantumRange*(min+x); + *red=(double) QuantumRange*min; + *green=(double) QuantumRange*(min+c); + *blue=(double) QuantumRange*(min+x); break; } case 3: { - *red=QuantumRange*min; - *green=QuantumRange*(min+x); - *blue=QuantumRange*(min+c); + *red=(double) QuantumRange*min; + *green=(double) QuantumRange*(min+x); + *blue=(double) QuantumRange*(min+c); break; } case 4: { - *red=QuantumRange*(min+x); - *green=QuantumRange*min; - *blue=QuantumRange*(min+c); + *red=(double) QuantumRange*(min+x); + *green=(double) QuantumRange*min; + *blue=(double) QuantumRange*(min+c); break; } case 5: { - *red=QuantumRange*(min+c); - *green=QuantumRange*min; - *blue=QuantumRange*(min+x); + *red=(double) QuantumRange*(min+c); + *green=(double) QuantumRange*min; + *blue=(double) QuantumRange*(min+x); break; } - default: - { - *red=0.0; - *green=0.0; - *blue=0.0; - } } } @@ -686,9 +676,9 @@ MagickPrivate void ConvertHWBToRGB(const double hue,const double whiteness, v=1.0-blackness; if (fabs(hue-(-1.0)) < MagickEpsilon) { - *red=QuantumRange*v; - *green=QuantumRange*v; - *blue=QuantumRange*v; + *red=(double) QuantumRange*v; + *green=(double) QuantumRange*v; + *blue=(double) QuantumRange*v; return; } i=CastDoubleToLong(floor(6.0*hue)); @@ -698,18 +688,17 @@ MagickPrivate void ConvertHWBToRGB(const double hue,const double whiteness, n=whiteness+f*(v-whiteness); /* linear interpolation */ switch (i) { - default: - case 6: - case 0: r=v; g=n; b=whiteness; break; + case 0: + default: r=v; g=n; b=whiteness; break; case 1: r=n; g=v; b=whiteness; break; case 2: r=whiteness; g=v; b=n; break; case 3: r=whiteness; g=n; b=v; break; case 4: r=n; g=whiteness; b=v; break; case 5: r=v; g=whiteness; b=n; break; } - *red=QuantumRange*r; - *green=QuantumRange*g; - *blue=QuantumRange*b; + *red=(double) QuantumRange*r; + *green=(double) QuantumRange*g; + *blue=(double) QuantumRange*b; } /* @@ -1525,7 +1514,7 @@ MagickPrivate double GenerateDifferentialNoise(RandomInfo *random_info, case UniformNoise: default: { - noise=(double) (pixel+QuantumRange*SigmaUniform*(alpha-0.5)); + noise=(double) pixel+(double) QuantumRange*SigmaUniform*(alpha-0.5); break; } case GaussianNoise: @@ -1540,8 +1529,8 @@ MagickPrivate double GenerateDifferentialNoise(RandomInfo *random_info, gamma=sqrt(-2.0*log(alpha)); sigma=gamma*cos((double) (2.0*MagickPI*beta)); tau=gamma*sin((double) (2.0*MagickPI*beta)); - noise=(double) (pixel+sqrt((double) pixel)*SigmaGaussian*sigma+ - QuantumRange*TauGaussian*tau); + noise=(double) pixel+sqrt((double) pixel)*SigmaGaussian*sigma+ + (double) QuantumRange*TauGaussian*tau; break; } case ImpulseNoise: @@ -1562,15 +1551,16 @@ MagickPrivate double GenerateDifferentialNoise(RandomInfo *random_info, if (alpha <= MagickEpsilon) noise=(double) (pixel-QuantumRange); else - noise=(double) (pixel+QuantumRange*SigmaLaplacian*log(2.0*alpha)+ - 0.5); + noise=(double) pixel+(double) QuantumRange*SigmaLaplacian* + log(2.0*alpha)+0.5; break; } beta=1.0-alpha; if (beta <= (0.5*MagickEpsilon)) noise=(double) (pixel+QuantumRange); else - noise=(double) (pixel-QuantumRange*SigmaLaplacian*log(2.0*beta)+0.5); + noise=(double) pixel-(double) QuantumRange*SigmaLaplacian* + log(2.0*beta)+0.5; break; } case MultiplicativeGaussianNoise: @@ -1579,8 +1569,8 @@ MagickPrivate double GenerateDifferentialNoise(RandomInfo *random_info, if (alpha > MagickEpsilon) sigma=sqrt(-2.0*log(alpha)); beta=GetPseudoRandomValue(random_info); - noise=(double) (pixel+pixel*SigmaMultiplicativeGaussian*sigma* - cos((double) (2.0*MagickPI*beta))/2.0); + noise=(double) pixel+(double) pixel*SigmaMultiplicativeGaussian*sigma* + cos((double) (2.0*MagickPI*beta))/2.0; break; } case PoissonNoise: @@ -1591,18 +1581,18 @@ MagickPrivate double GenerateDifferentialNoise(RandomInfo *random_info, ssize_t i; - poisson=exp(-SigmaPoisson*QuantumScale*pixel); + poisson=exp(-SigmaPoisson*QuantumScale*(double) pixel); for (i=0; alpha > poisson; i++) { beta=GetPseudoRandomValue(random_info); alpha*=beta; } - noise=(double) (QuantumRange*i*PerceptibleReciprocal(SigmaPoisson)); + noise=(double) QuantumRange*i*PerceptibleReciprocal(SigmaPoisson); break; } case RandomNoise: { - noise=(double) (QuantumRange*SigmaRandom*alpha); + noise=(double) QuantumRange*SigmaRandom*alpha; break; } } diff --git a/ImageMagick-7.1.1-15/MagickCore/gem.h b/ImageMagick-7.1.1-16/MagickCore/gem.h similarity index 94% rename from ImageMagick-7.1.1-15/MagickCore/gem.h rename to ImageMagick-7.1.1-16/MagickCore/gem.h index ea94b3ea..68f826c7 100644 --- a/ImageMagick-7.1.1-15/MagickCore/gem.h +++ b/ImageMagick-7.1.1-16/MagickCore/gem.h @@ -26,7 +26,7 @@ extern "C" { #endif extern MagickExport double - ExpandAffine(const AffineMatrix *); + ExpandAffine(const AffineMatrix *) magick_attribute((__pure__)); extern MagickExport void ConvertHSLToRGB(const double,const double,const double,double *,double *, diff --git a/ImageMagick-7.1.1-15/MagickCore/geometry-private.h b/ImageMagick-7.1.1-16/MagickCore/geometry-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/geometry-private.h rename to ImageMagick-7.1.1-16/MagickCore/geometry-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/geometry.c b/ImageMagick-7.1.1-16/MagickCore/geometry.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/geometry.c rename to ImageMagick-7.1.1-16/MagickCore/geometry.c index 221e0e13..40ff83fa 100644 --- a/ImageMagick-7.1.1-15/MagickCore/geometry.c +++ b/ImageMagick-7.1.1-16/MagickCore/geometry.c @@ -1219,7 +1219,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, geometry_info->sigma=geometry_info->xi; geometry_info->xi=0.0; flags|=SigmaValue; - flags&=(~XiValue); + flags&=(unsigned int) (~XiValue); } else if ((flags & ChiValue) == 0) @@ -1231,7 +1231,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, geometry_info->xi=geometry_info->psi; flags|=SigmaValue; flags|=XiValue; - flags&=(~PsiValue); + flags&=(unsigned int) (~PsiValue); } else { @@ -1244,7 +1244,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, flags|=SigmaValue; flags|=XiValue; flags|=PsiValue; - flags&=(~ChiValue); + flags&=(unsigned int) (~ChiValue); } } if ((flags & PercentValue) != 0) diff --git a/ImageMagick-7.1.1-15/MagickCore/geometry.h b/ImageMagick-7.1.1-16/MagickCore/geometry.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/geometry.h rename to ImageMagick-7.1.1-16/MagickCore/geometry.h diff --git a/ImageMagick-7.1.1-15/MagickCore/histogram.c b/ImageMagick-7.1.1-16/MagickCore/histogram.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/histogram.c rename to ImageMagick-7.1.1-16/MagickCore/histogram.c index 06c08231..612de0db 100644 --- a/ImageMagick-7.1.1-15/MagickCore/histogram.c +++ b/ImageMagick-7.1.1-16/MagickCore/histogram.c @@ -170,8 +170,8 @@ static inline size_t ColorToNodeId(const PixelInfo *pixel,size_t index) ((ScaleQuantumToChar(ClampToQuantum(pixel->green)) >> index) & 0x01) << 1 | ((ScaleQuantumToChar(ClampToQuantum(pixel->blue)) >> index) & 0x01) << 2); if (pixel->alpha_trait != UndefinedPixelTrait) - id|=((ScaleQuantumToChar(ClampToQuantum(pixel->alpha)) >> index) & - 0x01) << 3; + id|=((size_t) ((ScaleQuantumToChar(ClampToQuantum(pixel->alpha)) >> index) & + 0x01) << 3); return(id); } @@ -948,7 +948,7 @@ MagickExport MagickBooleanType MinMaxStretchImage(Image *image, min+=black; max-=white; if (fabs(min-max) >= MagickEpsilon) - status&=LevelImage(image,min,max,gamma,exception); + status&=(MagickStatusType) LevelImage(image,min,max,gamma,exception); return(status != 0 ? MagickTrue : MagickFalse); } /* @@ -964,11 +964,11 @@ MagickExport MagickBooleanType MinMaxStretchImage(Image *image, if ((traits & UpdatePixelTrait) == 0) continue; channel_mask=SetImageChannelMask(image,(ChannelType) (1UL << i)); - status&=GetImageRange(image,&min,&max,exception); + status&=(MagickStatusType) GetImageRange(image,&min,&max,exception); min+=black; max-=white; if (fabs(min-max) >= MagickEpsilon) - status&=LevelImage(image,min,max,gamma,exception); + status&=(MagickStatusType) LevelImage(image,min,max,gamma,exception); (void) SetImageChannelMask(image,channel_mask); } return(status != 0 ? MagickTrue : MagickFalse); diff --git a/ImageMagick-7.1.1-15/MagickCore/histogram.h b/ImageMagick-7.1.1-16/MagickCore/histogram.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/histogram.h rename to ImageMagick-7.1.1-16/MagickCore/histogram.h diff --git a/ImageMagick-7.1.1-15/MagickCore/identify.c b/ImageMagick-7.1.1-16/MagickCore/identify.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/identify.c rename to ImageMagick-7.1.1-16/MagickCore/identify.c index 4309edf3..418b1f7a 100644 --- a/ImageMagick-7.1.1-15/MagickCore/identify.c +++ b/ImageMagick-7.1.1-16/MagickCore/identify.c @@ -330,7 +330,7 @@ static ssize_t PrintChannelLocations(FILE *file,const Image *image, if (traits == UndefinedPixelTrait) continue; offset=GetPixelChannelOffset(image,channel); - match=fabs((double) (p[offset]-target)) < 0.5 ? MagickTrue : MagickFalse; + match=fabs((double) p[offset]-target) < 0.5 ? MagickTrue : MagickFalse; if (match != MagickFalse) { if ((max_locations != 0) && (n >= (ssize_t) max_locations)) @@ -1519,7 +1519,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, (double) dataset,(double) record); length=(size_t) (GetStringInfoDatum(profile)[i++] << 8); length|=GetStringInfoDatum(profile)[i++]; - length=MagickMin(length,profile_length-i); + length=MagickMin(length,profile_length-(size_t) i); attribute=(char *) NULL; if (~length >= (MagickPathExtent-1)) attribute=(char *) AcquireQuantumMemory(length+MagickPathExtent, diff --git a/ImageMagick-7.1.1-15/MagickCore/identify.h b/ImageMagick-7.1.1-16/MagickCore/identify.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/identify.h rename to ImageMagick-7.1.1-16/MagickCore/identify.h diff --git a/ImageMagick-7.1.1-15/MagickCore/image-private.h b/ImageMagick-7.1.1-16/MagickCore/image-private.h similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/image-private.h rename to ImageMagick-7.1.1-16/MagickCore/image-private.h index c156cf0e..d1d6788c 100644 --- a/ImageMagick-7.1.1-15/MagickCore/image-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/image-private.h @@ -45,13 +45,13 @@ extern "C" { #define MagickAbsoluteValue(x) ((x) < 0 ? -(x) : (x)) #define MagickPHI 1.61803398874989484820458683436563811772030917980576 #define MagickPI2 1.57079632679489661923132169163975144209858469968755 -#define MagickPI 3.14159265358979323846264338327950288419716939937510 +#define MagickPI 3.1415926535897932384626433832795028841971693993751058209749445923078164062 #define MagickSQ1_2 0.70710678118654752440084436210484903928483593768847 #define MagickSQ2 1.41421356237309504880168872420969807856967187537695 #define MagickSQ2PI 2.50662827463100024161235523934010416269302368164062 #define MAGICK_SIZE_MAX (SIZE_MAX) #define MAGICK_SSIZE_MAX (SSIZE_MAX) -#define MAGICK_SSIZE_MIN (-(SSIZE_MAX)-1) +#define MAGICK_SSIZE_MIN (-SSIZE_MAX-1) #define MatteColor "#bdbdbd" /* gray */ #define MatteColorRGBA ScaleShortToQuantum(0xbdbd),\ ScaleShortToQuantum(0xbdbd),ScaleShortToQuantum(0xbdbd),OpaqueAlpha diff --git a/ImageMagick-7.1.1-15/MagickCore/image-view.c b/ImageMagick-7.1.1-16/MagickCore/image-view.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/image-view.c rename to ImageMagick-7.1.1-16/MagickCore/image-view.c index 9fec1d0d..fb92f9fd 100644 --- a/ImageMagick-7.1.1-15/MagickCore/image-view.c +++ b/ImageMagick-7.1.1-16/MagickCore/image-view.c @@ -241,7 +241,7 @@ MagickExport MagickBooleanType DuplexTransferImageViewIterator( status=MagickTrue; progress=0; #if defined(MAGICKCORE_OPENMP_SUPPORT) - height=source->extent.height-source->extent.y; + height=source->extent.height-(size_t) source->extent.y; #pragma omp parallel for schedule(static) shared(progress,status) \ magick_number_threads(source_image,destination_image,height,1) #endif @@ -554,7 +554,7 @@ MagickExport MagickBooleanType GetImageViewIterator(ImageView *source, status=MagickTrue; progress=0; #if defined(MAGICKCORE_OPENMP_SUPPORT) - height=source->extent.height-source->extent.y; + height=source->extent.height-(size_t) source->extent.y; #pragma omp parallel for schedule(static) shared(progress,status) \ magick_number_threads(source_image,source_image,height,1) #endif @@ -901,7 +901,7 @@ MagickExport MagickBooleanType SetImageViewIterator(ImageView *destination, status=MagickTrue; progress=0; #if defined(MAGICKCORE_OPENMP_SUPPORT) - height=destination->extent.height-destination->extent.y; + height=destination->extent.height-(size_t) destination->extent.y; #pragma omp parallel for schedule(static) shared(progress,status) \ magick_number_threads(destination_image,destination_image,height,1) #endif @@ -1030,7 +1030,7 @@ MagickExport MagickBooleanType TransferImageViewIterator(ImageView *source, status=MagickTrue; progress=0; #if defined(MAGICKCORE_OPENMP_SUPPORT) - height=source->extent.height-source->extent.y; + height=source->extent.height-(size_t) source->extent.y; #pragma omp parallel for schedule(static) shared(progress,status) \ magick_number_threads(source_image,destination_image,height,1) #endif @@ -1162,7 +1162,7 @@ MagickExport MagickBooleanType UpdateImageViewIterator(ImageView *source, status=MagickTrue; progress=0; #if defined(MAGICKCORE_OPENMP_SUPPORT) - height=source->extent.height-source->extent.y; + height=source->extent.height-(size_t) source->extent.y; #pragma omp parallel for schedule(static) shared(progress,status) \ magick_number_threads(source_image,source_image,height,1) #endif diff --git a/ImageMagick-7.1.1-15/MagickCore/image-view.h b/ImageMagick-7.1.1-16/MagickCore/image-view.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/image-view.h rename to ImageMagick-7.1.1-16/MagickCore/image-view.h diff --git a/ImageMagick-7.1.1-15/MagickCore/image.c b/ImageMagick-7.1.1-16/MagickCore/image.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/image.c rename to ImageMagick-7.1.1-16/MagickCore/image.c index 47513274..93f42fe3 100644 --- a/ImageMagick-7.1.1-15/MagickCore/image.c +++ b/ImageMagick-7.1.1-16/MagickCore/image.c @@ -158,19 +158,19 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info, image->depth=MAGICKCORE_QUANTUM_DEPTH; image->colorspace=sRGBColorspace; image->rendering_intent=PerceptualIntent; - image->gamma=1.000f/2.200f; - image->chromaticity.red_primary.x=0.6400f; - image->chromaticity.red_primary.y=0.3300f; - image->chromaticity.red_primary.z=0.0300f; - image->chromaticity.green_primary.x=0.3000f; - image->chromaticity.green_primary.y=0.6000f; - image->chromaticity.green_primary.z=0.1000f; - image->chromaticity.blue_primary.x=0.1500f; - image->chromaticity.blue_primary.y=0.0600f; - image->chromaticity.blue_primary.z=0.7900f; - image->chromaticity.white_point.x=0.3127f; - image->chromaticity.white_point.y=0.3290f; - image->chromaticity.white_point.z=0.3583f; + image->gamma=1.000/2.200; + image->chromaticity.red_primary.x=0.6400; + image->chromaticity.red_primary.y=0.3300; + image->chromaticity.red_primary.z=0.0300; + image->chromaticity.green_primary.x=0.3000; + image->chromaticity.green_primary.y=0.6000; + image->chromaticity.green_primary.z=0.1000; + image->chromaticity.blue_primary.x=0.1500; + image->chromaticity.blue_primary.y=0.0600; + image->chromaticity.blue_primary.z=0.7900; + image->chromaticity.white_point.x=0.3127; + image->chromaticity.white_point.y=0.3290; + image->chromaticity.white_point.z=0.3583; image->interlace=NoInterlace; image->ticks_per_second=UndefinedTicksPerSecond; image->compose=OverCompositeOp; @@ -1068,8 +1068,8 @@ MagickExport MagickBooleanType CopyImagePixels(Image *image, if (IsEventLogging() != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); if ((offset->x < 0) || (offset->y < 0) || - ((ssize_t) (offset->x+geometry->width) > (ssize_t) image->columns) || - ((ssize_t) (offset->y+geometry->height) > (ssize_t) image->rows)) + ((offset->x+(ssize_t) geometry->width) > (ssize_t) image->columns) || + ((offset->y+(ssize_t) geometry->height) > (ssize_t) image->rows)) ThrowBinaryException(OptionError,"GeometryDoesNotContainImage", image->filename); if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse) @@ -1744,7 +1744,7 @@ MagickExport size_t InterpretImageFilename(const ImageInfo *image_info, *q='\0'; (void) CopyMagickString(filename+(p-format-offset),option,(size_t) (MagickPathExtent-(p-format-offset))); - offset+=strlen(pattern)-strlen(option)+3; + offset+=(ssize_t) strlen(pattern)-(ssize_t) strlen(option)+3; *q=c; (void) ConcatenateMagickString(filename,r+1,MagickPathExtent); canonical=MagickTrue; @@ -1853,7 +1853,7 @@ MagickExport MagickBooleanType IsHighDynamicRangeImage(const Image *image, if (traits == UndefinedPixelTrait) continue; pixel=(double) p[i]; - if ((pixel < 0.0) || (pixel > QuantumRange) || + if ((pixel < 0.0) || (pixel > (double) QuantumRange) || (pixel != (double) ((QuantumAny) pixel))) break; } @@ -2192,13 +2192,13 @@ MagickExport MagickBooleanType ResetImagePage(Image *image,const char *page) { image->page.x=geometry.x; if ((image->page.width == 0) && (geometry.x > 0)) - image->page.width=image->columns+geometry.x; + image->page.width=(size_t) ((ssize_t) image->columns+geometry.x); } if ((flags & YValue) != 0) { image->page.y=geometry.y; if ((image->page.height == 0) && (geometry.y > 0)) - image->page.height=image->rows+geometry.y; + image->page.height=(size_t) ((ssize_t) image->rows+geometry.y); } } return(MagickTrue); @@ -3219,17 +3219,20 @@ MagickExport MagickBooleanType SetImageMask(Image *image,const PixelMask type, { case ReadPixelMask: { - image->channels=(ChannelType) (image->channels & ~ReadMaskChannel); + image->channels=(ChannelType) (image->channels & + (unsigned int) ~ReadMaskChannel); break; } case WritePixelMask: { - image->channels=(ChannelType) (image->channels & ~WriteMaskChannel); + image->channels=(ChannelType) (image->channels & + (unsigned int) ~WriteMaskChannel); magick_fallthrough; } default: { - image->channels=(ChannelType) (image->channels & ~CompositeMaskChannel); + image->channels=(ChannelType) (image->channels & + (unsigned int) ~CompositeMaskChannel); break; } } @@ -3376,17 +3379,20 @@ MagickExport MagickBooleanType SetImageRegionMask(Image *image, { case ReadPixelMask: { - image->channels=(ChannelType) (image->channels & ~ReadMaskChannel); + image->channels=(ChannelType) (image->channels & + (unsigned int) ~ReadMaskChannel); break; } case WritePixelMask: { - image->channels=(ChannelType) (image->channels & ~WriteMaskChannel); + image->channels=(ChannelType) (image->channels & + (unsigned int) ~WriteMaskChannel); break; } default: { - image->channels=(ChannelType) (image->channels & ~CompositeMaskChannel); + image->channels=(ChannelType) (image->channels & + (unsigned int) ~CompositeMaskChannel); break; } } @@ -3594,7 +3600,7 @@ static ssize_t SmushXGap(const Image *smush_image,const Image *images, p=GetCacheViewVirtualPixels(left_view,x,left_geometry.y+y,1,1,exception); if ((p == (const Quantum *) NULL) || (GetPixelAlpha(left_image,p) != TransparentAlpha) || - ((left_image->columns-x-1) >= gap)) + (((ssize_t) left_image->columns-x-1) >= (ssize_t) gap)) break; } i=(ssize_t) left_image->columns-x-1; @@ -3665,7 +3671,7 @@ static ssize_t SmushYGap(const Image *smush_image,const Image *images, p=GetCacheViewVirtualPixels(top_view,top_geometry.x+x,y,1,1,exception); if ((p == (const Quantum *) NULL) || (GetPixelAlpha(top_image,p) != TransparentAlpha) || - ((top_image->rows-y-1) >= gap)) + (((ssize_t) top_image->rows-y-1) >= (ssize_t) gap)) break; } i=(ssize_t) top_image->rows-y-1; @@ -3750,12 +3756,12 @@ MagickExport Image *SmushImages(const Image *images, width=next->columns; height+=next->rows; if (next->previous != (Image *) NULL) - height+=offset; + height=(size_t) MagickMax((ssize_t) height+offset,0U); continue; } width+=next->columns; if (next->previous != (Image *) NULL) - width+=offset; + width=(size_t) MagickMax((ssize_t) width+offset,0U); if (next->rows > height) height=next->rows; } diff --git a/ImageMagick-7.1.1-15/MagickCore/image.h b/ImageMagick-7.1.1-16/MagickCore/image.h similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/image.h rename to ImageMagick-7.1.1-16/MagickCore/image.h index b9d870a9..97478304 100644 --- a/ImageMagick-7.1.1-15/MagickCore/image.h +++ b/ImageMagick-7.1.1-16/MagickCore/image.h @@ -333,7 +333,7 @@ struct _Image MagickBooleanType debug; /* debug output attribute */ - volatile ssize_t + ssize_t reference_count; /* image data sharing memory management */ SemaphoreInfo diff --git a/ImageMagick-7.1.1-15/MagickCore/layer.c b/ImageMagick-7.1.1-16/MagickCore/layer.c similarity index 96% rename from ImageMagick-7.1.1-15/MagickCore/layer.c rename to ImageMagick-7.1.1-16/MagickCore/layer.c index d1280080..cca46950 100644 --- a/ImageMagick-7.1.1-15/MagickCore/layer.c +++ b/ImageMagick-7.1.1-16/MagickCore/layer.c @@ -256,13 +256,13 @@ MagickExport Image *CoalesceImages(const Image *image,ExceptionInfo *exception) { bounds.width=next->columns; if (bounds.x > 0) - bounds.width+=bounds.x; + bounds.width+=(size_t) bounds.x; } if (bounds.height == 0) { bounds.height=next->rows; if (bounds.y > 0) - bounds.height+=bounds.y; + bounds.height+=(size_t) bounds.y; } bounds.x=0; bounds.y=0; @@ -303,18 +303,18 @@ MagickExport Image *CoalesceImages(const Image *image,ExceptionInfo *exception) bounds.height=previous->rows; if (bounds.x < 0) { - bounds.width+=bounds.x; + bounds.width=(size_t) ((ssize_t) bounds.width+bounds.x); bounds.x=0; } - if ((ssize_t) (bounds.x+bounds.width) > (ssize_t) coalesce_image->columns) - bounds.width=coalesce_image->columns-bounds.x; + if ((bounds.x+(ssize_t) bounds.width) > (ssize_t) coalesce_image->columns) + bounds.width=(size_t) ((ssize_t) coalesce_image->columns-bounds.x); if (bounds.y < 0) { - bounds.height+=bounds.y; + bounds.height=(size_t) ((ssize_t) bounds.height+bounds.y); bounds.y=0; } - if ((ssize_t) (bounds.y+bounds.height) > (ssize_t) coalesce_image->rows) - bounds.height=coalesce_image->rows-bounds.y; + if ((bounds.y+(ssize_t) bounds.height) > (ssize_t) coalesce_image->rows) + bounds.height=(size_t) ((ssize_t) coalesce_image->rows-bounds.y); /* Replace the dispose image with the new coalesced image. */ @@ -460,18 +460,18 @@ MagickExport Image *DisposeImages(const Image *images,ExceptionInfo *exception) bounds.height=next->rows; if (bounds.x < 0) { - bounds.width+=bounds.x; + bounds.width=(size_t) ((ssize_t) bounds.width+bounds.x); bounds.x=0; } - if ((ssize_t) (bounds.x+bounds.width) > (ssize_t) current_image->columns) - bounds.width=current_image->columns-bounds.x; + if ((bounds.x+(ssize_t) bounds.width) > (ssize_t) current_image->columns) + bounds.width=(size_t) ((ssize_t) current_image->columns-bounds.x); if (bounds.y < 0) { - bounds.height+=bounds.y; + bounds.height=(size_t) ((ssize_t) bounds.height+bounds.y); bounds.y=0; } - if ((ssize_t) (bounds.y+bounds.height) > (ssize_t) current_image->rows) - bounds.height=current_image->rows-bounds.y; + if ((bounds.y+(ssize_t) bounds.height) > (ssize_t) current_image->rows) + bounds.height=(size_t) ((ssize_t) current_image->rows-bounds.y); ClearBounds(current_image,&bounds,exception); } /* @@ -556,8 +556,10 @@ static MagickBooleanType ComparePixels(const LayerMethod method, */ if (method == CompareAnyLayer) return(IsFuzzyEquivalencePixelInfo(p,q) == MagickFalse ? MagickTrue : MagickFalse); - o1 = (p->alpha_trait != UndefinedPixelTrait) ? p->alpha : OpaqueAlpha; - o2 = (q->alpha_trait != UndefinedPixelTrait) ? q->alpha : OpaqueAlpha; + o1 = (p->alpha_trait != UndefinedPixelTrait) ? p->alpha : (double) + OpaqueAlpha; + o2 = (q->alpha_trait != UndefinedPixelTrait) ? q->alpha : (double) + OpaqueAlpha; /* Pixel goes from opaque to transparency. */ @@ -943,6 +945,12 @@ MagickExport Image *CompareImagesLayers(const Image *image, static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method, ExceptionInfo *exception) { + const Image + *curr; + + DisposeType + *disposals; + ExceptionInfo *sans_exception; @@ -963,12 +971,6 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method, try_cleared, cleared; - DisposeType - *disposals; - - const Image - *curr; - ssize_t i; @@ -1200,29 +1202,33 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method, #endif if ( try_bounds.x < bgnd_bounds.x ) { - bgnd_bounds.width+= bgnd_bounds.x-try_bounds.x; + bgnd_bounds.width=(size_t) ((ssize_t) bgnd_bounds.width+ + bgnd_bounds.x-try_bounds.x); if ( bgnd_bounds.width < try_bounds.width ) bgnd_bounds.width = try_bounds.width; bgnd_bounds.x = try_bounds.x; } else { - try_bounds.width += try_bounds.x - bgnd_bounds.x; + try_bounds.width=(size_t) ((ssize_t) try_bounds.width+ + try_bounds.x-bgnd_bounds.x); if ( bgnd_bounds.width < try_bounds.width ) bgnd_bounds.width = try_bounds.width; } if ( try_bounds.y < bgnd_bounds.y ) { - bgnd_bounds.height += bgnd_bounds.y - try_bounds.y; - if ( bgnd_bounds.height < try_bounds.height ) - bgnd_bounds.height = try_bounds.height; - bgnd_bounds.y = try_bounds.y; + bgnd_bounds.height=(size_t) ((ssize_t) bgnd_bounds.height+ + bgnd_bounds.y-try_bounds.y); + if (bgnd_bounds.height < try_bounds.height) + bgnd_bounds.height=try_bounds.height; + bgnd_bounds.y=try_bounds.y; } else { - try_bounds.height += try_bounds.y - bgnd_bounds.y; - if ( bgnd_bounds.height < try_bounds.height ) - bgnd_bounds.height = try_bounds.height; + try_bounds.height=(size_t) ((ssize_t) try_bounds.height+ + try_bounds.y-bgnd_bounds.y); + if ( bgnd_bounds.height < try_bounds.height ) + bgnd_bounds.height = try_bounds.height; } #if DEBUG_OPT_FRAME (void) FormatLocaleFile(stderr, " to : %.20gx%.20g%+.20g%+.20g\n", @@ -1365,7 +1371,7 @@ static Image *OptimizeLayerFrames(const Image *image,const LayerMethod method, time += (size_t)(curr->delay*1000* PerceptibleReciprocal((double) curr->ticks_per_second)); prev_image->ticks_per_second = 100L; - prev_image->delay = time*prev_image->ticks_per_second/1000; + prev_image->delay = time*(size_t) prev_image->ticks_per_second/1000; } bgnd_image=CropImage(prev_image,&bounds[i],sans_exception); prev_image=DestroyImage(prev_image); @@ -1553,18 +1559,18 @@ MagickExport void OptimizeImageTransparency(const Image *image, bounds.height=next->rows; if (bounds.x < 0) { - bounds.width+=bounds.x; + bounds.width=(size_t) ((ssize_t) bounds.width+bounds.x); bounds.x=0; } - if ((ssize_t) (bounds.x+bounds.width) > (ssize_t) current_image->columns) - bounds.width=current_image->columns-bounds.x; + if ((bounds.x+(ssize_t) bounds.width) > (ssize_t) current_image->columns) + bounds.width=(size_t) ((ssize_t) current_image->columns-bounds.x); if (bounds.y < 0) { - bounds.height+=bounds.y; + bounds.height=(size_t) ((ssize_t) bounds.height+bounds.y); bounds.y=0; } - if ((ssize_t) (bounds.y+bounds.height) > (ssize_t) current_image->rows) - bounds.height=current_image->rows-bounds.y; + if ((bounds.y+(ssize_t) bounds.height) > (ssize_t) current_image->rows) + bounds.height=(size_t) ((ssize_t) current_image->rows-bounds.y); ClearBounds(current_image,&bounds,exception); } if (next->dispose != PreviousDispose) @@ -1654,7 +1660,7 @@ MagickExport void RemoveDuplicateLayers(Image **images,ExceptionInfo *exception) time+=(size_t) (1000.0*next->delay* PerceptibleReciprocal((double) next->ticks_per_second)); next->ticks_per_second=100L; - next->delay=time*image->ticks_per_second/1000; + next->delay=time*(size_t) image->ticks_per_second/1000; next->iterations=image->iterations; *images=image; (void) DeleteImageFromList(images); @@ -1986,18 +1992,18 @@ MagickExport Image *MergeImageLayers(Image *image,const LayerMethod method, { if (page.x > next->page.x) { - width+=page.x-next->page.x; + width=(size_t) ((ssize_t) width+page.x-next->page.x); page.x=next->page.x; } if (page.y > next->page.y) { - height+=page.y-next->page.y; + height=(size_t) ((ssize_t) height+page.y-next->page.y); page.y=next->page.y; } if ((ssize_t) width < (next->page.x+(ssize_t) next->columns-page.x)) - width=(size_t) next->page.x+(ssize_t) next->columns-page.x; + width=(size_t) (next->page.x+(ssize_t) next->columns-page.x); if ((ssize_t) height < (next->page.y+(ssize_t) next->rows-page.y)) - height=(size_t) next->page.y+(ssize_t) next->rows-page.y; + height=(size_t) (next->page.y+(ssize_t) next->rows-page.y); } break; } @@ -2035,9 +2041,9 @@ MagickExport Image *MergeImageLayers(Image *image,const LayerMethod method, Set virtual canvas size if not defined. */ if (page.width == 0) - page.width=page.x < 0 ? width : width+page.x; + page.width=page.x < 0 ? width : (size_t) ((ssize_t) width+page.x); if (page.height == 0) - page.height=page.y < 0 ? height : height+page.y; + page.height=page.y < 0 ? height : (size_t) ((ssize_t) height+page.y); /* Handle "TrimBoundsLayer" method separately to normal 'layer merge'. */ diff --git a/ImageMagick-7.1.1-15/MagickCore/layer.h b/ImageMagick-7.1.1-16/MagickCore/layer.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/layer.h rename to ImageMagick-7.1.1-16/MagickCore/layer.h diff --git a/ImageMagick-7.1.1-15/MagickCore/linked-list-private.h b/ImageMagick-7.1.1-16/MagickCore/linked-list-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/linked-list-private.h rename to ImageMagick-7.1.1-16/MagickCore/linked-list-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/linked-list.c b/ImageMagick-7.1.1-16/MagickCore/linked-list.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/linked-list.c rename to ImageMagick-7.1.1-16/MagickCore/linked-list.c diff --git a/ImageMagick-7.1.1-15/MagickCore/linked-list.h b/ImageMagick-7.1.1-16/MagickCore/linked-list.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/linked-list.h rename to ImageMagick-7.1.1-16/MagickCore/linked-list.h diff --git a/ImageMagick-7.1.1-15/MagickCore/list.c b/ImageMagick-7.1.1-16/MagickCore/list.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/list.c rename to ImageMagick-7.1.1-16/MagickCore/list.c index c692e330..e9cc022d 100644 --- a/ImageMagick-7.1.1-15/MagickCore/list.c +++ b/ImageMagick-7.1.1-16/MagickCore/list.c @@ -254,7 +254,7 @@ MagickExport Image *CloneImages(const Image *images,const char *scenes, else if (first > (ssize_t) length) first=(ssize_t) length; - first%=(length << 1); + first%=(ssize_t) (length << 1); last=first; while (isspace((int) ((unsigned char) *p)) != 0) p++; @@ -267,7 +267,7 @@ MagickExport Image *CloneImages(const Image *images,const char *scenes, if (last > (ssize_t) length) last=(ssize_t) length; } - last%=(length << 1); + last%=(ssize_t) (length << 1); match=MagickFalse; step=1; if (artifact != (const char *) NULL) diff --git a/ImageMagick-7.1.1-15/MagickCore/list.h b/ImageMagick-7.1.1-16/MagickCore/list.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/list.h rename to ImageMagick-7.1.1-16/MagickCore/list.h diff --git a/ImageMagick-7.1.1-15/MagickCore/locale-private.h b/ImageMagick-7.1.1-16/MagickCore/locale-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/locale-private.h rename to ImageMagick-7.1.1-16/MagickCore/locale-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/locale.c b/ImageMagick-7.1.1-16/MagickCore/locale.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/locale.c rename to ImageMagick-7.1.1-16/MagickCore/locale.c index 558ff6a5..15419a75 100644 --- a/ImageMagick-7.1.1-15/MagickCore/locale.c +++ b/ImageMagick-7.1.1-16/MagickCore/locale.c @@ -1266,8 +1266,8 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *cache,const char *xml, file_xml=FileToXML(path,~0UL); if (file_xml != (char *) NULL) { - status&=LoadLocaleCache(cache,file_xml,path,locale, - depth+1,exception); + status&=(MagickStatusType) LoadLocaleCache(cache,file_xml, + path,locale,depth+1,exception); file_xml=DestroyString(file_xml); } } diff --git a/ImageMagick-7.1.1-15/MagickCore/locale_.h b/ImageMagick-7.1.1-16/MagickCore/locale_.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/locale_.h rename to ImageMagick-7.1.1-16/MagickCore/locale_.h diff --git a/ImageMagick-7.1.1-15/MagickCore/log-private.h b/ImageMagick-7.1.1-16/MagickCore/log-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/log-private.h rename to ImageMagick-7.1.1-16/MagickCore/log-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/log.c b/ImageMagick-7.1.1-16/MagickCore/log.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/log.c rename to ImageMagick-7.1.1-16/MagickCore/log.c index 4c439aed..d0175c76 100644 --- a/ImageMagick-7.1.1-15/MagickCore/log.c +++ b/ImageMagick-7.1.1-16/MagickCore/log.c @@ -294,8 +294,8 @@ static LinkedListInfo *AcquireLogCache(const char *filename, option=(const StringInfo *) GetNextValueInLinkedList(options); while (option != (const StringInfo *) NULL) { - status&=LoadLogCache(cache,(const char *) GetStringInfoDatum(option), - GetStringInfoPath(option),0,exception); + status&=(MagickStatusType) LoadLogCache(cache,(const char *) + GetStringInfoDatum(option),GetStringInfoPath(option),0,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); } options=DestroyConfigureOptions(options); @@ -330,7 +330,7 @@ static LinkedListInfo *AcquireLogCache(const char *filename, log_info->filename=ConstantString(p->filename); log_info->format=ConstantString(p->format); log_info->signature=MagickCoreSignature; - status&=AppendValueToLinkedList(cache,log_info); + status&=(MagickStatusType) AppendValueToLinkedList(cache,log_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",log_info->name); @@ -847,7 +847,7 @@ MagickExport MagickBooleanType ListLogInfo(FILE *file,ExceptionInfo *exception) break; mask=1; mask<<=j; - if ((log_info[i]->handler_mask & mask) != 0) + if (((size_t) log_info[i]->handler_mask & mask) != 0) { (void) FormatLocaleFile(file,"%s ",LogHandlers[j].name); length+=strlen(LogHandlers[j].name); @@ -996,8 +996,8 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *cache,const char *xml, file_xml=FileToXML(path,~0UL); if (file_xml != (char *) NULL) { - status&=LoadLogCache(cache,file_xml,path,depth+1, - exception); + status&=(MagickStatusType) LoadLogCache(cache,file_xml, + path,depth+1,exception); file_xml=DestroyString(file_xml); } } diff --git a/ImageMagick-7.1.1-15/MagickCore/log.h b/ImageMagick-7.1.1-16/MagickCore/log.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/log.h rename to ImageMagick-7.1.1-16/MagickCore/log.h diff --git a/ImageMagick-7.1.1-15/MagickCore/magic-private.h b/ImageMagick-7.1.1-16/MagickCore/magic-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/magic-private.h rename to ImageMagick-7.1.1-16/MagickCore/magic-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/magic.c b/ImageMagick-7.1.1-16/MagickCore/magic.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/magic.c rename to ImageMagick-7.1.1-16/MagickCore/magic.c index cdf052c8..bbf996ed 100644 --- a/ImageMagick-7.1.1-15/MagickCore/magic.c +++ b/ImageMagick-7.1.1-16/MagickCore/magic.c @@ -223,8 +223,8 @@ static LinkedListInfo *AcquireMagicList(ExceptionInfo *exception) magic_info->length=p->length; magic_info->skip_spaces=p->skip_spaces; magic_info->signature=MagickCoreSignature; - status&=InsertValueInSortedLinkedList(list,CompareMagickInfoExtent, - NULL,magic_info); + status&=(MagickStatusType) InsertValueInSortedLinkedList(list, + CompareMagickInfoExtent,NULL,magic_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",magic_info->name); diff --git a/ImageMagick-7.1.1-15/MagickCore/magic.h b/ImageMagick-7.1.1-16/MagickCore/magic.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/magic.h rename to ImageMagick-7.1.1-16/MagickCore/magic.h diff --git a/ImageMagick-7.1.1-15/MagickCore/magick-config.h b/ImageMagick-7.1.1-16/MagickCore/magick-config.h similarity index 92% rename from ImageMagick-7.1.1-15/MagickCore/magick-config.h rename to ImageMagick-7.1.1-16/MagickCore/magick-config.h index cd5ef553..4b5dc069 100644 --- a/ImageMagick-7.1.1-15/MagickCore/magick-config.h +++ b/ImageMagick-7.1.1-16/MagickCore/magick-config.h @@ -81,13 +81,6 @@ extern "C" { # endif #endif - -#if !defined(MAGICKCORE_HDRI_ENABLE) && defined(MAGICKCORE_HDRI_ENABLE_OBSOLETE_IN_H) -# warning "you should set MAGICKCORE_HDRI_ENABLE to sensible default set it to configure time default" -# warning "this is an obsolete behavior please fix yours makefile" -# define MAGICKCORE_HDRI_ENABLE MAGICKCORE_HDRI_ENABLE_OBSOLETE_IN_H -#endif - /* whether HDRI is enable */ #if !defined(MAGICKCORE_HDRI_ENABLE) # error "you should set MAGICKCORE_HDRI_ENABLE" @@ -96,6 +89,9 @@ extern "C" { #if MAGICKCORE_HDRI_ENABLE # define MAGICKCORE_HDRI_SUPPORT 1 #endif +#if MAGICKCORE_CHANNEL_MASK_DEPTH == 64 +# define MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT 1 +#endif /* Compatibility block */ #if !defined(MAGICKCORE_QUANTUM_DEPTH) && defined(MAGICKCORE_QUANTUM_DEPTH_OBSOLETE_IN_H) @@ -120,13 +116,6 @@ extern "C" { # endif #endif - -#if !defined(MAGICKCORE_HDRI_ENABLE) && defined(MAGICKCORE_HDRI_ENABLE_OBSOLETE_IN_H) -# warning "you should set MAGICKCORE_HDRI_ENABLE to sensible default set it to configure time default" -# warning "this is an obsolete behavior please fix yours makefile" -# define MAGICKCORE_HDRI_ENABLE MAGICKCORE_HDRI_ENABLE_OBSOLETE_IN_H -#endif - /* whether HDRI is enable */ #if !defined(MAGICKCORE_HDRI_ENABLE) # error "you should set MAGICKCORE_HDRI_ENABLE" @@ -146,9 +135,9 @@ extern "C" { /* ABI SUFFIX */ #ifndef MAGICKCORE_HDRI_SUPPORT #define MAGICKCORE_ABI_SUFFIX "Q" MAGICKCORE_STRING_XQUOTE(MAGICKCORE_QUANTUM_DEPTH) -#else +#else #define MAGICKCORE_ABI_SUFFIX "Q" MAGICKCORE_STRING_XQUOTE(MAGICKCORE_QUANTUM_DEPTH) "HDRI" -#endif +#endif /* some path game */ #if !defined __CYGWIN__ @@ -161,7 +150,7 @@ extern "C" { # define MAGICKCORE_PATH_SEPARATOR ";" # endif #endif - + /* posix */ #ifndef MAGICKCORE_DIR_SEPARATOR_CHAR /* Assume that not having this is an indicator that all @@ -173,20 +162,20 @@ extern "C" { #endif /* !DIR_SEPARATOR_CHAR */ # if defined(MAGICKCORE_POSIX_SUPPORT) || defined(__MINGW32__) - + /* module dir */ #ifndef MAGICKCORE_MODULES_DIRNAME # define MAGICKCORE_MODULES_DIRNAME MAGICKCORE_MODULES_BASEDIRNAME "-" MAGICKCORE_ABI_SUFFIX #endif - + #ifndef MAGICKCORE_MODULES_PATH # define MAGICKCORE_MODULES_PATH MAGICKCORE_LIBRARY_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_MODULES_DIRNAME #endif - + #ifndef MAGICKCORE_MODULES_RELATIVE_PATH #define MAGICKCORE_MODULES_RELATIVE_PATH MAGICKCORE_LIBRARY_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_MODULES_DIRNAME #endif - + /* Subdirectory under lib to place ImageMagick coder module files */ #ifndef MAGICKCORE_CODER_PATH # if defined(vms) @@ -195,11 +184,11 @@ extern "C" { # define MAGICKCORE_CODER_PATH MAGICKCORE_MODULES_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_CODER_DIRNAME # endif #endif - + #ifndef MAGICKCORE_CODER_RELATIVE_PATH # define MAGICKCORE_CODER_RELATIVE_PATH MAGICKCORE_MODULES_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_CODER_DIRNAME #endif - + /* subdirectory under lib to place ImageMagick filter module files */ #ifndef MAGICKCORE_FILTER_PATH # if defined(vms) @@ -208,7 +197,7 @@ extern "C" { # define MAGICKCORE_FILTER_PATH MAGICKCORE_MODULES_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_FILTER_DIRNAME # endif #endif - + #ifndef MAGICKCORE_FILTER_RELATIVE_PATH # define MAGICKCORE_FILTER_RELATIVE_PATH MAGICKCORE_MODULES_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_FILTER_DIRNAME #endif @@ -217,11 +206,11 @@ extern "C" { #ifndef MAGICKCORE_SHAREARCH_DIRNAME # define MAGICKCORE_SHAREARCH_DIRNAME MAGICKCORE_SHAREARCH_BASEDIRNAME "-" MAGICKCORE_ABI_SUFFIX #endif - + #ifndef MAGICKCORE_SHAREARCH_PATH # define MAGICKCORE_SHAREARCH_PATH MAGICKCORE_LIBRARY_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_SHAREARCH_DIRNAME MAGICKCORE_DIR_SEPARATOR #endif - + #ifndef MAGICKCORE_SHAREARCH_RELATIVE_PATH #define MAGICKCORE_SHAREARCH_RELATIVE_PATH MAGICKCORE_LIBRARY_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_SHAREARCH_DIRNAME #endif @@ -263,9 +252,9 @@ extern "C" { #define MAGICKCORE_ALIGN_UP(n, power_of_2) \ MAGICKCORE_ALIGN_DOWN((n) + MAGICKCORE_MAX_ALIGNMENT_PADDING(power_of_2),power_of_2) - + #if defined(__cplusplus) || defined(c_plusplus) } #endif - + #endif diff --git a/ImageMagick-7.1.1-15/MagickCore/magick-private.h b/ImageMagick-7.1.1-16/MagickCore/magick-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/magick-private.h rename to ImageMagick-7.1.1-16/MagickCore/magick-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/magick-type.h b/ImageMagick-7.1.1-16/MagickCore/magick-type.h similarity index 96% rename from ImageMagick-7.1.1-15/MagickCore/magick-type.h rename to ImageMagick-7.1.1-16/MagickCore/magick-type.h index 75a11ee2..9a993946 100644 --- a/ImageMagick-7.1.1-15/MagickCore/magick-type.h +++ b/ImageMagick-7.1.1-16/MagickCore/magick-type.h @@ -67,7 +67,7 @@ typedef double MagickDoubleType; #if defined(MAGICKCORE_HDRI_SUPPORT) typedef MagickFloatType Quantum; -#define QuantumRange 255.0 +#define QuantumRange ((Quantum) 255.0) #define QuantumFormat "%g" #else typedef unsigned char Quantum; @@ -80,7 +80,7 @@ typedef unsigned char Quantum; #if defined(MAGICKCORE_HDRI_SUPPORT) typedef MagickFloatType Quantum; -#define QuantumRange 65535.0f +#define QuantumRange ((Quantum) 65535.0) #define QuantumFormat "%g" #else typedef unsigned short Quantum; @@ -93,7 +93,7 @@ typedef unsigned short Quantum; #if defined(MAGICKCORE_HDRI_SUPPORT) typedef MagickDoubleType Quantum; -#define QuantumRange 4294967295.0 +#define QuantumRange ((Quantum) 4294967295.0) #define QuantumFormat "%g" #else typedef unsigned int Quantum; @@ -106,7 +106,7 @@ typedef unsigned int Quantum; #define MaxMap 65535UL typedef MagickDoubleType Quantum; -#define QuantumRange 18446744073709551615.0 +#define QuantumRange ((Quantum) 18446744073709551615.0) #define QuantumFormat "%g" #else #error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64" diff --git a/ImageMagick-7.1.1-15/MagickCore/magick.c b/ImageMagick-7.1.1-16/MagickCore/magick.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/magick.c rename to ImageMagick-7.1.1-16/MagickCore/magick.c index bf347f41..13e2bd48 100644 --- a/ImageMagick-7.1.1-15/MagickCore/magick.c +++ b/ImageMagick-7.1.1-16/MagickCore/magick.c @@ -1606,7 +1606,29 @@ MagickExport void MagickCoreGenesis(const char *path, % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% MagickCoreTerminus() destroys the MagickCore environment. +% MagickCoreTerminus() is a function in the ImageMagick library that is +% used to clean up and release resources when shutting down an application +% that uses ImageMagick. This function should be called in the primary thread +% of the application's process during the shutdown process. It's crucial that +% this function is invoked only after any threads that are using ImageMagick +% functions have terminated. +% +% ImageMagick might internally use threads via OpenMP (a method for parallel +% programming). As a result, it's important to ensure that any function calls +% into ImageMagick have completed before calling MagickCoreTerminus(). This +% prevents issues with OpenMP worker threads accessing resources that are +% destroyed by this termination function. +% +% If OpenMP is being used (starting from version 5.0), the OpenMP +% implementation itself handles starting and stopping worker threads and +% allocating and freeing resources using its own methods. This means that +% after calling MagickCoreTerminus(), some OpenMP resources and worker +% threads might still remain allocated. To address this, the function +% omp_pause_resource_all(omp_pause_hard) can be invoked. This function, +% introduced in OpenMP version 5.0, ensures that any resources allocated by +% OpenMP (such as threads and thread-specific memory) are freed. It's +% recommended to call this function after MagickCoreTerminus() has completed +% its execution. % % The format of the MagickCoreTerminus function is: % diff --git a/ImageMagick-7.1.1-15/MagickCore/magick.h b/ImageMagick-7.1.1-16/MagickCore/magick.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/magick.h rename to ImageMagick-7.1.1-16/MagickCore/magick.h diff --git a/ImageMagick-7.1.1-15/MagickCore/matrix-private.h b/ImageMagick-7.1.1-16/MagickCore/matrix-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/matrix-private.h rename to ImageMagick-7.1.1-16/MagickCore/matrix-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/matrix.c b/ImageMagick-7.1.1-16/MagickCore/matrix.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/matrix.c rename to ImageMagick-7.1.1-16/MagickCore/matrix.c index 0ec9c179..f51543cd 100644 --- a/ImageMagick-7.1.1-15/MagickCore/matrix.c +++ b/ImageMagick-7.1.1-16/MagickCore/matrix.c @@ -151,11 +151,11 @@ static inline MagickOffsetType WriteMatrixElements( for (i=0; i < (MagickOffsetType) length; i+=count) { #if !defined(MAGICKCORE_HAVE_PWRITE) - count=write(matrix_info->file,buffer+i,(size_t) MagickMin(length-i, - (MagickSizeType) MAGICK_SSIZE_MAX)); + count=write(matrix_info->file,buffer+i,(size_t) MagickMin(length- + (MagickSizeType) i,(MagickSizeType) MAGICK_SSIZE_MAX)); #else - count=pwrite(matrix_info->file,buffer+i,(size_t) MagickMin(length-i, - (MagickSizeType) MAGICK_SSIZE_MAX),(off_t) (offset+i)); + count=pwrite(matrix_info->file,buffer+i,(size_t) MagickMin(length- + (MagickSizeType) i,(MagickSizeType) MAGICK_SSIZE_MAX),offset+i); #endif if (count <= 0) { @@ -687,8 +687,8 @@ static inline MagickOffsetType ReadMatrixElements( count=read(matrix_info->file,buffer+i,(size_t) MagickMin(length-i, (MagickSizeType) MAGICK_SSIZE_MAX)); #else - count=pread(matrix_info->file,buffer+i,(size_t) MagickMin(length-i, - (MagickSizeType) MAGICK_SSIZE_MAX),(off_t) (offset+i)); + count=pread(matrix_info->file,buffer+i,(size_t) MagickMin(length- + (MagickSizeType) i,(MagickSizeType) MAGICK_SSIZE_MAX),offset+i); #endif if (count <= 0) { @@ -712,15 +712,15 @@ MagickExport MagickBooleanType GetMatrixElement(const MatrixInfo *matrix_info, assert(matrix_info != (const MatrixInfo *) NULL); assert(matrix_info->signature == MagickCoreSignature); - i=(MagickOffsetType) EdgeY(y,matrix_info->rows)*matrix_info->columns+ + i=EdgeY(y,matrix_info->rows)*(MagickOffsetType) matrix_info->columns+ EdgeX(x,matrix_info->columns); if (matrix_info->type != DiskCache) { (void) memcpy(value,(unsigned char *) matrix_info->elements+i* - matrix_info->stride,matrix_info->stride); + (MagickOffsetType) matrix_info->stride,matrix_info->stride); return(MagickTrue); } - count=ReadMatrixElements(matrix_info,i*matrix_info->stride, + count=ReadMatrixElements(matrix_info,i*(MagickOffsetType) matrix_info->stride, matrix_info->stride,(unsigned char *) value); if (count != (MagickOffsetType) matrix_info->stride) return(MagickFalse); @@ -1117,18 +1117,18 @@ MagickExport MagickBooleanType SetMatrixElement(const MatrixInfo *matrix_info, assert(matrix_info != (const MatrixInfo *) NULL); assert(matrix_info->signature == MagickCoreSignature); - i=(MagickOffsetType) y*matrix_info->columns+x; + i=y*(MagickOffsetType) matrix_info->columns+x; if ((i < 0) || - ((MagickSizeType) (i*matrix_info->stride) >= matrix_info->length)) + (((MagickSizeType) i*matrix_info->stride) >= matrix_info->length)) return(MagickFalse); if (matrix_info->type != DiskCache) { (void) memcpy((unsigned char *) matrix_info->elements+i* - matrix_info->stride,value,matrix_info->stride); + (MagickOffsetType) matrix_info->stride,value,matrix_info->stride); return(MagickTrue); } - count=WriteMatrixElements(matrix_info,i*matrix_info->stride, - matrix_info->stride,(unsigned char *) value); + count=WriteMatrixElements(matrix_info,i*(MagickOffsetType) + matrix_info->stride,matrix_info->stride,(unsigned char *) value); if (count != (MagickOffsetType) matrix_info->stride) return(MagickFalse); return(MagickTrue); diff --git a/ImageMagick-7.1.1-15/MagickCore/matrix.h b/ImageMagick-7.1.1-16/MagickCore/matrix.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/matrix.h rename to ImageMagick-7.1.1-16/MagickCore/matrix.h diff --git a/ImageMagick-7.1.1-15/MagickCore/memory-private.h b/ImageMagick-7.1.1-16/MagickCore/memory-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/memory-private.h rename to ImageMagick-7.1.1-16/MagickCore/memory-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/memory.c b/ImageMagick-7.1.1-16/MagickCore/memory.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/memory.c rename to ImageMagick-7.1.1-16/MagickCore/memory.c index d4d5c590..d8473b83 100644 --- a/ImageMagick-7.1.1-15/MagickCore/memory.c +++ b/ImageMagick-7.1.1-16/MagickCore/memory.c @@ -771,7 +771,7 @@ MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count, MagickOffsetType offset; - offset=(MagickOffsetType) lseek(file,size-1,SEEK_SET); + offset=(MagickOffsetType) lseek(file,(off_t) (size-1),SEEK_SET); if ((offset == (MagickOffsetType) (size-1)) && (write(file,"",1) == 1)) { diff --git a/ImageMagick-7.1.1-15/MagickCore/memory_.h b/ImageMagick-7.1.1-16/MagickCore/memory_.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/memory_.h rename to ImageMagick-7.1.1-16/MagickCore/memory_.h diff --git a/ImageMagick-7.1.1-15/MagickCore/method-attribute.h b/ImageMagick-7.1.1-16/MagickCore/method-attribute.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/method-attribute.h rename to ImageMagick-7.1.1-16/MagickCore/method-attribute.h diff --git a/ImageMagick-7.1.1-15/MagickCore/methods.h b/ImageMagick-7.1.1-16/MagickCore/methods.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/methods.h rename to ImageMagick-7.1.1-16/MagickCore/methods.h diff --git a/ImageMagick-7.1.1-15/MagickCore/mime-private.h b/ImageMagick-7.1.1-16/MagickCore/mime-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/mime-private.h rename to ImageMagick-7.1.1-16/MagickCore/mime-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/mime.c b/ImageMagick-7.1.1-16/MagickCore/mime.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/mime.c rename to ImageMagick-7.1.1-16/MagickCore/mime.c index 405a255e..06c9cbae 100644 --- a/ImageMagick-7.1.1-15/MagickCore/mime.c +++ b/ImageMagick-7.1.1-16/MagickCore/mime.c @@ -366,7 +366,7 @@ MagickExport const MimeInfo *GetMimeInfo(const char *filename, { for (i=0; i <= (ssize_t) q->extent; i++) { - if ((size_t) (q->offset+i+q->length) > length) + if ((size_t) (q->offset+i+(ssize_t) q->length) > length) break; if (memcmp(magic+q->offset+i,q->magic,q->length) == 0) { @@ -854,7 +854,8 @@ static MagickBooleanType LoadMimeCache(LinkedListInfo *cache,const char *xml, file_xml=FileToXML(path,~0UL); if (file_xml != (char *) NULL) { - status&=LoadMimeCache(cache,file_xml,path,depth+1,exception); + status&=(MagickStatusType) LoadMimeCache(cache,file_xml,path, + depth+1,exception); file_xml=DestroyString(file_xml); } } diff --git a/ImageMagick-7.1.1-15/MagickCore/mime.h b/ImageMagick-7.1.1-16/MagickCore/mime.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/mime.h rename to ImageMagick-7.1.1-16/MagickCore/mime.h diff --git a/ImageMagick-7.1.1-15/MagickCore/module-private.h b/ImageMagick-7.1.1-16/MagickCore/module-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/module-private.h rename to ImageMagick-7.1.1-16/MagickCore/module-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/module.c b/ImageMagick-7.1.1-16/MagickCore/module.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/module.c rename to ImageMagick-7.1.1-16/MagickCore/module.c index f53470d7..2566ed1f 100644 --- a/ImageMagick-7.1.1-15/MagickCore/module.c +++ b/ImageMagick-7.1.1-16/MagickCore/module.c @@ -1259,6 +1259,7 @@ MagickPrivate MagickBooleanType OpenModule(const char *module, p=GetCoderInfo(module,exception); if (p != (CoderInfo *) NULL) (void) CopyMagickString(module_name,p->name,MagickPathExtent); + LocaleUpper(module_name); rights=(PolicyRights) (ReadPolicyRights | WritePolicyRights); if (IsRightsAuthorized(ModulePolicyDomain,rights,module_name) == MagickFalse) { diff --git a/ImageMagick-7.1.1-15/MagickCore/module.h b/ImageMagick-7.1.1-16/MagickCore/module.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/module.h rename to ImageMagick-7.1.1-16/MagickCore/module.h diff --git a/ImageMagick-7.1.1-15/MagickCore/monitor-private.h b/ImageMagick-7.1.1-16/MagickCore/monitor-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/monitor-private.h rename to ImageMagick-7.1.1-16/MagickCore/monitor-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/monitor.c b/ImageMagick-7.1.1-16/MagickCore/monitor.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/monitor.c rename to ImageMagick-7.1.1-16/MagickCore/monitor.c diff --git a/ImageMagick-7.1.1-15/MagickCore/monitor.h b/ImageMagick-7.1.1-16/MagickCore/monitor.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/monitor.h rename to ImageMagick-7.1.1-16/MagickCore/monitor.h diff --git a/ImageMagick-7.1.1-15/MagickCore/montage.c b/ImageMagick-7.1.1-16/MagickCore/montage.c similarity index 96% rename from ImageMagick-7.1.1-15/MagickCore/montage.c rename to ImageMagick-7.1.1-16/MagickCore/montage.c index 6873a4b6..5591d289 100644 --- a/ImageMagick-7.1.1-15/MagickCore/montage.c +++ b/ImageMagick-7.1.1-16/MagickCore/montage.c @@ -595,19 +595,19 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info, if (image_list[tile]->rows > max_height) max_height=image_list[tile]->rows; } - x_offset+=(ssize_t) (width+2*(extract_info.x+border_width)); + x_offset+=((ssize_t) width+2*(extract_info.x+(ssize_t) border_width)); if (x_offset > (ssize_t) bounds.width) bounds.width=(size_t) x_offset; if (((tile+1) == (ssize_t) tiles_per_page) || - (((tile+1) % tiles_per_row) == 0)) + (((tile+1) % (ssize_t) tiles_per_row) == 0)) { x_offset=0; if (montage_info->tile != (char *) NULL) GetMontageGeometry(montage_info->tile,number_images,&x_offset,&y, &sans,&sans); height=concatenate != MagickFalse ? max_height : extract_info.height; - y_offset+=(ssize_t) (height+(extract_info.y+(ssize_t) border_width)*2+ - (metrics.ascent-metrics.descent+4)*number_lines+ + y_offset+=((ssize_t) height+(extract_info.y+(ssize_t) border_width)*2+ + (metrics.ascent-metrics.descent+4)*(ssize_t) number_lines+ (montage_info->shadow != MagickFalse ? 4 : 0)); if (y_offset > (ssize_t) bounds.height) bounds.height=(size_t) y_offset; @@ -654,11 +654,12 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info, &sans,&sans); y_offset+=(ssize_t) title_offset; (void) FormatLocaleString(montage->montage,MagickPathExtent, - "%.20gx%.20g%+.20g%+.20g",(double) (extract_info.width+ - (extract_info.x+border_width)*2),(double) (extract_info.height+ - (extract_info.y+border_width)*2+(double) ((metrics.ascent- - metrics.descent+4)*number_lines+(montage_info->shadow != MagickFalse ? 4 : - 0))),(double) x_offset,(double) y_offset); + "%.20gx%.20g%+.20g%+.20g",(double) ((ssize_t) extract_info.width+ + (extract_info.x+(ssize_t) border_width)*2),(double) ((ssize_t) + extract_info.height+(extract_info.y+(ssize_t) border_width)*2+(double) + ((metrics.ascent-metrics.descent+4)*number_lines+ + (montage_info->shadow != MagickFalse ? 4 : 0))),(double) x_offset, + (double) y_offset); *montage->directory='\0'; tile=0; while (tile < MagickMin((ssize_t) tiles_per_page,(ssize_t) number_images)) @@ -772,8 +773,8 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info, (void) FormatLocaleString(tile_geometry,MagickPathExtent, "%.20gx%.20g+0+0",(double) image->columns,(double) image->rows); flags=ParseGravityGeometry(tile_image,tile_geometry,&geometry,exception); - x=(ssize_t) (geometry.x+border_width); - y=(ssize_t) (geometry.y+border_width); + x=geometry.x+(ssize_t) border_width; + y=geometry.y+(ssize_t) border_width; if ((montage_info->frame != (char *) NULL) && (bevel_width > 0)) { FrameInfo @@ -816,7 +817,7 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info, */ (void) QueryColorCompliance("#0000",AllCompliance, &image->background_color,exception); - shadow_image=ShadowImage(image,80.0,2.0,5,5,exception); + shadow_image=ShadowImage(image,30.0,5.0,5,5,exception); if (shadow_image != (Image *) NULL) { (void) CompositeImage(shadow_image,image,OverCompositeOp, @@ -837,21 +838,22 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info, "%.20gx%.20g%+.20g%+.20g",(double) ((montage_info->frame ? image->columns : width)-2*border_width),(double) (metrics.ascent-metrics.descent+4)*MultilineCensus(value), - (double) (x_offset+border_width),(double) - ((montage_info->frame ? y_offset+height+border_width+4 : - y_offset+extract_info.height+border_width+ + (double) (x_offset+(ssize_t) border_width),(double) + ((montage_info->frame ? y_offset+(ssize_t) height+(ssize_t) + border_width+4 : y_offset+(ssize_t) extract_info.height+ + (ssize_t) border_width+ (montage_info->shadow != MagickFalse ? 4 : 0))+bevel_width)); (void) CloneString(&draw_info->geometry,tile_geometry); (void) CloneString(&draw_info->text,value); (void) AnnotateImage(montage,draw_info,exception); } } - x_offset+=(ssize_t) (width+2*(extract_info.x+border_width)); + x_offset+=(ssize_t) width+2*(extract_info.x+(ssize_t) border_width); if (((tile+1) == (ssize_t) tiles_per_page) || - (((tile+1) % tiles_per_row) == 0)) + (((tile+1) % (ssize_t) tiles_per_row) == 0)) { x_offset=extract_info.x; - y_offset+=(ssize_t) (height+(extract_info.y+border_width)*2+ + y_offset+=((ssize_t) height+(extract_info.y+(ssize_t) border_width)*2+ (metrics.ascent-metrics.descent+4)*number_lines+ (montage_info->shadow != MagickFalse ? 4 : 0)); max_height=0; diff --git a/ImageMagick-7.1.1-15/MagickCore/montage.h b/ImageMagick-7.1.1-16/MagickCore/montage.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/montage.h rename to ImageMagick-7.1.1-16/MagickCore/montage.h diff --git a/ImageMagick-7.1.1-15/MagickCore/morphology-private.h b/ImageMagick-7.1.1-16/MagickCore/morphology-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/morphology-private.h rename to ImageMagick-7.1.1-16/MagickCore/morphology-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/morphology.c b/ImageMagick-7.1.1-16/MagickCore/morphology.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/morphology.c rename to ImageMagick-7.1.1-16/MagickCore/morphology.c index e7b43e76..b5b92a32 100644 --- a/ImageMagick-7.1.1-15/MagickCore/morphology.c +++ b/ImageMagick-7.1.1-16/MagickCore/morphology.c @@ -457,9 +457,9 @@ static KernelInfo *ParseKernelName(const char *kernel_string, if ( (flags & HeightValue) == 0 ) /* no distance scale */ args.sigma = 100.0; /* default distance scaling */ else if ( (flags & AspectValue ) != 0 ) /* '!' flag */ - args.sigma = QuantumRange/(args.sigma+1); /* maximum pixel distance */ + args.sigma = (double) QuantumRange/(args.sigma+1); /* maximum pixel distance */ else if ( (flags & PercentValue ) != 0 ) /* '%' flag */ - args.sigma *= QuantumRange/100.0; /* percentage of color range */ + args.sigma *= (double) QuantumRange/100.0; /* percentage of color range */ break; default: break; @@ -1083,7 +1083,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type, else /* limiting case - a unity (normalized Dirac) kernel */ { (void) memset(kernel->values,0, (size_t) kernel->width*kernel->height*sizeof(*kernel->values)); - kernel->values[kernel->x+kernel->y*kernel->width] = 1.0; + kernel->values[kernel->x+kernel->y*(ssize_t) kernel->width] = 1.0; } } @@ -1098,7 +1098,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type, kernel->values[i] -= exp(-((double)(u*u+v*v))*A)*B; } else /* limiting case - a unity (normalized Dirac) kernel */ - kernel->values[kernel->x+kernel->y*kernel->width] -= 1.0; + kernel->values[kernel->x+kernel->y*(ssize_t) kernel->width] -= 1.0; } if ( type == LoGKernel ) @@ -1115,7 +1115,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type, else /* special case - generate a unity kernel */ { (void) memset(kernel->values,0, (size_t) kernel->width*kernel->height*sizeof(*kernel->values)); - kernel->values[kernel->x+kernel->y*kernel->width] = 1.0; + kernel->values[kernel->x+kernel->y*(ssize_t) kernel->width] = 1.0; } } @@ -1186,7 +1186,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type, } } else /* special case - generate a unity kernel */ - kernel->values[kernel->x+kernel->y*kernel->width] = 1.0; + kernel->values[kernel->x+kernel->y*(ssize_t) kernel->width] = 1.0; #else /* Direct calculation without curve averaging This is equivalent to a KernelRank of 1 */ @@ -1282,7 +1282,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type, else /* special case - generate a unity kernel */ { (void) memset(kernel->values,0, (size_t) kernel->width*kernel->height*sizeof(*kernel->values)); - kernel->values[kernel->x+kernel->y*kernel->width] = 1.0; + kernel->values[kernel->x+kernel->y*(ssize_t) kernel->width] = 1.0; kernel->positive_range = 1.0; } @@ -1316,13 +1316,13 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type, /* set all kernel values within diamond area to scale given */ for ( i=0, v=0; v < (ssize_t)kernel->height; v++) { size_t - alpha = order_f / ( fact((size_t) v) * fact(kernel->height-v-1) ); + alpha = order_f / ( fact((size_t) v) * fact(kernel->height-(size_t) v-1) ); for ( u=0; u < (ssize_t)kernel->width; u++, i++) kernel->positive_range += kernel->values[i] = (double) - (alpha * order_f / ( fact((size_t) u) * fact(kernel->height-u-1) )); + (alpha * order_f / ( fact((size_t) u) * fact(kernel->height-(size_t) u-1) )); } kernel->minimum = 1.0; - kernel->maximum = kernel->values[kernel->x+kernel->y*kernel->width]; + kernel->maximum = kernel->values[kernel->x+kernel->y*(ssize_t) kernel->width]; kernel->negative_range = 0.0; break; } @@ -1739,7 +1739,7 @@ MagickExport KernelInfo *AcquireKernelBuiltIn(const KernelInfoType type, kernel->minimum = kernel->maximum = (double) scale; if ( type == PeaksKernel ) { /* set the central point in the middle */ - kernel->values[kernel->x+kernel->y*kernel->width] = 1.0; + kernel->values[kernel->x+kernel->y*(ssize_t) kernel->width] = 1.0; kernel->positive_range = 1.0; kernel->maximum = 1.0; } @@ -2746,7 +2746,7 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, { if (!IsNaN(*k)) { - pixel+=(*k)*pixels[i]; + pixel+=(*k)*(double) pixels[i]; count++; } k--; @@ -2759,8 +2759,9 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, { if (!IsNaN(*k)) { - alpha=(double) (QuantumScale*GetPixelAlpha(image,pixels)); - pixel+=alpha*(*k)*pixels[i]; + alpha=(double) (QuantumScale*(double) + GetPixelAlpha(image,pixels)); + pixel+=alpha*(*k)*(double) pixels[i]; gamma+=alpha*(*k); count++; } @@ -2768,7 +2769,7 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, pixels+=GetPixelChannels(image); } } - if (fabs(pixel-p[center+i]) >= MagickEpsilon) + if (fabs(pixel-(double) p[center+i]) >= MagickEpsilon) changes[id]++; gamma=PerceptibleReciprocal(gamma); if (count != 0) @@ -2802,7 +2803,7 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, for (j=0; j < (ssize_t) GetOpenMPMaximumThreads(); j++) changed+=changes[j]; changes=(size_t *) RelinquishMagickMemory(changes); - return(status ? (ssize_t) changed/GetImageChannels(image) : 0); + return(status ? (ssize_t) (changed/GetImageChannels(image)) : 0); } /* Normal handling of horizontal or rectangular kernels (row by row). @@ -2839,8 +2840,8 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, status=MagickFalse; continue; } - center=(ssize_t) (GetPixelChannels(image)*width*offset.y+ - GetPixelChannels(image)*offset.x); + center=(ssize_t) ((ssize_t) GetPixelChannels(image)*(ssize_t) width* + offset.y+(ssize_t) GetPixelChannels(image)*offset.x); for (x=0; x < (ssize_t) image->columns; x++) { ssize_t @@ -2946,7 +2947,7 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, for (u=0; u < (ssize_t) kernel->width; u++) { if (!IsNaN(*k)) - pixel+=(*k)*pixels[i]; + pixel+=(*k)*(double) pixels[i]; k--; pixels+=GetPixelChannels(image); } @@ -2964,8 +2965,9 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, { if (!IsNaN(*k)) { - alpha=(double) (QuantumScale*GetPixelAlpha(image,pixels)); - pixel+=alpha*(*k)*pixels[i]; + alpha=(double) (QuantumScale*(double) + GetPixelAlpha(image,pixels)); + pixel+=alpha*(*k)*(double) pixels[i]; gamma+=alpha*(*k); } k--; @@ -3173,7 +3175,7 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, { if (!IsNaN(*k)) { - if ((pixels[i]+(*k)) < pixel) + if (((double) pixels[i]+(*k)) < pixel) pixel=(double) pixels[i]+(*k); } k--; @@ -3194,7 +3196,7 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, } gamma=PerceptibleReciprocal(gamma); SetPixelChannel(morphology_image,channel,ClampToQuantum(gamma*pixel),q); - if (fabs(pixel-p[center+i]) >= MagickEpsilon) + if (fabs(pixel-(double) p[center+i]) >= MagickEpsilon) changes[id]++; } p+=GetPixelChannels(image); @@ -3372,7 +3374,7 @@ static ssize_t MorphologyPrimitiveDirect(Image *image, { if (!IsNaN(*k)) { - if ((pixels[i]+(*k)) < pixel) + if (((double) pixels[i]+(*k)) < pixel) pixel=(double) pixels[i]+(*k); } k--; @@ -3380,13 +3382,13 @@ static ssize_t MorphologyPrimitiveDirect(Image *image, } pixels+=(image->columns-1)*GetPixelChannels(image); } - k=(&kernel->values[kernel->width*(kernel->y+1)-1]); - pixels=q-offset.x*GetPixelChannels(image); + k=(&kernel->values[(ssize_t) kernel->width*(kernel->y+1)-1]); + pixels=q-offset.x*(ssize_t) GetPixelChannels(image); for (u=0; u < offset.x; u++) { if (!IsNaN(*k) && ((x+u-offset.x) >= 0)) { - if ((pixels[i]+(*k)) < pixel) + if (((double) pixels[i]+(*k)) < pixel) pixel=(double) pixels[i]+(*k); } k--; @@ -3403,7 +3405,7 @@ static ssize_t MorphologyPrimitiveDirect(Image *image, { if (!IsNaN(*k)) { - if ((pixels[i]+(*k)) < pixel) + if (((double) pixels[i]+(*k)) < pixel) pixel=(double) pixels[i]+(*k); } k--; @@ -3411,13 +3413,13 @@ static ssize_t MorphologyPrimitiveDirect(Image *image, } pixels+=(image->columns-1)*GetPixelChannels(image); } - k=(&kernel->values[kernel->width*(kernel->y+1)-1]); - pixels=q-offset.x*GetPixelChannels(image); + k=(&kernel->values[(ssize_t) kernel->width*(kernel->y+1)-1]); + pixels=q-offset.x*(ssize_t) GetPixelChannels(image); for (u=0; u < offset.x; u++) { if (!IsNaN(*k) && ((x+u-offset.x) >= 0)) { - if ((pixels[i]+(*k)) < pixel) + if (((double) pixels[i]+(*k)) < pixel) pixel=(double) pixels[i]+(*k); } k--; @@ -3428,7 +3430,7 @@ static ssize_t MorphologyPrimitiveDirect(Image *image, default: break; } - if (fabs(pixel-q[i]) > MagickEpsilon) + if (fabs(pixel-(double) q[i]) > MagickEpsilon) changed++; q[i]=ClampToQuantum(pixel); } @@ -3529,14 +3531,14 @@ static ssize_t MorphologyPrimitiveDirect(Image *image, { case DistanceMorphology: { - k=(&kernel->values[kernel->width*(kernel->y+1)-1]); + k=(&kernel->values[(ssize_t) kernel->width*(kernel->y+1)-1]); for (v=offset.y; v < (ssize_t) kernel->height; v++) { for (u=0; u < (ssize_t) kernel->width; u++) { if (!IsNaN(*k)) { - if ((pixels[i]+(*k)) < pixel) + if (((double) pixels[i]+(*k)) < pixel) pixel=(double) pixels[i]+(*k); } k--; @@ -3544,14 +3546,14 @@ static ssize_t MorphologyPrimitiveDirect(Image *image, } pixels+=(image->columns-1)*GetPixelChannels(image); } - k=(&kernel->values[kernel->width*kernel->y+kernel->x-1]); + k=(&kernel->values[(ssize_t) kernel->width*kernel->y+kernel->x-1]); pixels=q; for (u=offset.x+1; u < (ssize_t) kernel->width; u++) { pixels+=GetPixelChannels(image); if (!IsNaN(*k) && ((x+u-offset.x) < (ssize_t) image->columns)) { - if ((pixels[i]+(*k)) < pixel) + if (((double) pixels[i]+(*k)) < pixel) pixel=(double) pixels[i]+(*k); } k--; @@ -3560,14 +3562,14 @@ static ssize_t MorphologyPrimitiveDirect(Image *image, } case VoronoiMorphology: { - k=(&kernel->values[kernel->width*(kernel->y+1)-1]); + k=(&kernel->values[(ssize_t) kernel->width*(kernel->y+1)-1]); for (v=offset.y; v < (ssize_t) kernel->height; v++) { for (u=0; u < (ssize_t) kernel->width; u++) { if (!IsNaN(*k)) { - if ((pixels[i]+(*k)) < pixel) + if (((double) pixels[i]+(*k)) < pixel) pixel=(double) pixels[i]+(*k); } k--; @@ -3575,14 +3577,14 @@ static ssize_t MorphologyPrimitiveDirect(Image *image, } pixels+=(image->columns-1)*GetPixelChannels(image); } - k=(&kernel->values[kernel->width*(kernel->y+1)-1]); + k=(&kernel->values[(ssize_t) kernel->width*(kernel->y+1)-1]); pixels=q; for (u=offset.x+1; u < (ssize_t) kernel->width; u++) { pixels+=GetPixelChannels(image); if (!IsNaN(*k) && ((x+u-offset.x) < (ssize_t) image->columns)) { - if ((pixels[i]+(*k)) < pixel) + if (((double) pixels[i]+(*k)) < pixel) pixel=(double) pixels[i]+(*k); } k--; @@ -3592,7 +3594,7 @@ static ssize_t MorphologyPrimitiveDirect(Image *image, default: break; } - if (fabs(pixel-q[i]) > MagickEpsilon) + if (fabs(pixel-(double) q[i]) > MagickEpsilon) changed++; q[i]=ClampToQuantum(pixel); } @@ -3946,8 +3948,8 @@ MagickPrivate Image *MorphologyApply(const Image *image, } if ( changed < 0 ) goto error_cleanup; - kernel_changed += changed; - method_changed += changed; + kernel_changed = (size_t) ((ssize_t) kernel_changed+changed); + method_changed = (size_t) ((ssize_t) method_changed+changed); /* prepare next loop */ { Image *tmp = work_image; /* swap images for iteration */ @@ -4371,17 +4373,17 @@ static void RotateKernelInfo(KernelInfo *kernel, double angle) k=kernel->values; for( i=0, x=(ssize_t) kernel->width-1; i<=x; i++, x--) for( j=0, y=(ssize_t) kernel->height-1; jwidth]; - k[i+j*kernel->width] = k[j+x*kernel->width]; - k[j+x*kernel->width] = k[x+y*kernel->width]; - k[x+y*kernel->width] = k[y+i*kernel->width]; - k[y+i*kernel->width] = t; + { t = k[i+j*(ssize_t) kernel->width]; + k[i+j*(ssize_t) kernel->width] = k[j+x*(ssize_t) kernel->width]; + k[j+x*(ssize_t) kernel->width] = k[x+y*(ssize_t) kernel->width]; + k[x+y*(ssize_t) kernel->width] = k[y+i*(ssize_t) kernel->width]; + k[y+i*(ssize_t) kernel->width] = t; } } /* rotate the origin - relative to center of array */ { ssize_t x,y; - x = (ssize_t) (kernel->x*2-kernel->width+1); - y = (ssize_t) (kernel->y*2-kernel->height+1); + x = (ssize_t) (kernel->x*2-(ssize_t) kernel->width+1); + y = (ssize_t) (kernel->y*2-(ssize_t) kernel->height+1); kernel->x = (ssize_t) ( -y +(ssize_t) kernel->width-1)/2; kernel->y = (ssize_t) ( +x +(ssize_t) kernel->height-1)/2; } @@ -4740,7 +4742,7 @@ MagickExport void UnityAddKernelInfo(KernelInfo *kernel, UnityAddKernelInfo(kernel->next, scale); /* Add the scaled unity kernel to the existing kernel */ - kernel->values[kernel->x+kernel->y*kernel->width] += scale; + kernel->values[kernel->x+kernel->y*(ssize_t) kernel->width] += scale; CalcKernelMetaData(kernel); /* recalculate the meta-data */ return; diff --git a/ImageMagick-7.1.1-15/MagickCore/morphology.h b/ImageMagick-7.1.1-16/MagickCore/morphology.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/morphology.h rename to ImageMagick-7.1.1-16/MagickCore/morphology.h diff --git a/ImageMagick-7.1.1-15/MagickCore/mutex.h b/ImageMagick-7.1.1-16/MagickCore/mutex.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/mutex.h rename to ImageMagick-7.1.1-16/MagickCore/mutex.h diff --git a/ImageMagick-7.1.1-15/MagickCore/nt-base-private.h b/ImageMagick-7.1.1-16/MagickCore/nt-base-private.h similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/nt-base-private.h rename to ImageMagick-7.1.1-16/MagickCore/nt-base-private.h index 4c7d6641..98ac1bd8 100644 --- a/ImageMagick-7.1.1-15/MagickCore/nt-base-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/nt-base-private.h @@ -99,8 +99,7 @@ extern MagickPrivate DIR extern MagickPrivate double NTElapsedTime(void), - NTErf(double), - NTUserTime(void); + NTErf(double); extern MagickPrivate int #if !defined(__MINGW32__) diff --git a/ImageMagick-7.1.1-15/MagickCore/nt-base.c b/ImageMagick-7.1.1-16/MagickCore/nt-base.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/nt-base.c rename to ImageMagick-7.1.1-16/MagickCore/nt-base.c index 7a4583c3..f7f1659f 100644 --- a/ImageMagick-7.1.1-15/MagickCore/nt-base.c +++ b/ImageMagick-7.1.1-16/MagickCore/nt-base.c @@ -629,10 +629,8 @@ MagickPrivate double NTErf(double x) a4=-1.453152027; a5=1.061405429; p=0.3275911; - sign=1; - if (x < 0) - sign=-1; - x=abs(x); + sign=x < 0 ? -1 : 1; + x=fabs(x); t=1.0/(1.0+p*x); y=1.0-(((((a5*t+a4)*t)+a3)*t+a2)*t+a1)*t*exp(-x*x); return(sign*y); @@ -2320,66 +2318,6 @@ MagickPrivate int NTUnmapMemory(void *map,size_t length) % % % % % % -% N T U s e r T i m e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% NTUserTime() returns the total time the process has been scheduled (e.g. -% seconds) since the last call to StartTimer(). -% -% The format of the UserTime method is: -% -% double NTUserTime(void) -% -*/ -MagickPrivate double NTUserTime(void) -{ - DWORD - status; - - FILETIME - create_time, - exit_time; - - OSVERSIONINFO - OsVersionInfo; - - union - { - FILETIME - filetime; - - __int64 - filetime64; - } kernel_time; - - union - { - FILETIME - filetime; - - __int64 - filetime64; - } user_time; - - OsVersionInfo.dwOSVersionInfoSize=sizeof(OSVERSIONINFO); - GetVersionEx(&OsVersionInfo); - if (OsVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT) - return(NTElapsedTime()); - status=GetProcessTimes(GetCurrentProcess(),&create_time,&exit_time, - &kernel_time.filetime,&user_time.filetime); - if (status != TRUE) - return(0.0); - return((double) 1.0e-7*(kernel_time.filetime64+user_time.filetime64)); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % N T W a r n i n g H a n d l e r % % % % % diff --git a/ImageMagick-7.1.1-15/MagickCore/nt-base.h b/ImageMagick-7.1.1-16/MagickCore/nt-base.h similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/nt-base.h rename to ImageMagick-7.1.1-16/MagickCore/nt-base.h index 49b2fd0f..5b0fff22 100644 --- a/ImageMagick-7.1.1-15/MagickCore/nt-base.h +++ b/ImageMagick-7.1.1-16/MagickCore/nt-base.h @@ -61,16 +61,10 @@ extern "C" { # if !defined(SSIZE_MAX) # define SSIZE_MAX LLONG_MAX # endif -# if defined(_MSC_VER) -# define MAGICKCORE_SIZEOF_SSIZE_T 8 -# endif #else # if !defined(SSIZE_MAX) # define SSIZE_MAX LONG_MAX # endif -# if defined(_MSC_VER) -# define MAGICKCORE_SIZEOF_SSIZE_T 4 -# endif #endif #ifndef S_ISCHR # define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) diff --git a/ImageMagick-7.1.1-15/MagickCore/nt-feature.c b/ImageMagick-7.1.1-16/MagickCore/nt-feature.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/nt-feature.c rename to ImageMagick-7.1.1-16/MagickCore/nt-feature.c diff --git a/ImageMagick-7.1.1-15/MagickCore/nt-feature.h b/ImageMagick-7.1.1-16/MagickCore/nt-feature.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/nt-feature.h rename to ImageMagick-7.1.1-16/MagickCore/nt-feature.h diff --git a/ImageMagick-7.1.1-15/MagickCore/opencl-private.h b/ImageMagick-7.1.1-16/MagickCore/opencl-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/opencl-private.h rename to ImageMagick-7.1.1-16/MagickCore/opencl-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/opencl.c b/ImageMagick-7.1.1-16/MagickCore/opencl.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/opencl.c rename to ImageMagick-7.1.1-16/MagickCore/opencl.c index cf9af1da..c2670ed7 100644 --- a/ImageMagick-7.1.1-15/MagickCore/opencl.c +++ b/ImageMagick-7.1.1-16/MagickCore/opencl.c @@ -41,6 +41,7 @@ Include declarations. */ #include "MagickCore/studio.h" +#include "MagickCore/accelerate-kernels-private.h" #include "MagickCore/artifact.h" #include "MagickCore/cache.h" #include "MagickCore/cache-private.h" @@ -755,6 +756,7 @@ MagickPrivate cl_kernel AcquireOpenCLKernel(MagickCLDevice device, % */ +#if !MAGICKCORE_ZERO_CONFIGURATION_SUPPORT static void LoadOpenCLDeviceBenchmark(MagickCLEnv clEnv,const char *xml) { char @@ -841,12 +843,13 @@ static void LoadOpenCLDeviceBenchmark(MagickCLEnv clEnv,const char *xml) } } - device_benchmark->platform_name=RelinquishMagickMemory( + device_benchmark->platform_name=(char *) RelinquishMagickMemory( device_benchmark->platform_name); - device_benchmark->vendor_name=RelinquishMagickMemory( + device_benchmark->vendor_name=(char *) RelinquishMagickMemory( device_benchmark->vendor_name); - device_benchmark->name=RelinquishMagickMemory(device_benchmark->name); - device_benchmark->version=RelinquishMagickMemory( + device_benchmark->name=(char *) RelinquishMagickMemory( + device_benchmark->name); + device_benchmark->version=(char *) RelinquishMagickMemory( device_benchmark->version); device_benchmark=(MagickCLDeviceBenchmark *) RelinquishMagickMemory( device_benchmark); @@ -930,6 +933,7 @@ static MagickBooleanType CanWriteProfileToFile(const char *filename) fclose(profileFile); return(MagickTrue); } +#endif static MagickBooleanType LoadOpenCLBenchmarks(MagickCLEnv clEnv) { @@ -1450,7 +1454,7 @@ static cl_event* CopyOpenCLEvents(MagickCLCacheInfo first, *event_count+=second->event_count; if (*event_count > 0) { - events=AcquireQuantumMemory(*event_count,sizeof(*events)); + events=(cl_event *) AcquireQuantumMemory(*event_count,sizeof(*events)); if (events == (cl_event *) NULL) *event_count=0; else @@ -1513,8 +1517,8 @@ MagickPrivate MagickCLCacheInfo CopyMagickCLCacheInfo(MagickCLCacheInfo info) if (events != (cl_event *) NULL) { queue=AcquireOpenCLCommandQueue(info->device); - pixels=openCL_library->clEnqueueMapBuffer(queue,info->buffer,CL_TRUE, - CL_MAP_READ | CL_MAP_WRITE,0,info->length,event_count,events, + pixels=(Quantum *) openCL_library->clEnqueueMapBuffer(queue,info->buffer, + CL_TRUE,CL_MAP_READ | CL_MAP_WRITE,0,info->length,event_count,events, (cl_event *) NULL,(cl_int *) NULL); assert(pixels == info->pixels); ReleaseOpenCLCommandQueue(info->device,queue); @@ -1674,12 +1678,12 @@ static MagickBooleanType RegisterCacheEvent(MagickCLCacheInfo info, LockSemaphoreInfo(info->events_semaphore); if (info->events == (cl_event *) NULL) { - info->events=AcquireMagickMemory(sizeof(*info->events)); + info->events=(cl_event *) AcquireMagickMemory(sizeof(*info->events)); info->event_count=1; } else - info->events=ResizeQuantumMemory(info->events,++info->event_count, - sizeof(*info->events)); + info->events=(cl_event *) ResizeQuantumMemory(info->events, + ++info->event_count,sizeof(*info->events)); if (info->events == (cl_event *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); info->events[info->event_count-1]=event; @@ -2135,7 +2139,7 @@ static MagickBooleanType HasOpenCLDevices(MagickCLEnv clEnv, *accelerateKernelsBuffer, options[MagickPathExtent]; - MagickStatusType + MagickBooleanType status; size_t @@ -2210,7 +2214,8 @@ static MagickBooleanType HasOpenCLDevices(MagickCLEnv clEnv, if (status == MagickFalse) break; } - accelerateKernelsBuffer=RelinquishMagickMemory(accelerateKernelsBuffer); + accelerateKernelsBuffer=(char *) RelinquishMagickMemory( + accelerateKernelsBuffer); return(status); } @@ -2267,7 +2272,7 @@ static inline char *GetOpenCLPlatformString(cl_platform_id platform, length; openCL_library->clGetPlatformInfo(platform,param_name,0,NULL,&length); - value=AcquireCriticalMemory(length*sizeof(*value)); + value=(char *) AcquireCriticalMemory(length*sizeof(*value)); openCL_library->clGetPlatformInfo(platform,param_name,length,value,NULL); return(value); } @@ -2282,7 +2287,7 @@ static inline char *GetOpenCLDeviceString(cl_device_id device, length; openCL_library->clGetDeviceInfo(device,param_name,0,NULL,&length); - value=AcquireCriticalMemory(length*sizeof(*value)); + value=(char *) AcquireCriticalMemory(length*sizeof(*value)); openCL_library->clGetDeviceInfo(device,param_name,length,value,NULL); return(value); } @@ -2440,8 +2445,8 @@ static void LoadOpenCLDevices(MagickCLEnv clEnv) MagickPrivate MagickBooleanType InitializeOpenCL(MagickCLEnv clEnv, ExceptionInfo *exception) { - register - size_t i; + size_t + i; LockSemaphoreInfo(clEnv->lock); if (clEnv->initialized != MagickFalse) @@ -2754,7 +2759,7 @@ MagickPrivate MagickBooleanType RecordProfileData(MagickCLDevice device, &length); if (status != CL_SUCCESS) return(MagickTrue); - name=AcquireQuantumMemory(length,sizeof(*name)); + name=(char *) AcquireQuantumMemory(length,sizeof(*name)); if (name == (char *) NULL) return(MagickTrue); start=end=elapsed=0; @@ -2791,11 +2796,12 @@ MagickPrivate MagickBooleanType RecordProfileData(MagickCLDevice device, name=DestroyString(name); else { - profile_record=AcquireCriticalMemory(sizeof(*profile_record)); + profile_record=(KernelProfileRecord) AcquireCriticalMemory( + sizeof(*profile_record)); (void) memset(profile_record,0,sizeof(*profile_record)); profile_record->kernel_name=name; - device->profile_records=ResizeQuantumMemory(device->profile_records,(i+2), - sizeof(*device->profile_records)); + device->profile_records=(KernelProfileRecord *) ResizeQuantumMemory( + device->profile_records,(i+2),sizeof(*device->profile_records)); if (device->profile_records == (KernelProfileRecord *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); device->profile_records[i]=profile_record; @@ -2997,10 +3003,10 @@ static MagickCLDevice RelinquishMagickCLDevice(MagickCLDevice device) if (device == (MagickCLDevice) NULL) return((MagickCLDevice) NULL); - device->platform_name=RelinquishMagickMemory(device->platform_name); - device->vendor_name=RelinquishMagickMemory(device->vendor_name); - device->name=RelinquishMagickMemory(device->name); - device->version=RelinquishMagickMemory(device->version); + device->platform_name=(char *) RelinquishMagickMemory(device->platform_name); + device->vendor_name=(char *) RelinquishMagickMemory(device->vendor_name); + device->name=(char *) RelinquishMagickMemory(device->name); + device->version=(char *) RelinquishMagickMemory(device->version); if (device->program != (cl_program) NULL) (void) openCL_library->clReleaseProgram(device->program); while (device->command_queues_index >= 0) diff --git a/ImageMagick-7.1.1-15/MagickCore/opencl.h b/ImageMagick-7.1.1-16/MagickCore/opencl.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/opencl.h rename to ImageMagick-7.1.1-16/MagickCore/opencl.h diff --git a/ImageMagick-7.1.1-15/MagickCore/option-private.h b/ImageMagick-7.1.1-16/MagickCore/option-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/option-private.h rename to ImageMagick-7.1.1-16/MagickCore/option-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/option.c b/ImageMagick-7.1.1-16/MagickCore/option.c similarity index 95% rename from ImageMagick-7.1.1-15/MagickCore/option.c rename to ImageMagick-7.1.1-16/MagickCore/option.c index f17a6a0a..3e848024 100644 --- a/ImageMagick-7.1.1-15/MagickCore/option.c +++ b/ImageMagick-7.1.1-16/MagickCore/option.c @@ -80,6 +80,11 @@ #include "MagickCore/utility.h" #include "MagickCore/visual-effects.h" +/* + Define declarations. +*/ +#define MetaPixelChannelBit(bit) ((ssize_t) 1 << (MetaPixelChannels+bit)) + /* ImageMagick options. */ @@ -171,61 +176,60 @@ static const OptionInfo { "Magenta", MagentaChannel, UndefinedOptionFlag, MagickFalse }, { "Matte", AlphaChannel, DeprecateOptionFlag, MagickTrue },/*depreciate*/ { "Meta", MetaChannel, UndefinedOptionFlag, MagickFalse }, - { "Meta0", MetaPixelChannels+0, UndefinedOptionFlag, MagickFalse }, - { "Meta1", MetaPixelChannels+1, UndefinedOptionFlag, MagickFalse }, - { "Meta2", MetaPixelChannels+2, UndefinedOptionFlag, MagickFalse }, - { "Meta3", MetaPixelChannels+3, UndefinedOptionFlag, MagickFalse }, - { "Meta4", MetaPixelChannels+4, UndefinedOptionFlag, MagickFalse }, - { "Meta5", MetaPixelChannels+5, UndefinedOptionFlag, MagickFalse }, - { "Meta6", MetaPixelChannels+6, UndefinedOptionFlag, MagickFalse }, - { "Meta7", MetaPixelChannels+7, UndefinedOptionFlag, MagickFalse }, - { "Meta8", MetaPixelChannels+8, UndefinedOptionFlag, MagickFalse }, - { "Meta9", MetaPixelChannels+9, UndefinedOptionFlag, MagickFalse }, - { "Meta10", MetaPixelChannels+10, UndefinedOptionFlag, MagickFalse }, - { "Meta11", MetaPixelChannels+11, UndefinedOptionFlag, MagickFalse }, - { "Meta12", MetaPixelChannels+12, UndefinedOptionFlag, MagickFalse }, - { "Meta13", MetaPixelChannels+13, UndefinedOptionFlag, MagickFalse }, - { "Meta14", MetaPixelChannels+14, UndefinedOptionFlag, MagickFalse }, - { "Meta15", MetaPixelChannels+15, UndefinedOptionFlag, MagickFalse }, - { "Meta16", MetaPixelChannels+16, UndefinedOptionFlag, MagickFalse }, - { "Meta17", MetaPixelChannels+17, UndefinedOptionFlag, MagickFalse }, - { "Meta18", MetaPixelChannels+18, UndefinedOptionFlag, MagickFalse }, - { "Meta19", MetaPixelChannels+19, UndefinedOptionFlag, MagickFalse }, - { "Meta20", MetaPixelChannels+20, UndefinedOptionFlag, MagickFalse }, - { "Meta21", MetaPixelChannels+21, UndefinedOptionFlag, MagickFalse }, - { "Meta22", MetaPixelChannels+22, UndefinedOptionFlag, MagickFalse }, -#if AllChannels > 0x7ffffff - { "Meta23", MetaPixelChannels+23, UndefinedOptionFlag, MagickFalse }, - { "Meta24", MetaPixelChannels+24, UndefinedOptionFlag, MagickFalse }, - { "Meta25", MetaPixelChannels+25, UndefinedOptionFlag, MagickFalse }, - { "Meta26", MetaPixelChannels+26, UndefinedOptionFlag, MagickFalse }, - { "Meta27", MetaPixelChannels+27, UndefinedOptionFlag, MagickFalse }, - { "Meta28", MetaPixelChannels+29, UndefinedOptionFlag, MagickFalse }, - { "Meta29", MetaPixelChannels+30, UndefinedOptionFlag, MagickFalse }, - { "Meta30", MetaPixelChannels+31, UndefinedOptionFlag, MagickFalse }, - { "Meta31", MetaPixelChannels+32, UndefinedOptionFlag, MagickFalse }, - { "Meta32", MetaPixelChannels+33, UndefinedOptionFlag, MagickFalse }, - { "Meta33", MetaPixelChannels+34, UndefinedOptionFlag, MagickFalse }, - { "Meta34", MetaPixelChannels+35, UndefinedOptionFlag, MagickFalse }, - { "Meta35", MetaPixelChannels+36, UndefinedOptionFlag, MagickFalse }, - { "Meta36", MetaPixelChannels+37, UndefinedOptionFlag, MagickFalse }, - { "Meta37", MetaPixelChannels+38, UndefinedOptionFlag, MagickFalse }, - { "Meta38", MetaPixelChannels+39, UndefinedOptionFlag, MagickFalse }, - { "Meta39", MetaPixelChannels+40, UndefinedOptionFlag, MagickFalse }, - { "Meta40", MetaPixelChannels+41, UndefinedOptionFlag, MagickFalse }, - { "Meta41", MetaPixelChannels+42, UndefinedOptionFlag, MagickFalse }, - { "Meta42", MetaPixelChannels+43, UndefinedOptionFlag, MagickFalse }, - { "Meta43", MetaPixelChannels+44, UndefinedOptionFlag, MagickFalse }, - { "Meta44", MetaPixelChannels+45, UndefinedOptionFlag, MagickFalse }, - { "Meta45", MetaPixelChannels+46, UndefinedOptionFlag, MagickFalse }, - { "Meta46", MetaPixelChannels+47, UndefinedOptionFlag, MagickFalse }, - { "Meta47", MetaPixelChannels+48, UndefinedOptionFlag, MagickFalse }, - { "Meta48", MetaPixelChannels+49, UndefinedOptionFlag, MagickFalse }, - { "Meta49", MetaPixelChannels+50, UndefinedOptionFlag, MagickFalse }, - { "Meta50", MetaPixelChannels+51, UndefinedOptionFlag, MagickFalse }, - { "Meta51", MetaPixelChannels+52, UndefinedOptionFlag, MagickFalse }, - { "Meta52", MetaPixelChannels+53, UndefinedOptionFlag, MagickFalse }, - { "Meta53", MetaPixelChannels+54, UndefinedOptionFlag, MagickFalse }, + { "Meta0", MetaPixelChannelBit(0), UndefinedOptionFlag, MagickFalse }, + { "Meta1", MetaPixelChannelBit(1), UndefinedOptionFlag, MagickFalse }, + { "Meta2", MetaPixelChannelBit(2), UndefinedOptionFlag, MagickFalse }, + { "Meta3", MetaPixelChannelBit(3), UndefinedOptionFlag, MagickFalse }, + { "Meta4", MetaPixelChannelBit(4), UndefinedOptionFlag, MagickFalse }, + { "Meta5", MetaPixelChannelBit(5), UndefinedOptionFlag, MagickFalse }, + { "Meta6", MetaPixelChannelBit(6), UndefinedOptionFlag, MagickFalse }, + { "Meta7", MetaPixelChannelBit(7), UndefinedOptionFlag, MagickFalse }, + { "Meta8", MetaPixelChannelBit(8), UndefinedOptionFlag, MagickFalse }, + { "Meta9", MetaPixelChannelBit(9), UndefinedOptionFlag, MagickFalse }, + { "Meta10", MetaPixelChannelBit(10), UndefinedOptionFlag, MagickFalse }, + { "Meta11", MetaPixelChannelBit(11), UndefinedOptionFlag, MagickFalse }, + { "Meta12", MetaPixelChannelBit(12), UndefinedOptionFlag, MagickFalse }, + { "Meta13", MetaPixelChannelBit(13), UndefinedOptionFlag, MagickFalse }, + { "Meta14", MetaPixelChannelBit(14), UndefinedOptionFlag, MagickFalse }, + { "Meta15", MetaPixelChannelBit(15), UndefinedOptionFlag, MagickFalse }, + { "Meta16", MetaPixelChannelBit(16), UndefinedOptionFlag, MagickFalse }, + { "Meta17", MetaPixelChannelBit(17), UndefinedOptionFlag, MagickFalse }, + { "Meta18", MetaPixelChannelBit(18), UndefinedOptionFlag, MagickFalse }, + { "Meta19", MetaPixelChannelBit(19), UndefinedOptionFlag, MagickFalse }, + { "Meta20", MetaPixelChannelBit(20), UndefinedOptionFlag, MagickFalse }, + { "Meta21", MetaPixelChannelBit(21), UndefinedOptionFlag, MagickFalse }, +#if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT) + { "Meta22", MetaPixelChannelBit(22), UndefinedOptionFlag, MagickFalse }, + { "Meta23", MetaPixelChannelBit(23), UndefinedOptionFlag, MagickFalse }, + { "Meta24", MetaPixelChannelBit(24), UndefinedOptionFlag, MagickFalse }, + { "Meta25", MetaPixelChannelBit(25), UndefinedOptionFlag, MagickFalse }, + { "Meta26", MetaPixelChannelBit(26), UndefinedOptionFlag, MagickFalse }, + { "Meta27", MetaPixelChannelBit(27), UndefinedOptionFlag, MagickFalse }, + { "Meta28", MetaPixelChannelBit(28), UndefinedOptionFlag, MagickFalse }, + { "Meta29", MetaPixelChannelBit(29), UndefinedOptionFlag, MagickFalse }, + { "Meta30", MetaPixelChannelBit(30), UndefinedOptionFlag, MagickFalse }, + { "Meta31", MetaPixelChannelBit(31), UndefinedOptionFlag, MagickFalse }, + { "Meta32", MetaPixelChannelBit(32), UndefinedOptionFlag, MagickFalse }, + { "Meta33", MetaPixelChannelBit(33), UndefinedOptionFlag, MagickFalse }, + { "Meta34", MetaPixelChannelBit(34), UndefinedOptionFlag, MagickFalse }, + { "Meta35", MetaPixelChannelBit(35), UndefinedOptionFlag, MagickFalse }, + { "Meta36", MetaPixelChannelBit(36), UndefinedOptionFlag, MagickFalse }, + { "Meta37", MetaPixelChannelBit(37), UndefinedOptionFlag, MagickFalse }, + { "Meta38", MetaPixelChannelBit(38), UndefinedOptionFlag, MagickFalse }, + { "Meta39", MetaPixelChannelBit(39), UndefinedOptionFlag, MagickFalse }, + { "Meta40", MetaPixelChannelBit(40), UndefinedOptionFlag, MagickFalse }, + { "Meta41", MetaPixelChannelBit(41), UndefinedOptionFlag, MagickFalse }, + { "Meta42", MetaPixelChannelBit(42), UndefinedOptionFlag, MagickFalse }, + { "Meta43", MetaPixelChannelBit(43), UndefinedOptionFlag, MagickFalse }, + { "Meta44", MetaPixelChannelBit(44), UndefinedOptionFlag, MagickFalse }, + { "Meta45", MetaPixelChannelBit(45), UndefinedOptionFlag, MagickFalse }, + { "Meta46", MetaPixelChannelBit(46), UndefinedOptionFlag, MagickFalse }, + { "Meta47", MetaPixelChannelBit(47), UndefinedOptionFlag, MagickFalse }, + { "Meta48", MetaPixelChannelBit(48), UndefinedOptionFlag, MagickFalse }, + { "Meta49", MetaPixelChannelBit(49), UndefinedOptionFlag, MagickFalse }, + { "Meta50", MetaPixelChannelBit(50), UndefinedOptionFlag, MagickFalse }, + { "Meta51", MetaPixelChannelBit(51), UndefinedOptionFlag, MagickFalse }, + { "Meta52", MetaPixelChannelBit(52), UndefinedOptionFlag, MagickFalse }, #endif { "R", RedChannel, UndefinedOptionFlag, MagickFalse }, { "ReadMask", ReadMaskChannel, UndefinedOptionFlag, MagickFalse }, @@ -245,62 +249,61 @@ static const OptionInfo { "7", WriteMaskChannel, UndefinedOptionFlag, MagickFalse }, { "8", MetaChannel, UndefinedOptionFlag, MagickFalse }, { "9", CompositeMaskChannel, UndefinedOptionFlag, MagickFalse }, - { "10", MetaPixelChannels+0, UndefinedOptionFlag, MagickFalse }, - { "11", MetaPixelChannels+1, UndefinedOptionFlag, MagickFalse }, - { "12", MetaPixelChannels+2, UndefinedOptionFlag, MagickFalse }, - { "13", MetaPixelChannels+3, UndefinedOptionFlag, MagickFalse }, - { "14", MetaPixelChannels+4, UndefinedOptionFlag, MagickFalse }, - { "15", MetaPixelChannels+5, UndefinedOptionFlag, MagickFalse }, - { "16", MetaPixelChannels+6, UndefinedOptionFlag, MagickFalse }, - { "17", MetaPixelChannels+7, UndefinedOptionFlag, MagickFalse }, - { "18", MetaPixelChannels+8, UndefinedOptionFlag, MagickFalse }, - { "19", MetaPixelChannels+9, UndefinedOptionFlag, MagickFalse }, - { "20", MetaPixelChannels+10, UndefinedOptionFlag, MagickFalse }, - { "21", MetaPixelChannels+11, UndefinedOptionFlag, MagickFalse }, - { "22", MetaPixelChannels+12, UndefinedOptionFlag, MagickFalse }, - { "23", MetaPixelChannels+13, UndefinedOptionFlag, MagickFalse }, - { "24", MetaPixelChannels+14, UndefinedOptionFlag, MagickFalse }, - { "25", MetaPixelChannels+15, UndefinedOptionFlag, MagickFalse }, - { "26", MetaPixelChannels+16, UndefinedOptionFlag, MagickFalse }, - { "27", MetaPixelChannels+17, UndefinedOptionFlag, MagickFalse }, - { "28", MetaPixelChannels+18, UndefinedOptionFlag, MagickFalse }, - { "29", MetaPixelChannels+19, UndefinedOptionFlag, MagickFalse }, - { "30", MetaPixelChannels+20, UndefinedOptionFlag, MagickFalse }, - { "31", MetaPixelChannels+21, UndefinedOptionFlag, MagickFalse }, -#if AllChannels > 0x7ffffff - { "32", MetaPixelChannels+22, UndefinedOptionFlag, MagickFalse }, - { "33", MetaPixelChannels+23, UndefinedOptionFlag, MagickFalse }, - { "34", MetaPixelChannels+24, UndefinedOptionFlag, MagickFalse }, - { "35", MetaPixelChannels+25, UndefinedOptionFlag, MagickFalse }, - { "36", MetaPixelChannels+26, UndefinedOptionFlag, MagickFalse }, - { "37", MetaPixelChannels+27, UndefinedOptionFlag, MagickFalse }, - { "38", MetaPixelChannels+28, UndefinedOptionFlag, MagickFalse }, - { "39", MetaPixelChannels+29, UndefinedOptionFlag, MagickFalse }, - { "40", MetaPixelChannels+30, UndefinedOptionFlag, MagickFalse }, - { "41", MetaPixelChannels+31, UndefinedOptionFlag, MagickFalse }, - { "42", MetaPixelChannels+32, UndefinedOptionFlag, MagickFalse }, - { "43", MetaPixelChannels+33, UndefinedOptionFlag, MagickFalse }, - { "44", MetaPixelChannels+34, UndefinedOptionFlag, MagickFalse }, - { "45", MetaPixelChannels+35, UndefinedOptionFlag, MagickFalse }, - { "46", MetaPixelChannels+36, UndefinedOptionFlag, MagickFalse }, - { "47", MetaPixelChannels+37, UndefinedOptionFlag, MagickFalse }, - { "48", MetaPixelChannels+38, UndefinedOptionFlag, MagickFalse }, - { "49", MetaPixelChannels+39, UndefinedOptionFlag, MagickFalse }, - { "50", MetaPixelChannels+40, UndefinedOptionFlag, MagickFalse }, - { "51", MetaPixelChannels+41, UndefinedOptionFlag, MagickFalse }, - { "52", MetaPixelChannels+42, UndefinedOptionFlag, MagickFalse }, - { "53", MetaPixelChannels+43, UndefinedOptionFlag, MagickFalse }, - { "54", MetaPixelChannels+44, UndefinedOptionFlag, MagickFalse }, - { "55", MetaPixelChannels+45, UndefinedOptionFlag, MagickFalse }, - { "56", MetaPixelChannels+46, UndefinedOptionFlag, MagickFalse }, - { "57", MetaPixelChannels+47, UndefinedOptionFlag, MagickFalse }, - { "58", MetaPixelChannels+48, UndefinedOptionFlag, MagickFalse }, - { "59", MetaPixelChannels+49, UndefinedOptionFlag, MagickFalse }, - { "60", MetaPixelChannels+50, UndefinedOptionFlag, MagickFalse }, - { "61", MetaPixelChannels+51, UndefinedOptionFlag, MagickFalse }, - { "62", MetaPixelChannels+52, UndefinedOptionFlag, MagickFalse }, - { "63", MetaPixelChannels+53, UndefinedOptionFlag, MagickFalse }, - { "64", MetaPixelChannels+54, UndefinedOptionFlag, MagickFalse }, + { "10", MetaPixelChannelBit(0), UndefinedOptionFlag, MagickFalse }, + { "11", MetaPixelChannelBit(1), UndefinedOptionFlag, MagickFalse }, + { "12", MetaPixelChannelBit(2), UndefinedOptionFlag, MagickFalse }, + { "13", MetaPixelChannelBit(3), UndefinedOptionFlag, MagickFalse }, + { "14", MetaPixelChannelBit(4), UndefinedOptionFlag, MagickFalse }, + { "15", MetaPixelChannelBit(5), UndefinedOptionFlag, MagickFalse }, + { "16", MetaPixelChannelBit(6), UndefinedOptionFlag, MagickFalse }, + { "17", MetaPixelChannelBit(7), UndefinedOptionFlag, MagickFalse }, + { "18", MetaPixelChannelBit(8), UndefinedOptionFlag, MagickFalse }, + { "19", MetaPixelChannelBit(9), UndefinedOptionFlag, MagickFalse }, + { "20", MetaPixelChannelBit(10), UndefinedOptionFlag, MagickFalse }, + { "21", MetaPixelChannelBit(11), UndefinedOptionFlag, MagickFalse }, + { "22", MetaPixelChannelBit(12), UndefinedOptionFlag, MagickFalse }, + { "23", MetaPixelChannelBit(13), UndefinedOptionFlag, MagickFalse }, + { "24", MetaPixelChannelBit(14), UndefinedOptionFlag, MagickFalse }, + { "25", MetaPixelChannelBit(15), UndefinedOptionFlag, MagickFalse }, + { "26", MetaPixelChannelBit(16), UndefinedOptionFlag, MagickFalse }, + { "27", MetaPixelChannelBit(17), UndefinedOptionFlag, MagickFalse }, + { "28", MetaPixelChannelBit(18), UndefinedOptionFlag, MagickFalse }, + { "29", MetaPixelChannelBit(19), UndefinedOptionFlag, MagickFalse }, + { "30", MetaPixelChannelBit(20), UndefinedOptionFlag, MagickFalse }, + { "31", MetaPixelChannelBit(21), UndefinedOptionFlag, MagickFalse }, +#if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT) + { "32", MetaPixelChannelBit(22), UndefinedOptionFlag, MagickFalse }, + { "33", MetaPixelChannelBit(23), UndefinedOptionFlag, MagickFalse }, + { "34", MetaPixelChannelBit(24), UndefinedOptionFlag, MagickFalse }, + { "35", MetaPixelChannelBit(25), UndefinedOptionFlag, MagickFalse }, + { "36", MetaPixelChannelBit(26), UndefinedOptionFlag, MagickFalse }, + { "37", MetaPixelChannelBit(27), UndefinedOptionFlag, MagickFalse }, + { "38", MetaPixelChannelBit(28), UndefinedOptionFlag, MagickFalse }, + { "39", MetaPixelChannelBit(29), UndefinedOptionFlag, MagickFalse }, + { "40", MetaPixelChannelBit(30), UndefinedOptionFlag, MagickFalse }, + { "41", MetaPixelChannelBit(31), UndefinedOptionFlag, MagickFalse }, + { "42", MetaPixelChannelBit(32), UndefinedOptionFlag, MagickFalse }, + { "43", MetaPixelChannelBit(33), UndefinedOptionFlag, MagickFalse }, + { "44", MetaPixelChannelBit(34), UndefinedOptionFlag, MagickFalse }, + { "45", MetaPixelChannelBit(35), UndefinedOptionFlag, MagickFalse }, + { "46", MetaPixelChannelBit(36), UndefinedOptionFlag, MagickFalse }, + { "47", MetaPixelChannelBit(37), UndefinedOptionFlag, MagickFalse }, + { "48", MetaPixelChannelBit(38), UndefinedOptionFlag, MagickFalse }, + { "49", MetaPixelChannelBit(39), UndefinedOptionFlag, MagickFalse }, + { "50", MetaPixelChannelBit(40), UndefinedOptionFlag, MagickFalse }, + { "51", MetaPixelChannelBit(41), UndefinedOptionFlag, MagickFalse }, + { "52", MetaPixelChannelBit(42), UndefinedOptionFlag, MagickFalse }, + { "53", MetaPixelChannelBit(43), UndefinedOptionFlag, MagickFalse }, + { "54", MetaPixelChannelBit(44), UndefinedOptionFlag, MagickFalse }, + { "55", MetaPixelChannelBit(45), UndefinedOptionFlag, MagickFalse }, + { "56", MetaPixelChannelBit(46), UndefinedOptionFlag, MagickFalse }, + { "57", MetaPixelChannelBit(47), UndefinedOptionFlag, MagickFalse }, + { "58", MetaPixelChannelBit(48), UndefinedOptionFlag, MagickFalse }, + { "59", MetaPixelChannelBit(49), UndefinedOptionFlag, MagickFalse }, + { "60", MetaPixelChannelBit(50), UndefinedOptionFlag, MagickFalse }, + { "61", MetaPixelChannelBit(51), UndefinedOptionFlag, MagickFalse }, + { "62", MetaPixelChannelBit(52), UndefinedOptionFlag, MagickFalse }, + { "63", MetaPixelChannelBit(53), UndefinedOptionFlag, MagickFalse }, #endif { (char *) NULL, UndefinedChannel, UndefinedOptionFlag, MagickFalse } }, @@ -1369,6 +1372,7 @@ static const OptionInfo { "JBIG2", JBIG2Compression, UndefinedOptionFlag, MagickFalse }, { "JPEG2000", JPEG2000Compression, UndefinedOptionFlag, MagickFalse }, { "JPEG", JPEGCompression, UndefinedOptionFlag, MagickFalse }, + { "LERC", LERCCompression, UndefinedOptionFlag, MagickFalse }, { "LosslessJPEG", LosslessJPEGCompression, UndefinedOptionFlag, MagickFalse }, { "Lossless", LosslessJPEGCompression, UndefinedOptionFlag, MagickFalse }, { "LZMA", LZMACompression, UndefinedOptionFlag, MagickFalse }, diff --git a/ImageMagick-7.1.1-15/MagickCore/option.h b/ImageMagick-7.1.1-16/MagickCore/option.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/option.h rename to ImageMagick-7.1.1-16/MagickCore/option.h diff --git a/ImageMagick-7.1.1-15/MagickCore/paint.c b/ImageMagick-7.1.1-16/MagickCore/paint.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/paint.c rename to ImageMagick-7.1.1-16/MagickCore/paint.c index 45c9cd5a..acb3f6a7 100644 --- a/ImageMagick-7.1.1-15/MagickCore/paint.c +++ b/ImageMagick-7.1.1-16/MagickCore/paint.c @@ -246,8 +246,8 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, exception); if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL)) break; - p+=x1*GetPixelChannels(image); - q+=x1*GetPixelChannels(floodplane_image); + p+=x1*(ssize_t) GetPixelChannels(image); + q+=x1*(ssize_t) GetPixelChannels(floodplane_image); for (x=x1; x >= 0; x--) { if (GetPixelGray(floodplane_image,q) != 0) @@ -275,10 +275,10 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, { if (x < (ssize_t) image->columns) { - p=GetCacheViewVirtualPixels(image_view,x,y,image->columns-x,1, - exception); - q=GetCacheViewAuthenticPixels(floodplane_view,x,y,image->columns- - x,1,exception); + p=GetCacheViewVirtualPixels(image_view,x,y,(size_t) + ((ssize_t) image->columns-x),1,exception); + q=GetCacheViewAuthenticPixels(floodplane_view,x,y,(size_t) + ((ssize_t) image->columns-x),1,exception); if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL)) break; for ( ; x < (ssize_t) image->columns; x++) @@ -753,8 +753,8 @@ MagickExport Image *OilPaintImage(const Image *image,const double radius, */ status=MagickTrue; progress=0; - center=(ssize_t) GetPixelChannels(linear_image)*(linear_image->columns+width)* - (width/2L)+GetPixelChannels(linear_image)*(width/2L); + center=(ssize_t) (GetPixelChannels(linear_image)*(linear_image->columns+ + width)*(width/2L)+GetPixelChannels(linear_image)*(width/2L)); image_view=AcquireVirtualCacheView(linear_image,exception); paint_view=AcquireAuthenticCacheView(paint_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) @@ -814,7 +814,7 @@ MagickExport Image *OilPaintImage(const Image *image,const double radius, for (u=0; u < (ssize_t) width; u++) { n=(ssize_t) ScaleQuantumToChar(ClampToQuantum(GetPixelIntensity( - linear_image,p+GetPixelChannels(linear_image)*(u+k)))); + linear_image,p+(ssize_t) GetPixelChannels(linear_image)*(u+k)))); histogram[n]++; if (histogram[n] > count) { @@ -837,8 +837,8 @@ MagickExport Image *OilPaintImage(const Image *image,const double radius, SetPixelChannel(paint_image,channel,p[center+i],q); continue; } - SetPixelChannel(paint_image,channel,p[j*GetPixelChannels(linear_image)+ - i],q); + SetPixelChannel(paint_image,channel,p[j*(ssize_t) + GetPixelChannels(linear_image)+i],q); } p+=GetPixelChannels(linear_image); q+=GetPixelChannels(paint_image); diff --git a/ImageMagick-7.1.1-15/MagickCore/paint.h b/ImageMagick-7.1.1-16/MagickCore/paint.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/paint.h rename to ImageMagick-7.1.1-16/MagickCore/paint.h diff --git a/ImageMagick-7.1.1-15/MagickCore/pixel-accessor.h b/ImageMagick-7.1.1-16/MagickCore/pixel-accessor.h similarity index 91% rename from ImageMagick-7.1.1-15/MagickCore/pixel-accessor.h rename to ImageMagick-7.1.1-16/MagickCore/pixel-accessor.h index 7bea62c5..f4f6ced5 100644 --- a/ImageMagick-7.1.1-15/MagickCore/pixel-accessor.h +++ b/ImageMagick-7.1.1-16/MagickCore/pixel-accessor.h @@ -34,7 +34,7 @@ extern "C" { static inline Quantum ClampPixel(const MagickRealType pixel) { - if (pixel < 0.0f) + if (pixel < 0.0) return((Quantum) 0); if (pixel >= (MagickRealType) QuantumRange) return((Quantum) QuantumRange); @@ -234,8 +234,9 @@ static inline MagickRealType GetPixelInfoChannel( return(pixel_info->alpha); } case IndexPixelChannel: return(pixel_info->index); - default: return((MagickRealType) 0.0); + default: break; } + return((MagickRealType) 0.0); } static inline double PerceptibleReciprocal(const double x) @@ -260,13 +261,13 @@ static inline MagickRealType GetPixelInfoLuma( if (pixel->colorspace == sRGBColorspace) { - intensity=(MagickRealType) (0.212656f*pixel->red+0.715158f*pixel->green+ - 0.072186f*pixel->blue); + intensity=(MagickRealType) (0.212656*pixel->red+0.715158*pixel->green+ + 0.072186*pixel->blue); return(intensity); } - intensity=(MagickRealType) (0.212656f*EncodePixelGamma(pixel->red)+ - 0.715158f*EncodePixelGamma(pixel->green)+ - 0.072186f*EncodePixelGamma(pixel->blue)); + intensity=(MagickRealType) (0.212656*EncodePixelGamma(pixel->red)+ + 0.715158*EncodePixelGamma(pixel->green)+ + 0.072186*EncodePixelGamma(pixel->blue)); return(intensity); } @@ -278,13 +279,13 @@ static inline MagickRealType GetPixelInfoLuminance( if (pixel->colorspace != sRGBColorspace) { - intensity=(MagickRealType) (0.212656f*pixel->red+0.715158f*pixel->green+ - 0.072186f*pixel->blue); + intensity=(MagickRealType) (0.212656*pixel->red+0.715158*pixel->green+ + 0.072186*pixel->blue); return(intensity); } - intensity=(MagickRealType) (0.212656f*DecodePixelGamma(pixel->red)+ - 0.715158f*DecodePixelGamma(pixel->green)+ - 0.072186f*DecodePixelGamma(pixel->blue)); + intensity=(MagickRealType) (0.212656*DecodePixelGamma(pixel->red)+ + 0.715158*DecodePixelGamma(pixel->green)+ + 0.072186*DecodePixelGamma(pixel->blue)); return(intensity); } @@ -307,9 +308,9 @@ static inline MagickRealType GetPixelLuma( intensity; intensity= - 0.212656f*(MagickRealType) pixel[image->channel_map[RedPixelChannel].offset]+ - 0.715158f*(MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset]+ - 0.072186f*(MagickRealType) pixel[image->channel_map[BluePixelChannel].offset]; + 0.212656*(MagickRealType) pixel[image->channel_map[RedPixelChannel].offset]+ + 0.715158*(MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset]+ + 0.072186*(MagickRealType) pixel[image->channel_map[BluePixelChannel].offset]; return(intensity); } @@ -322,15 +323,15 @@ static inline MagickRealType GetPixelLuminance( if (image->colorspace != sRGBColorspace) { intensity= - 0.212656f*(MagickRealType) pixel[image->channel_map[RedPixelChannel].offset]+ - 0.715158f*(MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset]+ - 0.072186f*(MagickRealType) pixel[image->channel_map[BluePixelChannel].offset]; + 0.212656*(MagickRealType) pixel[image->channel_map[RedPixelChannel].offset]+ + 0.715158*(MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset]+ + 0.072186*(MagickRealType) pixel[image->channel_map[BluePixelChannel].offset]; return(intensity); } - intensity=(MagickRealType) (0.212656f*DecodePixelGamma((MagickRealType) - pixel[image->channel_map[RedPixelChannel].offset])+0.715158f* + intensity=(MagickRealType) (0.212656*DecodePixelGamma((MagickRealType) + pixel[image->channel_map[RedPixelChannel].offset])+0.715158* DecodePixelGamma((MagickRealType) - pixel[image->channel_map[GreenPixelChannel].offset])+0.072186f* + pixel[image->channel_map[GreenPixelChannel].offset])+0.072186* DecodePixelGamma((MagickRealType) pixel[image->channel_map[BluePixelChannel].offset])); return(intensity); @@ -499,7 +500,7 @@ static inline PixelTrait GetPixelYellowTraits( static inline MagickRealType AbsolutePixelValue(const MagickRealType x) { - return(x < 0.0f ? -x : x); + return(x < 0.0 ? -x : x); } static inline MagickBooleanType IsPixelAtDepth(const Quantum pixel, @@ -511,11 +512,11 @@ static inline MagickBooleanType IsPixelAtDepth(const Quantum pixel, if (range == 0) return(MagickTrue); #if !defined(MAGICKCORE_HDRI_SUPPORT) - quantum=(Quantum) (((MagickRealType) QuantumRange*((QuantumAny) - (((MagickRealType) range*pixel)/QuantumRange+0.5)))/range+0.5); + quantum=(Quantum) (((double) QuantumRange*((QuantumAny) (((double) range* + pixel)/(double) QuantumRange+0.5)))/(double) range+0.5); #else - quantum=(Quantum) (((MagickRealType) QuantumRange*((QuantumAny) - (((MagickRealType) range*pixel)/QuantumRange+0.5)))/(MagickRealType) range); + quantum=(Quantum) (((double) QuantumRange*((QuantumAny) (((double) range* + (double) pixel)/(double) QuantumRange+0.5)))/(double) range); #endif return(pixel == quantum ? MagickTrue : MagickFalse); } @@ -536,8 +537,8 @@ static inline MagickBooleanType IsPixelEquivalent( q->alpha; if (AbsolutePixelValue(alpha-beta) >= MagickEpsilon) return(MagickFalse); - if ((AbsolutePixelValue(alpha-TransparentAlpha) < MagickEpsilon) || - (AbsolutePixelValue(beta-TransparentAlpha) < MagickEpsilon)) + if ((AbsolutePixelValue(alpha-(MagickRealType) TransparentAlpha) < MagickEpsilon) || + (AbsolutePixelValue(beta-(MagickRealType) TransparentAlpha) < MagickEpsilon)) return(MagickTrue); /* no color component if pixel is transparent */ color=(MagickRealType) p[image->channel_map[RedPixelChannel].offset]; if (AbsolutePixelValue(color-q->red) >= MagickEpsilon) @@ -564,11 +565,12 @@ static inline MagickBooleanType IsPixelGray(const Image *magick_restrict image, green_blue, red_green; - red_green=(MagickRealType) pixel[image->channel_map[RedPixelChannel].offset]- - pixel[image->channel_map[GreenPixelChannel].offset]; - green_blue=(MagickRealType) - pixel[image->channel_map[GreenPixelChannel].offset]- - pixel[image->channel_map[BluePixelChannel].offset]; + red_green= + (MagickRealType) pixel[image->channel_map[RedPixelChannel].offset]- + (MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset]; + green_blue= + (MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset]- + (MagickRealType) pixel[image->channel_map[BluePixelChannel].offset]; if ((AbsolutePixelValue(red_green) < MagickEpsilon) && (AbsolutePixelValue(green_blue) < MagickEpsilon)) return(MagickTrue); @@ -588,8 +590,8 @@ static inline MagickBooleanType IsPixelInfoEquivalent( q->alpha; if (AbsolutePixelValue(alpha-beta) >= MagickEpsilon) return(MagickFalse); - if ((AbsolutePixelValue(alpha-TransparentAlpha) < MagickEpsilon) || - (AbsolutePixelValue(beta-TransparentAlpha) < MagickEpsilon)) + if ((AbsolutePixelValue(alpha-(MagickRealType) TransparentAlpha) < MagickEpsilon) || + (AbsolutePixelValue(beta-(MagickRealType) TransparentAlpha) < MagickEpsilon)) return(MagickTrue); /* no color component if pixel is transparent */ if (AbsolutePixelValue(p->red-q->red) >= MagickEpsilon) return(MagickFalse); @@ -615,13 +617,14 @@ static inline MagickBooleanType IsPixelMonochrome( red=(MagickRealType) pixel[image->channel_map[RedPixelChannel].offset]; if ((AbsolutePixelValue(red) >= MagickEpsilon) && - (AbsolutePixelValue(red-QuantumRange) >= MagickEpsilon)) + (AbsolutePixelValue(red-(MagickRealType) QuantumRange) >= MagickEpsilon)) return(MagickFalse); - red_green=(MagickRealType) pixel[image->channel_map[RedPixelChannel].offset]- - pixel[image->channel_map[GreenPixelChannel].offset]; - green_blue=(MagickRealType) - pixel[image->channel_map[GreenPixelChannel].offset]- - pixel[image->channel_map[BluePixelChannel].offset]; + red_green= + (MagickRealType) pixel[image->channel_map[RedPixelChannel].offset]- + (MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset]; + green_blue= + (MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset]- + (MagickRealType) pixel[image->channel_map[BluePixelChannel].offset]; if ((AbsolutePixelValue(red_green) < MagickEpsilon) && (AbsolutePixelValue(green_blue) < MagickEpsilon)) return(MagickTrue); @@ -645,7 +648,7 @@ static inline MagickBooleanType IsPixelInfoMonochrome( red_green; if ((AbsolutePixelValue(pixel_info->red) >= MagickEpsilon) || - (AbsolutePixelValue(pixel_info->red-QuantumRange) >= MagickEpsilon)) + (AbsolutePixelValue(pixel_info->red-(MagickRealType) QuantumRange) >= MagickEpsilon)) return(MagickFalse); red_green=pixel_info->red-pixel_info->green; green_blue=pixel_info->green-pixel_info->blue; diff --git a/ImageMagick-7.1.1-15/MagickCore/pixel-private.h b/ImageMagick-7.1.1-16/MagickCore/pixel-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/pixel-private.h rename to ImageMagick-7.1.1-16/MagickCore/pixel-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/pixel.c b/ImageMagick-7.1.1-16/MagickCore/pixel.c similarity index 92% rename from ImageMagick-7.1.1-15/MagickCore/pixel.c rename to ImageMagick-7.1.1-16/MagickCore/pixel.c index 2508c968..4f18d88e 100644 --- a/ImageMagick-7.1.1-15/MagickCore/pixel.c +++ b/ImageMagick-7.1.1-16/MagickCore/pixel.c @@ -317,10 +317,10 @@ static inline double DecodeGamma(const double x) MagickExport MagickRealType DecodePixelGamma(const MagickRealType pixel) { - if (pixel <= (0.0404482362771076*QuantumRange)) - return(pixel/12.92f); - return((MagickRealType) (QuantumRange*DecodeGamma((double) (QuantumScale* - pixel+0.055)/1.055))); + if (pixel <= (0.0404482362771076*(double) QuantumRange)) + return(pixel/12.92); + return((MagickRealType) ((double) QuantumRange*DecodeGamma((double) + (QuantumScale*pixel+0.055)/1.055))); } /* @@ -444,8 +444,8 @@ static inline double EncodeGamma(const double x) MagickExport MagickRealType EncodePixelGamma(const MagickRealType pixel) { - if (pixel <= (0.0031306684425005883*QuantumRange)) - return(12.92f*pixel); + if (pixel <= (0.0031306684425005883*(double) QuantumRange)) + return(12.92*pixel); return((MagickRealType) QuantumRange*(1.055*EncodeGamma((double) QuantumScale* pixel)-0.055)); } @@ -741,9 +741,9 @@ static MagickBooleanType ExportDoublePixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(double) (QuantumScale*GetPixelBlue(image,p)); - *q++=(double) (QuantumScale*GetPixelGreen(image,p)); - *q++=(double) (QuantumScale*GetPixelRed(image,p)); + *q++=QuantumScale*(double) GetPixelBlue(image,p); + *q++=QuantumScale*(double) GetPixelGreen(image,p); + *q++=QuantumScale*(double) GetPixelRed(image,p); p+=GetPixelChannels(image); } } @@ -758,10 +758,10 @@ static MagickBooleanType ExportDoublePixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(double) (QuantumScale*GetPixelBlue(image,p)); - *q++=(double) (QuantumScale*GetPixelGreen(image,p)); - *q++=(double) (QuantumScale*GetPixelRed(image,p)); - *q++=(double) (QuantumScale*GetPixelAlpha(image,p)); + *q++=QuantumScale*(double) GetPixelBlue(image,p); + *q++=QuantumScale*(double) GetPixelGreen(image,p); + *q++=QuantumScale*(double) GetPixelRed(image,p); + *q++=QuantumScale*(double) GetPixelAlpha(image,p); p+=GetPixelChannels(image); } } @@ -776,9 +776,9 @@ static MagickBooleanType ExportDoublePixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(double) (QuantumScale*GetPixelBlue(image,p)); - *q++=(double) (QuantumScale*GetPixelGreen(image,p)); - *q++=(double) (QuantumScale*GetPixelRed(image,p)); + *q++=QuantumScale*(double) GetPixelBlue(image,p); + *q++=QuantumScale*(double) GetPixelGreen(image,p); + *q++=QuantumScale*(double) GetPixelRed(image,p); *q++=0.0; p+=GetPixelChannels(image); } @@ -794,7 +794,7 @@ static MagickBooleanType ExportDoublePixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(double) (QuantumScale*GetPixelIntensity(image,p)); + *q++=(double) (QuantumScale*(double) GetPixelIntensity(image,p)); p+=GetPixelChannels(image); } } @@ -809,9 +809,9 @@ static MagickBooleanType ExportDoublePixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(double) (QuantumScale*GetPixelRed(image,p)); - *q++=(double) (QuantumScale*GetPixelGreen(image,p)); - *q++=(double) (QuantumScale*GetPixelBlue(image,p)); + *q++=QuantumScale*(double) GetPixelRed(image,p); + *q++=QuantumScale*(double) GetPixelGreen(image,p); + *q++=QuantumScale*(double) GetPixelBlue(image,p); p+=GetPixelChannels(image); } } @@ -826,10 +826,10 @@ static MagickBooleanType ExportDoublePixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(double) (QuantumScale*GetPixelRed(image,p)); - *q++=(double) (QuantumScale*GetPixelGreen(image,p)); - *q++=(double) (QuantumScale*GetPixelBlue(image,p)); - *q++=(double) (QuantumScale*GetPixelAlpha(image,p)); + *q++=QuantumScale*(double) GetPixelRed(image,p); + *q++=QuantumScale*(double) GetPixelGreen(image,p); + *q++=QuantumScale*(double) GetPixelBlue(image,p); + *q++=QuantumScale*(double) GetPixelAlpha(image,p); p+=GetPixelChannels(image); } } @@ -844,9 +844,9 @@ static MagickBooleanType ExportDoublePixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(double) (QuantumScale*GetPixelRed(image,p)); - *q++=(double) (QuantumScale*GetPixelGreen(image,p)); - *q++=(double) (QuantumScale*GetPixelBlue(image,p)); + *q++=QuantumScale*(double) GetPixelRed(image,p); + *q++=QuantumScale*(double) GetPixelGreen(image,p); + *q++=QuantumScale*(double) GetPixelBlue(image,p); *q++=0.0; p+=GetPixelChannels(image); } @@ -872,41 +872,40 @@ static MagickBooleanType ExportDoublePixel(const Image *image, case RedQuantum: case CyanQuantum: { - *q=(double) (QuantumScale*GetPixelRed(image,p)); + *q=QuantumScale*(double) GetPixelRed(image,p); break; } case GreenQuantum: case MagentaQuantum: { - *q=(double) (QuantumScale*GetPixelGreen(image,p)); + *q=QuantumScale*(double) GetPixelGreen(image,p); break; } case BlueQuantum: case YellowQuantum: { - *q=(double) (QuantumScale*GetPixelBlue(image,p)); + *q=QuantumScale*(double) GetPixelBlue(image,p); break; } case AlphaQuantum: { - *q=(double) (QuantumScale*GetPixelAlpha(image,p)); + *q=QuantumScale*(double) GetPixelAlpha(image,p); break; } case OpacityQuantum: { - *q=(double) (QuantumScale*GetPixelAlpha(image,p)); + *q=QuantumScale*(double) GetPixelAlpha(image,p); break; } case BlackQuantum: { if (image->colorspace == CMYKColorspace) - *q=(double) (QuantumScale* - GetPixelBlack(image,p)); + *q=QuantumScale*(double) GetPixelBlack(image,p); break; } case IndexQuantum: { - *q=(double) (QuantumScale*GetPixelIntensity(image,p)); + *q=QuantumScale*(double) GetPixelIntensity(image,p); break; } default: @@ -949,9 +948,9 @@ static MagickBooleanType ExportFloatPixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(float) (QuantumScale*GetPixelBlue(image,p)); - *q++=(float) (QuantumScale*GetPixelGreen(image,p)); - *q++=(float) (QuantumScale*GetPixelRed(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelBlue(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelGreen(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelRed(image,p)); p+=GetPixelChannels(image); } } @@ -966,10 +965,10 @@ static MagickBooleanType ExportFloatPixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(float) (QuantumScale*GetPixelBlue(image,p)); - *q++=(float) (QuantumScale*GetPixelGreen(image,p)); - *q++=(float) (QuantumScale*GetPixelRed(image,p)); - *q++=(float) (QuantumScale*GetPixelAlpha(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelBlue(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelGreen(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelRed(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelAlpha(image,p)); p+=GetPixelChannels(image); } } @@ -984,9 +983,9 @@ static MagickBooleanType ExportFloatPixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(float) (QuantumScale*GetPixelBlue(image,p)); - *q++=(float) (QuantumScale*GetPixelGreen(image,p)); - *q++=(float) (QuantumScale*GetPixelRed(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelBlue(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelGreen(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelRed(image,p)); *q++=0.0; p+=GetPixelChannels(image); } @@ -1002,7 +1001,7 @@ static MagickBooleanType ExportFloatPixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(float) (QuantumScale*GetPixelIntensity(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelIntensity(image,p)); p+=GetPixelChannels(image); } } @@ -1017,9 +1016,9 @@ static MagickBooleanType ExportFloatPixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(float) (QuantumScale*GetPixelRed(image,p)); - *q++=(float) (QuantumScale*GetPixelGreen(image,p)); - *q++=(float) (QuantumScale*GetPixelBlue(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelRed(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelGreen(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelBlue(image,p)); p+=GetPixelChannels(image); } } @@ -1034,10 +1033,10 @@ static MagickBooleanType ExportFloatPixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(float) (QuantumScale*GetPixelRed(image,p)); - *q++=(float) (QuantumScale*GetPixelGreen(image,p)); - *q++=(float) (QuantumScale*GetPixelBlue(image,p)); - *q++=(float) (QuantumScale*GetPixelAlpha(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelRed(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelGreen(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelBlue(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelAlpha(image,p)); p+=GetPixelChannels(image); } } @@ -1052,9 +1051,9 @@ static MagickBooleanType ExportFloatPixel(const Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - *q++=(float) (QuantumScale*GetPixelRed(image,p)); - *q++=(float) (QuantumScale*GetPixelGreen(image,p)); - *q++=(float) (QuantumScale*GetPixelBlue(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelRed(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelGreen(image,p)); + *q++=(float) (QuantumScale*(double) GetPixelBlue(image,p)); *q++=0.0; p+=GetPixelChannels(image); } @@ -1080,40 +1079,40 @@ static MagickBooleanType ExportFloatPixel(const Image *image, case RedQuantum: case CyanQuantum: { - *q=(float) (QuantumScale*GetPixelRed(image,p)); + *q=(float) (QuantumScale*(double) GetPixelRed(image,p)); break; } case GreenQuantum: case MagentaQuantum: { - *q=(float) (QuantumScale*GetPixelGreen(image,p)); + *q=(float) (QuantumScale*(double) GetPixelGreen(image,p)); break; } case BlueQuantum: case YellowQuantum: { - *q=(float) (QuantumScale*GetPixelBlue(image,p)); + *q=(float) (QuantumScale*(double) GetPixelBlue(image,p)); break; } case AlphaQuantum: { - *q=(float) (QuantumScale*((Quantum) (GetPixelAlpha(image,p)))); + *q=(float) (QuantumScale*((double) (GetPixelAlpha(image,p)))); break; } case OpacityQuantum: { - *q=(float) (QuantumScale*GetPixelAlpha(image,p)); + *q=(float) (QuantumScale*(double) GetPixelAlpha(image,p)); break; } case BlackQuantum: { if (image->colorspace == CMYKColorspace) - *q=(float) (QuantumScale* GetPixelBlack(image,p)); + *q=(float) (QuantumScale*(double) GetPixelBlack(image,p)); break; } case IndexQuantum: { - *q=(float) (QuantumScale*GetPixelIntensity(image,p)); + *q=(float) (QuantumScale*(double) GetPixelIntensity(image,p)); break; } default: @@ -2259,7 +2258,7 @@ MagickExport MagickRealType GetPixelInfoIntensity( case MSPixelIntensityMethod: { intensity=(MagickRealType) (((double) red*red+green*green+blue*blue)/ - (3.0*QuantumRange)); + (3.0*(double) QuantumRange)); break; } case Rec601LumaPixelIntensityMethod: @@ -2389,7 +2388,7 @@ MagickExport MagickRealType GetPixelIntensity( case MSPixelIntensityMethod: { intensity=(MagickRealType) (((double) red*red+green*green+blue*blue)/ - (3.0*QuantumRange)); + (3.0*(double) QuantumRange)); break; } case Rec601LumaPixelIntensityMethod: @@ -2797,11 +2796,11 @@ static MagickBooleanType ImportDoublePixel(Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; q+=GetPixelChannels(image); } @@ -2819,13 +2818,13 @@ static MagickBooleanType ImportDoublePixel(Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelAlpha(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; q+=GetPixelChannels(image); } @@ -2843,11 +2842,11 @@ static MagickBooleanType ImportDoublePixel(Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; p++; q+=GetPixelChannels(image); @@ -2866,7 +2865,7 @@ static MagickBooleanType ImportDoublePixel(Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelGray(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGray(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; q+=GetPixelChannels(image); } @@ -2884,11 +2883,11 @@ static MagickBooleanType ImportDoublePixel(Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; q+=GetPixelChannels(image); } @@ -2906,13 +2905,13 @@ static MagickBooleanType ImportDoublePixel(Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelAlpha(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; q+=GetPixelChannels(image); } @@ -2930,11 +2929,11 @@ static MagickBooleanType ImportDoublePixel(Image *image, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(*p)),q); p++; q+=GetPixelChannels(image); } @@ -2961,39 +2960,39 @@ static MagickBooleanType ImportDoublePixel(Image *image, case RedQuantum: case CyanQuantum: { - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(*p)),q); break; } case GreenQuantum: case MagentaQuantum: { - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(*p)),q); break; } case BlueQuantum: case YellowQuantum: { - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(*p)),q); break; } case AlphaQuantum: { - SetPixelAlpha(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(*p)),q); break; } case OpacityQuantum: { - SetPixelAlpha(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(*p)),q); break; } case BlackQuantum: { - SetPixelBlack(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlack(image,ClampToQuantum((double) QuantumRange*(*p)),q); break; } case IndexQuantum: { - SetPixelGray(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGray(image,ClampToQuantum((double) QuantumRange*(*p)),q); break; } default: @@ -3038,11 +3037,14 @@ static MagickBooleanType ImportFloatPixel(Image *image,const RectangleInfo *roi, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; q+=GetPixelChannels(image); } @@ -3060,13 +3062,17 @@ static MagickBooleanType ImportFloatPixel(Image *image,const RectangleInfo *roi, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelAlpha(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; q+=GetPixelChannels(image); } @@ -3084,11 +3090,14 @@ static MagickBooleanType ImportFloatPixel(Image *image,const RectangleInfo *roi, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; p++; q+=GetPixelChannels(image); @@ -3107,7 +3116,8 @@ static MagickBooleanType ImportFloatPixel(Image *image,const RectangleInfo *roi, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelGray(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGray(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; q+=GetPixelChannels(image); } @@ -3125,11 +3135,14 @@ static MagickBooleanType ImportFloatPixel(Image *image,const RectangleInfo *roi, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; q+=GetPixelChannels(image); } @@ -3147,13 +3160,17 @@ static MagickBooleanType ImportFloatPixel(Image *image,const RectangleInfo *roi, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelAlpha(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; q+=GetPixelChannels(image); } @@ -3171,11 +3188,14 @@ static MagickBooleanType ImportFloatPixel(Image *image,const RectangleInfo *roi, break; for (x=0; x < (ssize_t) roi->width; x++) { - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); p++; q+=GetPixelChannels(image); } @@ -3202,39 +3222,46 @@ static MagickBooleanType ImportFloatPixel(Image *image,const RectangleInfo *roi, case RedQuantum: case CyanQuantum: { - SetPixelRed(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); break; } case GreenQuantum: case MagentaQuantum: { - SetPixelGreen(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); break; } case BlueQuantum: case YellowQuantum: { - SetPixelBlue(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); break; } case AlphaQuantum: { - SetPixelAlpha(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); break; } case OpacityQuantum: { - SetPixelAlpha(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); break; } case BlackQuantum: { - SetPixelBlack(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelBlack(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); break; } case IndexQuantum: { - SetPixelGray(image,ClampToQuantum(QuantumRange*(*p)),q); + SetPixelGray(image,ClampToQuantum((double) QuantumRange*(double) + (*p)),q); break; } default: @@ -4566,15 +4593,15 @@ MagickExport MagickBooleanType InterpolatePixelChannel( for (i=0; i < (ssize_t) count; i++) { alpha[i]=1.0; - pixels[i]=(double) p[i*GetPixelChannels(image)+ + pixels[i]=(double) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } else for (i=0; i < (ssize_t) count; i++) { - alpha[i]=QuantumScale*GetPixelAlpha(image,p+i* - GetPixelChannels(image)); - pixels[i]=alpha[i]*p[i*GetPixelChannels(image)+ + alpha[i]=QuantumScale*(double) GetPixelAlpha(image,p+i* + (ssize_t) GetPixelChannels(image)); + pixels[i]=alpha[i]*(double) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } for (i=0; i < (ssize_t) count; i++) @@ -4601,15 +4628,15 @@ MagickExport MagickBooleanType InterpolatePixelChannel( for (i=0; i < 4; i++) { alpha[i]=1.0; - pixels[i]=(double) p[i*GetPixelChannels(image)+ + pixels[i]=(double) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } else for (i=0; i < 4; i++) { - alpha[i]=QuantumScale*GetPixelAlpha(image,p+i* - GetPixelChannels(image)); - pixels[i]=alpha[i]*p[i*GetPixelChannels(image)+ + alpha[i]=QuantumScale*(double) GetPixelAlpha(image,p+i* + (ssize_t) GetPixelChannels(image)); + pixels[i]=alpha[i]*(double) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } delta.x=x-x_offset; @@ -4635,15 +4662,15 @@ MagickExport MagickBooleanType InterpolatePixelChannel( for (i=0; i < 4; i++) { alpha[i]=1.0; - pixels[i]=(MagickRealType) p[i*GetPixelChannels(image)+ + pixels[i]=(MagickRealType) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } else for (i=0; i < 4; i++) { - alpha[i]=QuantumScale*GetPixelAlpha(image,p+i* - GetPixelChannels(image)); - pixels[i]=alpha[i]*p[i*GetPixelChannels(image)+ + alpha[i]=QuantumScale*(double) GetPixelAlpha(image,p+i* + (ssize_t) GetPixelChannels(image)); + pixels[i]=alpha[i]*(double) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } gamma=1.0; /* number of pixels blended together (its variable) */ @@ -4697,15 +4724,15 @@ MagickExport MagickBooleanType InterpolatePixelChannel( for (i=0; i < 16; i++) { alpha[i]=1.0; - pixels[i]=(double) p[i*GetPixelChannels(image)+ + pixels[i]=(double) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } else for (i=0; i < 16; i++) { - alpha[i]=QuantumScale*GetPixelAlpha(image,p+i* - GetPixelChannels(image)); - pixels[i]=alpha[i]*p[i*GetPixelChannels(image)+ + alpha[i]=QuantumScale*(double) GetPixelAlpha(image,p+i* + (ssize_t) GetPixelChannels(image)); + pixels[i]=alpha[i]*(double) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } CatromWeights((double) (x-x_offset),&cx); @@ -4763,15 +4790,15 @@ MagickExport MagickBooleanType InterpolatePixelChannel( for (i=0; i < 4; i++) { alpha[i]=1.0; - pixels[i]=(double) p[i*GetPixelChannels(image)+ + pixels[i]=(double) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } else for (i=0; i < 4; i++) { - alpha[i]=QuantumScale*GetPixelAlpha(image,p+i* - GetPixelChannels(image)); - pixels[i]=alpha[i]*p[i*GetPixelChannels(image)+ + alpha[i]=QuantumScale*(double) GetPixelAlpha(image,p+i* + (ssize_t) GetPixelChannels(image)); + pixels[i]=alpha[i]*(double) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } delta.x=x-x_offset; @@ -4855,15 +4882,15 @@ MagickExport MagickBooleanType InterpolatePixelChannel( for (i=0; i < 16; i++) { alpha[i]=1.0; - pixels[i]=(double) p[i*GetPixelChannels(image)+ + pixels[i]=(double) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } else for (i=0; i < 16; i++) { - alpha[i]=QuantumScale*GetPixelAlpha(image,p+i* - GetPixelChannels(image)); - pixels[i]=alpha[i]*p[i*GetPixelChannels(image)+ + alpha[i]=QuantumScale*(double) GetPixelAlpha(image,p+i* + (ssize_t) GetPixelChannels(image)); + pixels[i]=alpha[i]*(double) p[i*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,channel)]; } SplineWeights((double) (x-x_offset),&cx); @@ -5010,7 +5037,7 @@ MagickExport MagickBooleanType InterpolatePixelChannels( (destination_traits == UndefinedPixelTrait)) continue; for (j=0; j < (ssize_t) count; j++) - pixels[j]=(double) p[j*GetPixelChannels(source)+i]; + pixels[j]=(double) p[j*(ssize_t) GetPixelChannels(source)+i]; sum=0.0; if ((traits & BlendPixelTrait) == 0) { @@ -5022,8 +5049,8 @@ MagickExport MagickBooleanType InterpolatePixelChannels( } for (j=0; j < (ssize_t) count; j++) { - alpha[j]=QuantumScale*GetPixelAlpha(source,p+j* - GetPixelChannels(source)); + alpha[j]=QuantumScale*(double) GetPixelAlpha(source,p+j* + (ssize_t) GetPixelChannels(source)); pixels[j]*=alpha[j]; gamma=PerceptibleReciprocal(alpha[j]); sum+=gamma*pixels[j]; @@ -5060,9 +5087,9 @@ MagickExport MagickBooleanType InterpolatePixelChannels( epsilon.x=1.0-delta.x; epsilon.y=1.0-delta.y; pixels[0]=(double) p[i]; - pixels[1]=(double) p[GetPixelChannels(source)+i]; - pixels[2]=(double) p[2*GetPixelChannels(source)+i]; - pixels[3]=(double) p[3*GetPixelChannels(source)+i]; + pixels[1]=(double) p[(ssize_t) GetPixelChannels(source)+i]; + pixels[2]=(double) p[2*(ssize_t) GetPixelChannels(source)+i]; + pixels[3]=(double) p[3*(ssize_t) GetPixelChannels(source)+i]; if ((traits & BlendPixelTrait) == 0) { gamma=((epsilon.y*(epsilon.x+delta.x)+delta.y*(epsilon.x+delta.x))); @@ -5072,11 +5099,12 @@ MagickExport MagickBooleanType InterpolatePixelChannels( pixels[2]+delta.x*pixels[3]))),pixel); continue; } - alpha[0]=QuantumScale*GetPixelAlpha(source,p); - alpha[1]=QuantumScale*GetPixelAlpha(source,p+GetPixelChannels(source)); - alpha[2]=QuantumScale*GetPixelAlpha(source,p+2* + alpha[0]=QuantumScale*(double) GetPixelAlpha(source,p); + alpha[1]=QuantumScale*(double) GetPixelAlpha(source,p+ GetPixelChannels(source)); - alpha[3]=QuantumScale*GetPixelAlpha(source,p+3* + alpha[2]=QuantumScale*(double) GetPixelAlpha(source,p+2* + GetPixelChannels(source)); + alpha[3]=QuantumScale*(double) GetPixelAlpha(source,p+3* GetPixelChannels(source)); pixels[0]*=alpha[0]; pixels[1]*=alpha[1]; @@ -5115,14 +5143,14 @@ MagickExport MagickBooleanType InterpolatePixelChannels( for (j=0; j < 4; j++) { alpha[j]=1.0; - pixels[j]=(double) p[j*GetPixelChannels(source)+i]; + pixels[j]=(double) p[j*(ssize_t) GetPixelChannels(source)+i]; } else for (j=0; j < 4; j++) { - alpha[j]=QuantumScale*GetPixelAlpha(source,p+j* - GetPixelChannels(source)); - pixels[j]=(double) p[j*GetPixelChannels(source)+i]; + alpha[j]=QuantumScale*(double) GetPixelAlpha(source,p+j* + (ssize_t) GetPixelChannels(source)); + pixels[j]=(double) p[j*(ssize_t) GetPixelChannels(source)+i]; if (channel != AlphaPixelChannel) pixels[j]*=alpha[j]; } @@ -5192,14 +5220,15 @@ MagickExport MagickBooleanType InterpolatePixelChannels( for (j=0; j < 16; j++) { alpha[j]=1.0; - pixels[j]=(double) p[j*GetPixelChannels(source)+i]; + pixels[j]=(double) p[j*(ssize_t) GetPixelChannels(source)+i]; } else for (j=0; j < 16; j++) { - alpha[j]=QuantumScale*GetPixelAlpha(source,p+j* - GetPixelChannels(source)); - pixels[j]=alpha[j]*p[j*GetPixelChannels(source)+i]; + alpha[j]=QuantumScale*(double) GetPixelAlpha(source,p+j* + (ssize_t) GetPixelChannels(source)); + pixels[j]=alpha[j]*(double) + p[j*(ssize_t) GetPixelChannels(source)+i]; } CatromWeights((double) (x-x_offset),&cx); CatromWeights((double) (y-y_offset),&cy); @@ -5284,9 +5313,9 @@ MagickExport MagickBooleanType InterpolatePixelChannels( (destination_traits == UndefinedPixelTrait)) continue; pixels[0]=(double) p[i]; - pixels[1]=(double) p[GetPixelChannels(source)+i]; - pixels[2]=(double) p[2*GetPixelChannels(source)+i]; - pixels[3]=(double) p[3*GetPixelChannels(source)+i]; + pixels[1]=(double) p[(ssize_t) GetPixelChannels(source)+i]; + pixels[2]=(double) p[2*(ssize_t) GetPixelChannels(source)+i]; + pixels[3]=(double) p[3*(ssize_t) GetPixelChannels(source)+i]; if ((traits & BlendPixelTrait) == 0) { alpha[0]=1.0; @@ -5296,12 +5325,12 @@ MagickExport MagickBooleanType InterpolatePixelChannels( } else { - alpha[0]=QuantumScale*GetPixelAlpha(source,p); - alpha[1]=QuantumScale*GetPixelAlpha(source,p+ + alpha[0]=QuantumScale*(double) GetPixelAlpha(source,p); + alpha[1]=QuantumScale*(double) GetPixelAlpha(source,p+ GetPixelChannels(source)); - alpha[2]=QuantumScale*GetPixelAlpha(source,p+2* + alpha[2]=QuantumScale*(double) GetPixelAlpha(source,p+2* GetPixelChannels(source)); - alpha[3]=QuantumScale*GetPixelAlpha(source,p+3* + alpha[3]=QuantumScale*(double) GetPixelAlpha(source,p+3* GetPixelChannels(source)); } delta.x=x-x_offset; @@ -5399,14 +5428,15 @@ MagickExport MagickBooleanType InterpolatePixelChannels( for (j=0; j < 16; j++) { alpha[j]=1.0; - pixels[j]=(double) p[j*GetPixelChannels(source)+i]; + pixels[j]=(double) p[j*(ssize_t) GetPixelChannels(source)+i]; } else for (j=0; j < 16; j++) { - alpha[j]=QuantumScale*GetPixelAlpha(source,p+j* - GetPixelChannels(source)); - pixels[j]=alpha[j]*p[j*GetPixelChannels(source)+i]; + alpha[j]=QuantumScale*(double) GetPixelAlpha(source,p+j* + (ssize_t) GetPixelChannels(source)); + pixels[j]=alpha[j]*(double) p[j*(ssize_t) GetPixelChannels(source)+ + i]; } SplineWeights((double) (x-x_offset),&cx); SplineWeights((double) (y-y_offset),&cy); @@ -5484,13 +5514,13 @@ static inline void AlphaBlendPixelInfo(const Image *image, pixel_info->alpha=(double) GetPixelAlpha(image,pixel); return; } - *alpha=QuantumScale*GetPixelAlpha(image,pixel); - pixel_info->red=(*alpha*GetPixelRed(image,pixel)); - pixel_info->green=(*alpha*GetPixelGreen(image,pixel)); - pixel_info->blue=(*alpha*GetPixelBlue(image,pixel)); + *alpha=QuantumScale*(double) GetPixelAlpha(image,pixel); + pixel_info->red=(*alpha*(double) GetPixelRed(image,pixel)); + pixel_info->green=(*alpha*(double) GetPixelGreen(image,pixel)); + pixel_info->blue=(*alpha*(double) GetPixelBlue(image,pixel)); pixel_info->black=0.0; if (image->colorspace == CMYKColorspace) - pixel_info->black=(*alpha*GetPixelBlack(image,pixel)); + pixel_info->black=(*alpha*(double) GetPixelBlack(image,pixel)); pixel_info->alpha=(double) GetPixelAlpha(image,pixel); } @@ -5600,7 +5630,8 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image, break; } for (i=0; i < 4L; i++) - AlphaBlendPixelInfo(image,p+i*GetPixelChannels(image),pixels+i,alpha+i); + AlphaBlendPixelInfo(image,p+i*(ssize_t) GetPixelChannels(image), + pixels+i,alpha+i); delta.x=x-x_offset; delta.y=y-y_offset; epsilon.x=1.0-delta.x; @@ -5637,8 +5668,9 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image, } for (i=0; i < 4L; i++) { - GetPixelInfoPixel(image,p+i*GetPixelChannels(image),pixels+i); - AlphaBlendPixelInfo(image,p+i*GetPixelChannels(image),pixels+i,alpha+i); + GetPixelInfoPixel(image,p+i*(ssize_t) GetPixelChannels(image),pixels+i); + AlphaBlendPixelInfo(image,p+i*(ssize_t) GetPixelChannels(image), + pixels+i,alpha+i); } gamma=1.0; /* number of pixels blended together (its variable) */ for (i=0; i <= 1L; i++) @@ -5699,7 +5731,8 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image, break; } for (i=0; i < 16L; i++) - AlphaBlendPixelInfo(image,p+i*GetPixelChannels(image),pixels+i,alpha+i); + AlphaBlendPixelInfo(image,p+i*(ssize_t) GetPixelChannels(image), + pixels+i,alpha+i); CatromWeights((double) (x-x_offset),&cx); CatromWeights((double) (y-y_offset),&cy); pixel->red=(cy[0]*(cx[0]*pixels[0].red+cx[1]*pixels[1].red+cx[2]* @@ -5895,7 +5928,8 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image, break; } for (i=0; i < 16L; i++) - AlphaBlendPixelInfo(image,p+i*GetPixelChannels(image),pixels+i,alpha+i); + AlphaBlendPixelInfo(image,p+i*(ssize_t) GetPixelChannels(image), + pixels+i,alpha+i); SplineWeights((double) (x-x_offset),&cx); SplineWeights((double) (y-y_offset),&cy); pixel->red=(cy[0]*(cx[0]*pixels[0].red+cx[1]*pixels[1].red+cx[2]* @@ -5985,7 +6019,8 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixel(const Image *source, /* Transparencies are involved - set alpha distance. */ - pixel=GetPixelAlpha(source,p)-(double) GetPixelAlpha(destination,q); + pixel=(double) GetPixelAlpha(source,p)-(double) + GetPixelAlpha(destination,q); distance=pixel*pixel; if (distance > fuzz) return(MagickFalse); @@ -5994,9 +6029,9 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixel(const Image *source, Note that if one color is transparent, distance has no color component. */ if (source->alpha_trait != UndefinedPixelTrait) - scale*=QuantumScale*GetPixelAlpha(source,p); + scale*=QuantumScale*(double) GetPixelAlpha(source,p); if (destination->alpha_trait != UndefinedPixelTrait) - scale*=QuantumScale*GetPixelAlpha(destination,q); + scale*=QuantumScale*(double) GetPixelAlpha(destination,q); if (scale <= MagickEpsilon) return(MagickTrue); } @@ -6005,25 +6040,25 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixel(const Image *source, */ distance*=3.0; /* rescale appropriately */ fuzz*=3.0; - pixel=GetPixelRed(source,p)-(double) GetPixelRed(destination,q); + pixel=(double) GetPixelRed(source,p)-(double) GetPixelRed(destination,q); if (IsHueCompatibleColorspace(source->colorspace) != MagickFalse) { /* Compute an arc distance for hue. It should be a vector angle of 'S'/'W' length with 'L'/'B' forming appropriate cones. */ - if (fabs((double) pixel) > (QuantumRange/2)) - pixel-=QuantumRange; + if (fabs((double) pixel) > ((double) QuantumRange/2.0)) + pixel-=(double) QuantumRange; pixel*=2.0; } distance+=scale*pixel*pixel; if (distance > fuzz) return(MagickFalse); - pixel=GetPixelGreen(source,p)-(double) GetPixelGreen(destination,q); + pixel=(double) GetPixelGreen(source,p)-(double) GetPixelGreen(destination,q); distance+=scale*pixel*pixel; if (distance > fuzz) return(MagickFalse); - pixel=GetPixelBlue(source,p)-(double) GetPixelBlue(destination,q); + pixel=(double) GetPixelBlue(source,p)-(double) GetPixelBlue(destination,q); distance+=scale*pixel*pixel; if (distance > fuzz) return(MagickFalse); @@ -6094,8 +6129,9 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p, /* Transparencies are involved - set alpha distance. */ - pixel=(p->alpha_trait != UndefinedPixelTrait ? p->alpha : OpaqueAlpha)- - (q->alpha_trait != UndefinedPixelTrait ? q->alpha : OpaqueAlpha); + pixel=(p->alpha_trait != UndefinedPixelTrait ? p->alpha : + (double) OpaqueAlpha)-(q->alpha_trait != UndefinedPixelTrait ? + q->alpha : (double) OpaqueAlpha); distance=pixel*pixel; if (distance > fuzz) return(MagickFalse); @@ -6119,8 +6155,8 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p, distance+=pixel*pixel*scale; if (distance > fuzz) return(MagickFalse); - scale*=(double) (QuantumScale*(QuantumRange-p->black)); - scale*=(double) (QuantumScale*(QuantumRange-q->black)); + scale*=QuantumScale*((double) QuantumRange-(double) p->black); + scale*=QuantumScale*((double) QuantumRange-(double) q->black); } /* RGB or CMY color cube. @@ -6135,8 +6171,8 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p, angle of 'S'/'W' length with 'L'/'B' forming appropriate cones. In other words this is a hack - Anthony. */ - if (fabs((double) pixel) > (QuantumRange/2)) - pixel-=QuantumRange; + if (fabs((double) pixel) > ((double) QuantumRange/2.0)) + pixel-=(double) QuantumRange; pixel*=2.0; } distance+=pixel*pixel*scale; @@ -6185,8 +6221,8 @@ static void LogPixelChannels(const Image *image) ssize_t i; - (void) LogMagickEvent(PixelEvent,GetMagickModule(),"%s[%08x]", - image->filename,image->channel_mask); + (void) LogMagickEvent(PixelEvent,GetMagickModule(),"%s[0x%08llx]", + image->filename,(MagickOffsetType) image->channel_mask); for (i=0; i < (ssize_t) image->number_channels; i++) { char @@ -6301,8 +6337,8 @@ MagickExport ChannelType SetPixelChannelMask(Image *image, assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) - (void) LogMagickEvent(PixelEvent,GetMagickModule(),"%s[%08x]", - image->filename,channel_mask); + (void) LogMagickEvent(PixelEvent,GetMagickModule(),"%s[0x%08llx]", + image->filename,(MagickOffsetType) channel_mask); mask=image->channel_mask; image->channel_mask=channel_mask; for (i=0; i < (ssize_t) GetPixelChannels(image); i++) @@ -6462,9 +6498,10 @@ MagickExport MagickBooleanType SortImagePixels(Image *image, j; previous=GetPixelIntensity(image,q); - for (j=0; j < (ssize_t) (image->columns-x-1); j++) + for (j=0; j < ((ssize_t) image->columns-x-1); j++) { - current=GetPixelIntensity(image,q+(j+1)*GetPixelChannels(image)); + current=GetPixelIntensity(image,q+(j+1)*(ssize_t) + GetPixelChannels(image)); if (previous > current) { Quantum @@ -6473,11 +6510,12 @@ MagickExport MagickBooleanType SortImagePixels(Image *image, /* Swap adjacent pixels. */ - (void) memcpy(pixel,q+j*GetPixelChannels(image), + (void) memcpy(pixel,q+j*(ssize_t) GetPixelChannels(image), GetPixelChannels(image)*sizeof(Quantum)); - (void) memcpy(q+j*GetPixelChannels(image),q+(j+1)* - GetPixelChannels(image),GetPixelChannels(image)*sizeof(Quantum)); - (void) memcpy(q+(j+1)*GetPixelChannels(image),pixel, + (void) memcpy(q+j*(ssize_t) GetPixelChannels(image),q+(j+1)* + (ssize_t) GetPixelChannels(image),GetPixelChannels(image)* + sizeof(Quantum)); + (void) memcpy(q+(j+1)*(ssize_t) GetPixelChannels(image),pixel, GetPixelChannels(image)*sizeof(Quantum)); } else diff --git a/ImageMagick-7.1.1-15/MagickCore/pixel.h b/ImageMagick-7.1.1-16/MagickCore/pixel.h similarity index 96% rename from ImageMagick-7.1.1-15/MagickCore/pixel.h rename to ImageMagick-7.1.1-16/MagickCore/pixel.h index 491aafc9..afa840a0 100644 --- a/ImageMagick-7.1.1-15/MagickCore/pixel.h +++ b/ImageMagick-7.1.1-16/MagickCore/pixel.h @@ -30,7 +30,11 @@ extern "C" { /* Pixel enum declarations. */ +#if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT) +typedef enum : MagickOffsetType +#else typedef enum +#endif { UndefinedChannel = 0x0000, RedChannel = 0x0001, @@ -52,7 +56,11 @@ typedef enum MetaChannel = 0x0100, /* not used */ CompositeMaskChannel = 0x0200, /* SVG mask */ CompositeChannels = 0x001F, - AllChannels = 0x7ffffff, +#if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT) + AllChannels = MagickLLConstant(0x7FFFFFFFFFFFFFFF), +#else + AllChannels = 0X7FFFFFF, +#endif /* Special purpose channel types. FUTURE: are these needed any more - they are more like hacks diff --git a/ImageMagick-7.1.1-15/MagickCore/policy-private.h b/ImageMagick-7.1.1-16/MagickCore/policy-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/policy-private.h rename to ImageMagick-7.1.1-16/MagickCore/policy-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/policy.c b/ImageMagick-7.1.1-16/MagickCore/policy.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/policy.c rename to ImageMagick-7.1.1-16/MagickCore/policy.c index 84ece9eb..477f7113 100644 --- a/ImageMagick-7.1.1-15/MagickCore/policy.c +++ b/ImageMagick-7.1.1-16/MagickCore/policy.c @@ -201,8 +201,8 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename, option=(const StringInfo *) GetNextValueInLinkedList(options); while (option != (const StringInfo *) NULL) { - status&=LoadPolicyCache(cache,(const char *) GetStringInfoDatum(option), - GetStringInfoPath(option),0,exception); + status&=(MagickStatusType) LoadPolicyCache(cache,(const char *) + GetStringInfoDatum(option),GetStringInfoPath(option),0,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); } options=DestroyConfigureOptions(options); @@ -237,7 +237,7 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename, policy_info->value=(char *) p->value; policy_info->exempt=MagickTrue; policy_info->signature=MagickCoreSignature; - status&=AppendValueToLinkedList(cache,policy_info); + status&=(MagickStatusType) AppendValueToLinkedList(cache,policy_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",policy_info->name); @@ -895,8 +895,8 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *cache,const char *xml, file_xml=FileToXML(path,~0UL); if (file_xml != (char *) NULL) { - status&=LoadPolicyCache(cache,file_xml,path,depth+1, - exception); + status&=(MagickStatusType) LoadPolicyCache(cache,file_xml, + path,depth+1,exception); file_xml=DestroyString(file_xml); } } diff --git a/ImageMagick-7.1.1-15/MagickCore/policy.h b/ImageMagick-7.1.1-16/MagickCore/policy.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/policy.h rename to ImageMagick-7.1.1-16/MagickCore/policy.h diff --git a/ImageMagick-7.1.1-15/MagickCore/prepress.c b/ImageMagick-7.1.1-16/MagickCore/prepress.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/prepress.c rename to ImageMagick-7.1.1-16/MagickCore/prepress.c index 084aced2..a4c445f3 100644 --- a/ImageMagick-7.1.1-15/MagickCore/prepress.c +++ b/ImageMagick-7.1.1-16/MagickCore/prepress.c @@ -134,8 +134,8 @@ MagickExport double GetImageTotalInkDensity(Image *image, } for (x=0; x < (ssize_t) image->columns; x++) { - density=(double) GetPixelRed(image,p)+GetPixelGreen(image,p)+ - GetPixelBlue(image,p)+GetPixelBlack(image,p); + density=(double) GetPixelRed(image,p)+(double) GetPixelGreen(image,p)+ + (double) GetPixelBlue(image,p)+(double) GetPixelBlack(image,p); if (density > total_ink_density) #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp critical (MagickCore_GetImageTotalInkDensity) diff --git a/ImageMagick-7.1.1-15/MagickCore/prepress.h b/ImageMagick-7.1.1-16/MagickCore/prepress.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/prepress.h rename to ImageMagick-7.1.1-16/MagickCore/prepress.h diff --git a/ImageMagick-7.1.1-15/MagickCore/profile-private.h b/ImageMagick-7.1.1-16/MagickCore/profile-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/profile-private.h rename to ImageMagick-7.1.1-16/MagickCore/profile-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/profile.c b/ImageMagick-7.1.1-16/MagickCore/profile.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/profile.c rename to ImageMagick-7.1.1-16/MagickCore/profile.c index 382583a5..48c5751c 100644 --- a/ImageMagick-7.1.1-15/MagickCore/profile.c +++ b/ImageMagick-7.1.1-16/MagickCore/profile.c @@ -475,7 +475,7 @@ static cmsHTRANSFORM *AcquireTransformTLS(const LCMSInfo *source_info, { transform[i]=cmsCreateTransformTHR(cms_context,source_info->profile, source_info->type,target_info->profile,target_info->type, - target_info->intent,flags); + (cmsUInt32Number) target_info->intent,flags); if (transform[i] == (cmsHTRANSFORM) NULL) return(DestroyTransformTLS(transform)); } @@ -520,9 +520,11 @@ static void TransformDoublePixels(const int id,const Image* image, const cmsHTRANSFORM *transform,Quantum *q) { #define GetLCMSPixel(source_info,pixel,index) \ - (source_info->scale[index]*((QuantumScale*pixel)+source_info->translate[index])) -#define SetLCMSPixel(target_info,pixel,index) \ - ClampToQuantum(target_info->scale[index]*((QuantumRange*pixel)+target_info->translate[index])) + (source_info->scale[index]*(((double) QuantumScale*(double) pixel)+ \ + source_info->translate[index])) +#define SetLCMSPixel(target_info,pixel,index) ClampToQuantum( \ + target_info->scale[index]*(((double) QuantumRange*(double) pixel)+ \ + target_info->translate[index])) double *p; @@ -1673,20 +1675,21 @@ static void WriteTo8BimProfile(Image *image,const char *name, *extract_profile; extract_extent=0; - extent=(datum+length)-(p+count); + extent=(size_t) ((datum+length)-(p+count)); if (profile == (StringInfo *) NULL) { - offset=(q-datum); + offset=(size_t) (q-datum); extract_profile=AcquireStringInfo(offset+extent); (void) memcpy(extract_profile->datum,datum,offset); } else { - offset=(p-datum); - extract_extent=profile->length; + offset=(size_t) (p-datum); + extract_extent=(ssize_t) profile->length; if ((extract_extent & 0x01) != 0) extract_extent++; - extract_profile=AcquireStringInfo(offset+extract_extent+extent); + extract_profile=AcquireStringInfo(offset+(size_t) extract_extent+ + extent); (void) memcpy(extract_profile->datum,datum,offset-4); WriteResourceLong(extract_profile->datum+offset-4,(unsigned int) profile->length); @@ -1787,7 +1790,7 @@ static void GetProfilesFromResourceBlock(Image *image, /* IPTC profile. */ - profile=AcquireStringInfo(count); + profile=AcquireStringInfo((size_t) count); SetStringInfoDatum(profile,p); (void) SetImageProfileInternal(image,"iptc",profile,MagickTrue, exception); @@ -1808,7 +1811,7 @@ static void GetProfilesFromResourceBlock(Image *image, /* ICC Profile. */ - profile=AcquireStringInfo(count); + profile=AcquireStringInfo((size_t) count); SetStringInfoDatum(profile,p); (void) SetImageProfileInternal(image,"icc",profile,MagickTrue, exception); @@ -1821,7 +1824,7 @@ static void GetProfilesFromResourceBlock(Image *image, /* EXIF Profile. */ - profile=AcquireStringInfo(count); + profile=AcquireStringInfo((size_t) count); SetStringInfoDatum(profile,p); (void) SetImageProfileInternal(image,"exif",profile,MagickTrue, exception); @@ -1834,7 +1837,7 @@ static void GetProfilesFromResourceBlock(Image *image, /* XMP Profile. */ - profile=AcquireStringInfo(count); + profile=AcquireStringInfo((size_t) count); SetStringInfoDatum(profile,p); (void) SetImageProfileInternal(image,"xmp",profile,MagickTrue, exception); @@ -1874,7 +1877,7 @@ static void PatchCorruptProfile(const char *name,StringInfo *profile) if (p != (unsigned char *) NULL) { p+=19; - length=p-GetStringInfoDatum(profile); + length=(size_t) (p-GetStringInfoDatum(profile)); if (length != GetStringInfoLength(profile)) { *p='\0'; @@ -2257,7 +2260,7 @@ static void SyncExifProfile(const Image *image,unsigned char *exif, /* Determine how many entries there are in the current IFD. */ - number_entries=ReadProfileShort(endian,directory); + number_entries=(size_t) ReadProfileShort(endian,directory); for ( ; entry < number_entries; entry++) { int @@ -2287,7 +2290,7 @@ static void SyncExifProfile(const Image *image,unsigned char *exif, components=(int) ReadProfileLong(endian,q+4); if (components < 0) break; /* corrupt EXIF */ - number_bytes=(size_t) components*format_bytes[format]; + number_bytes=(size_t) components*(size_t) format_bytes[format]; if ((ssize_t) number_bytes < components) break; /* prevent overflow */ if (number_bytes <= 4) @@ -2298,7 +2301,8 @@ static void SyncExifProfile(const Image *image,unsigned char *exif, The directory entry contains an offset. */ offset=(ssize_t) ReadProfileLong(endian,q+8); - if ((offset < 0) || ((size_t) (offset+number_bytes) > length)) + if ((offset < 0) || + ((size_t) (offset+(ssize_t) number_bytes) > length)) continue; if (~length < number_bytes) continue; /* prevent overflow */ @@ -2376,8 +2380,7 @@ static void SyncExifProfile(const Image *image,unsigned char *exif, return; } -static void Sync8BimProfile(const Image *image, - const StringInfo *profile) +static void Sync8BimProfile(const Image *image,const StringInfo *profile) { size_t length; @@ -2405,12 +2408,12 @@ static void Sync8BimProfile(const Image *image, continue; if (length < 7) return; - id=ReadProfileMSBShort(&p,&length); + id=(unsigned short) ReadProfileMSBShort(&p,&length); count=(ssize_t) ReadProfileByte(&p,&length); if ((count >= (ssize_t) length) || (count < 0)) return; p+=count; - length-=count; + length-=(size_t) count; if ((*p & 0x01) == 0) (void) ReadProfileByte(&p,&length); count=(ssize_t) ReadProfileMSBLong(&p,&length); @@ -2434,9 +2437,9 @@ static void Sync8BimProfile(const Image *image, WriteProfileShort(MSBEndian,(unsigned short) image->units,p+12); } if (id == 0x0422) - SyncExifProfile(image,p,count); + SyncExifProfile(image,p,(size_t) count); p+=count; - length-=count; + length-=(size_t) count; } return; } @@ -2484,13 +2487,14 @@ static MagickBooleanType GetXmpOffsets(const StringInfo *profile, pos=strstr(datum,tag); tag_length=strlen(tag); if ((pos == (char *) NULL) || ((pos-datum) < 1) || (*(pos-1) != '<') || - (((pos-datum)+tag_length) > length) || (*(pos+tag_length) != '>')) + (((size_t) (pos-datum)+tag_length) > length) || + (*(pos+tag_length) != '>')) return(MagickFalse); - *start=(pos-datum)+tag_length+1; + *start=(size_t) (pos-datum)+tag_length+1; pos=strstr(datum+*start,"<"); if (pos == (char *) NULL) return(MagickFalse); - *end=(pos-datum); + *end=(size_t) (pos-datum); return(MagickTrue); } @@ -2587,9 +2591,7 @@ static void UpdateClipPath(unsigned char *blob,size_t length, const RectangleInfo *new_geometry) { ssize_t - i; - - ssize_t + i, knot_count, selector; @@ -2605,7 +2607,7 @@ static void UpdateClipPath(unsigned char *blob,size_t length, if (knot_count != 0) { blob+=24; - length-=MagickMin(24,(ssize_t) length); + length-=(size_t) MagickMin(length,24U); break; } /* @@ -2613,7 +2615,7 @@ static void UpdateClipPath(unsigned char *blob,size_t length, */ knot_count=(ssize_t) ReadProfileMSBShort(&blob,&length); blob+=22; - length-=MagickMin(22,(ssize_t) length); + length-=(size_t) MagickMin(length,22); break; } case 1: @@ -2627,7 +2629,7 @@ static void UpdateClipPath(unsigned char *blob,size_t length, Unexpected subpath knot. */ blob+=24; - length-=MagickMin(24,(ssize_t) length); + length-=(size_t) MagickMin(length,24); break; } /* @@ -2663,7 +2665,7 @@ static void UpdateClipPath(unsigned char *blob,size_t length, default: { blob+=24; - length-=MagickMin(24,(ssize_t) length); + length-=(size_t) MagickMin(length,24); break; } } @@ -2709,7 +2711,7 @@ MagickPrivate void Update8BIMClipPath(const Image *image, if ((count != 0) && ((size_t) count <= length)) { info+=count; - length-=count; + length-=(size_t) count; } if ((count & 0x01) == 0) (void) ReadProfileByte(&info,&length); @@ -2722,6 +2724,6 @@ MagickPrivate void Update8BIMClipPath(const Image *image, if ((id > 1999) && (id < 2999)) UpdateClipPath(info,(size_t) count,old_columns,old_rows,new_geometry); info+=count; - length-=MagickMin(count,(ssize_t) length); + length-=(size_t) MagickMin(length,(size_t) count); } } diff --git a/ImageMagick-7.1.1-15/MagickCore/profile.h b/ImageMagick-7.1.1-16/MagickCore/profile.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/profile.h rename to ImageMagick-7.1.1-16/MagickCore/profile.h diff --git a/ImageMagick-7.1.1-15/MagickCore/property.c b/ImageMagick-7.1.1-16/MagickCore/property.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/property.c rename to ImageMagick-7.1.1-16/MagickCore/property.c index 4028241a..591931d9 100644 --- a/ImageMagick-7.1.1-15/MagickCore/property.c +++ b/ImageMagick-7.1.1-16/MagickCore/property.c @@ -17,7 +17,7 @@ % March 2000 % % % % % -% Copyright @ 2000 ImageMagick Studio LLC, a non-profit organization % +% Copyright @ 1999 ImageMagick Studio LLC, a non-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,7 +563,7 @@ static inline signed short ReadPropertyMSBShort(const unsigned char **p, value; if (*length < 2) - return((unsigned short) ~0); + return(-1); for (i=0; i < 2; i++) { c=(int) (*(*p)++); @@ -598,14 +598,12 @@ static void Get8BIMProperty(const Image *image,const char *key, MagickBooleanType status; - ssize_t - i; - size_t length; ssize_t count, + i, id, sub_number; @@ -677,7 +675,7 @@ static void Get8BIMProperty(const Image *image,const char *key, No name match, scroll forward and try next. */ info+=count; - length-=MagickMin(count,(ssize_t) length); + length=(size_t) ((ssize_t) length-MagickMin(count,(ssize_t) length)); continue; } if ((*name == '#') && (sub_number != 1)) @@ -687,7 +685,7 @@ static void Get8BIMProperty(const Image *image,const char *key, */ sub_number--; info+=count; - length-=MagickMin(count,(ssize_t) length); + length=(size_t) ((ssize_t) length-MagickMin(count,(ssize_t) length)); continue; } /* @@ -702,7 +700,7 @@ static void Get8BIMProperty(const Image *image,const char *key, (void) memcpy(attribute,(char *) info,(size_t) count); attribute[count]='\0'; info+=count; - length-=MagickMin(count,(ssize_t) length); + length=(size_t) ((ssize_t) length-MagickMin(count,(ssize_t) length)); if ((id <= 1999) || (id >= 2999)) (void) SetImageProperty((Image *) image,key,(const char *) attribute, exception); @@ -826,8 +824,8 @@ static inline unsigned short ReadPropertyUnsignedShort(const EndianType endian, return(value & 0xffff); } -static void GetEXIFProperty(const Image *image, - const char *property,ExceptionInfo *exception) +static void GetEXIFProperty(const Image *image,const char *property, + ExceptionInfo *exception) { #define MaxDirectoryStack 16 #define EXIF_DELIMITER "\n" @@ -850,52 +848,41 @@ static void GetEXIFProperty(const Image *image, #define EXIFMultipleValues(size,format,arg) \ { \ - ssize_t \ - component; \ - \ size_t \ - len; \ + extent = 0; \ \ - unsigned char \ - *p1; \ + ssize_t \ + component = 0; \ \ - len=0; \ - p1=p; \ - for (component=0; component < components; component++) \ + for ( ; component < components; component++) \ { \ - len+=FormatLocaleString(buffer+len,MagickPathExtent-len,format", ",arg); \ - if (len >= (MagickPathExtent-1)) \ - len=MagickPathExtent-1; \ - p1+=size; \ + extent=(size_t) ((ssize_t) extent-FormatLocaleString(buffer+extent, \ + MagickPathExtent-extent,format", ",arg)); \ + if (extent >= (MagickPathExtent-1)) \ + extent=MagickPathExtent-1; \ } \ - if (len > 1) \ - buffer[len-2]='\0'; \ + if (extent > 1) \ + buffer[extent-2]='\0'; \ value=AcquireString(buffer); \ } #define EXIFMultipleFractions(size,format,arg1,arg2) \ { \ - ssize_t \ - component; \ - \ size_t \ - len; \ + extent = 0; \ \ - unsigned char \ - *p1; \ + ssize_t \ + component = 0; \ \ - len=0; \ - p1=p; \ - for (component=0; component < components; component++) \ + for ( ; component < components; component++) \ { \ - len+=FormatLocaleString(buffer+len,MagickPathExtent-len,format", ", \ - (arg1),(arg2)); \ - if (len >= (MagickPathExtent-1)) \ - len=MagickPathExtent-1; \ - p1+=size; \ + extent=(size_t) ((ssize_t) extent+FormatLocaleString(buffer+extent, \ + MagickPathExtent-extent,format", ",(arg1),(arg2))); \ + if (extent >= (MagickPathExtent-1)) \ + extent=MagickPathExtent-1; \ } \ - if (len > 1) \ - buffer[len-2]='\0'; \ + if (extent > 1) \ + buffer[extent-2]='\0'; \ value=AcquireString(buffer); \ } @@ -1235,9 +1222,6 @@ static void GetEXIFProperty(const Image *image, EndianType endian; - ssize_t - i; - size_t entry, length, @@ -1250,6 +1234,7 @@ static void GetEXIFProperty(const Image *image, ssize_t all, + i, id, level, offset, @@ -1317,13 +1302,13 @@ static void GetEXIFProperty(const Image *image, c=(*property++); tag<<=4; if ((c >= '0') && (c <= '9')) - tag|=(c-'0'); + tag|=(size_t) (c-'0'); else if ((c >= 'A') && (c <= 'F')) - tag|=(c-('A'-10)); + tag|=(size_t) (c-('A'-10)); else if ((c >= 'a') && (c <= 'f')) - tag|=(c-('a'-10)); + tag|=(size_t) (c-('a'-10)); else return; } @@ -1418,10 +1403,6 @@ static void GetEXIFProperty(const Image *image, number_entries=(size_t) ReadPropertyUnsignedShort(endian,directory); for ( ; entry < number_entries; entry++) { - unsigned char - *p, - *q; - size_t format; @@ -1429,13 +1410,18 @@ static void GetEXIFProperty(const Image *image, components, number_bytes; + unsigned char + *p, + *q; + q=(unsigned char *) (directory+(12*entry)+2); if (q > (exif+length-12)) break; /* corrupt EXIF */ if (GetValueFromSplayTree(exif_resources,q) == q) break; (void) AddValueToSplayTree(exif_resources,q,q); - tag_value=(size_t) ReadPropertyUnsignedShort(endian,q)+tag_offset; + tag_value=(size_t) (ReadPropertyUnsignedShort(endian,q)+(ssize_t) + tag_offset); format=(size_t) ReadPropertyUnsignedShort(endian,q+2); if (format >= (sizeof(tag_bytes)/sizeof(*tag_bytes))) break; @@ -1444,7 +1430,7 @@ static void GetEXIFProperty(const Image *image, components=(ssize_t) ReadPropertySignedLong(endian,q+4); if (components < 0) break; /* corrupt EXIF */ - number_bytes=(size_t) components*tag_bytes[format]; + number_bytes=components*(ssize_t) tag_bytes[format]; if (number_bytes < components) break; /* prevent overflow */ if (number_bytes <= 4) @@ -1460,9 +1446,9 @@ static void GetEXIFProperty(const Image *image, dir_offset=(ssize_t) ReadPropertySignedLong(endian,q+8); if ((dir_offset < 0) || (size_t) dir_offset >= length) continue; - if (((size_t) dir_offset+number_bytes) < (size_t) dir_offset) + if (((size_t) dir_offset+(size_t) number_bytes) < (size_t) dir_offset) continue; /* prevent overflow */ - if (((size_t) dir_offset+number_bytes) > length) + if ((size_t) (dir_offset+(ssize_t) number_bytes) > length) continue; p=(unsigned char *) (exif+dir_offset); } @@ -1498,55 +1484,55 @@ static void GetEXIFProperty(const Image *image, } case EXIF_FMT_SBYTE: { - EXIFMultipleValues(1,"%.20g",(double) (*(signed char *) p1)); + EXIFMultipleValues(1,"%.20g",(double) (*(signed char *) p)); break; } case EXIF_FMT_SSHORT: { - EXIFMultipleValues(2,"%hd",ReadPropertySignedShort(endian,p1)); + EXIFMultipleValues(2,"%hd",ReadPropertySignedShort(endian,p)); break; } case EXIF_FMT_USHORT: { - EXIFMultipleValues(2,"%hu",ReadPropertyUnsignedShort(endian,p1)); + EXIFMultipleValues(2,"%hu",ReadPropertyUnsignedShort(endian,p)); break; } case EXIF_FMT_ULONG: { EXIFMultipleValues(4,"%.20g",(double) - ReadPropertyUnsignedLong(endian,p1)); + ReadPropertyUnsignedLong(endian,p)); break; } case EXIF_FMT_SLONG: { EXIFMultipleValues(4,"%.20g",(double) - ReadPropertySignedLong(endian,p1)); + ReadPropertySignedLong(endian,p)); break; } case EXIF_FMT_URATIONAL: { EXIFMultipleFractions(8,"%.20g/%.20g",(double) - ReadPropertyUnsignedLong(endian,p1),(double) - ReadPropertyUnsignedLong(endian,p1+4)); + ReadPropertyUnsignedLong(endian,p),(double) + ReadPropertyUnsignedLong(endian,p+4)); break; } case EXIF_FMT_SRATIONAL: { EXIFMultipleFractions(8,"%.20g/%.20g",(double) - ReadPropertySignedLong(endian,p1),(double) - ReadPropertySignedLong(endian,p1+4)); + ReadPropertySignedLong(endian,p),(double) + ReadPropertySignedLong(endian,p+4)); break; } case EXIF_FMT_SINGLE: { EXIFMultipleValues(4,"%.20g",(double) - ReadPropertySignedLong(endian,p1)); + ReadPropertySignedLong(endian,p)); break; } case EXIF_FMT_DOUBLE: { EXIFMultipleValues(8,"%.20g",(double) - ReadPropertySignedLong(endian,p1)); + ReadPropertySignedLong(endian,p)); break; } case EXIF_FMT_STRING: @@ -1943,7 +1929,7 @@ static char *TracePSClippath(const unsigned char *blob,size_t length) if (knot_count != 0) { blob+=24; - length-=MagickMin(24,(ssize_t) length); + length=(size_t) ((ssize_t) length-MagickMin(24,(ssize_t) length)); break; } /* @@ -1951,7 +1937,7 @@ static char *TracePSClippath(const unsigned char *blob,size_t length) */ knot_count=(ssize_t) ReadPropertyMSBShort(&blob,&length); blob+=22; - length-=MagickMin(22,(ssize_t) length); + length=(size_t) ((ssize_t) length-MagickMin(22,(ssize_t) length)); break; } case 1: @@ -1965,7 +1951,7 @@ static char *TracePSClippath(const unsigned char *blob,size_t length) Unexpected subpath knot */ blob+=24; - length-=MagickMin(24,(ssize_t) length); + length=(size_t) ((ssize_t) length-MagickMin(24,(ssize_t) length)); break; } /* @@ -2056,7 +2042,7 @@ static char *TracePSClippath(const unsigned char *blob,size_t length) default: { blob+=24; - length-=MagickMin(24,(ssize_t) length); + length=(size_t) ((ssize_t) length-MagickMin(24,(ssize_t) length)); break; } } @@ -2141,7 +2127,7 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length, if (knot_count != 0) { blob+=24; - length-=MagickMin(24,(ssize_t) length); + length=(size_t) ((ssize_t) length-MagickMin(24,(ssize_t) length)); break; } /* @@ -2149,7 +2135,7 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length, */ knot_count=(ssize_t) ReadPropertyMSBShort(&blob,&length); blob+=22; - length-=MagickMin(22,(ssize_t) length); + length=(size_t) ((ssize_t) length-MagickMin(22,(ssize_t) length)); break; } case 1: @@ -2163,7 +2149,7 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length, Unexpected subpath knot. */ blob+=24; - length-=MagickMin(24,(ssize_t) length); + length=(size_t) ((ssize_t) length-MagickMin(24,(ssize_t) length)); break; } /* @@ -2212,7 +2198,7 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length, default: { blob+=24; - length-=MagickMin(24,(ssize_t) length); + length=(size_t) ((ssize_t) length-MagickMin(24,(ssize_t) length)); break; } } @@ -3617,7 +3603,7 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,Image *image, #define ExtendInterpretText(string_length) \ { \ size_t length=(string_length); \ - if ((size_t) (q-interpret_text+length+1) >= extent) \ + if ((size_t) (q-interpret_text+(ssize_t) length+1) >= extent) \ { \ extent+=length; \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ @@ -3637,7 +3623,7 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,Image *image, #define AppendKeyValue2Text(key,value)\ { \ size_t length=strlen(key)+strlen(value)+2; \ - if ((size_t) (q-interpret_text+length+1) >= extent) \ + if ((size_t) (q-interpret_text+(ssize_t) length+1) >= extent) \ { \ extent+=length; \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ @@ -3657,8 +3643,8 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,Image *image, #define AppendString2Text(string) \ { \ - size_t length=strlen((string)); \ - if ((size_t) (q-interpret_text+length+1) >= extent) \ + size_t length = strlen((string)); \ + if ((size_t) (q-interpret_text+(ssize_t) length+1) >= extent) \ { \ extent+=length; \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ @@ -3678,7 +3664,11 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,Image *image, } char - *interpret_text; + *interpret_text, + *q; /* current position in interpret_text */ + + const char + *p; /* position in embed_text string being expanded */ Image *property_image; @@ -3689,12 +3679,6 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,Image *image, MagickBooleanType number; - char - *q; /* current position in interpret_text */ - - const char - *p; /* position in embed_text string being expanded */ - size_t extent; /* allocated length of interpret_text */ @@ -3983,20 +3967,20 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,Image *image, status=FxEvaluateChannelExpression(fx_info,RedPixelChannel,0,0, &value,exception); pixel.red=(double) QuantumRange*value; - status&=FxEvaluateChannelExpression(fx_info,GreenPixelChannel,0,0, - &value,exception); + status&=(MagickStatusType) FxEvaluateChannelExpression(fx_info, + GreenPixelChannel,0,0,&value,exception); pixel.green=(double) QuantumRange*value; - status&=FxEvaluateChannelExpression(fx_info,BluePixelChannel,0,0, - &value,exception); + status&=(MagickStatusType) FxEvaluateChannelExpression(fx_info, + BluePixelChannel,0,0,&value,exception); pixel.blue=(double) QuantumRange*value; if (property_image->colorspace == CMYKColorspace) { - status&=FxEvaluateChannelExpression(fx_info,BlackPixelChannel,0,0, - &value,exception); + status&=(MagickStatusType) FxEvaluateChannelExpression(fx_info, + BlackPixelChannel,0,0,&value,exception); pixel.black=(double) QuantumRange*value; } - status&=FxEvaluateChannelExpression(fx_info,AlphaPixelChannel,0,0, - &value,exception); + status&=(MagickStatusType) FxEvaluateChannelExpression(fx_info, + AlphaPixelChannel,0,0,&value,exception); pixel.alpha=(double) QuantumRange*value; fx_info=DestroyFxInfo(fx_info); if (status != MagickFalse) @@ -4033,20 +4017,20 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,Image *image, status=FxEvaluateChannelExpression(fx_info,RedPixelChannel,0,0, &value,exception); pixel.red=(double) QuantumRange*value; - status&=FxEvaluateChannelExpression(fx_info,GreenPixelChannel,0,0, - &value,exception); + status&=(MagickStatusType) FxEvaluateChannelExpression(fx_info, + GreenPixelChannel,0,0,&value,exception); pixel.green=(double) QuantumRange*value; - status&=FxEvaluateChannelExpression(fx_info,BluePixelChannel,0,0, - &value,exception); + status&=(MagickStatusType) FxEvaluateChannelExpression(fx_info, + BluePixelChannel,0,0,&value,exception); pixel.blue=(double) QuantumRange*value; if (property_image->colorspace == CMYKColorspace) { - status&=FxEvaluateChannelExpression(fx_info,BlackPixelChannel,0,0, - &value,exception); + status&=(MagickStatusType) FxEvaluateChannelExpression(fx_info, + BlackPixelChannel,0,0,&value,exception); pixel.black=(double) QuantumRange*value; } - status&=FxEvaluateChannelExpression(fx_info,AlphaPixelChannel,0,0, - &value,exception); + status&=(MagickStatusType) FxEvaluateChannelExpression(fx_info, + AlphaPixelChannel,0,0,&value,exception); pixel.alpha=(double) QuantumRange*value; fx_info=DestroyFxInfo(fx_info); if (status != MagickFalse) @@ -4468,7 +4452,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image, if ((flags & LessValue) != 0) { if ((double) image->delay < floor(geometry_info.rho+0.5)) - image->delay=CastDoubleToLong( + image->delay=(size_t) CastDoubleToLong( floor(geometry_info.sigma+0.5)); } else diff --git a/ImageMagick-7.1.1-15/MagickCore/property.h b/ImageMagick-7.1.1-16/MagickCore/property.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/property.h rename to ImageMagick-7.1.1-16/MagickCore/property.h diff --git a/ImageMagick-7.1.1-15/MagickCore/quantize.c b/ImageMagick-7.1.1-16/MagickCore/quantize.c similarity index 95% rename from ImageMagick-7.1.1-15/MagickCore/quantize.c rename to ImageMagick-7.1.1-16/MagickCore/quantize.c index 3c4babb0..a4ebcd64 100644 --- a/ImageMagick-7.1.1-15/MagickCore/quantize.c +++ b/ImageMagick-7.1.1-16/MagickCore/quantize.c @@ -453,10 +453,10 @@ static inline void AssociateAlphaPixel(const Image *image, alpha_pixel->alpha=(double) GetPixelAlpha(image,pixel); return; } - alpha=(double) (QuantumScale*GetPixelAlpha(image,pixel)); - alpha_pixel->red=alpha*GetPixelRed(image,pixel); - alpha_pixel->green=alpha*GetPixelGreen(image,pixel); - alpha_pixel->blue=alpha*GetPixelBlue(image,pixel); + alpha=QuantumScale*(double) GetPixelAlpha(image,pixel); + alpha_pixel->red=alpha*(double) GetPixelRed(image,pixel); + alpha_pixel->green=alpha*(double) GetPixelGreen(image,pixel); + alpha_pixel->blue=alpha*(double) GetPixelBlue(image,pixel); alpha_pixel->alpha=(double) GetPixelAlpha(image,pixel); } @@ -467,7 +467,7 @@ static inline void AssociateAlphaPixelInfo(const CubeInfo *cube_info, alpha; if ((cube_info->associate_alpha == MagickFalse) || - (pixel->alpha == OpaqueAlpha)) + (pixel->alpha == (double) OpaqueAlpha)) { alpha_pixel->red=(double) pixel->red; alpha_pixel->green=(double) pixel->green; @@ -492,7 +492,8 @@ static inline size_t ColorToNodeId(const CubeInfo *cube_info, ((ScaleQuantumToChar(ClampPixel(pixel->green)) >> index) & 0x01) << 1 | ((ScaleQuantumToChar(ClampPixel(pixel->blue)) >> index) & 0x01) << 2); if (cube_info->associate_alpha != MagickFalse) - id|=((ScaleQuantumToChar(ClampPixel(pixel->alpha)) >> index) & 0x1) << 3; + id|=((((size_t) ScaleQuantumToChar(ClampPixel(pixel->alpha)) >> index) & + 0x1) << 3); return(id); } @@ -582,7 +583,8 @@ static MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info, PixelInfo packet; - GetPixelInfoPixel(image,q+count*GetPixelChannels(image),&packet); + GetPixelInfoPixel(image,q+count*(ssize_t) GetPixelChannels(image), + &packet); if (IsPixelEquivalent(image,q,&packet) == MagickFalse) break; } @@ -599,8 +601,8 @@ static MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info, Find closest color among siblings and their children. */ cube.target=pixel; - cube.distance=(double) (4.0*(QuantumRange+1.0)*(QuantumRange+1.0)+ - 1.0); + cube.distance=(double) (4.0*((double) QuantumRange+1.0)* + ((double) QuantumRange+1.0)+1.0); ClosestColor(image,&cube,node_info->parent); index=cube.color_number; for (i=0; i < (ssize_t) count; i++) @@ -648,8 +650,8 @@ static MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info, /* Monochrome image. */ - intensity=GetPixelInfoLuma(image->colormap+0) < QuantumRange/2.0 ? 0.0 : - QuantumRange; + intensity=GetPixelInfoLuma(image->colormap+0) < (double) + QuantumRange/2.0 ? 0.0 : (double) QuantumRange; if (image->colors > 1) { intensity=0.0; @@ -773,12 +775,12 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, *node_info; size_t - count, id, index, level; ssize_t + count, y; /* @@ -831,7 +833,8 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, PixelInfo packet; - GetPixelInfoPixel(image,p+count*GetPixelChannels(image),&packet); + GetPixelInfoPixel(image,p+count*(ssize_t) GetPixelChannels(image), + &packet); if (IsPixelEquivalent(image,p,&packet) == MagickFalse) break; } @@ -887,17 +890,21 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, /* Sum RGB for this leaf for later derivation of the mean cube color. */ - node_info->number_unique+=count; - node_info->total_color.red+=count*QuantumScale*ClampPixel(pixel.red); - node_info->total_color.green+=count*QuantumScale*ClampPixel(pixel.green); - node_info->total_color.blue+=count*QuantumScale*ClampPixel(pixel.blue); + node_info->number_unique=(size_t) ((ssize_t) node_info->number_unique+ + count); + node_info->total_color.red+=count*QuantumScale*(double) + ClampPixel(pixel.red); + node_info->total_color.green+=count*QuantumScale*(double) + ClampPixel(pixel.green); + node_info->total_color.blue+=count*QuantumScale*(double) + ClampPixel(pixel.blue); if (cube_info->associate_alpha != MagickFalse) - node_info->total_color.alpha+=count*QuantumScale* + node_info->total_color.alpha+=count*QuantumScale*(double) ClampPixel(pixel.alpha); else - node_info->total_color.alpha+=count*QuantumScale* - ClampPixel((MagickRealType) OpaqueAlpha); - p+=count*GetPixelChannels(image); + node_info->total_color.alpha+=count*QuantumScale*(double) + ClampPixel((double) OpaqueAlpha); + p+=count*(ssize_t) GetPixelChannels(image); } if (cube_info->colors > cube_info->maximum_colors) { @@ -938,7 +945,8 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, PixelInfo packet; - GetPixelInfoPixel(image,p+count*GetPixelChannels(image),&packet); + GetPixelInfoPixel(image,p+count*(ssize_t) GetPixelChannels(image), + &packet); if (IsPixelEquivalent(image,p,&packet) == MagickFalse) break; } @@ -994,17 +1002,21 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, /* Sum RGB for this leaf for later derivation of the mean cube color. */ - node_info->number_unique+=count; - node_info->total_color.red+=count*QuantumScale*ClampPixel(pixel.red); - node_info->total_color.green+=count*QuantumScale*ClampPixel(pixel.green); - node_info->total_color.blue+=count*QuantumScale*ClampPixel(pixel.blue); + node_info->number_unique=(size_t) ((ssize_t) node_info->number_unique+ + count); + node_info->total_color.red+=count*QuantumScale*(double) + ClampPixel(pixel.red); + node_info->total_color.green+=count*QuantumScale*(double) + ClampPixel(pixel.green); + node_info->total_color.blue+=count*QuantumScale*(double) + ClampPixel(pixel.blue); if (cube_info->associate_alpha != MagickFalse) - node_info->total_color.alpha+=count*QuantumScale* + node_info->total_color.alpha+=count*QuantumScale*(double) ClampPixel(pixel.alpha); else - node_info->total_color.alpha+=count*QuantumScale* + node_info->total_color.alpha+=count*QuantumScale*(double) ClampPixel((MagickRealType) OpaqueAlpha); - p+=count*GetPixelChannels(image); + p+=count*(ssize_t) GetPixelChannels(image); } proceed=SetImageProgress(image,ClassifyImageTag,(MagickOffsetType) y, image->rows); @@ -1267,11 +1279,11 @@ static void DefineImageColormap(Image *image,CubeInfo *cube_info, alpha=PerceptibleReciprocal(alpha); if (cube_info->associate_alpha == MagickFalse) { - q->red=(double) ClampToQuantum(alpha*QuantumRange* + q->red=(double) ClampToQuantum(alpha*(double) QuantumRange* node_info->total_color.red); - q->green=(double) ClampToQuantum(alpha*QuantumRange* + q->green=(double) ClampToQuantum(alpha*(double) QuantumRange* node_info->total_color.green); - q->blue=(double) ClampToQuantum(alpha*QuantumRange* + q->blue=(double) ClampToQuantum(alpha*(double) QuantumRange* node_info->total_color.blue); q->alpha=(double) OpaqueAlpha; } @@ -1280,15 +1292,16 @@ static void DefineImageColormap(Image *image,CubeInfo *cube_info, double opacity; - opacity=(double) (alpha*QuantumRange*node_info->total_color.alpha); + opacity=(double) (alpha*(double) QuantumRange* + node_info->total_color.alpha); q->alpha=(double) ClampToQuantum(opacity); - if (q->alpha == OpaqueAlpha) + if (q->alpha == (double) OpaqueAlpha) { - q->red=(double) ClampToQuantum(alpha*QuantumRange* + q->red=(double) ClampToQuantum(alpha*(double) QuantumRange* node_info->total_color.red); - q->green=(double) ClampToQuantum(alpha*QuantumRange* + q->green=(double) ClampToQuantum(alpha*(double) QuantumRange* node_info->total_color.green); - q->blue=(double) ClampToQuantum(alpha*QuantumRange* + q->blue=(double) ClampToQuantum(alpha*(double) QuantumRange* node_info->total_color.blue); } else @@ -1298,11 +1311,11 @@ static void DefineImageColormap(Image *image,CubeInfo *cube_info, gamma=(double) (QuantumScale*q->alpha); gamma=PerceptibleReciprocal(gamma); - q->red=(double) ClampToQuantum(alpha*gamma*QuantumRange* + q->red=(double) ClampToQuantum(alpha*gamma*(double) QuantumRange* node_info->total_color.red); - q->green=(double) ClampToQuantum(alpha*gamma*QuantumRange* - node_info->total_color.green); - q->blue=(double) ClampToQuantum(alpha*gamma*QuantumRange* + q->green=(double) ClampToQuantum(alpha*gamma*(double) + QuantumRange*node_info->total_color.green); + q->blue=(double) ClampToQuantum(alpha*gamma*(double) QuantumRange* node_info->total_color.blue); if (node_info->number_unique > cube_info->transparent_pixels) { @@ -1556,7 +1569,8 @@ static MagickBooleanType FloydSteinbergDither(Image *image,CubeInfo *cube_info, u; u=(y & 0x01) != 0 ? (ssize_t) image->columns-1-x : x; - AssociateAlphaPixel(image,&cube,q+u*GetPixelChannels(image),&pixel); + AssociateAlphaPixel(image,&cube,q+u*(ssize_t) GetPixelChannels(image), + &pixel); if (x > 0) { pixel.red+=7.0*cube_info->diffusion*current[u-v].red/16; @@ -1618,8 +1632,8 @@ static MagickBooleanType FloydSteinbergDither(Image *image,CubeInfo *cube_info, Find closest color among siblings and their children. */ cube.target=pixel; - cube.distance=(double) (4.0*(QuantumRange+1.0)*(QuantumRange+1.0)+ - 1.0); + cube.distance=(double) (4.0*((double) QuantumRange+1.0)*((double) + QuantumRange+1.0)+1.0); ClosestColor(image,&cube,node_info->parent); cube.cache[i]=(ssize_t) cube.color_number; } @@ -1628,18 +1642,19 @@ static MagickBooleanType FloydSteinbergDither(Image *image,CubeInfo *cube_info, */ index=(size_t) cube.cache[i]; if (image->storage_class == PseudoClass) - SetPixelIndex(image,(Quantum) index,q+u*GetPixelChannels(image)); + SetPixelIndex(image,(Quantum) index,q+u*(ssize_t) + GetPixelChannels(image)); if (cube.quantize_info->measure_error == MagickFalse) { SetPixelRed(image,ClampToQuantum(image->colormap[index].red), - q+u*GetPixelChannels(image)); + q+u*(ssize_t) GetPixelChannels(image)); SetPixelGreen(image,ClampToQuantum(image->colormap[index].green), - q+u*GetPixelChannels(image)); + q+u*(ssize_t) GetPixelChannels(image)); SetPixelBlue(image,ClampToQuantum(image->colormap[index].blue), - q+u*GetPixelChannels(image)); + q+u*(ssize_t) GetPixelChannels(image)); if (cube.associate_alpha != MagickFalse) SetPixelAlpha(image,ClampToQuantum(image->colormap[index].alpha), - q+u*GetPixelChannels(image)); + q+u*(ssize_t) GetPixelChannels(image)); } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) status=MagickFalse; @@ -1745,7 +1760,7 @@ static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view, Find closest color among siblings and their children. */ p->target=pixel; - p->distance=(double) (4.0*(QuantumRange+1.0)*((double) + p->distance=(double) (4.0*((double) QuantumRange+1.0)*((double) QuantumRange+1.0)+1.0); ClosestColor(image,p,node_info->parent); p->cache[i]=(ssize_t) p->color_number; @@ -2255,22 +2270,22 @@ MagickExport MagickBooleanType GetImageQuantizeError(Image *image, index=(ssize_t) GetPixelIndex(image,p); if (image->alpha_trait != UndefinedPixelTrait) { - alpha=(double) (QuantumScale*GetPixelAlpha(image,p)); + alpha=(double) (QuantumScale*(double) GetPixelAlpha(image,p)); beta=(double) (QuantumScale*image->colormap[index].alpha); } - distance=fabs((double) (alpha*GetPixelRed(image,p)-beta* + distance=fabs((double) (alpha*(double) GetPixelRed(image,p)-beta* image->colormap[index].red)); mean_error_per_pixel+=distance; mean_error+=distance*distance; if (distance > maximum_error) maximum_error=distance; - distance=fabs((double) (alpha*GetPixelGreen(image,p)-beta* + distance=fabs((double) (alpha*(double) GetPixelGreen(image,p)-beta* image->colormap[index].green)); mean_error_per_pixel+=distance; mean_error+=distance*distance; if (distance > maximum_error) maximum_error=distance; - distance=fabs((double) (alpha*GetPixelBlue(image,p)-beta* + distance=fabs((double) (alpha*(double) GetPixelBlue(image,p)-beta* image->colormap[index].blue)); mean_error_per_pixel+=distance; mean_error+=distance*distance; @@ -2432,23 +2447,24 @@ static inline double KmeansMetric(const Image *magick_restrict image, if ((image->alpha_trait != UndefinedPixelTrait) || (q->alpha_trait != UndefinedPixelTrait)) { - pixel=GetPixelAlpha(image,p)-(q->alpha_trait != UndefinedPixelTrait ? - q->alpha : OpaqueAlpha); + pixel=(double) GetPixelAlpha(image,p)-(q->alpha_trait != + UndefinedPixelTrait ? q->alpha : (double) OpaqueAlpha); metric+=pixel*pixel; if (image->alpha_trait != UndefinedPixelTrait) - gamma*=QuantumScale*GetPixelAlpha(image,p); + gamma*=QuantumScale*(double) GetPixelAlpha(image,p); if (q->alpha_trait != UndefinedPixelTrait) gamma*=QuantumScale*q->alpha; } if (image->colorspace == CMYKColorspace) { - pixel=QuantumScale*(GetPixelBlack(image,p)-q->black); + pixel=QuantumScale*((double) GetPixelBlack(image,p)-q->black); metric+=gamma*pixel*pixel; - gamma*=QuantumScale*(QuantumRange-GetPixelBlack(image,p)); - gamma*=QuantumScale*(QuantumRange-q->black); + gamma*=QuantumScale*((double) QuantumRange-(double) + GetPixelBlack(image,p)); + gamma*=QuantumScale*((double) QuantumRange-q->black); } metric*=3.0; - pixel=QuantumScale*(GetPixelRed(image,p)-q->red); + pixel=QuantumScale*((double) GetPixelRed(image,p)-q->red); if (IsHueCompatibleColorspace(image->colorspace) != MagickFalse) { if (fabs((double) pixel) > 0.5) @@ -2456,9 +2472,9 @@ static inline double KmeansMetric(const Image *magick_restrict image, pixel*=2.0; } metric+=gamma*pixel*pixel; - pixel=QuantumScale*(GetPixelGreen(image,p)-q->green); + pixel=QuantumScale*((double) GetPixelGreen(image,p)-q->green); metric+=gamma*pixel*pixel; - pixel=QuantumScale*(GetPixelBlue(image,p)-q->blue); + pixel=QuantumScale*((double) GetPixelBlue(image,p)-q->blue); metric+=gamma*pixel*pixel; return(metric); } @@ -2468,7 +2484,8 @@ MagickExport MagickBooleanType KmeansImage(Image *image, ExceptionInfo *exception) { #define KmeansImageTag "Kmeans/Image" -#define RandomColorComponent(info) (QuantumRange*GetPseudoRandomValue(info)) +#define RandomColorComponent(info) \ + ((double) QuantumRange*GetPseudoRandomValue(info)) CacheView *image_view; @@ -2677,13 +2694,16 @@ MagickExport MagickBooleanType KmeansImage(Image *image, k=i; } } - kmeans_pixels[id][k].red+=QuantumScale*GetPixelRed(image,q); - kmeans_pixels[id][k].green+=QuantumScale*GetPixelGreen(image,q); - kmeans_pixels[id][k].blue+=QuantumScale*GetPixelBlue(image,q); + kmeans_pixels[id][k].red+=QuantumScale*(double) GetPixelRed(image,q); + kmeans_pixels[id][k].green+=QuantumScale*(double) + GetPixelGreen(image,q); + kmeans_pixels[id][k].blue+=QuantumScale*(double) GetPixelBlue(image,q); if (image->alpha_trait != UndefinedPixelTrait) - kmeans_pixels[id][k].alpha+=QuantumScale*GetPixelAlpha(image,q); + kmeans_pixels[id][k].alpha+=QuantumScale*(double) + GetPixelAlpha(image,q); if (image->colorspace == CMYKColorspace) - kmeans_pixels[id][k].black+=QuantumScale*GetPixelBlack(image,q); + kmeans_pixels[id][k].black+=QuantumScale*(double) + GetPixelBlack(image,q); kmeans_pixels[id][k].count++; kmeans_pixels[id][k].distortion+=min_distance; SetPixelIndex(image,(Quantum) k,q); @@ -2725,13 +2745,18 @@ MagickExport MagickBooleanType KmeansImage(Image *image, gamma; gamma=PerceptibleReciprocal((double) kmeans_pixels[0][j].count); - image->colormap[j].red=gamma*QuantumRange*kmeans_pixels[0][j].red; - image->colormap[j].green=gamma*QuantumRange*kmeans_pixels[0][j].green; - image->colormap[j].blue=gamma*QuantumRange*kmeans_pixels[0][j].blue; + image->colormap[j].red=gamma*(double) QuantumRange* + kmeans_pixels[0][j].red; + image->colormap[j].green=gamma*(double) QuantumRange* + kmeans_pixels[0][j].green; + image->colormap[j].blue=gamma*(double) QuantumRange* + kmeans_pixels[0][j].blue; if (image->alpha_trait != UndefinedPixelTrait) - image->colormap[j].alpha=gamma*QuantumRange*kmeans_pixels[0][j].alpha; + image->colormap[j].alpha=gamma*(double) QuantumRange* + kmeans_pixels[0][j].alpha; if (image->colorspace == CMYKColorspace) - image->colormap[j].black=gamma*QuantumRange*kmeans_pixels[0][j].black; + image->colormap[j].black=gamma*(double) QuantumRange* + kmeans_pixels[0][j].black; image->colormap[j].count=(MagickSizeType) kmeans_pixels[0][j].count; distortion+=kmeans_pixels[0][j].distortion; } @@ -2830,7 +2855,8 @@ MagickExport MagickBooleanType PosterizeImage(Image *image,const size_t levels, { #define PosterizeImageTag "Posterize/Image" #define PosterizePixel(pixel) ClampToQuantum((MagickRealType) QuantumRange*( \ - MagickRound(QuantumScale*pixel*(levels-1)))/MagickMax((ssize_t) levels-1,1)) + MagickRound(QuantumScale*(double) pixel*(levels-1)))/ \ + MagickMax((ssize_t) levels-1,1)) CacheView *image_view; @@ -2939,8 +2965,8 @@ MagickExport MagickBooleanType PosterizeImage(Image *image,const size_t levels, } image_view=DestroyCacheView(image_view); quantize_info=AcquireQuantizeInfo((ImageInfo *) NULL); - quantize_info->number_colors=(size_t) MagickMin((ssize_t) levels*levels* - levels,MaxColormapSize+1); + quantize_info->number_colors=(size_t) MagickMin(levels*levels*levels, + MaxColormapSize+1); quantize_info->dither_method=dither_method; quantize_info->tree_depth=MaxTreeDepth; status=QuantizeImage(quantize_info,image,exception); @@ -3392,7 +3418,7 @@ static size_t QuantizeErrorFlatten(const CubeInfo *cube_info, number_children=cube_info->associate_alpha == MagickFalse ? 8UL : 16UL; for (i=0; i < (ssize_t) number_children ; i++) if (node_info->child[i] != (NodeInfo *) NULL) - n+=QuantizeErrorFlatten(cube_info,node_info->child[i],offset+n, + n+=QuantizeErrorFlatten(cube_info,node_info->child[i],offset+(ssize_t) n, quantize_error); return(n); } @@ -3563,7 +3589,7 @@ static void ReduceImageColors(const Image *image,CubeInfo *cube_info) cube_info->next_threshold=cube_info->root->quantize_error-1; cube_info->colors=0; Reduce(cube_info,cube_info->root); - offset=(MagickOffsetType) span-cube_info->colors; + offset=(MagickOffsetType) span-(MagickOffsetType) cube_info->colors; proceed=SetImageProgress(image,ReduceImageTag,offset,span- cube_info->maximum_colors+1); if (proceed == MagickFalse) diff --git a/ImageMagick-7.1.1-15/MagickCore/quantize.h b/ImageMagick-7.1.1-16/MagickCore/quantize.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/quantize.h rename to ImageMagick-7.1.1-16/MagickCore/quantize.h diff --git a/ImageMagick-7.1.1-15/MagickCore/quantum-export.c b/ImageMagick-7.1.1-16/MagickCore/quantum-export.c similarity index 95% rename from ImageMagick-7.1.1-15/MagickCore/quantum-export.c rename to ImageMagick-7.1.1-16/MagickCore/quantum-export.c index cbd271c7..4ef20074 100644 --- a/ImageMagick-7.1.1-15/MagickCore/quantum-export.c +++ b/ImageMagick-7.1.1-16/MagickCore/quantum-export.c @@ -195,7 +195,7 @@ static inline unsigned char *PopQuantumPixel(QuantumInfo *quantum_info, if (quantum_info->state.bits == 8UL) *pixels='\0'; quantum_info->state.bits-=quantum_bits; - *pixels|=(((pixel >> i) &~ ((~0UL) << quantum_bits)) << + *pixels|=(((pixel >> i) &~ (((QuantumAny) ~0UL) << quantum_bits)) << quantum_info->state.bits); if (quantum_info->state.bits == 0UL) { @@ -222,7 +222,7 @@ static inline unsigned char *PopQuantumLongPixel(QuantumInfo *quantum_info, quantum_bits=(size_t) i; if (quantum_bits > quantum_info->state.bits) quantum_bits=quantum_info->state.bits; - quantum_info->state.pixel|=(((pixel >> (quantum_info->depth-i)) & + quantum_info->state.pixel|=(((pixel >> ((ssize_t) quantum_info->depth-i)) & quantum_info->state.mask[quantum_bits]) << (32U- quantum_info->state.bits)); i-=(ssize_t) quantum_bits; @@ -273,7 +273,8 @@ static void ExportAlphaQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelAlpha(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -551,11 +552,14 @@ static void ExportBGRQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlue(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelGreen(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelRed(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -776,13 +780,17 @@ static void ExportBGRAQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlue(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelGreen(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelRed(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelAlpha(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -1019,13 +1027,17 @@ static void ExportBGROQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlue(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelGreen(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelRed(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelOpacity(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelOpacity(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -1169,7 +1181,8 @@ static void ExportBlackQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlack(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlack(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -1273,7 +1286,8 @@ static void ExportBlueQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlue(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -1501,13 +1515,17 @@ static void ExportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelRed(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelGreen(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlue(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlack(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlack(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -1651,15 +1669,20 @@ static void ExportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelRed(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelGreen(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlue(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlack(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlack(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelAlpha(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -1821,15 +1844,20 @@ static void ExportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelRed(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelGreen(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlue(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlack(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlack(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelOpacity(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelOpacity(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -1972,7 +2000,7 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, black=0x01; white=0x00; } - threshold=QuantumRange/2.0; + threshold=(double) QuantumRange/2.0; for (x=((ssize_t) number_pixels-7); x > 0; x-=8) { *q='\0'; @@ -2121,7 +2149,8 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelLuma(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelLuma(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -2230,7 +2259,7 @@ static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, black=0x01; white=0x00; } - threshold=QuantumRange/2.0; + threshold=(double) QuantumRange/2.0; for (x=((ssize_t) number_pixels-3); x > 0; x-=4) { *q='\0'; @@ -2282,7 +2311,8 @@ static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, { pixel=ScaleQuantumToChar(ClampToQuantum(GetPixelLuma(image,p))); *q=(((pixel >> 4) & 0xf) << 4); - pixel=(unsigned char) (16*QuantumScale*GetPixelAlpha(image,p)+0.5); + pixel=(unsigned char) (16.0*QuantumScale*(double) + GetPixelAlpha(image,p)+0.5); *q|=pixel & 0xf; p+=GetPixelChannels(image); q++; @@ -2314,9 +2344,11 @@ static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelLuma(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelLuma(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelAlpha(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -2438,7 +2470,8 @@ static void ExportGreenQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelGreen(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -2612,7 +2645,7 @@ static void ExportIndexQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { q=PopShortPixel(quantum_info->endian,SinglePrecisionToHalf( - QuantumScale*GetPixelIndex(image,p)),q); + QuantumScale*(double) GetPixelIndex(image,p)),q); p+=GetPixelChannels(image); q+=quantum_info->pad; } @@ -2752,7 +2785,8 @@ static void ExportIndexAlphaQuantum(const Image *image, { pixel=(unsigned char) ((ssize_t) GetPixelIndex(image,p)); *q=((pixel & 0xf) << 4); - pixel=(unsigned char) (16*QuantumScale*GetPixelAlpha(image,p)+0.5); + pixel=(unsigned char) (16.0*QuantumScale*(double) + GetPixelAlpha(image,p)+0.5); *q|=((pixel & 0xf) << 0); p+=GetPixelChannels(image); q++; @@ -2785,7 +2819,8 @@ static void ExportIndexAlphaQuantum(const Image *image, { q=PopShortPixel(quantum_info->endian,(unsigned short) ((ssize_t) GetPixelIndex(image,p)),q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelAlpha(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -2917,7 +2952,7 @@ static void ExportMultispectralQuantum(const Image *image, { for (i=0; i < (ssize_t) GetImageChannels(image); i++) { - pixel=SinglePrecisionToHalf(QuantumScale*p[i]); + pixel=SinglePrecisionToHalf(QuantumScale*(double) p[i]); q=PopShortPixel(quantum_info->endian,pixel,q); } p+=GetPixelChannels(image); @@ -3033,7 +3068,8 @@ static void ExportOpacityQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelOpacity(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelOpacity(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -3137,7 +3173,8 @@ static void ExportRedQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelRed(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -3415,11 +3452,14 @@ static void ExportRGBQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelRed(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelGreen(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlue(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -3643,13 +3683,17 @@ static void ExportRGBAQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelRed(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelGreen(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlue(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelAlpha(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -3886,13 +3930,17 @@ static void ExportRGBOQuantum(const Image *image,QuantumInfo *quantum_info, { for (x=0; x < (ssize_t) number_pixels; x++) { - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelRed(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelGreen(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelBlue(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); - pixel=SinglePrecisionToHalf(QuantumScale*GetPixelOpacity(image,p)); + pixel=SinglePrecisionToHalf(QuantumScale*(double) + GetPixelOpacity(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p+=GetPixelChannels(image); q+=quantum_info->pad; @@ -4057,14 +4105,14 @@ MagickExport size_t ExportQuantumPixels(const Image *image, ssize_t i; - Sa=QuantumScale*GetPixelAlpha(image,r); + Sa=QuantumScale*(double) GetPixelAlpha(image,r); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { PixelChannel channel = GetPixelChannelChannel(image,i); PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - r[i]=ClampToQuantum(Sa*r[i]); + r[i]=ClampToQuantum(Sa*(double) r[i]); } r+=GetPixelChannels(image); } diff --git a/ImageMagick-7.1.1-15/MagickCore/quantum-import.c b/ImageMagick-7.1.1-16/MagickCore/quantum-import.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/quantum-import.c rename to ImageMagick-7.1.1-16/MagickCore/quantum-import.c index 298e0e50..d9167b23 100644 --- a/ImageMagick-7.1.1-15/MagickCore/quantum-import.c +++ b/ImageMagick-7.1.1-16/MagickCore/quantum-import.c @@ -166,9 +166,9 @@ static inline float ScaleFloatPixel(const QuantumInfo *quantum_info, pixel=(double) (*((float *) quantum)); pixel-=quantum_info->minimum; pixel*=quantum_info->scale; - if (pixel < -FLT_MAX) + if (pixel < (double) -FLT_MAX) return(-FLT_MAX); - if (pixel > FLT_MAX) + if (pixel > (double) FLT_MAX) return(FLT_MAX); return(pixel); } @@ -291,7 +291,8 @@ static inline const unsigned char *PushQuantumLongPixel( if (quantum_bits > quantum_info->state.bits) quantum_bits=quantum_info->state.bits; *quantum|=(((quantum_info->state.pixel >> (32U-quantum_info->state.bits)) & - quantum_info->state.mask[quantum_bits]) << (quantum_info->depth-i)); + quantum_info->state.mask[quantum_bits]) << ((ssize_t) + quantum_info->depth-i)); i-=(ssize_t) quantum_bits; quantum_info->state.bits-=quantum_bits; } @@ -336,7 +337,7 @@ static void ImportAlphaQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelAlpha(image,ClampToQuantum(QuantumRange* + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -653,13 +654,13 @@ static void ImportBGRQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelRed(image,ClampToQuantum(QuantumRange* + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGreen(image,ClampToQuantum(QuantumRange* + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlue(image,ClampToQuantum(QuantumRange* + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -903,16 +904,16 @@ static void ImportBGRAQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelRed(image,ClampToQuantum(QuantumRange* + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGreen(image,ClampToQuantum(QuantumRange* + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlue(image,ClampToQuantum(QuantumRange* + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelAlpha(image,ClampToQuantum(QuantumRange* + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -1168,16 +1169,16 @@ static void ImportBGROQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelRed(image,ClampToQuantum(QuantumRange* + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGreen(image,ClampToQuantum(QuantumRange* + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlue(image,ClampToQuantum(QuantumRange* + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelOpacity(image,ClampToQuantum(QuantumRange* + SetPixelOpacity(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -1355,7 +1356,7 @@ static void ImportBlackQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlack(image,ClampToQuantum(QuantumRange* + SetPixelBlack(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -1494,7 +1495,7 @@ static void ImportBlueQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlue(image,ClampToQuantum(QuantumRange* + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -1738,16 +1739,16 @@ static void ImportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelRed(image,ClampToQuantum(QuantumRange* + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGreen(image,ClampToQuantum(QuantumRange* + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlue(image,ClampToQuantum(QuantumRange* + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlack(image,ClampToQuantum(QuantumRange* + SetPixelBlack(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -1933,19 +1934,19 @@ static void ImportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelRed(image,ClampToQuantum(QuantumRange* + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGreen(image,ClampToQuantum(QuantumRange* + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlue(image,ClampToQuantum(QuantumRange* + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlack(image,ClampToQuantum(QuantumRange* + SetPixelBlack(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelAlpha(image,ClampToQuantum(QuantumRange* + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -2143,19 +2144,19 @@ static void ImportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelRed(image,ClampToQuantum(QuantumRange* + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGreen(image,ClampToQuantum(QuantumRange* + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlue(image,ClampToQuantum(QuantumRange* + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlack(image,ClampToQuantum(QuantumRange* + SetPixelBlack(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelOpacity(image,ClampToQuantum(QuantumRange* + SetPixelOpacity(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -2548,7 +2549,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGray(image,ClampToQuantum(QuantumRange* + SetPixelGray(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -2786,10 +2787,10 @@ static void ImportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGray(image,ClampToQuantum(QuantumRange* + SetPixelGray(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelAlpha(image,ClampToQuantum(QuantumRange* + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -2940,7 +2941,7 @@ static void ImportGreenQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGreen(image,ClampToQuantum(QuantumRange* + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -3155,7 +3156,7 @@ static void ImportIndexQuantum(const Image *image,QuantumInfo *quantum_info, { p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelIndex(image,PushColormapIndex(image,(size_t) - ClampToQuantum((double) QuantumRange* + ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),&range_exception),q); SetPixelViaPixelInfo(image,image->colormap+(ssize_t) GetPixelIndex(image,q),q); @@ -3385,12 +3386,12 @@ static void ImportIndexAlphaQuantum(const Image *image, { p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelIndex(image,PushColormapIndex(image,(size_t) - ClampToQuantum((double) QuantumRange* + ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),&range_exception),q); SetPixelViaPixelInfo(image,image->colormap+(ssize_t) GetPixelIndex(image,q),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelAlpha(image,ClampToQuantum(QuantumRange* + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -3571,7 +3572,7 @@ static void ImportMultispectralQuantum(const Image *image, for (i=0; i < (ssize_t) GetImageChannels(image); i++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - q[i]=ClampToQuantum(QuantumRange*HalfToSinglePrecision(pixel)); + q[i]=ClampToQuantum((double) QuantumRange*(double)HalfToSinglePrecision(pixel)); } p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -3727,7 +3728,7 @@ static void ImportOpacityQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelOpacity(image,ClampToQuantum(QuantumRange* + SetPixelOpacity(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -3866,7 +3867,7 @@ static void ImportRedQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelRed(image,ClampToQuantum(QuantumRange* + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -4183,13 +4184,13 @@ static void ImportRGBQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelRed(image,ClampToQuantum(QuantumRange* + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGreen(image,ClampToQuantum(QuantumRange* + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlue(image,ClampToQuantum(QuantumRange* + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -4433,16 +4434,16 @@ static void ImportRGBAQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelRed(image,ClampToQuantum(QuantumRange* + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGreen(image,ClampToQuantum(QuantumRange* + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlue(image,ClampToQuantum(QuantumRange* + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelAlpha(image,ClampToQuantum(QuantumRange* + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -4698,16 +4699,16 @@ static void ImportRGBOQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelRed(image,ClampToQuantum(QuantumRange* + SetPixelRed(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelGreen(image,ClampToQuantum(QuantumRange* + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelBlue(image,ClampToQuantum(QuantumRange* + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); - SetPixelOpacity(image,ClampToQuantum(QuantumRange* + SetPixelOpacity(image,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); @@ -5033,7 +5034,7 @@ MagickExport size_t ImportQuantumPixels(const Image *image, ssize_t i; - Sa=QuantumScale*GetPixelAlpha(image,q); + Sa=QuantumScale*(double) GetPixelAlpha(image,q); gamma=PerceptibleReciprocal(Sa); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { @@ -5042,7 +5043,7 @@ MagickExport size_t ImportQuantumPixels(const Image *image, if ((channel == AlphaPixelChannel) || ((traits & UpdatePixelTrait) == 0)) continue; - q[i]=ClampToQuantum(gamma*q[i]); + q[i]=ClampToQuantum(gamma*(double) q[i]); } q+=GetPixelChannels(image); } diff --git a/ImageMagick-7.1.1-15/MagickCore/quantum-private.h b/ImageMagick-7.1.1-16/MagickCore/quantum-private.h similarity index 94% rename from ImageMagick-7.1.1-15/MagickCore/quantum-private.h rename to ImageMagick-7.1.1-16/MagickCore/quantum-private.h index b9e6c0f0..ebab5567 100644 --- a/ImageMagick-7.1.1-15/MagickCore/quantum-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/quantum-private.h @@ -110,11 +110,11 @@ static inline MagickSizeType GetQuantumRange(const size_t depth) static inline float HalfToSinglePrecision(const unsigned short half) { #define ExponentBias (127-15) -#define ExponentMask 0x7c00 +#define ExponentMask (0x7c00U) #define ExponentShift 23 #define SignBitShift 31 #define SignificandShift 13 -#define SignificandMask 0x00000400 +#define SignificandMask (0x00000400U) typedef union _SinglePrecision { @@ -125,15 +125,13 @@ static inline float HalfToSinglePrecision(const unsigned short half) single_precision; } SinglePrecision; - unsigned int - exponent, - significand, - sign_bit; - SinglePrecision map; unsigned int + exponent, + significand, + sign_bit, value; /* @@ -331,11 +329,11 @@ static inline QuantumAny ScaleQuantumToAny(const Quantum quantum, #if !defined(MAGICKCORE_HDRI_SUPPORT) return((QuantumAny) ((double) range*quantum/QuantumRange)); #else - if ((IsNaN(quantum) != 0) || (quantum <= 0.0)) + if ((IsNaN(quantum) != 0) || (quantum <= 0.0f)) return((QuantumAny) 0UL); - if (((double) range*quantum/QuantumRange) >= 18446744073709551615.0) + if ((range*(double) quantum/(double) QuantumRange) >= 18446744073709551615.0) return((QuantumAny) MagickULLConstant(18446744073709551615)); - return((QuantumAny) ((double) range*quantum/QuantumRange+0.5)); + return((QuantumAny) (range*(double) quantum/(double) QuantumRange+0.5)); #endif } @@ -398,7 +396,7 @@ static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum) return(0UL); if ((72340172838076673.0*quantum) >= 18446744073709551615.0) return(MagickULLConstant(18446744073709551615)); - return((MagickSizeType) (72340172838076673*quantum+0.5)); + return((MagickSizeType) (72340172838076673.0*quantum+0.5)); #endif } @@ -482,11 +480,11 @@ static inline unsigned int ScaleQuantumToLong(const Quantum quantum) #if !defined(MAGICKCORE_HDRI_SUPPORT) return((unsigned int) (65537UL*quantum)); #else - if ((IsNaN(quantum) != 0) || (quantum <= 0.0)) + if ((IsNaN(quantum) != 0) || (quantum <= 0.0f)) return(0U); - if ((65537.0*quantum) >= 4294967295.0) + if ((65537.0*(double) quantum) >= 4294967295.0) return(4294967295U); - return((unsigned int) (65537.0*quantum+0.5)); + return((unsigned int) (65537.0*(double) quantum+0.5)); #endif } @@ -495,11 +493,11 @@ static inline MagickSizeType ScaleQuantumToLongLong(const Quantum quantum) #if !defined(MAGICKCORE_HDRI_SUPPORT) return((MagickSizeType) (MagickULLConstant(281479271743489)*quantum)); #else - if ((IsNaN(quantum) != 0) || (quantum <= 0.0)) + if ((IsNaN(quantum) != 0) || (quantum <= 0.0f)) return(0UL); - if ((281479271743489.0*quantum) >= 18446744073709551615.0) + if ((281479271743489.0*(double) quantum) >= 18446744073709551615.0) return(MagickULLConstant(18446744073709551615)); - return((MagickSizeType) (281479271743489.0*quantum+0.5)); + return((MagickSizeType) (281479271743489.0*(double) quantum+0.5)); #endif } @@ -510,9 +508,9 @@ static inline unsigned int ScaleQuantumToMap(const Quantum quantum) #if !defined(MAGICKCORE_HDRI_SUPPORT) return((unsigned int) quantum); #else - if ((IsNaN(quantum) != 0) || (quantum <= 0.0)) + if ((IsNaN(quantum) != 0) || (quantum <= 0.0f)) return(0U); - return((unsigned int) (quantum+0.5)); + return((unsigned int) (quantum+0.5f)); #endif } @@ -521,11 +519,11 @@ static inline unsigned short ScaleQuantumToShort(const Quantum quantum) #if !defined(MAGICKCORE_HDRI_SUPPORT) return((unsigned short) quantum); #else - if ((IsNaN(quantum) != 0) || (quantum <= 0.0)) + if ((IsNaN(quantum) != 0) || (quantum <= 0.0f)) return(0); - if (quantum >= 65535.0) + if (quantum >= 65535.0f) return(65535); - return((unsigned short) (quantum+0.5)); + return((unsigned short) (quantum+0.5f)); #endif } @@ -713,13 +711,13 @@ static inline unsigned short SinglePrecisionToHalf(const float value) int exponent; + SinglePrecision + map; + unsigned int significand, sign_bit; - SinglePrecision - map; - unsigned short half; @@ -743,7 +741,7 @@ static inline unsigned short SinglePrecisionToHalf(const float value) return((unsigned short) sign_bit); significand=significand | 0x00800000; shift=(int) (14-exponent); - significand=(unsigned int) ((significand+((1 << (shift-1))-1)+ + significand=(unsigned int) ((significand+((1U << (shift-1))-1)+ ((significand >> shift) & 0x01)) >> shift); return((unsigned short) (sign_bit | significand)); } @@ -782,7 +780,7 @@ static inline unsigned short SinglePrecisionToHalf(const float value) alpha*=alpha; return((unsigned short) (sign_bit | ExponentMask)); } - half=(unsigned short) (sign_bit | (exponent << 10) | + half=(unsigned short) (sign_bit | ((unsigned int) exponent << 10) | (significand >> SignificandShift)); return(half); } diff --git a/ImageMagick-7.1.1-15/MagickCore/quantum.c b/ImageMagick-7.1.1-16/MagickCore/quantum.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/quantum.c rename to ImageMagick-7.1.1-16/MagickCore/quantum.c diff --git a/ImageMagick-7.1.1-15/MagickCore/quantum.h b/ImageMagick-7.1.1-16/MagickCore/quantum.h similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/quantum.h rename to ImageMagick-7.1.1-16/MagickCore/quantum.h index eb5308f8..10505d1f 100644 --- a/ImageMagick-7.1.1-15/MagickCore/quantum.h +++ b/ImageMagick-7.1.1-16/MagickCore/quantum.h @@ -115,11 +115,11 @@ static inline unsigned char ScaleQuantumToChar(const Quantum quantum) #if !defined(MAGICKCORE_HDRI_SUPPORT) return((unsigned char) (((quantum+128UL)-((quantum+128UL) >> 8)) >> 8)); #else - if ((IsNaN(quantum) != 0) || (quantum <= 0.0)) + if ((IsNaN(quantum) != 0) || (quantum <= 0.0f)) return(0); - if ((quantum/257.0) >= 255.0) + if ((quantum/257.0f) >= 255.0f) return(255); - return((unsigned char) (quantum/257.0+0.5)); + return((unsigned char) (quantum/257.0f+0.5f)); #endif } #elif (MAGICKCORE_QUANTUM_DEPTH == 32) diff --git a/ImageMagick-7.1.1-15/MagickCore/random-private.h b/ImageMagick-7.1.1-16/MagickCore/random-private.h similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/random-private.h rename to ImageMagick-7.1.1-16/MagickCore/random-private.h index 3a6b8a19..ada203a6 100644 --- a/ImageMagick-7.1.1-15/MagickCore/random-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/random-private.h @@ -1,12 +1,12 @@ /* Copyright @ 2001 ImageMagick Studio LLC, a non-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. @@ -41,7 +41,6 @@ static inline RandomInfo **DestroyRandomInfoTLS(RandomInfo **random_info) ssize_t i; - assert(random_info != (RandomInfo **) NULL); for (i=0; i < (ssize_t) GetMagickResourceLimit(ThreadResource); i++) if (random_info[i] != (RandomInfo *) NULL) random_info[i]=DestroyRandomInfo(random_info[i]); diff --git a/ImageMagick-7.1.1-15/MagickCore/random.c b/ImageMagick-7.1.1-16/MagickCore/random.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/random.c rename to ImageMagick-7.1.1-16/MagickCore/random.c index 208e56fa..02c2e69a 100644 --- a/ImageMagick-7.1.1-15/MagickCore/random.c +++ b/ImageMagick-7.1.1-16/MagickCore/random.c @@ -331,7 +331,7 @@ static ssize_t ReadRandom(int file,unsigned char *source,size_t length) count; offset=0; - for (q=source; length != 0; length-=count) + for (q=source; length != 0; length-=(size_t) count) { count=(ssize_t) read(file,q,length); if (count <= 0) @@ -359,13 +359,13 @@ static StringInfo *GenerateEntropicChaos(RandomInfo *random_info) *chaos, *entropy; - size_t - nanoseconds, - seconds; - ssize_t pid; + time_t + nanoseconds, + seconds; + /* Initialize random reservoir. */ @@ -430,8 +430,8 @@ static StringInfo *GenerateEntropicChaos(RandomInfo *random_info) if (gettimeofday(&timer,(struct timezone *) NULL) == 0) { - seconds=(size_t) timer.tv_sec; - nanoseconds=(size_t) (1000UL*timer.tv_usec); + seconds=timer.tv_sec; + nanoseconds=1000*timer.tv_usec; } } #endif @@ -480,7 +480,7 @@ static StringInfo *GenerateEntropicChaos(RandomInfo *random_info) /* Not cryptographically strong but better than nothing. */ - nt_seconds=NTElapsedTime()+NTUserTime(); + nt_seconds=NTElapsedTime()+NTElapsedTime(); SetStringInfoLength(chaos,sizeof(nt_seconds)); SetStringInfoDatum(chaos,(unsigned char *) &nt_seconds); ConcatenateStringInfo(entropy,chaos); diff --git a/ImageMagick-7.1.1-15/MagickCore/random_.h b/ImageMagick-7.1.1-16/MagickCore/random_.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/random_.h rename to ImageMagick-7.1.1-16/MagickCore/random_.h diff --git a/ImageMagick-7.1.1-15/MagickCore/registry-private.h b/ImageMagick-7.1.1-16/MagickCore/registry-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/registry-private.h rename to ImageMagick-7.1.1-16/MagickCore/registry-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/registry.c b/ImageMagick-7.1.1-16/MagickCore/registry.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/registry.c rename to ImageMagick-7.1.1-16/MagickCore/registry.c index 181fa72b..f0bb8369 100644 --- a/ImageMagick-7.1.1-15/MagickCore/registry.c +++ b/ImageMagick-7.1.1-16/MagickCore/registry.c @@ -479,7 +479,7 @@ MagickExport MagickBooleanType SetImageRegistry(const RegistryType type, string=(const char *) value; if (LocaleCompare(key,"date:precision") == 0) - SetMagickDatePrecision(StringToInteger(string)); + SetMagickDatePrecision((size_t) StringToInteger(string)); clone_value=(void *) ConstantString(string); break; } diff --git a/ImageMagick-7.1.1-15/MagickCore/registry.h b/ImageMagick-7.1.1-16/MagickCore/registry.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/registry.h rename to ImageMagick-7.1.1-16/MagickCore/registry.h diff --git a/ImageMagick-7.1.1-15/MagickCore/resample-private.h b/ImageMagick-7.1.1-16/MagickCore/resample-private.h similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/resample-private.h rename to ImageMagick-7.1.1-16/MagickCore/resample-private.h index 5912b47a..9fbba4e3 100644 --- a/ImageMagick-7.1.1-15/MagickCore/resample-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/resample-private.h @@ -29,7 +29,6 @@ static inline ResampleFilter **DestroyResampleFilterTLS(ResampleFilter **filter) ssize_t i; - assert(filter != (ResampleFilter **) NULL); for (i=0; i < (ssize_t) GetMagickResourceLimit(ThreadResource); i++) if (filter[i] != (ResampleFilter *) NULL) filter[i]=DestroyResampleFilter(filter[i]); diff --git a/ImageMagick-7.1.1-15/MagickCore/resample.c b/ImageMagick-7.1.1-16/MagickCore/resample.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/resample.c rename to ImageMagick-7.1.1-16/MagickCore/resample.c index ac4c53d7..70abf47b 100644 --- a/ImageMagick-7.1.1-15/MagickCore/resample.c +++ b/ImageMagick-7.1.1-16/MagickCore/resample.c @@ -607,16 +607,22 @@ MagickExport MagickBooleanType ResamplePixelColor( sqrt(Q)); /* a SquareRoot! Arrggghhhhh... */ #endif - pixel->alpha += weight*GetPixelAlpha(resample_filter->image,pixels); + pixel->alpha+=weight*(double) + GetPixelAlpha(resample_filter->image,pixels); divisor_m += weight; if (pixel->alpha_trait != UndefinedPixelTrait) - weight *= QuantumScale*((double) GetPixelAlpha(resample_filter->image,pixels)); - pixel->red += weight*GetPixelRed(resample_filter->image,pixels); - pixel->green += weight*GetPixelGreen(resample_filter->image,pixels); - pixel->blue += weight*GetPixelBlue(resample_filter->image,pixels); + weight*=QuantumScale*((double) + GetPixelAlpha(resample_filter->image,pixels)); + pixel->red+=weight*(double) + GetPixelRed(resample_filter->image,pixels); + pixel->green+=weight*(double) + GetPixelGreen(resample_filter->image,pixels); + pixel->blue+=weight*(double) + GetPixelBlue(resample_filter->image,pixels); if (pixel->colorspace == CMYKColorspace) - pixel->black += weight*GetPixelBlack(resample_filter->image,pixels); + pixel->black+=weight*(double) + GetPixelBlack(resample_filter->image,pixels); divisor_c += weight; hit++; diff --git a/ImageMagick-7.1.1-15/MagickCore/resample.h b/ImageMagick-7.1.1-16/MagickCore/resample.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/resample.h rename to ImageMagick-7.1.1-16/MagickCore/resample.h diff --git a/ImageMagick-7.1.1-15/MagickCore/resize-private.h b/ImageMagick-7.1.1-16/MagickCore/resize-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/resize-private.h rename to ImageMagick-7.1.1-16/MagickCore/resize-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/resize.c b/ImageMagick-7.1.1-16/MagickCore/resize.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/resize.c rename to ImageMagick-7.1.1-16/MagickCore/resize.c index 7aee039e..d4f468c7 100644 --- a/ImageMagick-7.1.1-15/MagickCore/resize.c +++ b/ImageMagick-7.1.1-16/MagickCore/resize.c @@ -1235,7 +1235,7 @@ MagickPrivate ResizeFilter *AcquireResizeFilter(const Image *image, /* Output values of resulting filter graph -- for graphing filter result. */ - for (x=0.0; x <= support; x+=0.01f) + for (x=0.0; x <= support; x+=0.01) (void) FormatLocaleFile(stdout,"%5.2lf\t%.*g\n",x,GetMagickPrecision(), (double) GetResizeFilterWeight(resize_filter,x)); /* @@ -1943,7 +1943,7 @@ MagickExport Image *LiquidRescaleImage(const Image *image,const size_t columns, i; for (i=0; i < (ssize_t) GetPixelChannels(image); i++) - *q++=QuantumScale*p[i]; + *q++=QuantumScale*(double) p[i]; p+=GetPixelChannels(image); } } @@ -1959,8 +1959,8 @@ MagickExport Image *LiquidRescaleImage(const Image *image,const size_t columns, lqr_status=lqr_carver_init(carver,(int) delta_x,rigidity); lqr_status=lqr_carver_resize(carver,(int) columns,(int) rows); (void) lqr_status; - rescale_image=CloneImage(image,lqr_carver_get_width(carver), - lqr_carver_get_height(carver),MagickTrue,exception); + rescale_image=CloneImage(image,(size_t) lqr_carver_get_width(carver), + (size_t) lqr_carver_get_height(carver),MagickTrue,exception); if (rescale_image == (Image *) NULL) { pixel_info=RelinquishVirtualMemory(pixel_info); @@ -2063,7 +2063,8 @@ static inline void CopyPixels(const Quantum *source,const ssize_t source_offset, i; for (i=0; i < (ssize_t) channels; i++) - destination[channels*destination_offset+i]=source[source_offset*channels+i]; + destination[(ssize_t) channels*destination_offset+i]= + source[source_offset*(ssize_t) channels+i]; } static inline void MixPixels(const Quantum *source,const ssize_t *source_offset, @@ -2080,8 +2081,9 @@ static inline void MixPixels(const Quantum *source,const ssize_t *source_offset, sum = 0; for (j=0; j < (ssize_t) source_size; j++) - sum+=source[source_offset[j]*channels+i]; - destination[channels*destination_offset+i]=(Quantum) (sum/source_size); + sum+=source[source_offset[j]*(ssize_t) channels+i]; + destination[(ssize_t) channels*destination_offset+i]=(Quantum) (sum/ + (ssize_t) source_size); } } @@ -2101,8 +2103,8 @@ static inline int PixelsEqual(const Quantum *source1,ssize_t offset1, ssize_t i; - offset1*=channels; - offset2*=channels; + offset1*=(ssize_t) channels; + offset2*=(ssize_t) channels; for (i=0; i < (ssize_t) channels; i++) if (source1[offset1+i] != source2[offset2+i]) return(0); @@ -2328,7 +2330,7 @@ static inline unsigned int Hq2XPatternToNumber(const int *pattern) order=1; for (i=7; i >= 0; i--) { - result+=order*pattern[i]; + result+=order*(unsigned int) pattern[i]; order*=2; } return(result); @@ -2434,7 +2436,7 @@ static void Fish2X(const Image *source,const Quantum *pixels,Quantum *result, i; for (i=0; i < 9; i++) - intensities[i]=GetPixelIntensity(source,pixels + i*channels); + intensities[i]=GetPixelIntensity(source,pixels+i*(ssize_t) channels); CopyPixels(pixels,0,result,0,channels); CopyPixels(pixels,(ssize_t) (intensities[0] > intensities[1] ? 0 : 1),result, 1,channels); @@ -3044,7 +3046,8 @@ MagickExport Image *MagnifyImage(const Image *image,ExceptionInfo *exception) */ for (j=0; j < (ssize_t) magnification; j++) for (i=0; i < (ssize_t) (channels*magnification); i++) - q[j*channels*magnify_image->columns+i]=r[j*magnification*channels+i]; + q[j*(ssize_t) channels*(ssize_t) magnify_image->columns+i]= + r[j*magnification*(ssize_t) channels+i]; q+=magnification*GetPixelChannels(magnify_image); } if (SyncCacheViewAuthenticPixels(magnify_view,exception) == MagickFalse) @@ -3426,8 +3429,8 @@ static MagickBooleanType HorizontalFilter( stop-1.0)+0.5); k=y*(contribution[n-1].pixel-contribution[0].pixel+1)+ (contribution[j-start].pixel-contribution[0].pixel); - SetPixelChannel(resize_image,channel,p[k*GetPixelChannels(image)+i], - q); + SetPixelChannel(resize_image,channel, + p[k*(ssize_t) GetPixelChannels(image)+i],q); continue; } pixel=0.0; @@ -3441,7 +3444,7 @@ static MagickBooleanType HorizontalFilter( k=y*(contribution[n-1].pixel-contribution[0].pixel+1)+ (contribution[j].pixel-contribution[0].pixel); alpha=contribution[j].weight; - pixel+=alpha*p[k*GetPixelChannels(image)+i]; + pixel+=alpha*(double) p[k*(ssize_t) GetPixelChannels(image)+i]; } SetPixelChannel(resize_image,channel,ClampToQuantum(pixel),q); continue; @@ -3455,8 +3458,8 @@ static MagickBooleanType HorizontalFilter( k=y*(contribution[n-1].pixel-contribution[0].pixel+1)+ (contribution[j].pixel-contribution[0].pixel); alpha=contribution[j].weight*QuantumScale* - GetPixelAlpha(image,p+k*GetPixelChannels(image)); - pixel+=alpha*p[k*GetPixelChannels(image)+i]; + (double) GetPixelAlpha(image,p+k*(ssize_t) GetPixelChannels(image)); + pixel+=alpha*(double) p[k*(ssize_t) GetPixelChannels(image)+i]; gamma+=alpha; } gamma=PerceptibleReciprocal(gamma); @@ -3640,9 +3643,9 @@ static MagickBooleanType VerticalFilter( j=(ssize_t) (MagickMin(MagickMax(bisect,(double) start),(double) stop-1.0)+0.5); k=(ssize_t) ((contribution[j-start].pixel-contribution[0].pixel)* - image->columns+x); - SetPixelChannel(resize_image,channel,p[k*GetPixelChannels(image)+i], - q); + (ssize_t) image->columns+x); + SetPixelChannel(resize_image,channel,p[k*(ssize_t) + GetPixelChannels(image)+i],q); continue; } pixel=0.0; @@ -3654,9 +3657,9 @@ static MagickBooleanType VerticalFilter( for (j=0; j < n; j++) { k=(ssize_t) ((contribution[j].pixel-contribution[0].pixel)* - image->columns+x); + (ssize_t) image->columns+x); alpha=contribution[j].weight; - pixel+=alpha*p[k*GetPixelChannels(image)+i]; + pixel+=alpha*(double) p[k*(ssize_t) GetPixelChannels(image)+i]; } SetPixelChannel(resize_image,channel,ClampToQuantum(pixel),q); continue; @@ -3665,10 +3668,10 @@ static MagickBooleanType VerticalFilter( for (j=0; j < n; j++) { k=(ssize_t) ((contribution[j].pixel-contribution[0].pixel)* - image->columns+x); - alpha=contribution[j].weight*QuantumScale*GetPixelAlpha(image,p+k* - GetPixelChannels(image)); - pixel+=alpha*p[k*GetPixelChannels(image)+i]; + (ssize_t) image->columns+x); + alpha=contribution[j].weight*QuantumScale*(double) + GetPixelAlpha(image,p+k*(ssize_t) GetPixelChannels(image)); + pixel+=alpha*(double) p[k*(ssize_t) GetPixelChannels(image)+i]; gamma+=alpha; } gamma=PerceptibleReciprocal(gamma); @@ -3788,16 +3791,16 @@ MagickExport Image *ResizeImage(const Image *image,const size_t columns, span=(MagickSizeType) (filter_image->columns+rows); status=HorizontalFilter(resize_filter,image,filter_image,x_factor,span, &offset,exception); - status&=VerticalFilter(resize_filter,filter_image,resize_image,y_factor, - span,&offset,exception); + status&=(MagickStatusType) VerticalFilter(resize_filter,filter_image, + resize_image,y_factor,span,&offset,exception); } else { span=(MagickSizeType) (filter_image->rows+columns); status=VerticalFilter(resize_filter,image,filter_image,y_factor,span, &offset,exception); - status&=HorizontalFilter(resize_filter,filter_image,resize_image,x_factor, - span,&offset,exception); + status&=(MagickStatusType) HorizontalFilter(resize_filter,filter_image, + resize_image,x_factor,span,&offset,exception); } /* Free resources. @@ -3988,8 +3991,8 @@ MagickExport Image *SampleImage(const Image *image,const size_t columns, if ((traits == UndefinedPixelTrait) || (image_traits == UndefinedPixelTrait)) continue; - SetPixelChannel(sample_image,channel,p[x_offset[x]*GetPixelChannels( - image)+i],q); + SetPixelChannel(sample_image,channel,p[x_offset[x]*(ssize_t) + GetPixelChannels(image)+i],q); } q+=GetPixelChannels(sample_image); } @@ -4184,17 +4187,17 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, continue; } if (image->alpha_trait != UndefinedPixelTrait) - alpha=QuantumScale*GetPixelAlpha(image,p); + alpha=QuantumScale*(double) GetPixelAlpha(image,p); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { PixelChannel channel = GetPixelChannelChannel(image,i); PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & BlendPixelTrait) == 0) { - x_vector[x*GetPixelChannels(image)+i]=(double) p[i]; + x_vector[x*(ssize_t) GetPixelChannels(image)+i]=(double) p[i]; continue; } - x_vector[x*GetPixelChannels(image)+i]=alpha*p[i]; + x_vector[x*(ssize_t) GetPixelChannels(image)+i]=alpha*(double) p[i]; } p+=GetPixelChannels(image); } @@ -4227,17 +4230,19 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, continue; } if (image->alpha_trait != UndefinedPixelTrait) - alpha=QuantumScale*GetPixelAlpha(image,p); + alpha=QuantumScale*(double) GetPixelAlpha(image,p); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { PixelChannel channel = GetPixelChannelChannel(image,i); PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & BlendPixelTrait) == 0) { - x_vector[x*GetPixelChannels(image)+i]=(double) p[i]; + x_vector[x*(ssize_t) GetPixelChannels(image)+i]= + (double) p[i]; continue; } - x_vector[x*GetPixelChannels(image)+i]=alpha*p[i]; + x_vector[x*(ssize_t) GetPixelChannels(image)+i]=alpha* + (double) p[i]; } p+=GetPixelChannels(image); } @@ -4245,8 +4250,8 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, } for (x=0; x < (ssize_t) image->columns; x++) for (i=0; i < (ssize_t) GetPixelChannels(image); i++) - y_vector[x*GetPixelChannels(image)+i]+=scale.y* - x_vector[x*GetPixelChannels(image)+i]; + y_vector[x*(ssize_t) GetPixelChannels(image)+i]+=scale.y* + x_vector[x*(ssize_t) GetPixelChannels(image)+i]; span.y-=scale.y; scale.y=(double) scale_image->rows/(double) image->rows; next_row=MagickTrue; @@ -4271,17 +4276,19 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, continue; } if (image->alpha_trait != UndefinedPixelTrait) - alpha=QuantumScale*GetPixelAlpha(image,p); + alpha=QuantumScale*(double) GetPixelAlpha(image,p); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { PixelChannel channel = GetPixelChannelChannel(image,i); PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & BlendPixelTrait) == 0) { - x_vector[x*GetPixelChannels(image)+i]=(double) p[i]; + x_vector[x*(ssize_t) GetPixelChannels(image)+i]= + (double) p[i]; continue; } - x_vector[x*GetPixelChannels(image)+i]=alpha*p[i]; + x_vector[x*(ssize_t) GetPixelChannels(image)+i]=alpha* + (double) p[i]; } p+=GetPixelChannels(image); } @@ -4292,10 +4299,10 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, { for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { - pixel[i]=y_vector[x*GetPixelChannels(image)+i]+span.y* - x_vector[x*GetPixelChannels(image)+i]; - scanline[x*GetPixelChannels(image)+i]=pixel[i]; - y_vector[x*GetPixelChannels(image)+i]=0.0; + pixel[i]=y_vector[x*(ssize_t) GetPixelChannels(image)+i]+span.y* + x_vector[x*(ssize_t) GetPixelChannels(image)+i]; + scanline[x*(ssize_t) GetPixelChannels(image)+i]=pixel[i]; + y_vector[x*(ssize_t) GetPixelChannels(image)+i]=0.0; } } scale.y-=span.y; @@ -4320,7 +4327,7 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, } if (image->alpha_trait != UndefinedPixelTrait) { - alpha=QuantumScale*scanline[x*GetPixelChannels(image)+ + alpha=QuantumScale*scanline[x*(ssize_t) GetPixelChannels(image)+ GetPixelChannelOffset(image,AlphaPixelChannel)]; alpha=PerceptibleReciprocal(alpha); } @@ -4335,11 +4342,11 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, if ((traits & BlendPixelTrait) == 0) { SetPixelChannel(scale_image,channel,ClampToQuantum( - scanline[x*GetPixelChannels(image)+i]),q); + scanline[x*(ssize_t) GetPixelChannels(image)+i]),q); continue; } SetPixelChannel(scale_image,channel,ClampToQuantum(alpha*scanline[ - x*GetPixelChannels(image)+i]),q); + x*(ssize_t) GetPixelChannels(image)+i]),q); } q+=GetPixelChannels(scale_image); } @@ -4374,8 +4381,8 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, PixelTrait traits = GetPixelChannelTraits(image,channel); if (traits == UndefinedPixelTrait) continue; - pixel[i]+=span.x*scanline[x*GetPixelChannels(image)+i]; - scale_scanline[t*GetPixelChannels(image)+i]=pixel[i]; + pixel[i]+=span.x*scanline[x*(ssize_t) GetPixelChannels(image)+i]; + scale_scanline[t*(ssize_t) GetPixelChannels(image)+i]=pixel[i]; } scale.x-=span.x; span.x=1.0; @@ -4391,18 +4398,20 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, t++; } for (i=0; i < (ssize_t) GetPixelChannels(image); i++) - pixel[i]+=scale.x*scanline[x*GetPixelChannels(image)+i]; + pixel[i]+=scale.x*scanline[x*(ssize_t) + GetPixelChannels(image)+i]; span.x-=scale.x; } } if (span.x > 0) { for (i=0; i < (ssize_t) GetPixelChannels(image); i++) - pixel[i]+=span.x*scanline[(x-1)*GetPixelChannels(image)+i]; + pixel[i]+=span.x* + scanline[(x-1)*(ssize_t) GetPixelChannels(image)+i]; } if ((next_column == MagickFalse) && (t < (ssize_t) scale_image->columns)) for (i=0; i < (ssize_t) GetPixelChannels(image); i++) - scale_scanline[t*GetPixelChannels(image)+i]=pixel[i]; + scale_scanline[t*(ssize_t) GetPixelChannels(image)+i]=pixel[i]; /* Transfer scanline to scaled image. */ @@ -4415,7 +4424,8 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, } if (image->alpha_trait != UndefinedPixelTrait) { - alpha=QuantumScale*scale_scanline[x*GetPixelChannels(image)+ + alpha=QuantumScale*scale_scanline[x*(ssize_t) + GetPixelChannels(image)+ GetPixelChannelOffset(image,AlphaPixelChannel)]; alpha=PerceptibleReciprocal(alpha); } @@ -4430,11 +4440,11 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, if ((traits & BlendPixelTrait) == 0) { SetPixelChannel(scale_image,channel,ClampToQuantum( - scale_scanline[x*GetPixelChannels(image)+i]),q); + scale_scanline[x*(ssize_t) GetPixelChannels(image)+i]),q); continue; } SetPixelChannel(scale_image,channel,ClampToQuantum(alpha* - scale_scanline[x*GetPixelChannels(image)+i]),q); + scale_scanline[x*(ssize_t) GetPixelChannels(image)+i]),q); } q+=GetPixelChannels(scale_image); } @@ -4535,8 +4545,8 @@ MagickExport Image *ThumbnailImage(const Image *image,const size_t columns, x_factor, y_factor; - x_factor=(ssize_t) image->columns/columns; - y_factor=(ssize_t) image->rows/rows; + x_factor=(ssize_t) image->columns/(ssize_t) columns; + y_factor=(ssize_t) image->rows/(ssize_t) rows; if ((x_factor > 4) && (y_factor > 4)) { thumbnail_image=SampleImage(clone_image,4*columns,4*rows,exception); diff --git a/ImageMagick-7.1.1-15/MagickCore/resize.h b/ImageMagick-7.1.1-16/MagickCore/resize.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/resize.h rename to ImageMagick-7.1.1-16/MagickCore/resize.h diff --git a/ImageMagick-7.1.1-15/MagickCore/resource-private.h b/ImageMagick-7.1.1-16/MagickCore/resource-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/resource-private.h rename to ImageMagick-7.1.1-16/MagickCore/resource-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/resource.c b/ImageMagick-7.1.1-16/MagickCore/resource.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/resource.c rename to ImageMagick-7.1.1-16/MagickCore/resource.c index f4aac363..3a8b7ee9 100644 --- a/ImageMagick-7.1.1-15/MagickCore/resource.c +++ b/ImageMagick-7.1.1-16/MagickCore/resource.c @@ -126,8 +126,8 @@ static ResourceInfo MagickULLConstant(0), /* initial thread */ MagickULLConstant(0), /* initial throttle */ MagickULLConstant(0), /* initial time */ - (MagickSizeType) MAGICK_SSIZE_MAX/sizeof(Quantum)/5,/* width limit */ - (MagickSizeType) MAGICK_SSIZE_MAX/sizeof(Quantum)/5,/* height limit */ + (MagickSizeType) (SSIZE_MAX/sizeof(Quantum)/MaxPixelChannels), /* width limit */ + (MagickSizeType) (SSIZE_MAX/sizeof(Quantum)/MaxPixelChannels), /* height limit */ MagickResourceInfinity, /* list length limit */ MagickULLConstant(3072)*1024*1024, /* area limit */ MagickULLConstant(1536)*1024*1024, /* memory limit */ @@ -236,8 +236,7 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type, { bi=MagickTrue; limit=resource_info.disk_limit; - if (((MagickSizeType) resource_info.disk+request) > - (MagickSizeType) resource_info.disk) + if (((MagickSizeType) resource_info.disk+(MagickSizeType) request) > (MagickSizeType) resource_info.disk) { resource_info.disk+=request; if ((limit == MagickResourceInfinity) || @@ -252,8 +251,7 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type, case FileResource: { limit=resource_info.file_limit; - if (((MagickSizeType) resource_info.file+request) > - (MagickSizeType) resource_info.file) + if (((MagickSizeType) resource_info.file+(MagickSizeType) request) > (MagickSizeType) resource_info.file) { resource_info.file+=request; if ((limit == MagickResourceInfinity) || @@ -284,8 +282,7 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type, { bi=MagickTrue; limit=resource_info.map_limit; - if (((MagickSizeType) resource_info.map+request) > - (MagickSizeType) resource_info.map) + if (((MagickSizeType) resource_info.map+(MagickSizeType) request) > (MagickSizeType) resource_info.map) { resource_info.map+=request; if ((limit == MagickResourceInfinity) || @@ -301,8 +298,7 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type, { bi=MagickTrue; limit=resource_info.memory_limit; - if (((MagickSizeType) resource_info.memory+request) > - (MagickSizeType) resource_info.memory) + if (((MagickSizeType) resource_info.memory+(MagickSizeType) request) > (MagickSizeType) resource_info.memory) { resource_info.memory+=request; if ((limit == MagickResourceInfinity) || @@ -333,8 +329,7 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type, case TimeResource: { limit=resource_info.time_limit; - if (((MagickSizeType) resource_info.time+request) > - (MagickSizeType) resource_info.time) + if (((MagickSizeType) resource_info.time+(MagickSizeType) request) > (MagickSizeType) resource_info.time) { resource_info.time+=request; if ((limit == MagickResourceInfinity) || @@ -998,7 +993,7 @@ MagickExport void RelinquishMagickResource(const ResourceType type, case DiskResource: { bi=MagickTrue; - resource_info.disk-=size; + resource_info.disk-=(MagickOffsetType) size; current=(MagickSizeType) resource_info.disk; limit=resource_info.disk_limit; assert(resource_info.disk >= 0); @@ -1006,7 +1001,7 @@ MagickExport void RelinquishMagickResource(const ResourceType type, } case FileResource: { - resource_info.file-=size; + resource_info.file-=(MagickOffsetType) size; current=(MagickSizeType) resource_info.file; limit=resource_info.file_limit; assert(resource_info.file >= 0); @@ -1015,7 +1010,7 @@ MagickExport void RelinquishMagickResource(const ResourceType type, case MapResource: { bi=MagickTrue; - resource_info.map-=size; + resource_info.map-=(MagickOffsetType) size; current=(MagickSizeType) resource_info.map; limit=resource_info.map_limit; assert(resource_info.map >= 0); @@ -1024,7 +1019,7 @@ MagickExport void RelinquishMagickResource(const ResourceType type, case MemoryResource: { bi=MagickTrue; - resource_info.memory-=size; + resource_info.memory-=(MagickOffsetType) size; current=(MagickSizeType) resource_info.memory; limit=resource_info.memory_limit; assert(resource_info.memory >= 0); @@ -1033,7 +1028,7 @@ MagickExport void RelinquishMagickResource(const ResourceType type, case TimeResource: { bi=MagickTrue; - resource_info.time-=size; + resource_info.time-=(MagickOffsetType) size; current=(MagickSizeType) resource_info.time; limit=resource_info.time_limit; assert(resource_info.time >= 0); @@ -1122,12 +1117,12 @@ MagickExport MagickBooleanType RelinquishUniqueFileResource(const char *path) if (access_utf8(cache_path,F_OK) == 0) { status=ShredFile(cache_path); - status|=remove_utf8(cache_path); + status|=(MagickStatusType) remove_utf8(cache_path); } if (status == MagickFalse) { status=ShredFile(path); - status|=remove_utf8(path); + status|=(MagickStatusType) remove_utf8(path); } return(status == 0 ? MagickFalse : MagickTrue); } @@ -1197,7 +1192,7 @@ MagickPrivate MagickBooleanType ResourceComponentGenesis(void) pages=pages/2; #endif #endif - memory=(MagickSizeType) pages*pagesize; + memory=(MagickSizeType) ((MagickOffsetType) pages*pagesize); if ((pagesize <= 0) || (pages <= 0)) memory=2048UL*1024UL*1024UL; #if defined(MAGICKCORE_PixelCacheThreshold) diff --git a/ImageMagick-7.1.1-15/MagickCore/resource_.h b/ImageMagick-7.1.1-16/MagickCore/resource_.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/resource_.h rename to ImageMagick-7.1.1-16/MagickCore/resource_.h diff --git a/ImageMagick-7.1.1-15/MagickCore/segment.c b/ImageMagick-7.1.1-16/MagickCore/segment.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/segment.c rename to ImageMagick-7.1.1-16/MagickCore/segment.c index b6085e9a..d3cac112 100644 --- a/ImageMagick-7.1.1-15/MagickCore/segment.c +++ b/ImageMagick-7.1.1-16/MagickCore/segment.c @@ -658,7 +658,7 @@ static MagickBooleanType Classify(Image *image,short **extrema, } } image_view=DestroyCacheView(image_view); - status&=SyncImage(image,exception); + status&=(MagickStatusType) SyncImage(image,exception); /* Relinquish resources. */ @@ -997,11 +997,11 @@ MagickExport MagickBooleanType GetImageDynamicThreshold(const Image *image, */ InitializeHistogram(image,histogram,exception); (void) OptimalTau(histogram[Red],Tau,0.2f,DeltaTau, - (smooth_threshold == 0.0f ? 1.0f : smooth_threshold),extrema[Red]); + (smooth_threshold == 0.0 ? 1.0 : smooth_threshold),extrema[Red]); (void) OptimalTau(histogram[Green],Tau,0.2f,DeltaTau, - (smooth_threshold == 0.0f ? 1.0f : smooth_threshold),extrema[Green]); + (smooth_threshold == 0.0 ? 1.0 : smooth_threshold),extrema[Green]); (void) OptimalTau(histogram[Blue],Tau,0.2f,DeltaTau, - (smooth_threshold == 0.0f ? 1.0f : smooth_threshold),extrema[Blue]); + (smooth_threshold == 0.0 ? 1.0 : smooth_threshold),extrema[Blue]); /* Form clusters. */ @@ -1376,7 +1376,7 @@ static IntervalTree *InitializeIntervalTree(const ZeroCrossing *zero_crossing, root->right=255; root->mean_stability=0.0; root->stability=0.0; - (void) memset(list,0,TreeLength*sizeof(*list)); + (void) memset(list,0,(size_t) TreeLength*sizeof(*list)); for (i=(-1); i < (ssize_t) number_crossings; i++) { /* diff --git a/ImageMagick-7.1.1-15/MagickCore/segment.h b/ImageMagick-7.1.1-16/MagickCore/segment.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/segment.h rename to ImageMagick-7.1.1-16/MagickCore/segment.h diff --git a/ImageMagick-7.1.1-15/MagickCore/semaphore-private.h b/ImageMagick-7.1.1-16/MagickCore/semaphore-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/semaphore-private.h rename to ImageMagick-7.1.1-16/MagickCore/semaphore-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/semaphore.c b/ImageMagick-7.1.1-16/MagickCore/semaphore.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/semaphore.c rename to ImageMagick-7.1.1-16/MagickCore/semaphore.c index a1041a5e..dc7755ef 100644 --- a/ImageMagick-7.1.1-15/MagickCore/semaphore.c +++ b/ImageMagick-7.1.1-16/MagickCore/semaphore.c @@ -129,7 +129,7 @@ MagickExport void ActivateSemaphoreInfo(SemaphoreInfo **semaphore_info) static void *AcquireSemaphoreMemory(const size_t count,const size_t quantum) { #define AlignedExtent(size,alignment) \ - (((size)+((alignment)-1)) & ~((alignment)-1)) + (((size)+((alignment)-1)) & (size_t) ~((alignment)-1)) size_t alignment, diff --git a/ImageMagick-7.1.1-15/MagickCore/semaphore.h b/ImageMagick-7.1.1-16/MagickCore/semaphore.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/semaphore.h rename to ImageMagick-7.1.1-16/MagickCore/semaphore.h diff --git a/ImageMagick-7.1.1-15/MagickCore/shear.c b/ImageMagick-7.1.1-16/MagickCore/shear.c similarity index 93% rename from ImageMagick-7.1.1-15/MagickCore/shear.c rename to ImageMagick-7.1.1-16/MagickCore/shear.c index 86ae25d6..9f15f328 100644 --- a/ImageMagick-7.1.1-15/MagickCore/shear.c +++ b/ImageMagick-7.1.1-16/MagickCore/shear.c @@ -243,26 +243,26 @@ static void RadonProjection(MatrixInfo *source_matrices, for (i=0; i < (ssize_t) step; i++) { - for (y=0; y < (ssize_t) (GetMatrixRows(p)-i-1); y++) + for (y=0; y < ((ssize_t) GetMatrixRows(p)-i-1); y++) { if (GetMatrixElement(p,x+i,y,&element) == MagickFalse) continue; - if (GetMatrixElement(p,x+i+step,y+i,&neighbor) == MagickFalse) + if (GetMatrixElement(p,x+i+(ssize_t) step,y+i,&neighbor) == MagickFalse) continue; neighbor+=element; if (SetMatrixElement(q,x+2*i,y,&neighbor) == MagickFalse) continue; - if (GetMatrixElement(p,x+i+step,y+i+1,&neighbor) == MagickFalse) + if (GetMatrixElement(p,x+i+(ssize_t) step,y+i+1,&neighbor) == MagickFalse) continue; neighbor+=element; if (SetMatrixElement(q,x+2*i+1,y,&neighbor) == MagickFalse) continue; } - for ( ; y < (ssize_t) (GetMatrixRows(p)-i); y++) + for ( ; y < ((ssize_t) GetMatrixRows(p)-i); y++) { if (GetMatrixElement(p,x+i,y,&element) == MagickFalse) continue; - if (GetMatrixElement(p,x+i+step,y+i,&neighbor) == MagickFalse) + if (GetMatrixElement(p,x+i+(ssize_t) step,y+i,&neighbor) == MagickFalse) continue; neighbor+=element; if (SetMatrixElement(q,x+2*i,y,&neighbor) == MagickFalse) @@ -312,9 +312,9 @@ static void RadonProjection(MatrixInfo *source_matrices, if (GetMatrixElement(p,x,y+1,&neighbor) == MagickFalse) continue; delta=(ssize_t) element-(ssize_t) neighbor; - sum+=delta*delta; + sum+=(size_t) (delta*delta); } - projection[GetMatrixColumns(p)+sign*x-1]=sum; + projection[(ssize_t) GetMatrixColumns(p)+sign*x-1]=sum; } } @@ -533,25 +533,25 @@ static void GetImageBackgroundColor(Image *image,const ssize_t offset, { if ((x >= offset) && (x < ((ssize_t) image->columns-offset))) continue; - background.red+=QuantumScale*GetPixelRed(image,p); - background.green+=QuantumScale*GetPixelGreen(image,p); - background.blue+=QuantumScale*GetPixelBlue(image,p); + background.red+=QuantumScale*(double) GetPixelRed(image,p); + background.green+=QuantumScale*(double) GetPixelGreen(image,p); + background.blue+=QuantumScale*(double) GetPixelBlue(image,p); if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) - background.alpha+=QuantumScale*GetPixelAlpha(image,p); + background.alpha+=QuantumScale*(double) GetPixelAlpha(image,p); count++; p+=GetPixelChannels(image); } } image_view=DestroyCacheView(image_view); - image->background_color.red=(double) ClampToQuantum(QuantumRange* - background.red/count); - image->background_color.green=(double) ClampToQuantum(QuantumRange* - background.green/count); - image->background_color.blue=(double) ClampToQuantum(QuantumRange* - background.blue/count); + image->background_color.red=(double) ClampToQuantum((double) QuantumRange* + (double) background.red/count); + image->background_color.green=(double) ClampToQuantum((double) QuantumRange* + (double) background.green/count); + image->background_color.blue=(double) ClampToQuantum((double) QuantumRange* + (double) background.blue/count); if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) - image->background_color.alpha=(double) ClampToQuantum(QuantumRange* - background.alpha/count); + image->background_color.alpha=(double) ClampToQuantum((double) QuantumRange* + (double) background.alpha/count); } MagickExport Image *DeskewImage(const Image *image,const double threshold, @@ -804,11 +804,13 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, y; width=tile_width; - if ((tile_width+tile_x) > image->columns) - width=(size_t) (tile_width-(tile_x+tile_width-image->columns)); + if ((tile_width+(size_t) tile_x) > image->columns) + width=(size_t) ((ssize_t) tile_width-(tile_x+(ssize_t) tile_width- + (ssize_t) image->columns)); height=tile_height; - if ((tile_height+tile_y) > image->rows) - height=(size_t) (tile_height-(tile_y+tile_height-image->rows)); + if ((tile_height+(size_t) tile_y) > image->rows) + height=(size_t) ((ssize_t) tile_height-(tile_y+(ssize_t) + tile_height-(ssize_t) image->rows)); p=GetCacheViewVirtualPixels(image_view,tile_x,tile_y,width,height, exception); if (p == (const Quantum *) NULL) @@ -827,14 +829,15 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, if (status == MagickFalse) continue; q=QueueCacheViewAuthenticPixels(rotate_view,(ssize_t) - (rotate_image->columns-(tile_y+height)),y+tile_x,height,1, - exception); + rotate_image->columns-(tile_y+(ssize_t) height),y+tile_x,height, + 1,exception); if (q == (Quantum *) NULL) { status=MagickFalse; continue; } - tile_pixels=p+((height-1)*width+y)*GetPixelChannels(image); + tile_pixels=p+(((ssize_t) height-1)*(ssize_t) width+y)*(ssize_t) + GetPixelChannels(image); for (x=0; x < (ssize_t) height; x++) { ssize_t @@ -864,8 +867,8 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, MagickBooleanType proceed; - proceed=SetImageProgress(image,RotateImageTag,progress+=tile_height, - image->rows); + proceed=SetImageProgress(image,RotateImageTag, + progress+=(MagickOffsetType) tile_height,image->rows); if (proceed == MagickFalse) status=MagickFalse; } @@ -875,7 +878,7 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, Swap(page.width,page.height); Swap(page.x,page.y); if (page.width != 0) - page.x=(ssize_t) (page.width-rotate_image->columns-page.x); + page.x=(ssize_t) page.width-(ssize_t) rotate_image->columns-page.x; break; } case 2: @@ -907,8 +910,8 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, if (status == MagickFalse) continue; p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); - q=QueueCacheViewAuthenticPixels(rotate_view,0,(ssize_t) (image->rows-y- - 1),image->columns,1,exception); + q=QueueCacheViewAuthenticPixels(rotate_view,0,(ssize_t) image->rows-y-1, + image->columns,1,exception); if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL)) { status=MagickFalse; @@ -951,9 +954,9 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, (void) SetImageProgress(image,RotateImageTag,(MagickOffsetType) image->rows-1,image->rows); if (page.width != 0) - page.x=(ssize_t) (page.width-rotate_image->columns-page.x); + page.x=(ssize_t) page.width-(ssize_t) rotate_image->columns-page.x; if (page.height != 0) - page.y=(ssize_t) (page.height-rotate_image->rows-page.y); + page.y=(ssize_t) page.height-(ssize_t) rotate_image->rows-page.y; break; } case 3: @@ -1001,11 +1004,13 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, y; width=tile_width; - if ((tile_width+tile_x) > image->columns) - width=(size_t) (tile_width-(tile_x+tile_width-image->columns)); + if ((tile_width+(size_t) tile_x) > image->columns) + width=(size_t) ((ssize_t) tile_width-(tile_x+(ssize_t) tile_width- + (ssize_t) image->columns)); height=tile_height; - if ((tile_height+tile_y) > image->rows) - height=(size_t) (tile_height-(tile_y+tile_height-image->rows)); + if ((tile_height+(size_t) tile_y) > image->rows) + height=(size_t) ((ssize_t) tile_height-(tile_y+(ssize_t) + tile_height-(ssize_t) image->rows)); p=GetCacheViewVirtualPixels(image_view,tile_x,tile_y,width,height, exception); if (p == (const Quantum *) NULL) @@ -1023,14 +1028,15 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, if (status == MagickFalse) continue; - q=QueueCacheViewAuthenticPixels(rotate_view,tile_y,(ssize_t) (y+ - rotate_image->rows-(tile_x+width)),height,1,exception); + q=QueueCacheViewAuthenticPixels(rotate_view,tile_y,y+(ssize_t) + rotate_image->rows-(tile_x+(ssize_t) width),height,1,exception); if (q == (Quantum *) NULL) { status=MagickFalse; continue; } - tile_pixels=p+((width-1)-y)*GetPixelChannels(image); + tile_pixels=p+(((ssize_t) width-1)-y)*(ssize_t) + GetPixelChannels(image); for (x=0; x < (ssize_t) height; x++) { ssize_t @@ -1063,8 +1069,8 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, MagickBooleanType proceed; - proceed=SetImageProgress(image,RotateImageTag,progress+=tile_height, - image->rows); + proceed=SetImageProgress(image,RotateImageTag, + progress+=(MagickOffsetType) tile_height,image->rows); if (proceed == MagickFalse) status=MagickFalse; } @@ -1074,7 +1080,7 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, Swap(page.width,page.height); Swap(page.x,page.y); if (page.height != 0) - page.y=(ssize_t) (page.height-rotate_image->rows-page.y); + page.y=(ssize_t) page.height-(ssize_t) rotate_image->rows-page.y; break; } default: @@ -1198,7 +1204,7 @@ static MagickBooleanType XShearImage(Image *image,const double degrees, status=MagickFalse; continue; } - p+=x_offset*GetPixelChannels(image); + p+=x_offset*(ssize_t) GetPixelChannels(image); displacement=degrees*(double) (y-height/2.0); if (displacement == 0.0) continue; @@ -1224,7 +1230,7 @@ static MagickBooleanType XShearImage(Image *image,const double degrees, */ if (step > x_offset) break; - q=p-step*GetPixelChannels(image); + q=p-step*(ssize_t) GetPixelChannels(image); for (i=0; i < (ssize_t) width; i++) { if ((x_offset+i) < step) @@ -1259,12 +1265,12 @@ static MagickBooleanType XShearImage(Image *image,const double degrees, Transfer pixels right-to-left. */ p+=width*GetPixelChannels(image); - q=p+step*GetPixelChannels(image); + q=p+step*(ssize_t) GetPixelChannels(image); for (i=0; i < (ssize_t) width; i++) { p-=GetPixelChannels(image); q-=GetPixelChannels(image); - if ((size_t) (x_offset+width+step-i) > image->columns) + if ((size_t) (x_offset+(ssize_t) width+step-i) > image->columns) continue; GetPixelInfoPixel(image,p,&source); CompositePixelInfoAreaBlend(&pixel,(double) pixel.alpha, @@ -1413,7 +1419,7 @@ static MagickBooleanType YShearImage(Image *image,const double degrees, status=MagickFalse; continue; } - p+=y_offset*GetPixelChannels(image); + p+=y_offset*(ssize_t) GetPixelChannels(image); displacement=degrees*(double) (x-width/2.0); if (displacement == 0.0) continue; @@ -1439,7 +1445,7 @@ static MagickBooleanType YShearImage(Image *image,const double degrees, */ if (step > y_offset) break; - q=p-step*GetPixelChannels(image); + q=p-step*(ssize_t) GetPixelChannels(image); for (i=0; i < (ssize_t) height; i++) { if ((y_offset+i) < step) @@ -1475,12 +1481,12 @@ static MagickBooleanType YShearImage(Image *image,const double degrees, Transfer pixels bottom-to-top. */ p+=height*GetPixelChannels(image); - q=p+step*GetPixelChannels(image); + q=p+step*(ssize_t) GetPixelChannels(image); for (i=0; i < (ssize_t) height; i++) { p-=GetPixelChannels(image); q-=GetPixelChannels(image); - if ((size_t) (y_offset+height+step-i) > image->rows) + if ((size_t) (y_offset+(ssize_t) height+step-i) > image->rows) continue; GetPixelInfoPixel(image,p,&source); CompositePixelInfoAreaBlend(&pixel,(double) pixel.alpha, @@ -1607,8 +1613,8 @@ MagickExport Image *ShearImage(const Image *image,const double x_shear, /* Compute image size. */ - bounds.width=image->columns+CastDoubleToLong(floor(fabs(shear.x)* - image->rows+0.5)); + bounds.width=(size_t) ((ssize_t) image->columns+ + CastDoubleToLong(floor(fabs(shear.x)*image->rows+0.5))); bounds.x=CastDoubleToLong(ceil((double) image->columns+((fabs(shear.x)* image->rows)-image->columns)/2.0-0.5)); bounds.y=CastDoubleToLong(ceil((double) image->rows+((fabs(shear.y)* diff --git a/ImageMagick-7.1.1-15/MagickCore/shear.h b/ImageMagick-7.1.1-16/MagickCore/shear.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/shear.h rename to ImageMagick-7.1.1-16/MagickCore/shear.h diff --git a/ImageMagick-7.1.1-15/MagickCore/signature-private.h b/ImageMagick-7.1.1-16/MagickCore/signature-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/signature-private.h rename to ImageMagick-7.1.1-16/MagickCore/signature-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/signature.c b/ImageMagick-7.1.1-16/MagickCore/signature.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/signature.c rename to ImageMagick-7.1.1-16/MagickCore/signature.c index 68282148..9953c894 100644 --- a/ImageMagick-7.1.1-15/MagickCore/signature.c +++ b/ImageMagick-7.1.1-16/MagickCore/signature.c @@ -545,7 +545,7 @@ MagickExport MagickBooleanType SignatureImage(Image *image, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - pixel=(float) (QuantumScale*p[i]); + pixel=(float) (QuantumScale*(double) p[i]); if (signature_info->lsb_first == MagickFalse) for (j=(ssize_t) sizeof(pixel)-1; j >= 0; j--) *q++=(unsigned char) ((unsigned char *) &pixel)[j]; diff --git a/ImageMagick-7.1.1-15/MagickCore/signature.h b/ImageMagick-7.1.1-16/MagickCore/signature.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/signature.h rename to ImageMagick-7.1.1-16/MagickCore/signature.h diff --git a/ImageMagick-7.1.1-15/MagickCore/splay-tree.c b/ImageMagick-7.1.1-16/MagickCore/splay-tree.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/splay-tree.c rename to ImageMagick-7.1.1-16/MagickCore/splay-tree.c diff --git a/ImageMagick-7.1.1-15/MagickCore/splay-tree.h b/ImageMagick-7.1.1-16/MagickCore/splay-tree.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/splay-tree.h rename to ImageMagick-7.1.1-16/MagickCore/splay-tree.h diff --git a/ImageMagick-7.1.1-15/MagickCore/static.c b/ImageMagick-7.1.1-16/MagickCore/static.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/static.c rename to ImageMagick-7.1.1-16/MagickCore/static.c diff --git a/ImageMagick-7.1.1-15/MagickCore/static.h b/ImageMagick-7.1.1-16/MagickCore/static.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/static.h rename to ImageMagick-7.1.1-16/MagickCore/static.h diff --git a/ImageMagick-7.1.1-15/MagickCore/statistic-private.h b/ImageMagick-7.1.1-16/MagickCore/statistic-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/statistic-private.h rename to ImageMagick-7.1.1-16/MagickCore/statistic-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/statistic.c b/ImageMagick-7.1.1-16/MagickCore/statistic.c similarity index 95% rename from ImageMagick-7.1.1-15/MagickCore/statistic.c rename to ImageMagick-7.1.1-16/MagickCore/statistic.c index 13b1592d..821ba4d5 100644 --- a/ImageMagick-7.1.1-15/MagickCore/statistic.c +++ b/ImageMagick-7.1.1-16/MagickCore/statistic.c @@ -253,12 +253,12 @@ static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, break; case AbsEvaluateOperator: { - result=(double) fabs((double) (pixel+value)); + result=(double) fabs((double) pixel+value); break; } case AddEvaluateOperator: { - result=(double) (pixel+value); + result=(double) pixel+value; break; } case AddModulusEvaluateOperator: @@ -269,8 +269,9 @@ static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, result, where floor() is replaced by trunc() and could return a negative result (which is clipped). */ - result=pixel+value; - result-=(QuantumRange+1.0)*floor((double) result/(QuantumRange+1.0)); + result=(double) pixel+value; + result-=((double) QuantumRange+1.0)*floor(result/((double) + QuantumRange+1.0)); break; } case AndEvaluateOperator: @@ -280,18 +281,18 @@ static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, } case CosineEvaluateOperator: { - result=(double) (QuantumRange*(0.5*cos((double) (2.0*MagickPI* - QuantumScale*pixel*value))+0.5)); + result=(double) QuantumRange*(0.5*cos((double) (2.0*MagickPI* + QuantumScale*(double) pixel*value))+0.5); break; } case DivideEvaluateOperator: { - result=pixel/(value == 0.0 ? 1.0 : value); + result=(double) pixel/(value == 0.0 ? 1.0 : value); break; } case ExponentialEvaluateOperator: { - result=(double) (QuantumRange*exp((double) (value*QuantumScale*pixel))); + result=(double) QuantumRange*exp(value*QuantumScale*(double) pixel); break; } case GaussianNoiseEvaluateOperator: @@ -308,8 +309,8 @@ static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, } case InverseLogEvaluateOperator: { - result=(QuantumRange*pow((value+1.0),QuantumScale*pixel)-1.0)* - PerceptibleReciprocal(value); + result=(double) QuantumRange*pow((value+1.0),QuantumScale*(double) + pixel-1.0)*PerceptibleReciprocal(value); break; } case LaplacianNoiseEvaluateOperator: @@ -327,9 +328,9 @@ static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, } case LogEvaluateOperator: { - if ((QuantumScale*pixel) >= MagickEpsilon) - result=(double) (QuantumRange*log((double) (QuantumScale*value*pixel+ - 1.0))/log((double) (value+1.0))); + if ((QuantumScale*(double) pixel) >= MagickEpsilon) + result=(double) QuantumRange*log(QuantumScale*value* + (double) pixel+1.0)/log((double) (value+1.0)); break; } case MaxEvaluateOperator: @@ -339,17 +340,17 @@ static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, } case MeanEvaluateOperator: { - result=(double) (pixel+value); + result=(double) pixel+value; break; } case MedianEvaluateOperator: { - result=(double) (pixel+value); + result=(double) pixel+value; break; } case MinEvaluateOperator: { - result=(double) MagickMin((double) pixel,value); + result=MagickMin((double) pixel,value); break; } case MultiplicativeNoiseEvaluateOperator: @@ -360,7 +361,7 @@ static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, } case MultiplyEvaluateOperator: { - result=(double) (value*pixel); + result=(double) pixel*value; break; } case OrEvaluateOperator: @@ -377,11 +378,11 @@ static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, case PowEvaluateOperator: { if (((double) pixel < 0) && ((value-floor(value)) > MagickEpsilon)) - result=(double) -(QuantumRange*pow((double) -(QuantumScale*pixel), - (double) value)); + result=(double) -((double) QuantumRange*pow(-(QuantumScale*(double) + pixel),(double) value)); else - result=(double) (QuantumRange*pow((double) (QuantumScale*pixel), - (double) value)); + result=(double) QuantumRange*pow(QuantumScale*(double) pixel, + (double) value); break; } case RightShiftEvaluateOperator: @@ -393,7 +394,7 @@ static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, } case RootMeanSquareEvaluateOperator: { - result=((double) pixel*pixel+value); + result=((double) pixel*(double) pixel+value); break; } case SetEvaluateOperator: @@ -403,18 +404,18 @@ static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, } case SineEvaluateOperator: { - result=(double) (QuantumRange*(0.5*sin((double) (2.0*MagickPI* - QuantumScale*pixel*value))+0.5)); + result=(double) QuantumRange*(0.5*sin((double) (2.0*MagickPI* + QuantumScale*(double) pixel*value))+0.5); break; } case SubtractEvaluateOperator: { - result=(double) (pixel-value); + result=(double) pixel-value; break; } case SumEvaluateOperator: { - result=(double) (pixel+value); + result=(double) pixel+value; break; } case ThresholdEvaluateOperator: @@ -996,8 +997,8 @@ static Quantum ApplyFunction(Quantum pixel,const MagickFunction function, */ result=0.0; for (i=0; i < (ssize_t) number_parameters; i++) - result=result*QuantumScale*pixel+parameters[i]; - result*=QuantumRange; + result=result*QuantumScale*(double) pixel+parameters[i]; + result*=(double) QuantumRange; break; } case SinusoidFunction: @@ -1015,8 +1016,8 @@ static Quantum ApplyFunction(Quantum pixel,const MagickFunction function, phase=(number_parameters >= 2) ? parameters[1] : 0.0; amplitude=(number_parameters >= 3) ? parameters[2] : 0.5; bias=(number_parameters >= 4) ? parameters[3] : 0.5; - result=(double) (QuantumRange*(amplitude*sin((double) (2.0* - MagickPI*(frequency*QuantumScale*pixel+phase/360.0)))+bias)); + result=(double) QuantumRange*(amplitude*sin((double) (2.0* + MagickPI*(frequency*QuantumScale*(double) pixel+phase/360.0)))+bias); break; } case ArcsinFunction: @@ -1035,7 +1036,8 @@ static Quantum ApplyFunction(Quantum pixel,const MagickFunction function, center=(number_parameters >= 2) ? parameters[1] : 0.5; range=(number_parameters >= 3) ? parameters[2] : 1.0; bias=(number_parameters >= 4) ? parameters[3] : 0.5; - result=2.0*PerceptibleReciprocal(width)*(QuantumScale*pixel-center); + result=2.0*PerceptibleReciprocal(width)*(QuantumScale*(double) pixel- + center); if (result <= -1.0) result=bias-range/2.0; else @@ -1043,7 +1045,7 @@ static Quantum ApplyFunction(Quantum pixel,const MagickFunction function, result=bias+range/2.0; else result=(double) (range/MagickPI*asin((double) result)+bias); - result*=QuantumRange; + result*=(double) QuantumRange; break; } case ArctanFunction: @@ -1061,9 +1063,8 @@ static Quantum ApplyFunction(Quantum pixel,const MagickFunction function, center=(number_parameters >= 2) ? parameters[1] : 0.5; range=(number_parameters >= 3) ? parameters[2] : 1.0; bias=(number_parameters >= 4) ? parameters[3] : 0.5; - result=(double) (MagickPI*slope*(QuantumScale*pixel-center)); - result=(double) (QuantumRange*(range/MagickPI*atan((double) - result)+bias)); + result=MagickPI*slope*(QuantumScale*(double) pixel-center); + result=(double) QuantumRange*(range/MagickPI*atan((double) result)+bias); break; } case UndefinedFunction: @@ -1514,12 +1515,12 @@ MagickExport ChannelMoments *GetImageMoments(const Image *image, continue; if ((traits & UpdatePixelTrait) == 0) continue; - M00[channel]+=QuantumScale*p[i]; - M00[MaxPixelChannels]+=QuantumScale*p[i]; - M10[channel]+=x*QuantumScale*p[i]; - M10[MaxPixelChannels]+=x*QuantumScale*p[i]; - M01[channel]+=y*QuantumScale*p[i]; - M01[MaxPixelChannels]+=y*QuantumScale*p[i]; + M00[channel]+=QuantumScale*(double) p[i]; + M00[MaxPixelChannels]+=QuantumScale*(double) p[i]; + M10[channel]+=x*QuantumScale*(double) p[i]; + M10[MaxPixelChannels]+=x*QuantumScale*(double) p[i]; + M01[channel]+=y*QuantumScale*(double) p[i]; + M01[MaxPixelChannels]+=y*QuantumScale*(double) p[i]; } p+=GetPixelChannels(image); } @@ -1560,37 +1561,39 @@ MagickExport ChannelMoments *GetImageMoments(const Image *image, if ((traits & UpdatePixelTrait) == 0) continue; M11[channel]+=(x-centroid[channel].x)*(y-centroid[channel].y)* - QuantumScale*p[i]; + QuantumScale*(double) p[i]; M11[MaxPixelChannels]+=(x-centroid[channel].x)*(y-centroid[channel].y)* - QuantumScale*p[i]; + QuantumScale*(double) p[i]; M20[channel]+=(x-centroid[channel].x)*(x-centroid[channel].x)* - QuantumScale*p[i]; + QuantumScale*(double) p[i]; M20[MaxPixelChannels]+=(x-centroid[channel].x)*(x-centroid[channel].x)* - QuantumScale*p[i]; + QuantumScale*(double) p[i]; M02[channel]+=(y-centroid[channel].y)*(y-centroid[channel].y)* - QuantumScale*p[i]; + QuantumScale*(double) p[i]; M02[MaxPixelChannels]+=(y-centroid[channel].y)*(y-centroid[channel].y)* - QuantumScale*p[i]; + QuantumScale*(double) p[i]; M21[channel]+=(x-centroid[channel].x)*(x-centroid[channel].x)* - (y-centroid[channel].y)*QuantumScale*p[i]; + (y-centroid[channel].y)*QuantumScale*(double) p[i]; M21[MaxPixelChannels]+=(x-centroid[channel].x)*(x-centroid[channel].x)* - (y-centroid[channel].y)*QuantumScale*p[i]; + (y-centroid[channel].y)*QuantumScale*(double) p[i]; M12[channel]+=(x-centroid[channel].x)*(y-centroid[channel].y)* - (y-centroid[channel].y)*QuantumScale*p[i]; + (y-centroid[channel].y)*QuantumScale*(double) p[i]; M12[MaxPixelChannels]+=(x-centroid[channel].x)*(y-centroid[channel].y)* - (y-centroid[channel].y)*QuantumScale*p[i]; + (y-centroid[channel].y)*QuantumScale*(double) p[i]; M22[channel]+=(x-centroid[channel].x)*(x-centroid[channel].x)* - (y-centroid[channel].y)*(y-centroid[channel].y)*QuantumScale*p[i]; + (y-centroid[channel].y)*(y-centroid[channel].y)*QuantumScale*(double) + p[i]; M22[MaxPixelChannels]+=(x-centroid[channel].x)*(x-centroid[channel].x)* - (y-centroid[channel].y)*(y-centroid[channel].y)*QuantumScale*p[i]; + (y-centroid[channel].y)*(y-centroid[channel].y)*QuantumScale*(double) + p[i]; M30[channel]+=(x-centroid[channel].x)*(x-centroid[channel].x)* - (x-centroid[channel].x)*QuantumScale*p[i]; + (x-centroid[channel].x)*QuantumScale*(double) p[i]; M30[MaxPixelChannels]+=(x-centroid[channel].x)*(x-centroid[channel].x)* - (x-centroid[channel].x)*QuantumScale*p[i]; + (x-centroid[channel].x)*QuantumScale*(double) p[i]; M03[channel]+=(y-centroid[channel].y)*(y-centroid[channel].y)* - (y-centroid[channel].y)*QuantumScale*p[i]; + (y-centroid[channel].y)*QuantumScale*(double) p[i]; M03[MaxPixelChannels]+=(y-centroid[channel].y)*(y-centroid[channel].y)* - (y-centroid[channel].y)*QuantumScale*p[i]; + (y-centroid[channel].y)*QuantumScale*(double) p[i]; } p+=GetPixelChannels(image); } @@ -2126,25 +2129,26 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, channel_statistics[channel].minima=(double) p[i]; if ((double) p[i] > channel_statistics[channel].maxima) channel_statistics[channel].maxima=(double) p[i]; - channel_statistics[channel].sum+=p[i]; - channel_statistics[channel].sum_squared+=(double) p[i]*p[i]; - channel_statistics[channel].sum_cubed+=(double) p[i]*p[i]*p[i]; - channel_statistics[channel].sum_fourth_power+=(double) p[i]*p[i]*p[i]* - p[i]; + channel_statistics[channel].sum+=(double) p[i]; + channel_statistics[channel].sum_squared+=(double) p[i]*(double) p[i]; + channel_statistics[channel].sum_cubed+=(double) p[i]*(double) p[i]* + (double) p[i]; + channel_statistics[channel].sum_fourth_power+=(double) p[i]*(double) + p[i]*(double) p[i]*(double) p[i]; channel_statistics[channel].area++; if ((double) p[i] < channel_statistics[CompositePixelChannel].minima) channel_statistics[CompositePixelChannel].minima=(double) p[i]; if ((double) p[i] > channel_statistics[CompositePixelChannel].maxima) channel_statistics[CompositePixelChannel].maxima=(double) p[i]; - histogram[GetPixelChannels(image)*ScaleQuantumToMap( + histogram[(ssize_t) GetPixelChannels(image)*ScaleQuantumToMap( ClampToQuantum((double) p[i]))+i]++; channel_statistics[CompositePixelChannel].sum+=(double) p[i]; channel_statistics[CompositePixelChannel].sum_squared+=(double) - p[i]*p[i]; + p[i]*(double) p[i]; channel_statistics[CompositePixelChannel].sum_cubed+=(double) - p[i]*p[i]*p[i]; + p[i]*(double) p[i]*(double) p[i]; channel_statistics[CompositePixelChannel].sum_fourth_power+=(double) - p[i]*p[i]*p[i]*p[i]; + p[i]*(double) p[i]*(double) p[i]*(double) p[i]; channel_statistics[CompositePixelChannel].area++; } p+=GetPixelChannels(image); @@ -2182,7 +2186,7 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, PixelChannel channel = GetPixelChannelChannel(image,i); number_bins=0.0; for (j=0; j <= (ssize_t) MaxMap; j++) - if (histogram[GetPixelChannels(image)*j+i] > 0.0) + if (histogram[(ssize_t) GetPixelChannels(image)*j+i] > 0.0) number_bins++; area=PerceptibleReciprocal(channel_statistics[channel].area); for (j=0; j <= (ssize_t) MaxMap; j++) @@ -2190,7 +2194,7 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, double count; - count=area*histogram[GetPixelChannels(image)*j+i]; + count=area*histogram[(ssize_t) GetPixelChannels(image)*j+i]; channel_statistics[channel].entropy+=-count*MagickLog10(count)* PerceptibleReciprocal(MagickLog10(number_bins)); channel_statistics[CompositePixelChannel].entropy+=-count* @@ -2454,7 +2458,7 @@ MagickExport Image *PolynomialImage(const Image *images, coefficient=(MagickRealType) terms[2*j]; degree=(MagickRealType) terms[(j << 1)+1]; polynomial_pixel[x].channel[i]+=coefficient* - pow(QuantumScale*GetPixelChannel(image,channel,p),degree); + pow(QuantumScale*(double) GetPixelChannel(image,channel,p),degree); } p+=GetPixelChannels(next); } @@ -2471,7 +2475,8 @@ MagickExport Image *PolynomialImage(const Image *images, continue; if ((traits & UpdatePixelTrait) == 0) continue; - q[i]=ClampToQuantum(QuantumRange*polynomial_pixel[x].channel[i]); + q[i]=ClampToQuantum((double) QuantumRange* + polynomial_pixel[x].channel[i]); } q+=GetPixelChannels(image); } @@ -2712,7 +2717,7 @@ static inline void GetMedianPixelList(PixelList *pixel_list,Quantum *pixel) do { color=p->nodes[color].next[0]; - count+=p->nodes[color].count; + count+=(ssize_t) p->nodes[color].count; } while (count <= (ssize_t) (pixel_list->length >> 1)); *pixel=ScaleShortToQuantum((unsigned short) color); } @@ -2746,7 +2751,7 @@ static inline void GetModePixelList(PixelList *pixel_list,Quantum *pixel) mode=color; max_count=p->nodes[mode].count; } - count+=p->nodes[color].count; + count+=(ssize_t) p->nodes[color].count; } while (count < (ssize_t) pixel_list->length); *pixel=ScaleShortToQuantum((unsigned short) mode); } @@ -2776,7 +2781,7 @@ static inline void GetNonpeakPixelList(PixelList *pixel_list,Quantum *pixel) previous=color; color=next; next=p->nodes[color].next[0]; - count+=p->nodes[color].count; + count+=(ssize_t) p->nodes[color].count; } while (count <= (ssize_t) (pixel_list->length >> 1)); if ((previous == 65536UL) && (next != 65536UL)) color=next; @@ -2879,8 +2884,9 @@ MagickExport Image *StatisticImage(const Image *image,const StatisticType type, /* Make each pixel the min / max / median / mode / etc. of the neighborhood. */ - center=(ssize_t) GetPixelChannels(image)*(image->columns+MagickMax(width,1))* - (MagickMax(height,1)/2L)+GetPixelChannels(image)*(MagickMax(width,1)/2L); + center=(ssize_t) GetPixelChannels(image)*((ssize_t) image->columns+ + MagickMax((ssize_t) width,1L))*(MagickMax((ssize_t) height,1)/2L)+(ssize_t) + GetPixelChannels(image)*(MagickMax((ssize_t) width,1L)/2L); status=MagickTrue; progress=0; image_view=AcquireVirtualCacheView(image,exception); @@ -2974,12 +2980,12 @@ MagickExport Image *StatisticImage(const Image *image,const StatisticType type, continue; } area++; - if (pixels[i] < minimum) + if ((double) pixels[i] < minimum) minimum=(double) pixels[i]; - if (pixels[i] > maximum) + if ((double) pixels[i] > maximum) maximum=(double) pixels[i]; sum+=(double) pixels[i]; - sum_squared+=(double) pixels[i]*pixels[i]; + sum_squared+=(double) pixels[i]*(double) pixels[i]; pixels+=GetPixelChannels(image); } pixels+=GetPixelChannels(image)*image->columns; diff --git a/ImageMagick-7.1.1-15/MagickCore/statistic.h b/ImageMagick-7.1.1-16/MagickCore/statistic.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/statistic.h rename to ImageMagick-7.1.1-16/MagickCore/statistic.h diff --git a/ImageMagick-7.1.1-15/MagickCore/stream-private.h b/ImageMagick-7.1.1-16/MagickCore/stream-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/stream-private.h rename to ImageMagick-7.1.1-16/MagickCore/stream-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/stream.c b/ImageMagick-7.1.1-16/MagickCore/stream.c similarity index 95% rename from ImageMagick-7.1.1-15/MagickCore/stream.c rename to ImageMagick-7.1.1-16/MagickCore/stream.c index a2ea430c..83a9173a 100644 --- a/ImageMagick-7.1.1-15/MagickCore/stream.c +++ b/ImageMagick-7.1.1-16/MagickCore/stream.c @@ -1277,7 +1277,7 @@ static size_t WriteStreamImage(const Image *image,const void *pixels, return(count == 0 ? 0 : columns); } if ((stream_info->y < extract_info.y) || - (stream_info->y >= (ssize_t) (extract_info.y+extract_info.height))) + (stream_info->y >= (extract_info.y+(ssize_t) extract_info.height))) { stream_info->y++; return(columns); @@ -1287,8 +1287,8 @@ static size_t WriteStreamImage(const Image *image,const void *pixels, */ (void) StreamImagePixels(stream_info,image,stream_info->exception); length=packet_size*extract_info.width; - count=WriteBlob(stream_info->stream,length,stream_info->pixels+packet_size* - extract_info.x); + count=WriteBlob(stream_info->stream,length,stream_info->pixels+(ssize_t) + packet_size*extract_info.x); stream_info->y++; return(count == 0 ? 0 : columns); } @@ -1675,11 +1675,11 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(double) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelRed(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); p+=GetPixelChannels(image); } @@ -1692,13 +1692,13 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(double) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelRed(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelAlpha(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelAlpha(image,p))* quantum_info->scale+quantum_info->minimum); p+=GetPixelChannels(image); } @@ -1711,11 +1711,11 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(double) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelRed(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); *q++=0.0; p+=GetPixelChannels(image); @@ -1729,7 +1729,7 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(double) ((QuantumScale*GetPixelIntensity(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelIntensity(image,p))* quantum_info->scale+quantum_info->minimum); p+=GetPixelChannels(image); } @@ -1742,11 +1742,11 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(double) ((QuantumScale*GetPixelRed(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); p+=GetPixelChannels(image); } @@ -1759,13 +1759,13 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(double) ((QuantumScale*GetPixelRed(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelAlpha(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelAlpha(image,p))* quantum_info->scale+quantum_info->minimum); p+=GetPixelChannels(image); } @@ -1778,11 +1778,11 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(double) ((QuantumScale*GetPixelRed(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(double) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(double) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); *q++=0.0; p+=GetPixelChannels(image); @@ -1802,46 +1802,46 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, case RedQuantum: case CyanQuantum: { - *q=(double) ((QuantumScale*GetPixelRed(image,p))* + *q=(double) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); break; } case GreenQuantum: case MagentaQuantum: { - *q=(double) ((QuantumScale*GetPixelGreen(image,p))* + *q=(double) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); break; } case BlueQuantum: case YellowQuantum: { - *q=(double) ((QuantumScale*GetPixelBlue(image,p))* + *q=(double) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); break; } case AlphaQuantum: { - *q=(double) ((QuantumScale*GetPixelAlpha(image,p))* + *q=(double) ((QuantumScale*(double) GetPixelAlpha(image,p))* quantum_info->scale+quantum_info->minimum); break; } case OpacityQuantum: { - *q=(double) ((QuantumScale*GetPixelOpacity(image,p))* + *q=(double) ((QuantumScale*(double) GetPixelOpacity(image,p))* quantum_info->scale+quantum_info->minimum); break; } case BlackQuantum: { if (image->colorspace == CMYKColorspace) - *q=(double) ((QuantumScale*GetPixelBlack(image,p))* + *q=(double) ((QuantumScale*(double) GetPixelBlack(image,p))* quantum_info->scale+quantum_info->minimum); break; } case IndexQuantum: { - *q=(double) ((QuantumScale*GetPixelIntensity(image,p))* + *q=(double) ((QuantumScale*(double) GetPixelIntensity(image,p))* quantum_info->scale+quantum_info->minimum); break; } @@ -1867,11 +1867,11 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(float) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelRed(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); p+=GetPixelChannels(image); } @@ -1884,13 +1884,13 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(float) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelRed(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelAlpha(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelAlpha(image,p))* quantum_info->scale+quantum_info->minimum); p+=GetPixelChannels(image); } @@ -1903,11 +1903,11 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(float) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelRed(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); *q++=0.0; p+=GetPixelChannels(image); @@ -1921,7 +1921,7 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(float) ((QuantumScale*GetPixelIntensity(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelIntensity(image,p))* quantum_info->scale+quantum_info->minimum); p+=GetPixelChannels(image); } @@ -1934,11 +1934,11 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(float) ((QuantumScale*GetPixelRed(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); p+=GetPixelChannels(image); } @@ -1951,13 +1951,13 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(float) ((QuantumScale*GetPixelRed(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelAlpha(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelAlpha(image,p))* quantum_info->scale+quantum_info->minimum); p+=GetPixelChannels(image); } @@ -1970,11 +1970,11 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, break; for (x=0; x < (ssize_t) GetImageExtent(image); x++) { - *q++=(float) ((QuantumScale*GetPixelRed(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelGreen(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); - *q++=(float) ((QuantumScale*GetPixelBlue(image,p))* + *q++=(float) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); *q++=0.0; p+=GetPixelChannels(image); @@ -1994,46 +1994,46 @@ static MagickBooleanType StreamImagePixels(const StreamInfo *stream_info, case RedQuantum: case CyanQuantum: { - *q=(float) ((QuantumScale*GetPixelRed(image,p))* + *q=(float) ((QuantumScale*(double) GetPixelRed(image,p))* quantum_info->scale+quantum_info->minimum); break; } case GreenQuantum: case MagentaQuantum: { - *q=(float) ((QuantumScale*GetPixelGreen(image,p))* + *q=(float) ((QuantumScale*(double) GetPixelGreen(image,p))* quantum_info->scale+quantum_info->minimum); break; } case BlueQuantum: case YellowQuantum: { - *q=(float) ((QuantumScale*GetPixelBlue(image,p))* + *q=(float) ((QuantumScale*(double) GetPixelBlue(image,p))* quantum_info->scale+quantum_info->minimum); break; } case AlphaQuantum: { - *q=(float) ((QuantumScale*GetPixelAlpha(image,p))* + *q=(float) ((QuantumScale*(double) GetPixelAlpha(image,p))* quantum_info->scale+quantum_info->minimum); break; } case OpacityQuantum: { - *q=(float) ((QuantumScale*GetPixelOpacity(image,p))* + *q=(float) ((QuantumScale*(double) GetPixelOpacity(image,p))* quantum_info->scale+quantum_info->minimum); break; } case BlackQuantum: { if (image->colorspace == CMYKColorspace) - *q=(float) ((QuantumScale*GetPixelBlack(image,p))* + *q=(float) ((QuantumScale*(double) GetPixelBlack(image,p))* quantum_info->scale+quantum_info->minimum); break; } case IndexQuantum: { - *q=(float) ((QuantumScale*GetPixelIntensity(image,p))* + *q=(float) ((QuantumScale*(double) GetPixelIntensity(image,p))* quantum_info->scale+quantum_info->minimum); break; } diff --git a/ImageMagick-7.1.1-15/MagickCore/stream.h b/ImageMagick-7.1.1-16/MagickCore/stream.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/stream.h rename to ImageMagick-7.1.1-16/MagickCore/stream.h diff --git a/ImageMagick-7.1.1-15/MagickCore/string-private.h b/ImageMagick-7.1.1-16/MagickCore/string-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/string-private.h rename to ImageMagick-7.1.1-16/MagickCore/string-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/string.c b/ImageMagick-7.1.1-16/MagickCore/string.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/string.c rename to ImageMagick-7.1.1-16/MagickCore/string.c index ede124f2..89d30b77 100644 --- a/ImageMagick-7.1.1-15/MagickCore/string.c +++ b/ImageMagick-7.1.1-16/MagickCore/string.c @@ -400,11 +400,9 @@ MagickExport size_t ConcatenateMagickString(char *magick_restrict destination, *magick_restrict p; size_t + count, i; - size_t - count; - assert(destination != (char *) NULL); assert(source != (const char *) NULL); assert(length >= 1); @@ -427,7 +425,7 @@ MagickExport size_t ConcatenateMagickString(char *magick_restrict destination, p++; } *q='\0'; - return(count+(p-source)); + return(count+(size_t) (p-source)); } /* @@ -624,7 +622,7 @@ MagickExport StringInfo *ConfigureFileToStringInfo(const char *filename) count; (void) lseek(file,0,SEEK_SET); - for (i=0; i < length; i+=count) + for (i=0; i < length; i+=(size_t) count) { count=read(file,string+i,(size_t) MagickMin(length-i,(size_t) MAGICK_SSIZE_MAX)); @@ -2073,7 +2071,7 @@ MagickExport char **StringToArgv(const char *text,int *argc) p++; } (*argc)++; - argv=(char **) AcquireQuantumMemory((size_t) (*argc+1UL),sizeof(*argv)); + argv=(char **) AcquireQuantumMemory((size_t) *argc+1UL,sizeof(*argv)); if (argv == (char **) NULL) ThrowFatalException(ResourceLimitFatalError,"UnableToConvertStringToARGV"); /* diff --git a/ImageMagick-7.1.1-15/MagickCore/string_.h b/ImageMagick-7.1.1-16/MagickCore/string_.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/string_.h rename to ImageMagick-7.1.1-16/MagickCore/string_.h diff --git a/ImageMagick-7.1.1-15/MagickCore/studio.h b/ImageMagick-7.1.1-16/MagickCore/studio.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/studio.h rename to ImageMagick-7.1.1-16/MagickCore/studio.h diff --git a/ImageMagick-7.1.1-15/MagickCore/thread-private.h b/ImageMagick-7.1.1-16/MagickCore/thread-private.h similarity index 96% rename from ImageMagick-7.1.1-15/MagickCore/thread-private.h rename to ImageMagick-7.1.1-16/MagickCore/thread-private.h index cba5dde1..291a6e46 100644 --- a/ImageMagick-7.1.1-15/MagickCore/thread-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/thread-private.h @@ -28,7 +28,8 @@ extern "C" { #endif #define magick_number_threads(source,destination,chunk,multithreaded) \ - num_threads(GetMagickNumberThreads(source,destination,chunk,multithreaded)) + num_threads(GetMagickNumberThreads((source),(destination),(chunk), \ + (multithreaded))) #if defined(__clang__) || (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 10)) #define MagickCachePrefetch(address,mode,locality) \ __builtin_prefetch(address,mode,locality) @@ -127,7 +128,7 @@ static inline MagickBooleanType IsMagickThreadEqual(const MagickThreadType id) static inline size_t GetOpenMPMaximumThreads(void) { #if defined(MAGICKCORE_OPENMP_SUPPORT) - return(omp_get_max_threads()); + return((size_t) omp_get_max_threads()); #else return(1); #endif diff --git a/ImageMagick-7.1.1-15/MagickCore/thread.c b/ImageMagick-7.1.1-16/MagickCore/thread.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/thread.c rename to ImageMagick-7.1.1-16/MagickCore/thread.c index 0dbaff87..a05a498e 100644 --- a/ImageMagick-7.1.1-15/MagickCore/thread.c +++ b/ImageMagick-7.1.1-16/MagickCore/thread.c @@ -100,10 +100,10 @@ MagickExport MagickBooleanType CreateMagickThreadKey(MagickThreadKey *key, if (*keys != (MagickThreadValue *) NULL) { (*keys)->number_threads=GetOpenMPMaximumThreads(); - (*keys)->values=AcquireQuantumMemory((*keys)->number_threads, + (*keys)->values=(void **) AcquireQuantumMemory((*keys)->number_threads, sizeof(void *)); - if ((*keys)->values == (void *) NULL) - *keys=RelinquishMagickMemory(*keys); + if ((*keys)->values == (void **) NULL) + *keys=(MagickThreadValue *) RelinquishMagickMemory(*keys); else (void) memset((*keys)->values,0,(*keys)->number_threads* sizeof(void *)); diff --git a/ImageMagick-7.1.1-15/MagickCore/thread_.h b/ImageMagick-7.1.1-16/MagickCore/thread_.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/thread_.h rename to ImageMagick-7.1.1-16/MagickCore/thread_.h diff --git a/ImageMagick-7.1.1-15/MagickCore/threshold.c b/ImageMagick-7.1.1-16/MagickCore/threshold.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/threshold.c rename to ImageMagick-7.1.1-16/MagickCore/threshold.c index ad52d7e0..7d62b9b3 100644 --- a/ImageMagick-7.1.1-15/MagickCore/threshold.c +++ b/ImageMagick-7.1.1-16/MagickCore/threshold.c @@ -269,8 +269,9 @@ MagickExport Image *AdaptiveThresholdImage(const Image *image, status=MagickFalse; continue; } - center=(ssize_t) GetPixelChannels(image)*(image->columns+width)*(height/2L)+ - GetPixelChannels(image)*(width/2); + center=(ssize_t) GetPixelChannels(image)*((ssize_t) image->columns+ + (ssize_t) width)*((ssize_t) height/2L)+(ssize_t) GetPixelChannels(image)* + ((ssize_t) width/2); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { PixelChannel channel = GetPixelChannelChannel(image,i); @@ -293,8 +294,8 @@ MagickExport Image *AdaptiveThresholdImage(const Image *image, for (u=0; u < (ssize_t) width; u++) { if (u == (ssize_t) (width-1)) - channel_bias[channel]+=pixels[i]; - channel_sum[channel]+=pixels[i]; + channel_bias[channel]+=(double) pixels[i]; + channel_sum[channel]+=(double) pixels[i]; pixels+=GetPixelChannels(image); } pixels+=GetPixelChannels(image)*image->columns; @@ -324,9 +325,9 @@ MagickExport Image *AdaptiveThresholdImage(const Image *image, pixels=p; for (v=0; v < (ssize_t) height; v++) { - channel_bias[channel]+=pixels[i]; + channel_bias[channel]+=(double) pixels[i]; pixels+=(width-1)*GetPixelChannels(image); - channel_sum[channel]+=pixels[i]; + channel_sum[channel]+=(double) pixels[i]; pixels+=GetPixelChannels(image)*(image->columns+1); } mean=(double) (channel_sum[channel]/number_pixels+bias); @@ -759,7 +760,7 @@ MagickExport MagickBooleanType AutoThresholdImage(Image *image, (void) SetImageProperty(image,"auto-threshold:threshold",property,exception); if (IsStringTrue(GetImageArtifact(image,"auto-threshold:verbose")) != MagickFalse) (void) FormatLocaleFile(stdout,"%.*g%%\n",GetMagickPrecision(),threshold); - return(BilevelImage(image,QuantumRange*threshold/100.0,exception)); + return(BilevelImage(image,(double) QuantumRange*threshold/100.0,exception)); } /* @@ -983,11 +984,11 @@ MagickExport MagickBooleanType BlackThresholdImage(Image *image, } if ((flags & PercentValue) != 0) { - threshold.red*=(MagickRealType) (QuantumRange/100.0); - threshold.green*=(MagickRealType) (QuantumRange/100.0); - threshold.blue*=(MagickRealType) (QuantumRange/100.0); - threshold.black*=(MagickRealType) (QuantumRange/100.0); - threshold.alpha*=(MagickRealType) (QuantumRange/100.0); + threshold.red*=((MagickRealType) QuantumRange/100.0); + threshold.green*=((MagickRealType) QuantumRange/100.0); + threshold.blue*=((MagickRealType) QuantumRange/100.0); + threshold.black*=((MagickRealType) QuantumRange/100.0); + threshold.alpha*=((MagickRealType) QuantumRange/100.0); } /* White threshold image. @@ -1329,12 +1330,12 @@ MagickExport MagickBooleanType ColorThresholdImage(Image *image, break; } } - start.red*=QuantumRange; - start.green*=QuantumRange; - start.blue*=QuantumRange; - stop.red*=QuantumRange; - stop.green*=QuantumRange; - stop.blue*=QuantumRange; + start.red*=(double) QuantumRange; + start.green*=(double) QuantumRange; + start.blue*=(double) QuantumRange; + stop.red*=(double) QuantumRange; + stop.green*=(double) QuantumRange; + stop.blue*=(double) QuantumRange; progress=0; image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) @@ -1371,8 +1372,8 @@ MagickExport MagickBooleanType ColorThresholdImage(Image *image, PixelTrait traits = GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; - if ((q[i] < GetPixelInfoChannel(&start,channel)) || - (q[i] > GetPixelInfoChannel(&stop,channel))) + if (((double) q[i] < GetPixelInfoChannel(&start,channel)) || + ((double) q[i] > GetPixelInfoChannel(&stop,channel))) foreground=MagickFalse; } SetPixelIndex(image,(Quantum) (foreground != MagickFalse ? 1 : 0),q); @@ -1836,8 +1837,8 @@ MagickExport MagickBooleanType ListThresholdMaps(FILE *file, while (option != (const StringInfo *) NULL) { (void) FormatLocaleFile(file,"\nPath: %s\n\n",GetStringInfoPath(option)); - status&=ListThresholdMapFile(file,(const char *) GetStringInfoDatum(option), - GetStringInfoPath(option),exception); + status&=(MagickStatusType) ListThresholdMapFile(file,(const char *) + GetStringInfoDatum(option),GetStringInfoPath(option),exception); option=(const StringInfo *) GetNextValueInLinkedList(options); } options=DestroyConfigureOptions(options); @@ -2016,12 +2017,13 @@ MagickExport MagickBooleanType OrderedDitherImage(Image *image, n++; continue; } - threshold=(ssize_t) (QuantumScale*q[j]*(levels[n]*(map->divisor-1)+1)); + threshold=(ssize_t) (QuantumScale*(double) q[j]*(levels[n]* + (map->divisor-1)+1)); level=threshold/(map->divisor-1); threshold-=level*(map->divisor-1); q[j]=ClampToQuantum((double) (level+(threshold >= - map->levels[(x % map->width)+map->width*(y % map->height)]))* - QuantumRange/levels[n]); + map->levels[(x % (ssize_t) map->width)+(ssize_t) map->width* + (y % (ssize_t) map->height)]))*(double) QuantumRange/levels[n]); n++; } q+=GetPixelChannels(image); @@ -2084,7 +2086,7 @@ static inline Quantum PerceptibleThreshold(const Quantum quantum, sign; sign=(double) quantum < 0.0 ? -1.0 : 1.0; - if ((sign*quantum) >= epsilon) + if ((sign*(double) quantum) >= epsilon) return(quantum); return((Quantum) (sign*epsilon)); } @@ -2312,7 +2314,7 @@ MagickExport MagickBooleanType RandomThresholdImage(Image *image, if ((double) q[i] > max_threshold) threshold=max_threshold; else - threshold=(double) (QuantumRange* + threshold=((double) QuantumRange* GetPseudoRandomValue(random_info[id])); q[i]=(double) q[i] <= threshold ? 0 : QuantumRange; } @@ -2447,15 +2449,16 @@ MagickExport MagickBooleanType RangeThresholdImage(Image *image, q[i]=(Quantum) 0; else if ((pixel >= low_black) && (pixel < low_white)) - q[i]=ClampToQuantum(QuantumRange* + q[i]=ClampToQuantum((double) QuantumRange* PerceptibleReciprocal(low_white-low_black)*(pixel-low_black)); else if ((pixel >= low_white) && (pixel <= high_white)) q[i]=QuantumRange; else if ((pixel > high_white) && (pixel <= high_black)) - q[i]=ClampToQuantum(QuantumRange*PerceptibleReciprocal( - high_black-high_white)*(high_black-pixel)); + q[i]=ClampToQuantum((double) QuantumRange*(double) + PerceptibleReciprocal(high_black-high_white)* + (high_black-pixel)); else if (pixel > high_black) q[i]=(Quantum) 0; @@ -2572,11 +2575,11 @@ MagickExport MagickBooleanType WhiteThresholdImage(Image *image, } if ((flags & PercentValue) != 0) { - threshold.red*=(MagickRealType) (QuantumRange/100.0); - threshold.green*=(MagickRealType) (QuantumRange/100.0); - threshold.blue*=(MagickRealType) (QuantumRange/100.0); - threshold.black*=(MagickRealType) (QuantumRange/100.0); - threshold.alpha*=(MagickRealType) (QuantumRange/100.0); + threshold.red*=((MagickRealType) QuantumRange/100.0); + threshold.green*=((MagickRealType) QuantumRange/100.0); + threshold.blue*=((MagickRealType) QuantumRange/100.0); + threshold.black*=((MagickRealType) QuantumRange/100.0); + threshold.alpha*=((MagickRealType) QuantumRange/100.0); } /* White threshold image. diff --git a/ImageMagick-7.1.1-15/MagickCore/threshold.h b/ImageMagick-7.1.1-16/MagickCore/threshold.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/threshold.h rename to ImageMagick-7.1.1-16/MagickCore/threshold.h diff --git a/ImageMagick-7.1.1-15/MagickCore/timer-private.h b/ImageMagick-7.1.1-16/MagickCore/timer-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/timer-private.h rename to ImageMagick-7.1.1-16/MagickCore/timer-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/timer.c b/ImageMagick-7.1.1-16/MagickCore/timer.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/timer.c rename to ImageMagick-7.1.1-16/MagickCore/timer.c index d26c2b28..6a606c33 100644 --- a/ImageMagick-7.1.1-15/MagickCore/timer.c +++ b/ImageMagick-7.1.1-16/MagickCore/timer.c @@ -499,7 +499,7 @@ MagickExport void ResetTimer(TimerInfo *time_info) */ MagickPrivate void SetMagickDatePrecision(const unsigned long precision) { - date_precision=precision; + date_precision=(ssize_t) precision; } /* @@ -615,7 +615,7 @@ static double UserTime(void) return((double) (timer.tms_utime+timer.tms_stime)/sysconf(_SC_CLK_TCK)); #else #if defined(MAGICKCORE_WINDOWS_SUPPORT) - return(NTUserTime()); + return(NTElapsedTime()); #else return((double) clock()/CLOCKS_PER_SEC); #endif diff --git a/ImageMagick-7.1.1-15/MagickCore/timer.h b/ImageMagick-7.1.1-16/MagickCore/timer.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/timer.h rename to ImageMagick-7.1.1-16/MagickCore/timer.h diff --git a/ImageMagick-7.1.1-15/MagickCore/token-private.h b/ImageMagick-7.1.1-16/MagickCore/token-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/token-private.h rename to ImageMagick-7.1.1-16/MagickCore/token-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/token.c b/ImageMagick-7.1.1-16/MagickCore/token.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/token.c rename to ImageMagick-7.1.1-16/MagickCore/token.c index 99f36c1d..97630693 100644 --- a/ImageMagick-7.1.1-15/MagickCore/token.c +++ b/ImageMagick-7.1.1-16/MagickCore/token.c @@ -319,7 +319,7 @@ MagickExport magick_hot_spot size_t GetNextToken( p++; if (end != (const char **) NULL) *end=(const char *) p; - return(p-start+1); + return((size_t) (p-start+1)); } /* diff --git a/ImageMagick-7.1.1-15/MagickCore/token.h b/ImageMagick-7.1.1-16/MagickCore/token.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/token.h rename to ImageMagick-7.1.1-16/MagickCore/token.h diff --git a/ImageMagick-7.1.1-15/MagickCore/transform-private.h b/ImageMagick-7.1.1-16/MagickCore/transform-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/transform-private.h rename to ImageMagick-7.1.1-16/MagickCore/transform-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/transform.c b/ImageMagick-7.1.1-16/MagickCore/transform.c similarity index 95% rename from ImageMagick-7.1.1-15/MagickCore/transform.c rename to ImageMagick-7.1.1-16/MagickCore/transform.c index a13bda72..5e5a8c41 100644 --- a/ImageMagick-7.1.1-15/MagickCore/transform.c +++ b/ImageMagick-7.1.1-16/MagickCore/transform.c @@ -258,7 +258,7 @@ MagickExport Image *ChopImage(const Image *image,const RectangleInfo *chop_info, chop_view=AcquireAuthenticCacheView(chop_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,chop_image,extent.y,1) + magick_number_threads(image,chop_image,(size_t) extent.y,1) #endif for (y=0; y < (ssize_t) extent.y; y++) { @@ -283,7 +283,7 @@ MagickExport Image *ChopImage(const Image *image,const RectangleInfo *chop_info, } for (x=0; x < (ssize_t) image->columns; x++) { - if ((x < extent.x) || (x >= (ssize_t) (extent.x+extent.width))) + if ((x < extent.x) || (x >= (extent.x+(ssize_t) extent.width))) { ssize_t i; @@ -323,9 +323,9 @@ MagickExport Image *ChopImage(const Image *image,const RectangleInfo *chop_info, */ #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,chop_image,image->rows-(extent.y+extent.height),1) + magick_number_threads(image,chop_image,image->rows-((size_t) extent.y+extent.height),1) #endif - for (y=0; y < (ssize_t) (image->rows-(extent.y+extent.height)); y++) + for (y=0; y < (ssize_t) (image->rows-((size_t) extent.y+extent.height)); y++) { const Quantum *magick_restrict p; @@ -338,7 +338,7 @@ MagickExport Image *ChopImage(const Image *image,const RectangleInfo *chop_info, if (status == MagickFalse) continue; - p=GetCacheViewVirtualPixels(image_view,0,extent.y+extent.height+y, + p=GetCacheViewVirtualPixels(image_view,0,extent.y+(ssize_t) extent.height+y, image->columns,1,exception); q=QueueCacheViewAuthenticPixels(chop_view,0,extent.y+y,chop_image->columns, 1,exception); @@ -349,7 +349,7 @@ MagickExport Image *ChopImage(const Image *image,const RectangleInfo *chop_info, } for (x=0; x < (ssize_t) image->columns; x++) { - if ((x < extent.x) || (x >= (ssize_t) (extent.x+extent.width))) + if ((x < extent.x) || (x >= (extent.x+(ssize_t) extent.width))) { ssize_t i; @@ -482,7 +482,8 @@ MagickExport Image *ConsolidateCMYKImages(const Image *images, Quantum pixel; - pixel=ClampToQuantum(QuantumRange-GetPixelIntensity(images,p)); + pixel=ClampToQuantum((double) QuantumRange- + GetPixelIntensity(images,p)); switch (i) { case 0: SetPixelCyan(cmyk_image,pixel,q); break; @@ -614,34 +615,34 @@ MagickExport Image *CropImage(const Image *image,const RectangleInfo *geometry, } if ((page.x < 0) && (bounding_box.x >= 0)) { - page.width+=page.x-bounding_box.x; + page.width=(size_t) ((ssize_t) page.width+page.x-bounding_box.x); page.x=0; } else { - page.width-=bounding_box.x-page.x; + page.width=(size_t) ((ssize_t) page.width-(bounding_box.x-page.x)); page.x-=bounding_box.x; if (page.x < 0) page.x=0; } if ((page.y < 0) && (bounding_box.y >= 0)) { - page.height+=page.y-bounding_box.y; + page.height=(size_t) ((ssize_t) page.height+page.y-bounding_box.y); page.y=0; } else { - page.height-=bounding_box.y-page.y; + page.height=(size_t) ((ssize_t) page.height-(bounding_box.y-page.y)); page.y-=bounding_box.y; if (page.y < 0) page.y=0; } if ((page.x+(ssize_t) page.width) > (ssize_t) image->columns) - page.width=image->columns-page.x; + page.width=(size_t) ((ssize_t) image->columns-page.x); if ((geometry->width != 0) && (page.width > geometry->width)) page.width=geometry->width; if ((page.y+(ssize_t) page.height) > (ssize_t) image->rows) - page.height=image->rows-page.y; + page.height=(size_t) ((ssize_t) image->rows-page.y); if ((geometry->height != 0) && (page.height > geometry->height)) page.height=geometry->height; bounding_box.x+=page.x; @@ -660,8 +661,8 @@ MagickExport Image *CropImage(const Image *image,const RectangleInfo *geometry, return((Image *) NULL); crop_image->page.width=image->page.width; crop_image->page.height=image->page.height; - offset.x=(ssize_t) (bounding_box.x+bounding_box.width); - offset.y=(ssize_t) (bounding_box.y+bounding_box.height); + offset.x=bounding_box.x+(ssize_t) bounding_box.width; + offset.y=bounding_box.y+(ssize_t) bounding_box.height; if ((offset.x > (ssize_t) image->page.width) || (offset.y > (ssize_t) image->page.height)) { @@ -826,13 +827,15 @@ MagickExport Image *CropImageToTiles(const Image *image, geometry.height=1; if ((flags & AspectValue) == 0) { - width-=(geometry.x < 0 ? -1 : 1)*geometry.x; - height-=(geometry.y < 0 ? -1 : 1)*geometry.y; + width=(size_t) ((ssize_t) width-(geometry.x < 0 ? -1 : 1)*geometry.x); + height=(size_t) ((ssize_t) height-(geometry.y < 0 ? -1 : 1)* + geometry.y); } else { - width+=(geometry.x < 0 ? -1 : 1)*geometry.x; - height+=(geometry.y < 0 ? -1 : 1)*geometry.y; + width=(size_t) ((ssize_t) width+(geometry.x < 0 ? -1 : 1)*geometry.x); + height=(size_t) ((ssize_t) height+(geometry.y < 0 ? -1 : 1)* + geometry.y); } delta.x=(double) width/geometry.width; delta.y=(double) height/geometry.height; @@ -858,7 +861,7 @@ MagickExport Image *CropImageToTiles(const Image *image, crop.height=(size_t) PixelRoundOffset((double) (offset.y+(geometry.y < -1 ? geometry.y : 0))); } - crop.height-=crop.y; + crop.height=(size_t) ((ssize_t) crop.height-crop.y); crop.y+=image->page.y; for (offset.x=0; offset.x < (double) width; ) { @@ -878,7 +881,7 @@ MagickExport Image *CropImageToTiles(const Image *image, crop.width=(size_t) PixelRoundOffset((double) (offset.x+ (geometry.x < 0 ? geometry.x : 0))); } - crop.width-=crop.x; + crop.width=(size_t) ((ssize_t) crop.width-crop.x); crop.x+=image->page.x; next=CropImage(image,&crop,exception); if (next != (Image *) NULL) @@ -1242,7 +1245,7 @@ MagickExport Image *FlipImage(const Image *image,ExceptionInfo *exception) if (status == MagickFalse) continue; p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); - q=QueueCacheViewAuthenticPixels(flip_view,0,(ssize_t) (flip_image->rows-y- + q=QueueCacheViewAuthenticPixels(flip_view,0,((ssize_t) flip_image->rows-y- 1),flip_image->columns,1,exception); if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL)) { @@ -1287,7 +1290,7 @@ MagickExport Image *FlipImage(const Image *image,ExceptionInfo *exception) image_view=DestroyCacheView(image_view); flip_image->type=image->type; if (page.height != 0) - page.y=(ssize_t) (page.height-flip_image->rows-page.y); + page.y=((ssize_t) page.height-(ssize_t) flip_image->rows-page.y); flip_image->page=page; if (status == MagickFalse) flip_image=DestroyImage(flip_image); @@ -1423,7 +1426,7 @@ MagickExport Image *FlopImage(const Image *image,ExceptionInfo *exception) image_view=DestroyCacheView(image_view); flop_image->type=image->type; if (page.width != 0) - page.x=(ssize_t) (page.width-flop_image->columns-page.x); + page.x=((ssize_t) page.width-(ssize_t) flop_image->columns-page.x); flop_image->page=page; if (status == MagickFalse) flop_image=DestroyImage(flop_image); @@ -1579,15 +1582,17 @@ MagickExport Image *RollImage(const Image *image,const ssize_t x_offset, (size_t) offset.y,(ssize_t) image->columns-offset.x,(ssize_t) image->rows- offset.y,0,0,exception); (void) SetImageProgress(image,RollImageTag,0,3); - status&=CopyImageRegion(roll_image,image,image->columns-offset.x, - (size_t) offset.y,0,(ssize_t) image->rows-offset.y,offset.x,0, - exception); + status&=(MagickStatusType) CopyImageRegion(roll_image,image,(size_t) + ((ssize_t) image->columns-offset.x),(size_t) offset.y,0,(ssize_t) + image->rows-offset.y,offset.x,0,exception); (void) SetImageProgress(image,RollImageTag,1,3); - status&=CopyImageRegion(roll_image,image,(size_t) offset.x,image->rows- - offset.y,(ssize_t) image->columns-offset.x,0,0,offset.y,exception); + status&=(MagickStatusType) CopyImageRegion(roll_image,image,(size_t) + offset.x,(size_t) ((ssize_t) image->rows-offset.y),(ssize_t) + image->columns-offset.x,0,0,offset.y,exception); (void) SetImageProgress(image,RollImageTag,2,3); - status&=CopyImageRegion(roll_image,image,image->columns-offset.x,image->rows- - offset.y,0,0,offset.x,offset.y,exception); + status&=(MagickStatusType) CopyImageRegion(roll_image,image,(size_t) + ((ssize_t) image->columns-offset.x),(size_t) ((ssize_t) image->rows- + offset.y),0,0,offset.x,offset.y,exception); (void) SetImageProgress(image,RollImageTag,3,3); roll_image->type=image->type; if (status == MagickFalse) @@ -1805,7 +1810,7 @@ MagickExport Image *SpliceImage(const Image *image, splice_view=AcquireAuthenticCacheView(splice_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,splice_image,splice_geometry.y,1) + magick_number_threads(image,splice_image,(size_t) splice_geometry.y,1) #endif for (y=0; y < (ssize_t) splice_geometry.y; y++) { @@ -1851,7 +1856,7 @@ MagickExport Image *SpliceImage(const Image *image, p+=GetPixelChannels(image); q+=GetPixelChannels(splice_image); } - for ( ; x < (ssize_t) (splice_geometry.x+splice_geometry.width); x++) + for ( ; x < (splice_geometry.x+(ssize_t) splice_geometry.width); x++) q+=GetPixelChannels(splice_image); for ( ; x < (ssize_t) splice_image->columns; x++) { @@ -1896,8 +1901,7 @@ MagickExport Image *SpliceImage(const Image *image, #pragma omp parallel for schedule(static) shared(progress,status) \ magick_number_threads(image,splice_image,splice_image->rows,2) #endif - for (y=(ssize_t) (splice_geometry.y+splice_geometry.height); - y < (ssize_t) splice_image->rows; y++) + for (y=splice_geometry.y+(ssize_t) splice_geometry.height; y < (ssize_t) splice_image->rows; y++) { const Quantum *magick_restrict p; @@ -1910,7 +1914,7 @@ MagickExport Image *SpliceImage(const Image *image, if (status == MagickFalse) continue; - if ((y < 0) || (y >= (ssize_t)splice_image->rows)) + if ((y < 0) || (y >= (ssize_t) splice_image->rows)) continue; p=GetCacheViewVirtualPixels(image_view,0,y-(ssize_t) splice_geometry.height, splice_image->columns,1,exception); @@ -1943,7 +1947,7 @@ MagickExport Image *SpliceImage(const Image *image, p+=GetPixelChannels(image); q+=GetPixelChannels(splice_image); } - for ( ; x < (ssize_t) (splice_geometry.x+splice_geometry.width); x++) + for ( ; x < (splice_geometry.x+(ssize_t) splice_geometry.width); x++) q+=GetPixelChannels(splice_image); for ( ; x < (ssize_t) splice_image->columns; x++) { @@ -2175,7 +2179,7 @@ MagickExport Image *TransposeImage(const Image *image,ExceptionInfo *exception) continue; p=GetCacheViewVirtualPixels(image_view,0,(ssize_t) image->rows-y-1, image->columns,1,exception); - q=QueueCacheViewAuthenticPixels(transpose_view,(ssize_t) (image->rows-y-1), + q=QueueCacheViewAuthenticPixels(transpose_view,(ssize_t) image->rows-y-1, 0,1,transpose_image->rows,exception); if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL)) { @@ -2315,7 +2319,7 @@ MagickExport Image *TransverseImage(const Image *image,ExceptionInfo *exception) if (status == MagickFalse) continue; p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); - q=QueueCacheViewAuthenticPixels(transverse_view,(ssize_t) (image->rows-y-1), + q=QueueCacheViewAuthenticPixels(transverse_view,(ssize_t) image->rows-y-1, 0,1,transverse_image->rows,exception); if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL)) { @@ -2366,9 +2370,9 @@ MagickExport Image *TransverseImage(const Image *image,ExceptionInfo *exception) Swap(page.width,page.height); Swap(page.x,page.y); if (page.width != 0) - page.x=(ssize_t) (page.width-transverse_image->columns-page.x); + page.x=(ssize_t) page.width-(ssize_t) transverse_image->columns-page.x; if (page.height != 0) - page.y=(ssize_t) (page.height-transverse_image->rows-page.y); + page.y=(ssize_t) page.height-(ssize_t) transverse_image->rows-page.y; transverse_image->page=page; if (status == MagickFalse) transverse_image=DestroyImage(transverse_image); @@ -2447,48 +2451,48 @@ MagickExport Image *TrimImage(const Image *image,ExceptionInfo *exception) { case CenterGravity: { - geometry.x-=((ssize_t) page.width-geometry.width)/2; - geometry.y-=((ssize_t) page.height-geometry.height)/2; + geometry.x-=((ssize_t) page.width-(ssize_t) geometry.width)/2; + geometry.y-=((ssize_t) page.height-(ssize_t) geometry.height)/2; break; } case NorthWestGravity: { - geometry.x-=((ssize_t) page.width-geometry.width); - geometry.y-=((ssize_t) page.height-geometry.height); + geometry.x-=((ssize_t) page.width-(ssize_t) geometry.width); + geometry.y-=((ssize_t) page.height-(ssize_t) geometry.height); break; } case NorthGravity: { - geometry.x-=((ssize_t) page.width-geometry.width)/2; - geometry.y-=((ssize_t) page.height-geometry.height); + geometry.x-=((ssize_t) page.width-(ssize_t) geometry.width)/2; + geometry.y-=((ssize_t) page.height-(ssize_t) geometry.height); break; } case NorthEastGravity: { - geometry.y-=((ssize_t) page.height-geometry.height); + geometry.y-=((ssize_t) page.height-(ssize_t) geometry.height); break; } case EastGravity: { - geometry.y-=((ssize_t) page.height-geometry.height)/2; + geometry.y-=((ssize_t) page.height-(ssize_t) geometry.height)/2; break; } case SouthEastGravity: break; case SouthGravity: { - geometry.x-=((ssize_t) page.width-geometry.width)/2; + geometry.x-=((ssize_t) page.width-(ssize_t) geometry.width)/2; break; } case SouthWestGravity: { - geometry.x-=((ssize_t) page.width-geometry.width); + geometry.x-=((ssize_t) page.width-(ssize_t) geometry.width); break; } case WestGravity: { - geometry.x-=((ssize_t) page.width-geometry.width); - geometry.y-=((ssize_t) page.height-geometry.height)/2; + geometry.x-=((ssize_t) page.width-(ssize_t) geometry.width); + geometry.y-=((ssize_t) page.height-(ssize_t) geometry.height)/2; break; } default: diff --git a/ImageMagick-7.1.1-15/MagickCore/transform.h b/ImageMagick-7.1.1-16/MagickCore/transform.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/transform.h rename to ImageMagick-7.1.1-16/MagickCore/transform.h diff --git a/ImageMagick-7.1.1-15/MagickCore/type-private.h b/ImageMagick-7.1.1-16/MagickCore/type-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/type-private.h rename to ImageMagick-7.1.1-16/MagickCore/type-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/type.c b/ImageMagick-7.1.1-16/MagickCore/type.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/type.c rename to ImageMagick-7.1.1-16/MagickCore/type.c index b3ab3f80..d5388bc9 100644 --- a/ImageMagick-7.1.1-15/MagickCore/type.c +++ b/ImageMagick-7.1.1-16/MagickCore/type.c @@ -331,15 +331,16 @@ MagickExport const TypeInfo *GetTypeInfoByFamily(const char *family, } Fontmap; const TypeInfo + *p, *type_info; - const TypeInfo - *p; - - ssize_t - i; + size_t + font_weight, + max_score, + score; ssize_t + i, range; static const Fontmap @@ -354,11 +355,6 @@ MagickExport const TypeInfo *GetTypeInfoByFamily(const char *family, { "wingdings", "symbol" } }; - size_t - font_weight, - max_score, - score; - /* Check for an exact type match. */ @@ -450,15 +446,16 @@ MagickExport const TypeInfo *GetTypeInfoByFamily(const char *family, if (((style == ItalicStyle) || (style == ObliqueStyle)) && ((p->style == ItalicStyle) || (p->style == ObliqueStyle))) score+=25; - score+=(16*(800-((ssize_t) MagickMax(MagickMin(font_weight,900),p->weight)- - (ssize_t) MagickMin(MagickMin(font_weight,900),p->weight))))/800; + score+=(size_t) ((16L*(800L-((ssize_t) MagickMax(MagickMin(font_weight,900), + p->weight)-(ssize_t) MagickMin(MagickMin(font_weight,900),p->weight))))/ + 800L); if ((stretch == UndefinedStretch) || (stretch == AnyStretch)) score+=8; else { range=(ssize_t) UltraExpandedStretch-(ssize_t) NormalStretch; - score+=(8*(range-((ssize_t) MagickMax(stretch,p->stretch)- - (ssize_t) MagickMin(stretch,p->stretch))))/range; + score+=(size_t) ((ssize_t) (8L*(range-((ssize_t) MagickMax(stretch, + p->stretch)-(ssize_t) MagickMin(stretch,p->stretch))))/range); } if (score > max_score) { @@ -1173,8 +1170,8 @@ static MagickBooleanType LoadTypeCache(SplayTreeInfo *cache,const char *xml, sans_exception=DestroyExceptionInfo(sans_exception); if (file_xml != (char *) NULL) { - status&=LoadTypeCache(cache,file_xml,path,depth+1, - exception); + status&=(MagickStatusType) LoadTypeCache(cache,file_xml, + path,depth+1,exception); file_xml=(char *) RelinquishMagickMemory(file_xml); } } diff --git a/ImageMagick-7.1.1-15/MagickCore/type.h b/ImageMagick-7.1.1-16/MagickCore/type.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/type.h rename to ImageMagick-7.1.1-16/MagickCore/type.h diff --git a/ImageMagick-7.1.1-15/MagickCore/utility-private.h b/ImageMagick-7.1.1-16/MagickCore/utility-private.h similarity index 93% rename from ImageMagick-7.1.1-15/MagickCore/utility-private.h rename to ImageMagick-7.1.1-16/MagickCore/utility-private.h index 183622fb..d9d35363 100644 --- a/ImageMagick-7.1.1-15/MagickCore/utility-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/utility-private.h @@ -79,12 +79,13 @@ static inline wchar_t *create_wchar_path(const char *utf8) (void) FormatLocaleString(buffer,MagickPathExtent,"\\\\?\\%s",utf8); count+=4; - longPath=(wchar_t *) NTAcquireQuantumMemory(count,sizeof(*longPath)); + longPath=(wchar_t *) NTAcquireQuantumMemory((size_t) count, + sizeof(*longPath)); if (longPath == (wchar_t *) NULL) return((wchar_t *) NULL); count=MultiByteToWideChar(CP_UTF8,0,buffer,-1,longPath,count); if (count != 0) - count=GetShortPathNameW(longPath,shortPath,MAX_PATH); + count=(int) GetShortPathNameW(longPath,shortPath,MAX_PATH); longPath=(wchar_t *) RelinquishMagickMemory(longPath); if ((count < 5) || (count >= MAX_PATH)) return((wchar_t *) NULL); @@ -92,7 +93,7 @@ static inline wchar_t *create_wchar_path(const char *utf8) wcscpy(wide,shortPath+4); return(wide); } - wide=(wchar_t *) NTAcquireQuantumMemory(count,sizeof(*wide)); + wide=(wchar_t *) NTAcquireQuantumMemory((size_t) count,sizeof(*wide)); if ((wide != (wchar_t *) NULL) && (MultiByteToWideChar(CP_UTF8,0,utf8,-1,wide,count) == 0)) wide=(wchar_t *) RelinquishMagickMemory(wide); @@ -239,7 +240,8 @@ static inline FILE *popen_utf8(const char *command,const char *type) length=MultiByteToWideChar(CP_UTF8,0,command,-1,NULL,0); if (length == 0) return(file); - command_wide=(wchar_t *) AcquireQuantumMemory(length,sizeof(*command_wide)); + command_wide=(wchar_t *) AcquireQuantumMemory((size_t) length, + sizeof(*command_wide)); if (command_wide == (wchar_t *) NULL) return(file); length=MultiByteToWideChar(CP_UTF8,0,command,-1,command_wide,length); @@ -350,13 +352,16 @@ static inline int set_file_timestamp(const char *path,struct stat *attributes) ULARGE_INTEGER date_time; - date_time.QuadPart=(attributes->st_ctime*10000000LL)+116444736000000000LL; + date_time.QuadPart=(ULONGLONG) (attributes->st_ctime*10000000LL)+ + 116444736000000000LL; creation_time.dwLowDateTime=date_time.LowPart; creation_time.dwHighDateTime=date_time.HighPart; - date_time.QuadPart=(attributes->st_atime*10000000LL)+116444736000000000LL; + date_time.QuadPart=(ULONGLONG) (attributes->st_atime*10000000LL)+ + 116444736000000000LL; last_access_time.dwLowDateTime=date_time.LowPart; last_access_time.dwHighDateTime=date_time.HighPart; - date_time.QuadPart=(attributes->st_mtime*10000000LL)+116444736000000000LL; + date_time.QuadPart=(ULONGLONG) (attributes->st_mtime*10000000LL)+ + 116444736000000000LL; last_write_time.dwLowDateTime=date_time.LowPart; last_write_time.dwHighDateTime=date_time.HighPart; status=SetFileTime(handle,&creation_time,&last_access_time,&last_write_time); diff --git a/ImageMagick-7.1.1-15/MagickCore/utility.c b/ImageMagick-7.1.1-16/MagickCore/utility.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickCore/utility.c rename to ImageMagick-7.1.1-16/MagickCore/utility.c index 07ebeff6..ec6f15f6 100644 --- a/ImageMagick-7.1.1-15/MagickCore/utility.c +++ b/ImageMagick-7.1.1-16/MagickCore/utility.c @@ -885,8 +885,8 @@ MagickExport MagickBooleanType ExpandFilenames(int *number_arguments, /* Transfer file list to argument vector. */ - vector=(char **) ResizeQuantumMemory(vector,(size_t) *number_arguments+ - count+number_files+1,sizeof(*vector)); + vector=(char **) ResizeQuantumMemory(vector,(size_t) ((ssize_t) + *number_arguments+count+(ssize_t) number_files+1),sizeof(*vector)); if (vector == (char **) NULL) { for (j=0; j < (ssize_t) number_files; j++) @@ -1746,7 +1746,7 @@ MagickExport void MagickDelay(const MagickSizeType milliseconds) timer; timer.tv_sec=(time_t) (milliseconds/1000); - timer.tv_nsec=(milliseconds % 1000)*1000*1000; + timer.tv_nsec=(time_t) ((milliseconds % 1000)*1000*1000); (void) nanosleep(&timer,(struct timespec *) NULL); } #elif defined(MAGICKCORE_HAVE_USLEEP) @@ -1926,7 +1926,7 @@ MagickPrivate MagickBooleanType ShredFile(const char *path) if (i != 0) SetRandomKey(random_info,quantum,GetStringInfoDatum(key)); count=write(file,GetStringInfoDatum(key),(size_t) - MagickMin((MagickSizeType) quantum,length-j)); + MagickMin((MagickOffsetType) quantum,(MagickOffsetType) length-j)); if (count <= 0) { count=0; diff --git a/ImageMagick-7.1.1-15/MagickCore/utility.h b/ImageMagick-7.1.1-16/MagickCore/utility.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/utility.h rename to ImageMagick-7.1.1-16/MagickCore/utility.h diff --git a/ImageMagick-7.1.1-15/MagickCore/version-private.h b/ImageMagick-7.1.1-16/MagickCore/version-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/version-private.h rename to ImageMagick-7.1.1-16/MagickCore/version-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/version.c b/ImageMagick-7.1.1-16/MagickCore/version.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/version.c rename to ImageMagick-7.1.1-16/MagickCore/version.c index 94117724..1db1e3fa 100644 --- a/ImageMagick-7.1.1-15/MagickCore/version.c +++ b/ImageMagick-7.1.1-16/MagickCore/version.c @@ -43,6 +43,7 @@ #include "MagickCore/linked-list.h" #include "MagickCore/locale_.h" #include "MagickCore/option.h" +#include "MagickCore/pixel.h" #include "MagickCore/string_.h" #include "MagickCore/utility.h" #include "MagickCore/utility-private.h" @@ -244,6 +245,9 @@ MagickExport const char *GetMagickFeatures(void) #if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG) "Debug " #endif +#if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT) + "Channel-masks(64-bit) " +#endif #if defined(MAGICKCORE_CIPHER_SUPPORT) "Cipher " #endif @@ -489,8 +493,8 @@ MagickExport const char *GetMagickReleaseDate(void) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % GetMagickSignature() returns a signature that uniquely encodes the -% MagickCore library version, quantum depth, HDRI status, OS word size, and -% endianness. +% MagickCore library version, quantum depth, HDRI status, OS word size, +% channel type, and endianness. % % The format of the GetMagickSignature method is: % @@ -570,7 +574,12 @@ MagickExport unsigned int GetMagickSignature(const StringInfo *nonce) signature=1; /* endianness */ (void) memcpy(p,&signature,sizeof(signature)); p+=sizeof(signature); - SetStringInfoLength(version,p-GetStringInfoDatum(version)); +#if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT) + signature=sizeof(ChannelType); + (void) memcpy(p,&signature,sizeof(signature)); + p+=sizeof(signature); +#endif + SetStringInfoLength(version,(size_t) (p-GetStringInfoDatum(version))); if (nonce != (const StringInfo *) NULL) ConcatenateStringInfo(version,nonce); signature=CRC32(GetStringInfoDatum(version),GetStringInfoLength(version)); diff --git a/ImageMagick-7.1.1-15/MagickCore/vision.c b/ImageMagick-7.1.1-16/MagickCore/vision.c similarity index 96% rename from ImageMagick-7.1.1-15/MagickCore/vision.c rename to ImageMagick-7.1.1-16/MagickCore/vision.c index 57887900..5d12d713 100644 --- a/ImageMagick-7.1.1-15/MagickCore/vision.c +++ b/ImageMagick-7.1.1-16/MagickCore/vision.c @@ -129,17 +129,17 @@ static int CCObjectInfoCompare(const void *x,const void *y) if (p->key == -4) return((int) (q->bounding_box.x-(ssize_t) p->bounding_box.x)); if (p->key == -3) - return((int) (q->bounding_box.height-(ssize_t) p->bounding_box.height)); + return((int) (q->bounding_box.height-p->bounding_box.height)); if (p->key == -2) - return((int) (q->bounding_box.width-(ssize_t) p->bounding_box.width)); + return((int) (q->bounding_box.width-p->bounding_box.width)); if (p->key == -1) return((int) (q->area-(ssize_t) p->area)); if (p->key == 1) return((int) (p->area-(ssize_t) q->area)); if (p->key == 2) - return((int) (p->bounding_box.width-(ssize_t) q->bounding_box.width)); + return((int) (p->bounding_box.width-q->bounding_box.width)); if (p->key == 3) - return((int) (p->bounding_box.height-(ssize_t) q->bounding_box.height)); + return((int) (p->bounding_box.height-q->bounding_box.height)); if (p->key == 4) return((int) (p->bounding_box.x-(ssize_t) q->bounding_box.x)); if (p->key == 5) @@ -223,9 +223,9 @@ static void PerimeterThreshold(const Image *component_image, ssize_t offset; - offset=v*(bounding_box.width+2)* - GetPixelChannels(component_image)+u* - GetPixelChannels(component_image); + offset=v*((ssize_t) bounding_box.width+2)* + (ssize_t) GetPixelChannels(component_image)+u* + (ssize_t) GetPixelChannels(component_image); pixels[2*v+u]=GetPixelIndex(component_image,p+offset); if ((ssize_t) pixels[2*v+u] == i) foreground++; @@ -332,9 +332,9 @@ static void CircularityThreshold(const Image *component_image, ssize_t offset; - offset=v*(bounding_box.width+2)* - GetPixelChannels(component_image)+u* - GetPixelChannels(component_image); + offset=v*((ssize_t) bounding_box.width+2)* + (ssize_t) GetPixelChannels(component_image)+u* + (ssize_t) GetPixelChannels(component_image); pixels[2*v+u]=GetPixelIndex(component_image,p+offset); if ((ssize_t) pixels[2*v+u] == i) foreground++; @@ -345,10 +345,8 @@ static void CircularityThreshold(const Image *component_image, else if (foreground == 2) { - if ((((ssize_t) pixels[0] == i) && - ((ssize_t) pixels[3] == i)) || - (((ssize_t) pixels[1] == i) && - ((ssize_t) pixels[2] == i))) + if ((((ssize_t) pixels[0] == i) && ((ssize_t) pixels[3] == i)) || + (((ssize_t) pixels[1] == i) && ((ssize_t) pixels[2] == i))) pattern[0]++; /* diagonal */ else pattern[2]++; @@ -944,8 +942,8 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, p+=GetPixelChannels(image); continue; } - neighbor_offset=dy*(GetPixelChannels(image)*image->columns)+dx* - GetPixelChannels(image); + neighbor_offset=dy*((ssize_t) GetPixelChannels(image)*(ssize_t) + image->columns)+dx*(ssize_t) GetPixelChannels(image); GetPixelInfoPixel(image,p+neighbor_offset,&target); if (IsFuzzyEquivalencePixelInfo(&pixel,&target) == MagickFalse) { @@ -955,8 +953,8 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, /* Resolve this equivalence. */ - offset=y*image->columns+x; - neighbor_offset=dy*image->columns+dx; + offset=y*(ssize_t) image->columns+x; + neighbor_offset=dy*(ssize_t) image->columns+dx; ox=offset; status=GetMatrixElement(equivalences,ox,0,&obj); while (obj != ox) @@ -995,7 +993,8 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, status=GetMatrixElement(equivalences,oy,0,&obj); status=SetMatrixElement(equivalences,oy,0,&root); } - status=SetMatrixElement(equivalences,y*image->columns+x,0,&root); + status=SetMatrixElement(equivalences,y*(ssize_t) image->columns+x,0, + &root); p+=GetPixelChannels(image); } } @@ -1032,7 +1031,7 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, id, offset; - offset=y*image->columns+x; + offset=y*(ssize_t) image->columns+x; status=GetMatrixElement(equivalences,offset,0,&id); if (id != offset) status=GetMatrixElement(equivalences,id,0,&id); @@ -1051,13 +1050,13 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, object[id].bounding_box.y=y; if (y >= (ssize_t) object[id].bounding_box.height) object[id].bounding_box.height=(size_t) y; - object[id].color.red+=QuantumScale*GetPixelRed(image,p); - object[id].color.green+=QuantumScale*GetPixelGreen(image,p); - object[id].color.blue+=QuantumScale*GetPixelBlue(image,p); + object[id].color.red+=QuantumScale*(double) GetPixelRed(image,p); + object[id].color.green+=QuantumScale*(double) GetPixelGreen(image,p); + object[id].color.blue+=QuantumScale*(double) GetPixelBlue(image,p); if (image->alpha_trait != UndefinedPixelTrait) - object[id].color.alpha+=QuantumScale*GetPixelAlpha(image,p); + object[id].color.alpha+=QuantumScale*(double) GetPixelAlpha(image,p); if (image->colorspace == CMYKColorspace) - object[id].color.black+=QuantumScale*GetPixelBlack(image,p); + object[id].color.black+=QuantumScale*(double) GetPixelBlack(image,p); object[id].centroid.x+=x; object[id].centroid.y+=y; object[id].area++; @@ -1096,8 +1095,10 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, component_image->colors=(size_t) n; for (i=0; i < (ssize_t) component_image->colors; i++) { - object[i].bounding_box.width-=(object[i].bounding_box.x-1); - object[i].bounding_box.height-=(object[i].bounding_box.y-1); + object[i].bounding_box.width=(size_t) ((ssize_t) + object[i].bounding_box.width-(object[i].bounding_box.x-1)); + object[i].bounding_box.height=(size_t) ((ssize_t) + object[i].bounding_box.height-(object[i].bounding_box.y-1)); object[i].color.red/=(QuantumScale*object[i].area); object[i].color.green/=(QuantumScale*object[i].area); object[i].color.blue/=(QuantumScale*object[i].area); @@ -1572,8 +1573,10 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, } for (i=0; i < (ssize_t) component_image->colors; i++) { - object[i].bounding_box.width-=(object[i].bounding_box.x-1); - object[i].bounding_box.height-=(object[i].bounding_box.y-1); + object[i].bounding_box.width=(size_t) ((ssize_t) + object[i].bounding_box.width-(object[i].bounding_box.x-1)); + object[i].bounding_box.height=(size_t) ((ssize_t) + object[i].bounding_box.height-(object[i].bounding_box.y-1)); object[i].centroid.x=object[i].centroid.x/object[i].area; object[i].centroid.y=object[i].centroid.y/object[i].area; } @@ -1765,11 +1768,11 @@ MagickExport Image *IntegralImage(const Image *image,ExceptionInfo *exception) continue; sum=(double) q[i]; if (x > 0) - sum+=(q-GetPixelChannels(integral_image))[i]; + sum+=(double) (q-GetPixelChannels(integral_image))[i]; if (y > 0) - sum+=p[i]; + sum+=(double) p[i]; if ((x > 0) && (y > 0)) - sum-=(p-GetPixelChannels(integral_image))[i]; + sum-=(double) (p-GetPixelChannels(integral_image))[i]; q[i]=ClampToQuantum(sum); } p+=GetPixelChannels(integral_image); diff --git a/ImageMagick-7.1.1-15/MagickCore/vision.h b/ImageMagick-7.1.1-16/MagickCore/vision.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/vision.h rename to ImageMagick-7.1.1-16/MagickCore/vision.h diff --git a/ImageMagick-7.1.1-15/MagickCore/visual-effects.c b/ImageMagick-7.1.1-16/MagickCore/visual-effects.c similarity index 96% rename from ImageMagick-7.1.1-15/MagickCore/visual-effects.c rename to ImageMagick-7.1.1-16/MagickCore/visual-effects.c index 5257865e..159f2561 100644 --- a/ImageMagick-7.1.1-15/MagickCore/visual-effects.c +++ b/ImageMagick-7.1.1-16/MagickCore/visual-effects.c @@ -172,11 +172,6 @@ MagickExport Image *AddNoiseImage(const Image *image,const NoiseType noise_type, assert(exception->signature == MagickCoreSignature); if (IsEventLogging() != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); -#if defined(MAGICKCORE_OPENCL_SUPPORT) - noise_image=AccelerateAddNoiseImage(image,noise_type,attenuate,exception); - if (noise_image != (Image *) NULL) - return(noise_image); -#endif noise_image=CloneImage(image,0,0,MagickTrue,exception); if (noise_image == (Image *) NULL) return((Image *) NULL); @@ -389,17 +384,17 @@ MagickExport Image *BlueShiftImage(const Image *image,const double factor, quantum=GetPixelGreen(image,p); if (GetPixelBlue(image,p) < quantum) quantum=GetPixelBlue(image,p); - pixel.red=0.5*(GetPixelRed(image,p)+factor*quantum); - pixel.green=0.5*(GetPixelGreen(image,p)+factor*quantum); - pixel.blue=0.5*(GetPixelBlue(image,p)+factor*quantum); + pixel.red=0.5*((double) GetPixelRed(image,p)+factor*(double) quantum); + pixel.green=0.5*((double) GetPixelGreen(image,p)+factor*(double) quantum); + pixel.blue=0.5*((double) GetPixelBlue(image,p)+factor*(double) quantum); quantum=GetPixelRed(image,p); if (GetPixelGreen(image,p) > quantum) quantum=GetPixelGreen(image,p); if (GetPixelBlue(image,p) > quantum) quantum=GetPixelBlue(image,p); - pixel.red=0.5*(pixel.red+factor*quantum); - pixel.green=0.5*(pixel.green+factor*quantum); - pixel.blue=0.5*(pixel.blue+factor*quantum); + pixel.red=0.5*(pixel.red+factor*(double) quantum); + pixel.green=0.5*(pixel.green+factor*(double) quantum); + pixel.blue=0.5*(pixel.blue+factor*(double) quantum); SetPixelRed(shift_image,ClampToQuantum(pixel.red),q); SetPixelGreen(shift_image,ClampToQuantum(pixel.green),q); SetPixelBlue(shift_image,ClampToQuantum(pixel.blue),q); @@ -536,7 +531,7 @@ MagickExport Image *ColorizeImage(const Image *image,const char *blend, { #define ColorizeImageTag "Colorize/Image" #define Colorize(pixel,blend_percentage,colorize) \ - (((pixel)*(100.0-(blend_percentage))+(colorize)*(blend_percentage))/100.0) + ((((double) pixel)*(100.0-(blend_percentage))+(colorize)*(blend_percentage))/100.0) CacheView *image_view; @@ -858,13 +853,14 @@ MagickExport Image *ColorMatrixImage(const Image *image, double sum; - sum=ColorMatrix[h][0]*GetPixelRed(image,p)+ColorMatrix[h][1]* - GetPixelGreen(image,p)+ColorMatrix[h][2]*GetPixelBlue(image,p); + sum=ColorMatrix[h][0]*(double) GetPixelRed(image,p)+ColorMatrix[h][1]* + (double) GetPixelGreen(image,p)+ColorMatrix[h][2]*(double) + GetPixelBlue(image,p); if (image->colorspace == CMYKColorspace) - sum+=ColorMatrix[h][3]*GetPixelBlack(image,p); + sum+=ColorMatrix[h][3]*(double) GetPixelBlack(image,p); if (image->alpha_trait != UndefinedPixelTrait) - sum+=ColorMatrix[h][4]*GetPixelAlpha(image,p); - sum+=QuantumRange*ColorMatrix[h][5]; + sum+=ColorMatrix[h][4]*(double) GetPixelAlpha(image,p); + sum+=(double) QuantumRange*ColorMatrix[h][5]; switch (h) { case 0: pixel.red=sum; break; @@ -982,7 +978,7 @@ MagickExport Image *ImplodeImage(const Image *image,const double amount, if (canvas_image == (Image *) NULL) return((Image *) NULL); if ((canvas_image->alpha_trait == UndefinedPixelTrait) && - (canvas_image->background_color.alpha != OpaqueAlpha)) + (canvas_image->background_color.alpha != (double) OpaqueAlpha)) (void) SetImageAlphaChannel(canvas_image,OpaqueAlphaChannel,exception); implode_image=CloneImage(canvas_image,0,0,MagickTrue,exception); if (implode_image == (Image *) NULL) @@ -1087,10 +1083,12 @@ MagickExport Image *ImplodeImage(const Image *image,const double amount, */ factor=1.0; if (distance > 0.0) - factor=pow(sin(MagickPI*sqrt((double) distance)*PerceptibleReciprocal(radius)/2),-amount); + factor=pow(sin(MagickPI*sqrt((double) distance)* + PerceptibleReciprocal(radius)/2),-amount); status=InterpolatePixelChannels(canvas_image,interpolate_view, - implode_image,method,(double) (factor*delta.x*PerceptibleReciprocal(scale.x)+center.x), - (double) (factor*delta.y*PerceptibleReciprocal(scale.y)+center.y),q,exception); + implode_image,method,(double) (factor*delta.x* + PerceptibleReciprocal(scale.x)+center.x),(double) (factor*delta.y* + PerceptibleReciprocal(scale.y)+center.y),q,exception); if (status == MagickFalse) break; } @@ -1308,8 +1306,8 @@ MagickExport Image *MorphImages(const Image *image,const size_t number_frames, SetPixelChannel(morph_image,channel,p[i],q); continue; } - SetPixelChannel(morph_image,channel,ClampToQuantum(alpha* - GetPixelChannel(morph_images,channel,q)+beta*p[i]),q); + SetPixelChannel(morph_image,channel,ClampToQuantum(alpha*(double) + GetPixelChannel(morph_images,channel,q)+beta*(double) p[i]),q); } p+=GetPixelChannels(morph_image); q+=GetPixelChannels(morph_images); @@ -1449,18 +1447,18 @@ static MagickBooleanType PlasmaImageProxy(Image *image,CacheView *image_view, local_info=(*segment); local_info.y1=(double) y_mid; local_info.x2=(double) x_mid; - status&=PlasmaImageProxy(image,image_view,u_view,v_view,random_info, - &local_info,attenuate,depth,exception); + status&=(MagickStatusType) PlasmaImageProxy(image,image_view,u_view, + v_view,random_info,&local_info,attenuate,depth,exception); local_info=(*segment); local_info.x1=(double) x_mid; local_info.y2=(double) y_mid; - status&=PlasmaImageProxy(image,image_view,u_view,v_view,random_info, - &local_info,attenuate,depth,exception); + status&=(MagickStatusType) PlasmaImageProxy(image,image_view,u_view, + v_view,random_info,&local_info,attenuate,depth,exception); local_info=(*segment); local_info.x1=(double) x_mid; local_info.y1=(double) y_mid; - status&=PlasmaImageProxy(image,image_view,u_view,v_view,random_info, - &local_info,attenuate,depth,exception); + status&=(MagickStatusType) PlasmaImageProxy(image,image_view,u_view, + v_view,random_info,&local_info,attenuate,depth,exception); return(status == 0 ? MagickFalse : MagickTrue); } x_mid=CastDoubleToLong(ceil((segment->x1+segment->x2)/2-0.5)); @@ -1496,7 +1494,7 @@ static MagickBooleanType PlasmaImageProxy(Image *image,CacheView *image_view, PixelTrait traits = GetPixelChannelTraits(image,channel); if (traits == UndefinedPixelTrait) continue; - q[i]=PlasmaPixel(random_info,((double) u[i]+v[i])/2.0,plasma); + q[i]=PlasmaPixel(random_info,((double) u[i]+(double) v[i])/2.0,plasma); } status=SyncCacheViewAuthenticPixels(image_view,exception); if (fabs(segment->x1-segment->x2) >= MagickEpsilon) @@ -1519,7 +1517,8 @@ static MagickBooleanType PlasmaImageProxy(Image *image,CacheView *image_view, PixelTrait traits = GetPixelChannelTraits(image,channel); if (traits == UndefinedPixelTrait) continue; - q[i]=PlasmaPixel(random_info,((double) u[i]+v[i])/2.0,plasma); + q[i]=PlasmaPixel(random_info,((double) u[i]+(double) v[i])/2.0, + plasma); } status=SyncCacheViewAuthenticPixels(image_view,exception); } @@ -1548,7 +1547,8 @@ static MagickBooleanType PlasmaImageProxy(Image *image,CacheView *image_view, PixelTrait traits = GetPixelChannelTraits(image,channel); if (traits == UndefinedPixelTrait) continue; - q[i]=PlasmaPixel(random_info,((double) u[i]+v[i])/2.0,plasma); + q[i]=PlasmaPixel(random_info,((double) u[i]+(double) v[i])/2.0, + plasma); } status=SyncCacheViewAuthenticPixels(image_view,exception); } @@ -1572,7 +1572,8 @@ static MagickBooleanType PlasmaImageProxy(Image *image,CacheView *image_view, PixelTrait traits = GetPixelChannelTraits(image,channel); if (traits == UndefinedPixelTrait) continue; - q[i]=PlasmaPixel(random_info,((double) u[i]+v[i])/2.0,plasma); + q[i]=PlasmaPixel(random_info,((double) u[i]+(double) v[i])/2.0, + plasma); } status=SyncCacheViewAuthenticPixels(image_view,exception); } @@ -1599,7 +1600,7 @@ static MagickBooleanType PlasmaImageProxy(Image *image,CacheView *image_view, PixelTrait traits = GetPixelChannelTraits(image,channel); if (traits == UndefinedPixelTrait) continue; - q[i]=PlasmaPixel(random_info,((double) u[i]+v[i])/2.0,plasma); + q[i]=PlasmaPixel(random_info,((double) u[i]+(double) v[i])/2.0,plasma); } status=SyncCacheViewAuthenticPixels(image_view,exception); } @@ -1707,7 +1708,7 @@ MagickExport Image *PolaroidImage(const Image *image,const DrawInfo *draw_info, (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); quantum=(ssize_t) MagickMax(MagickMax((double) image->columns,(double) image->rows)/25.0,10.0); - height=image->rows+2*quantum; + height=(size_t) ((ssize_t) image->rows+2*quantum); caption_image=(Image *) NULL; if (caption != (const char *) NULL) { @@ -1764,8 +1765,8 @@ MagickExport Image *PolaroidImage(const Image *image,const DrawInfo *draw_info, text=DestroyString(text); } } - picture_image=CloneImage(image,image->columns+2*quantum,height,MagickTrue, - exception); + picture_image=CloneImage(image,(size_t) ((ssize_t) image->columns+2*quantum), + height,MagickTrue,exception); if (picture_image == (Image *) NULL) { if (caption_image != (Image *) NULL) @@ -1779,7 +1780,7 @@ MagickExport Image *PolaroidImage(const Image *image,const DrawInfo *draw_info, if (caption_image != (Image *) NULL) { (void) CompositeImage(picture_image,caption_image,OverCompositeOp, - MagickTrue,quantum,(ssize_t) (image->rows+3*quantum/2),exception); + MagickTrue,quantum,((ssize_t) image->rows+3*quantum/2),exception); caption_image=DestroyImage(caption_image); } (void) QueryColorCompliance("none",AllCompliance, @@ -2100,7 +2101,8 @@ MagickExport Image *ShadowImage(const Image *image,const double alpha, for (x=0; x < (ssize_t) border_image->columns; x++) { if (border_image->alpha_trait != UndefinedPixelTrait) - background_color.alpha=GetPixelAlpha(border_image,q)*alpha/100.0; + background_color.alpha=(double) GetPixelAlpha(border_image,q)*alpha/ + 100.0; SetPixelViaPixelInfo(border_image,&background_color,q); q+=GetPixelChannels(border_image); } @@ -2123,8 +2125,10 @@ MagickExport Image *ShadowImage(const Image *image,const double alpha, shadow_image->page.width=shadow_image->columns; if (shadow_image->page.height == 0) shadow_image->page.height=shadow_image->rows; - shadow_image->page.width+=x_offset-(ssize_t) border_info.width; - shadow_image->page.height+=y_offset-(ssize_t) border_info.height; + shadow_image->page.width=(size_t) ((ssize_t) shadow_image->page.width+ + x_offset-(ssize_t) border_info.width); + shadow_image->page.height=(size_t) ((ssize_t) shadow_image->page.height+ + y_offset-(ssize_t) border_info.height); shadow_image->page.x+=x_offset-(ssize_t) border_info.width; shadow_image->page.y+=y_offset-(ssize_t) border_info.height; return(shadow_image); @@ -2243,7 +2247,7 @@ MagickExport Image *SketchImage(const Image *image,const double radius, PixelTrait traits = GetPixelChannelTraits(image,channel); if (traits == UndefinedPixelTrait) continue; - q[i]=ClampToQuantum(QuantumRange*value); + q[i]=ClampToQuantum((double) QuantumRange*value); } q+=GetPixelChannels(random_image); } @@ -2360,11 +2364,12 @@ MagickExport MagickBooleanType SolarizeImage(Image *image, for (i=0; i < (ssize_t) image->colors; i++) { if ((double) image->colormap[i].red > threshold) - image->colormap[i].red=QuantumRange-image->colormap[i].red; + image->colormap[i].red=(double) QuantumRange-image->colormap[i].red; if ((double) image->colormap[i].green > threshold) - image->colormap[i].green=QuantumRange-image->colormap[i].green; + image->colormap[i].green=(double) QuantumRange- + image->colormap[i].green; if ((double) image->colormap[i].blue > threshold) - image->colormap[i].blue=QuantumRange-image->colormap[i].blue; + image->colormap[i].blue=(double) QuantumRange-image->colormap[i].blue; } return(SyncImage(image,exception)); } @@ -2589,7 +2594,7 @@ MagickExport Image *SteganoImage(const Image *image,const Image *watermark, proceed; proceed=SetImageProgress(image,SteganoImageTag,(MagickOffsetType) - (depth-i),depth); + depth-i,depth); if (proceed == MagickFalse) status=MagickFalse; } @@ -3114,16 +3119,16 @@ MagickExport Image *TintImage(const Image *image,const char *blend, weight; GetPixelInfo(image,&pixel); - weight=QuantumScale*GetPixelRed(image,p)-0.5; + weight=QuantumScale*(double) GetPixelRed(image,p)-0.5; pixel.red=(MagickRealType) GetPixelRed(image,p)+color_vector.red* (1.0-(4.0*(weight*weight))); - weight=QuantumScale*GetPixelGreen(image,p)-0.5; + weight=QuantumScale*(double) GetPixelGreen(image,p)-0.5; pixel.green=(MagickRealType) GetPixelGreen(image,p)+color_vector.green* (1.0-(4.0*(weight*weight))); - weight=QuantumScale*GetPixelBlue(image,p)-0.5; + weight=QuantumScale*(double) GetPixelBlue(image,p)-0.5; pixel.blue=(MagickRealType) GetPixelBlue(image,p)+color_vector.blue* (1.0-(4.0*(weight*weight))); - weight=QuantumScale*GetPixelBlack(image,p)-0.5; + weight=QuantumScale*(double) GetPixelBlack(image,p)-0.5; pixel.black=(MagickRealType) GetPixelBlack(image,p)+color_vector.black* (1.0-(4.0*(weight*weight))); pixel.alpha=(MagickRealType) GetPixelAlpha(image,p); @@ -3330,7 +3335,7 @@ MagickExport Image *WaveImage(const Image *image,const double amplitude, if (canvas_image == (Image *) NULL) return((Image *) NULL); if ((canvas_image->alpha_trait == UndefinedPixelTrait) && - (canvas_image->background_color.alpha != OpaqueAlpha)) + (canvas_image->background_color.alpha != (double) OpaqueAlpha)) (void) SetImageAlpha(canvas_image,OpaqueAlpha,exception); wave_image=CloneImage(canvas_image,canvas_image->columns,(size_t) (canvas_image->rows+2.0*fabs(amplitude)),MagickTrue,exception); @@ -3357,8 +3362,8 @@ MagickExport Image *WaveImage(const Image *image,const double amplitude, ThrowImageException(ResourceLimitError,"MemoryAllocationFailed"); } for (i=0; i < (ssize_t) wave_image->columns; i++) - sine_map[i]=(float) fabs(amplitude)+amplitude*sin((double) - ((2.0*MagickPI*i)*PerceptibleReciprocal(wave_length))); + sine_map[i]=(float) (fabs(amplitude)+amplitude*sin((double) + ((2.0*MagickPI*i)*(double) PerceptibleReciprocal(wave_length)))); /* Wave image. */ @@ -3656,8 +3661,8 @@ MagickExport Image *WaveletDenoiseImage(const Image *image, ssize_t c; - p=kernel+id*image->columns; - q=pixels+y*image->columns; + p=kernel+id*(ssize_t) image->columns; + q=pixels+y*(ssize_t) image->columns; HatTransform(q+high_pass,1,image->columns,((size_t) 1UL << level),p); q+=low_pass; for (c=0; c < (ssize_t) image->columns; c++) @@ -3679,7 +3684,7 @@ MagickExport Image *WaveletDenoiseImage(const Image *image, ssize_t r; - p=kernel+id*image->rows; + p=kernel+id*(ssize_t) image->rows; q=pixels+x+low_pass; HatTransform(q,image->columns,image->rows,((size_t) 1UL << level),p); for (r=0; r < (ssize_t) image->rows; r++) @@ -3692,19 +3697,20 @@ MagickExport Image *WaveletDenoiseImage(const Image *image, To threshold, each coefficient is compared to a threshold value and attenuated / shrunk by some factor. */ - magnitude=threshold*noise_levels[level]; + magnitude=threshold*(double) noise_levels[level]; for (i=0; i < (ssize_t) number_pixels; ++i) { - pixels[high_pass+i]-=pixels[low_pass+i]; - if (pixels[high_pass+i] < -magnitude) - pixels[high_pass+i]+=magnitude-softness*magnitude; + pixels[(ssize_t) high_pass+i]-=pixels[(ssize_t) low_pass+i]; + if ((double) pixels[(ssize_t) high_pass+i] < -magnitude) + pixels[(ssize_t) high_pass+i]+=(float) (magnitude-softness*magnitude); else - if (pixels[high_pass+i] > magnitude) - pixels[high_pass+i]-=magnitude-softness*magnitude; + if ((double) pixels[(ssize_t) high_pass+i] > magnitude) + pixels[(ssize_t) high_pass+i]-=(float) (magnitude-softness* + magnitude); else - pixels[high_pass+i]*=softness; + pixels[(ssize_t) high_pass+i]*=(float) softness; if (high_pass != 0) - pixels[i]+=pixels[high_pass+i]; + pixels[i]+=pixels[(ssize_t) high_pass+i]; } high_pass=low_pass; } @@ -3739,7 +3745,8 @@ MagickExport Image *WaveletDenoiseImage(const Image *image, MagickRealType pixel; - pixel=(MagickRealType) pixels[i]+pixels[low_pass+i]; + pixel=(MagickRealType) pixels[i]+(MagickRealType) + pixels[(ssize_t) low_pass+i]; q[offset]=ClampToQuantum(pixel); i++; q+=GetPixelChannels(noise_image); diff --git a/ImageMagick-7.1.1-15/MagickCore/visual-effects.h b/ImageMagick-7.1.1-16/MagickCore/visual-effects.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/visual-effects.h rename to ImageMagick-7.1.1-16/MagickCore/visual-effects.h diff --git a/ImageMagick-7.1.1-15/MagickCore/vms.c b/ImageMagick-7.1.1-16/MagickCore/vms.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/vms.c rename to ImageMagick-7.1.1-16/MagickCore/vms.c diff --git a/ImageMagick-7.1.1-15/MagickCore/vms.h b/ImageMagick-7.1.1-16/MagickCore/vms.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/vms.h rename to ImageMagick-7.1.1-16/MagickCore/vms.h diff --git a/ImageMagick-7.1.1-15/MagickCore/widget-private.h b/ImageMagick-7.1.1-16/MagickCore/widget-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/widget-private.h rename to ImageMagick-7.1.1-16/MagickCore/widget-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/widget.c b/ImageMagick-7.1.1-16/MagickCore/widget.c similarity index 91% rename from ImageMagick-7.1.1-15/MagickCore/widget.c rename to ImageMagick-7.1.1-16/MagickCore/widget.c index a27f1657..9a35a14c 100644 --- a/ImageMagick-7.1.1-15/MagickCore/widget.c +++ b/ImageMagick-7.1.1-16/MagickCore/widget.c @@ -64,18 +64,18 @@ Define declarations. */ #define AreaIsActive(matte_info,position) ( \ - ((position.y >= (int) (matte_info.y-matte_info.bevel_width)) && \ - (position.y < (int) (matte_info.y+matte_info.height+matte_info.bevel_width))) \ + ((position.y >= (matte_info.y-(int) matte_info.bevel_width)) && \ + (position.y < (matte_info.y+(int) matte_info.height+(int) matte_info.bevel_width))) \ ? MagickTrue : MagickFalse) #define Extent(s) ((int) strlen(s)) #define MatteIsActive(matte_info,position) ( \ - ((position.x >= (int) (matte_info.x-matte_info.bevel_width)) && \ - (position.y >= (int) (matte_info.y-matte_info.bevel_width)) && \ - (position.x < (int) (matte_info.x+matte_info.width+matte_info.bevel_width)) && \ - (position.y < (int) (matte_info.y+matte_info.height+matte_info.bevel_width))) \ + ((position.x >= (matte_info.x-(int) matte_info.bevel_width)) && \ + (position.y >= (matte_info.y-(int) matte_info.bevel_width)) && \ + (position.x < (matte_info.x+(int) matte_info.width+(int) matte_info.bevel_width)) && \ + (position.y < (matte_info.y+(int) matte_info.height+(int) matte_info.bevel_width))) \ ? MagickTrue : MagickFalse) #define MaxTextWidth ((unsigned int) (255*XTextWidth(font_info,"_",1))) -#define MinTextWidth (26*XTextWidth(font_info,"_",1)) +#define MinTextWidth ((unsigned int) (26*XTextWidth(font_info,"_",1))) #define QuantumMargin MagickMax(font_info->max_bounds.width,12) #define WidgetTextWidth(font_info,text) \ ((unsigned int) XTextWidth(font_info,text,Extent(text))) @@ -242,8 +242,8 @@ static void XDrawBevel(Display *display,const XWindowInfo *window_info, Draw upper and left beveled border. */ x1=bevel_info->x; - y1=bevel_info->y+bevel_info->height; - x2=bevel_info->x+bevel_info->width; + y1=bevel_info->y+(int) bevel_info->height; + x2=bevel_info->x+(int) bevel_info->width; y2=bevel_info->y; bevel_width=bevel_info->bevel_width; points[0].x=x1; @@ -252,12 +252,12 @@ static void XDrawBevel(Display *display,const XWindowInfo *window_info, points[1].y=y2; points[2].x=x2; points[2].y=y2; - points[3].x=x2+bevel_width; - points[3].y=y2-bevel_width; - points[4].x=x1-bevel_width; - points[4].y=y2-bevel_width; - points[5].x=x1-bevel_width; - points[5].y=y1+bevel_width; + points[3].x=x2+(int) bevel_width; + points[3].y=y2-(int) bevel_width; + points[4].x=x1-(int) bevel_width; + points[4].y=y2-(int) bevel_width; + points[5].x=x1-(int) bevel_width; + points[5].y=y1+(int) bevel_width; XSetBevelColor(display,window_info,bevel_info->raised); (void) XFillPolygon(display,window_info->id,window_info->widget_context, points,6,Complex,CoordModeOrigin); @@ -270,12 +270,12 @@ static void XDrawBevel(Display *display,const XWindowInfo *window_info, points[1].y=y1; points[2].x=x2; points[2].y=y2; - points[3].x=x2+bevel_width; - points[3].y=y2-bevel_width; - points[4].x=x2+bevel_width; - points[4].y=y1+bevel_width; - points[5].x=x1-bevel_width; - points[5].y=y1+bevel_width; + points[3].x=x2+(int) bevel_width; + points[3].y=y2-(int) bevel_width; + points[4].x=x2+(int) bevel_width; + points[4].y=y1+(int) bevel_width; + points[5].x=x1-(int) bevel_width; + points[5].y=y1+(int) bevel_width; XSetBevelColor(display,window_info,!bevel_info->raised); (void) XFillPolygon(display,window_info->id,window_info->widget_context, points,6,Complex,CoordModeOrigin); @@ -336,8 +336,8 @@ static void XDrawBeveledButton(Display *display,const XWindowInfo *window_info, XSetMatteColor(display,window_info,button_info->raised); (void) XFillRectangle(display,window_info->id,window_info->widget_context, button_info->x,button_info->y,button_info->width,button_info->height); - x=button_info->x-button_info->bevel_width-1; - y=button_info->y-button_info->bevel_width-1; + x=button_info->x-(int) button_info->bevel_width-1; + y=button_info->y-(int) button_info->bevel_width-1; (void) XSetForeground(display,window_info->widget_context, window_info->pixel_info->trough_color.pixel); if (button_info->raised || (window_info->depth == 1)) @@ -358,10 +358,10 @@ static void XDrawBeveledButton(Display *display,const XWindowInfo *window_info, */ font_info=window_info->font_info; width=WidgetTextWidth(font_info,button_info->text); - x=button_info->x+(QuantumMargin >> 1); + x=button_info->x+(int) (QuantumMargin >> 1); if (button_info->center) - x=button_info->x+(button_info->width >> 1)-(width >> 1); - y=button_info->y+((button_info->height- + x=button_info->x+(int) (button_info->width >> 1)-(int) (width >> 1); + y=button_info->y+(int) (((int) button_info->height-(int) (font_info->ascent+font_info->descent)) >> 1)+font_info->ascent; if ((int) button_info->width == (QuantumMargin >> 1)) { @@ -369,7 +369,7 @@ static void XDrawBeveledButton(Display *display,const XWindowInfo *window_info, Option button-- write label to right of button. */ XSetTextColor(display,window_info,MagickTrue); - x=button_info->x+button_info->width+button_info->bevel_width+ + x=button_info->x+(int) button_info->width+(int) button_info->bevel_width+ (QuantumMargin >> 1); (void) XDrawString(display,window_info->id,window_info->widget_context, x,y,button_info->text,Extent(button_info->text)); @@ -535,9 +535,9 @@ static void XDrawMatteText(Display *display,const XWindowInfo *window_info, return; XSetTextColor(display,window_info,text_info->highlight); font_info=window_info->font_info; - x=text_info->x+(QuantumMargin >> 2); - y=text_info->y+font_info->ascent+(text_info->height >> 2); - width=text_info->width-(QuantumMargin >> 1); + x=text_info->x+(int) (QuantumMargin >> 2); + y=text_info->y+font_info->ascent+(int) (text_info->height >> 2); + width=text_info->width-(unsigned int) (QuantumMargin >> 1); height=(unsigned int) (font_info->ascent+font_info->descent); if (*text_info->text == '\0') { @@ -545,7 +545,7 @@ static void XDrawMatteText(Display *display,const XWindowInfo *window_info, No text-- just draw cursor. */ (void) XDrawLine(display,window_info->id,window_info->annotate_context, - x,y+3,x,y-height+3); + x,y+3,x,y-(int) height+3); return; } /* @@ -606,7 +606,7 @@ static void XDrawMatteText(Display *display,const XWindowInfo *window_info, x+=XTextWidth(font_info,text_info->marker,(int) (text_info->cursor-text_info->marker)); (void) XDrawLine(display,window_info->id,window_info->annotate_context,x,y+3, - x,y-height+3); + x,y-(int) height+3); } /* @@ -664,10 +664,10 @@ static void XDrawTriangleEast(Display *display,const XWindowInfo *window_info, */ x1=triangle_info->x; y1=triangle_info->y; - x2=triangle_info->x+triangle_info->width; - y2=triangle_info->y+(triangle_info->height >> 1); + x2=triangle_info->x+(int) triangle_info->width; + y2=triangle_info->y+(int) (triangle_info->height >> 1); x3=triangle_info->x; - y3=triangle_info->y+triangle_info->height; + y3=triangle_info->y+(int) triangle_info->height; bevel_width=triangle_info->bevel_width; points[0].x=x1; points[0].y=y1; @@ -685,9 +685,9 @@ static void XDrawTriangleEast(Display *display,const XWindowInfo *window_info, points[0].y=y2; points[1].x=x3; points[1].y=y3; - points[2].x=x3-bevel_width; - points[2].y=y3+bevel_width; - points[3].x=x2+bevel_width; + points[2].x=x3-(int) bevel_width; + points[2].y=y3+(int) bevel_width; + points[3].x=x2+(int) bevel_width; points[3].y=y2; XSetBevelColor(display,window_info,!triangle_info->raised); (void) XFillPolygon(display,window_info->id,window_info->widget_context, @@ -699,10 +699,10 @@ static void XDrawTriangleEast(Display *display,const XWindowInfo *window_info, points[0].y=y3; points[1].x=x1; points[1].y=y1; - points[2].x=x1-bevel_width+1; - points[2].y=y1-bevel_width; - points[3].x=x3-bevel_width+1; - points[3].y=y3+bevel_width; + points[2].x=x1-(int) bevel_width+1; + points[2].y=y1-(int) bevel_width; + points[3].x=x3-(int) bevel_width+1; + points[3].y=y3+(int) bevel_width; XSetBevelColor(display,window_info,triangle_info->raised); (void) XFillPolygon(display,window_info->id,window_info->widget_context, points,4,Complex,CoordModeOrigin); @@ -713,10 +713,10 @@ static void XDrawTriangleEast(Display *display,const XWindowInfo *window_info, points[0].y=y1; points[1].x=x2; points[1].y=y2; - points[2].x=x2+bevel_width; + points[2].x=x2+(int) bevel_width; points[2].y=y2; - points[3].x=x1-bevel_width; - points[3].y=y1-bevel_width; + points[3].x=x1-(int) bevel_width; + points[3].y=y1-(int) bevel_width; (void) XFillPolygon(display,window_info->id,window_info->widget_context, points,4,Complex,CoordModeOrigin); (void) XSetFillStyle(display,window_info->widget_context,FillSolid); @@ -727,10 +727,10 @@ static void XDrawTriangleEast(Display *display,const XWindowInfo *window_info, */ font_info=window_info->font_info; XSetTextColor(display,window_info,MagickTrue); - x1=triangle_info->x+triangle_info->width+triangle_info->bevel_width+ - (QuantumMargin >> 1); - y1=triangle_info->y+((triangle_info->height- - (font_info->ascent+font_info->descent)) >> 1)+font_info->ascent; + x1=triangle_info->x+(int) triangle_info->width+(int) + triangle_info->bevel_width+(QuantumMargin >> 1); + y1=triangle_info->y+(((int) triangle_info->height-(int) + (font_info->ascent+font_info->descent)) >> 1)+(int) font_info->ascent; (void) XDrawString(display,window_info->id,window_info->widget_context,x1,y1, triangle_info->text,Extent(triangle_info->text)); } @@ -786,11 +786,11 @@ static void XDrawTriangleNorth(Display *display,const XWindowInfo *window_info, Draw triangle matte. */ x1=triangle_info->x; - y1=triangle_info->y+triangle_info->height; - x2=triangle_info->x+(triangle_info->width >> 1); + y1=triangle_info->y+(int) triangle_info->height; + x2=triangle_info->x+(int) (triangle_info->width >> 1); y2=triangle_info->y; - x3=triangle_info->x+triangle_info->width; - y3=triangle_info->y+triangle_info->height; + x3=triangle_info->x+(int) triangle_info->width; + y3=triangle_info->y+(int) triangle_info->height; bevel_width=triangle_info->bevel_width; points[0].x=x1; points[0].y=y1; @@ -809,9 +809,9 @@ static void XDrawTriangleNorth(Display *display,const XWindowInfo *window_info, points[1].x=x2; points[1].y=y2; points[2].x=x2; - points[2].y=y2-bevel_width-2; - points[3].x=x1-bevel_width-1; - points[3].y=y1+bevel_width; + points[2].y=y2-(int) bevel_width-2; + points[3].x=x1-(int) bevel_width-1; + points[3].y=y1+(int) bevel_width; XSetBevelColor(display,window_info,triangle_info->raised); (void) XFillPolygon(display,window_info->id,window_info->widget_context, points,4,Complex,CoordModeOrigin); @@ -822,10 +822,10 @@ static void XDrawTriangleNorth(Display *display,const XWindowInfo *window_info, points[0].y=y2; points[1].x=x3; points[1].y=y3; - points[2].x=x3+bevel_width; - points[2].y=y3+bevel_width; + points[2].x=x3+(int) bevel_width; + points[2].y=y3+(int) bevel_width; points[3].x=x2; - points[3].y=y2-bevel_width; + points[3].y=y2-(int) bevel_width; XSetBevelColor(display,window_info,!triangle_info->raised); (void) XFillPolygon(display,window_info->id,window_info->widget_context, points,4,Complex,CoordModeOrigin); @@ -836,10 +836,10 @@ static void XDrawTriangleNorth(Display *display,const XWindowInfo *window_info, points[0].y=y3; points[1].x=x1; points[1].y=y1; - points[2].x=x1-bevel_width; - points[2].y=y1+bevel_width; - points[3].x=x3+bevel_width; - points[3].y=y3+bevel_width; + points[2].x=x1-(int) bevel_width; + points[2].y=y1+(int) bevel_width; + points[3].x=x3+(int) bevel_width; + points[3].y=y3+(int) bevel_width; (void) XFillPolygon(display,window_info->id,window_info->widget_context, points,4,Complex,CoordModeOrigin); (void) XSetFillStyle(display,window_info->widget_context,FillSolid); @@ -897,9 +897,9 @@ static void XDrawTriangleSouth(Display *display,const XWindowInfo *window_info, */ x1=triangle_info->x; y1=triangle_info->y; - x2=triangle_info->x+(triangle_info->width >> 1); - y2=triangle_info->y+triangle_info->height; - x3=triangle_info->x+triangle_info->width; + x2=triangle_info->x+(int) (triangle_info->width >> 1); + y2=triangle_info->y+(int) triangle_info->height; + x3=triangle_info->x+(int) triangle_info->width; y3=triangle_info->y; bevel_width=triangle_info->bevel_width; points[0].x=x1; @@ -918,10 +918,10 @@ static void XDrawTriangleSouth(Display *display,const XWindowInfo *window_info, points[0].y=y3; points[1].x=x1; points[1].y=y1; - points[2].x=x1-bevel_width; - points[2].y=y1-bevel_width; - points[3].x=x3+bevel_width; - points[3].y=y3-bevel_width; + points[2].x=x1-(int) bevel_width; + points[2].y=y1-(int) bevel_width; + points[3].x=x3+(int) bevel_width; + points[3].y=y3-(int) bevel_width; XSetBevelColor(display,window_info,triangle_info->raised); (void) XFillPolygon(display,window_info->id,window_info->widget_context, points,4,Complex,CoordModeOrigin); @@ -931,11 +931,11 @@ static void XDrawTriangleSouth(Display *display,const XWindowInfo *window_info, points[0].x=x2; points[0].y=y2; points[1].x=x3+1; - points[1].y=y3-bevel_width; - points[2].x=x3+bevel_width; - points[2].y=y3-bevel_width; + points[1].y=y3-(int) bevel_width; + points[2].x=x3+(int) bevel_width; + points[2].y=y3-(int) bevel_width; points[3].x=x2; - points[3].y=y2+bevel_width; + points[3].y=y2+(int) bevel_width; XSetBevelColor(display,window_info,!triangle_info->raised); (void) XFillPolygon(display,window_info->id,window_info->widget_context, points,4,Complex,CoordModeOrigin); @@ -947,9 +947,9 @@ static void XDrawTriangleSouth(Display *display,const XWindowInfo *window_info, points[1].x=x2; points[1].y=y2; points[2].x=x2; - points[2].y=y2+bevel_width; - points[3].x=x1-bevel_width; - points[3].y=y1-bevel_width; + points[2].y=y2+(int) bevel_width; + points[3].x=x1-(int) bevel_width; + points[3].y=y1-(int) bevel_width; XSetBevelColor(display,window_info,triangle_info->raised); (void) XFillPolygon(display,window_info->id,window_info->widget_context, points,4,Complex,CoordModeOrigin); @@ -1033,21 +1033,22 @@ static void XDrawWidgetText(Display *display,const XWindowInfo *window_info, Draw text. */ width=WidgetTextWidth(font_info,text_info->text); - x=text_info->x+(QuantumMargin >> 1); + x=text_info->x+(int) (QuantumMargin >> 1); if (text_info->center) - x=text_info->x+(text_info->width >> 1)-(width >> 1); + x=text_info->x+(int) (text_info->width >> 1)-(int) (width >> 1); if (text_info->raised) - if (width > (text_info->width-QuantumMargin)) - x+=(text_info->width-QuantumMargin-width); + if (width > (text_info->width-(unsigned int) QuantumMargin)) + x+=(int) (text_info->width-(unsigned int) QuantumMargin-width); height=(unsigned int) (font_info->ascent+font_info->descent); - y=text_info->y+((text_info->height-height) >> 1)+font_info->ascent; + y=text_info->y+(int) ((text_info->height-height) >> 1)+font_info->ascent; (void) XSetClipRectangles(display,widget_context,0,0,&crop_info,1,Unsorted); (void) XDrawString(display,window_info->id,widget_context,x,y,text_info->text, Extent(text_info->text)); (void) XSetClipMask(display,widget_context,None); if (x < text_info->x) (void) XDrawLine(display,window_info->id,window_info->annotate_context, - text_info->x,text_info->y,text_info->x,text_info->y+text_info->height-1); + text_info->x,text_info->y,text_info->x,text_info->y+(int) + text_info->height-1); } /* @@ -1270,12 +1271,15 @@ static void XHighlightWidget(Display *display,const XWindowInfo *window_info, */ XSetBevelColor(display,window_info,MagickTrue); (void) XDrawRectangle(display,window_info->id,window_info->widget_context,x,y, - window_info->width-(x << 1),window_info->height-(y << 1)); + (unsigned int) ((int) window_info->width-(x << 1)),(unsigned int) + ((int) window_info->height-(y << 1))); (void) XDrawRectangle(display,window_info->id,window_info->widget_context, - x-1,y-1,window_info->width-(x << 1)+1,window_info->height-(y << 1)+1); + x-1,y-1,(unsigned int) ((int) window_info->width-(x << 1)+1),(unsigned int) + ((int) window_info->height-(y << 1)+1)); XSetBevelColor(display,window_info,MagickFalse); (void) XDrawRectangle(display,window_info->id,window_info->widget_context, - x-1,y-1,window_info->width-(x << 1),window_info->height-(y << 1)); + x-1,y-1,(unsigned int) ((int) window_info->width-(x << 1)),(unsigned int) + ((int) window_info->height-(y << 1))); (void) XSetFillStyle(display,window_info->widget_context,FillSolid); } @@ -1345,7 +1349,7 @@ static int XScreenEvent(Display *display,XEvent *event,char *data) Convert Alt-Button3 to Button2. */ event->xbutton.button=Button2; - event->xbutton.state&=(~Mod1Mask); + event->xbutton.state&=(unsigned int) (~Mod1Mask); } return(MagickTrue); } @@ -1725,7 +1729,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, width=WidgetTextWidth(font_info,ResetButtonText); if (WidgetTextWidth(font_info,GrabButtonText) > width) width=WidgetTextWidth(font_info,GrabButtonText); - width+=QuantumMargin; + width+=(unsigned int) QuantumMargin; if (WidgetTextWidth(font_info,ColorPatternText) > width) width=WidgetTextWidth(font_info,ColorPatternText); if (WidgetTextWidth(font_info,ColornameText) > width) @@ -1734,16 +1738,15 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, /* Position Color Browser widget. */ - windows->widget.width=(unsigned int) - (width+MagickMin((int) text_width,(int) MaxTextWidth)+6*QuantumMargin); - windows->widget.min_width=(unsigned int) - (width+MinTextWidth+4*QuantumMargin); + windows->widget.width=width+MagickMin(text_width,MaxTextWidth)+ + 6*(unsigned int) QuantumMargin; + windows->widget.min_width=width+MinTextWidth+4*(unsigned int) QuantumMargin; if (windows->widget.width < windows->widget.min_width) windows->widget.width=windows->widget.min_width; windows->widget.height=(unsigned int) - ((81*height) >> 2)+((13*QuantumMargin) >> 1)+4; + ((81*height) >> 2)+((13*(unsigned int) QuantumMargin) >> 1)+4; windows->widget.min_height=(unsigned int) - (((23*height) >> 1)+((13*QuantumMargin) >> 1)+4); + (((23*height) >> 1)+((13*(unsigned int) QuantumMargin) >> 1)+4); if (windows->widget.height < windows->widget.min_height) windows->widget.height=windows->widget.min_height; XConstrainWindowPosition(display,&windows->widget); @@ -1792,43 +1795,44 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, XGetWidgetInfo(CancelButtonText,&cancel_info); cancel_info.width=width; cancel_info.height=(unsigned int) ((3*height) >> 1); - cancel_info.x=(int) - (windows->widget.width-cancel_info.width-QuantumMargin-2); - cancel_info.y=(int) - (windows->widget.height-cancel_info.height-QuantumMargin); + cancel_info.x=(int) windows->widget.width-(int) cancel_info.width- + QuantumMargin-2; + cancel_info.y=(int) windows->widget.height-(int) cancel_info.height- + QuantumMargin; XGetWidgetInfo(action,&action_info); action_info.width=width; action_info.height=(unsigned int) ((3*height) >> 1); - action_info.x=cancel_info.x-(cancel_info.width+(QuantumMargin >> 1)+ - (action_info.bevel_width << 1)); + action_info.x=cancel_info.x-(int) cancel_info.width+ + (QuantumMargin >> 1)+(int) (action_info.bevel_width << 1); action_info.y=cancel_info.y; XGetWidgetInfo(GrabButtonText,&grab_info); grab_info.width=width; grab_info.height=(unsigned int) ((3*height) >> 1); grab_info.x=QuantumMargin; - grab_info.y=((5*QuantumMargin) >> 1)+height; + grab_info.y=((5*QuantumMargin) >> 1)+(int) height; XGetWidgetInfo(ResetButtonText,&reset_info); reset_info.width=width; reset_info.height=(unsigned int) ((3*height) >> 1); reset_info.x=QuantumMargin; - reset_info.y=grab_info.y+grab_info.height+QuantumMargin; + reset_info.y=grab_info.y+(int) grab_info.height+QuantumMargin; /* Initialize reply information. */ XGetWidgetInfo(reply,&reply_info); reply_info.raised=MagickFalse; reply_info.bevel_width--; - reply_info.width=windows->widget.width-width-((6*QuantumMargin) >> 1); + reply_info.width=windows->widget.width-width-(unsigned int) + ((6*QuantumMargin) >> 1); reply_info.height=height << 1; - reply_info.x=(int) (width+(QuantumMargin << 1)); - reply_info.y=action_info.y-reply_info.height-QuantumMargin; + reply_info.x=(int) width+(QuantumMargin << 1); + reply_info.y=action_info.y-(int) reply_info.height-QuantumMargin; /* Initialize mode information. */ XGetWidgetInfo((char *) NULL,&mode_info); mode_info.active=MagickTrue; mode_info.bevel_width=0; - mode_info.width=(unsigned int) (action_info.x-(QuantumMargin << 1)); + mode_info.width=(unsigned int) (action_info.x-(int) (QuantumMargin << 1)); mode_info.height=action_info.height; mode_info.x=QuantumMargin; mode_info.y=action_info.y; @@ -1840,35 +1844,35 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, scroll_info.width=height; scroll_info.height=(unsigned int) (reply_info.y-grab_info.y- (QuantumMargin >> 1)); - scroll_info.x=reply_info.x+(reply_info.width-scroll_info.width); - scroll_info.y=grab_info.y-reply_info.bevel_width; + scroll_info.x=reply_info.x+(int) (reply_info.width-scroll_info.width); + scroll_info.y=grab_info.y-(int) reply_info.bevel_width; scroll_info.raised=MagickFalse; scroll_info.trough=MagickTrue; north_info=scroll_info; north_info.raised=MagickTrue; north_info.width-=(north_info.bevel_width << 1); north_info.height=north_info.width-1; - north_info.x+=north_info.bevel_width; - north_info.y+=north_info.bevel_width; + north_info.x+=(int) north_info.bevel_width; + north_info.y+=(int) north_info.bevel_width; south_info=north_info; - south_info.y=scroll_info.y+scroll_info.height-scroll_info.bevel_width- - south_info.height; + south_info.y=scroll_info.y+(int) scroll_info.height-(int) + scroll_info.bevel_width-(int) south_info.height; id=slider_info.id; slider_info=north_info; slider_info.id=id; slider_info.width-=2; - slider_info.min_y=north_info.y+north_info.height+north_info.bevel_width+ - slider_info.bevel_width+2; - slider_info.height=scroll_info.height-((slider_info.min_y- - scroll_info.y+1) << 1)+4; + slider_info.min_y=north_info.y+(int) north_info.height+(int) + north_info.bevel_width+(int) slider_info.bevel_width+2; + slider_info.height=(unsigned int) ((int) scroll_info.height- + ((slider_info.min_y-scroll_info.y+1) << 1)+4); visible_colors=(unsigned int) (scroll_info.height* PerceptibleReciprocal((double) height+(height >> 3))); if (colors > visible_colors) slider_info.height=(unsigned int) ((visible_colors* slider_info.height)/colors); - slider_info.max_y=south_info.y-south_info.bevel_width- - slider_info.bevel_width-2; - slider_info.x=scroll_info.x+slider_info.bevel_width+1; + slider_info.max_y=south_info.y-(int) south_info.bevel_width- + (int) slider_info.bevel_width-2; + slider_info.x=scroll_info.x+(int) slider_info.bevel_width+1; slider_info.y=slider_info.min_y; expose_info=scroll_info; expose_info.y=slider_info.y; @@ -1879,7 +1883,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, list_info.raised=MagickFalse; list_info.bevel_width--; list_info.width=(unsigned int) - (scroll_info.x-reply_info.x-(QuantumMargin >> 1)); + (scroll_info.x-reply_info.x-(int) (QuantumMargin >> 1)); list_info.height=scroll_info.height; list_info.x=reply_info.x; list_info.y=scroll_info.y; @@ -1893,7 +1897,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, text_info.center=MagickFalse; text_info.width=reply_info.width; text_info.height=height; - text_info.x=list_info.x-(QuantumMargin >> 1); + text_info.x=list_info.x-(int) (QuantumMargin >> 1); text_info.y=QuantumMargin; /* Initialize selection information. @@ -1903,7 +1907,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, selection_info.width=list_info.width; selection_info.height=(unsigned int) ((9*height) >> 3); selection_info.x=list_info.x; - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); } if (state & RedrawWidgetState) { @@ -1911,7 +1915,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, Redraw Color Browser window. */ x=QuantumMargin; - y=text_info.y+((text_info.height-height) >> 1)+font_info->ascent; + y=text_info.y+(int) ((text_info.height-height) >> 1)+font_info->ascent; (void) XDrawString(display,windows->widget.id, windows->widget.annotate_context,x,y,ColorPatternText, Extent(ColorPatternText)); @@ -1925,7 +1929,8 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, XDrawBeveledButton(display,&windows->widget,&slider_info); XDrawTriangleSouth(display,&windows->widget,&south_info); x=QuantumMargin; - y=reply_info.y+((reply_info.height-height) >> 1)+font_info->ascent; + y=reply_info.y+(int) ((reply_info.height-height) >> 1)+ + font_info->ascent; (void) XDrawString(display,windows->widget.id, windows->widget.annotate_context,x,y,ColornameText, Extent(ColornameText)); @@ -1937,7 +1942,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, selection_info.id=(~0); state|=RedrawActionState; state|=RedrawListState; - state&=(~RedrawWidgetState); + state&=(unsigned int) (~RedrawWidgetState); } if (state & UpdateListState) { @@ -1981,13 +1986,13 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, /* Sort color list in ascending order. */ - slider_info.height=scroll_info.height-((slider_info.min_y- - scroll_info.y+1) << 1)+1; + slider_info.height=(unsigned int) ((int) scroll_info.height- + ((slider_info.min_y-scroll_info.y+1) << 1)+1); if (colors > visible_colors) slider_info.height=(unsigned int) ((visible_colors* slider_info.height)/colors); - slider_info.max_y=south_info.y-south_info.bevel_width- - slider_info.bevel_width-2; + slider_info.max_y=south_info.y-(int) south_info.bevel_width- + (int) slider_info.bevel_width-2; slider_info.id=0; slider_info.y=slider_info.min_y; expose_info.y=slider_info.y; @@ -2007,7 +2012,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, XDrawBeveledButton(display,&windows->widget,&slider_info); XDrawTriangleSouth(display,&windows->widget,&south_info); XHighlightWidget(display,&windows->widget,BorderOffset,BorderOffset); - state&=(~UpdateListState); + state&=(unsigned int) (~UpdateListState); } if (state & JumpListState) { @@ -2022,11 +2027,11 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, break; } if ((i < slider_info.id) || - (i >= (int) (slider_info.id+visible_colors))) - slider_info.id=i-(visible_colors >> 1); + (i >= (int) (slider_info.id+(int) visible_colors))) + slider_info.id=i-(int) (visible_colors >> 1); selection_info.id=(~0); state|=RedrawListState; - state&=(~JumpListState); + state&=(unsigned int) (~JumpListState); } if (state & RedrawListState) { @@ -2039,15 +2044,15 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, slider_info.id=0; slider_info.y=slider_info.min_y; if (colors != 0) - slider_info.y+=((ssize_t) slider_info.id*(slider_info.max_y- - slider_info.min_y+1)/colors); + slider_info.y+=(int) slider_info.id*(slider_info.max_y- + slider_info.min_y+1)/(int) colors; if (slider_info.id != selection_info.id) { /* Redraw scroll bar and file names. */ selection_info.id=slider_info.id; - selection_info.y=list_info.y+(height >> 3)+2; + selection_info.y=list_info.y+(int) (height >> 3)+2; for (i=0; i < (int) visible_colors; i++) { selection_info.raised=(slider_info.id+i) != list_info.id ? @@ -2063,14 +2068,14 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, */ if (slider_info.y > expose_info.y) { - expose_info.height=(unsigned int) slider_info.y-expose_info.y; - expose_info.y=slider_info.y-expose_info.height- + expose_info.height=(unsigned int) (slider_info.y-expose_info.y); + expose_info.y=slider_info.y-(int) expose_info.height-(int) slider_info.bevel_width-1; } else { - expose_info.height=(unsigned int) expose_info.y-slider_info.y; - expose_info.y=slider_info.y+slider_info.height+ + expose_info.height=(unsigned int) (expose_info.y-slider_info.y); + expose_info.y=slider_info.y+(int) slider_info.height+(int) slider_info.bevel_width+1; } XDrawTriangleNorth(display,&windows->widget,&north_info); @@ -2079,7 +2084,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, XDrawTriangleSouth(display,&windows->widget,&south_info); expose_info.y=slider_info.y; } - state&=(~RedrawListState); + state&=(unsigned int) (~RedrawListState); } if (state & RedrawActionState) { @@ -2102,7 +2107,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, windows->widget.pixel_info->matte_color.blue); XDrawBeveledButton(display,&windows->widget,&mode_info); windows->widget.pixel_info->matte_color=color; - state&=(~RedrawActionState); + state&=(unsigned int) (~RedrawActionState); } /* Wait for next event. @@ -2178,9 +2183,9 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, Move slider. */ if (event.xbutton.y < slider_info.y) - slider_info.id-=(visible_colors-1); + slider_info.id-=(int) (visible_colors-1); else - slider_info.id+=(visible_colors-1); + slider_info.id+=(int) (visible_colors-1); state|=RedrawListState; break; } @@ -2192,8 +2197,8 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, /* User pressed list matte. */ - id=slider_info.id+(event.xbutton.y-(list_info.y+(height >> 1))+1)/ - selection_info.height; + id=slider_info.id+(event.xbutton.y-(list_info.y+(int) + (height >> 1))+1)/(int) selection_info.height; if (id >= (int) colors) break; (void) CopyMagickString(reply_info.text,colorlist[id], @@ -2279,12 +2284,12 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, /* Move text cursor to position of button press. */ - x=event.xbutton.x-reply_info.x-(QuantumMargin >> 2); + x=event.xbutton.x-reply_info.x-(int) (QuantumMargin >> 2); for (i=1; i <= Extent(reply_info.marker); i++) if (XTextWidth(font_info,reply_info.marker,i) > x) break; reply_info.cursor=reply_info.marker+i-1; - if (event.xbutton.time > (click_time+DoubleClick)) + if (event.xbutton.time > (click_time+(unsigned long) DoubleClick)) reply_info.highlight=MagickFalse; else { @@ -2443,7 +2448,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, { if (event.xcrossing.window != windows->widget.id) break; - state&=(~InactiveWidgetState); + state&=(unsigned int) (~InactiveWidgetState); break; } case Expose: @@ -2502,13 +2507,13 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, case XK_Prior: case XK_KP_Prior: { - slider_info.id-=visible_colors; + slider_info.id-=(int) visible_colors; break; } case XK_Next: case XK_KP_Next: { - slider_info.id+=visible_colors; + slider_info.id+=(int) visible_colors; break; } case XK_End: @@ -2580,7 +2585,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, (void) XLookupString((XKeyEvent *) &event.xkey,command, (int) sizeof(command),&key_symbol,(XComposeStatus *) NULL); if (key_symbol == XK_Control_L) - state&=(~ControlState); + state&=(unsigned int) (~ControlState); break; } case LeaveNotify: @@ -2592,8 +2597,8 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, } case MapNotify: { - mask&=(~CWX); - mask&=(~CWY); + mask&=(unsigned int) (~CWX); + mask&=(unsigned int) (~CWY); break; } case MotionNotify: @@ -2607,7 +2612,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, /* Move slider matte. */ - slider_info.y=event.xmotion.y- + slider_info.y=event.xmotion.y-(int) ((slider_info.height+slider_info.bevel_width) >> 1)+1; if (slider_info.y < slider_info.min_y) slider_info.y=slider_info.min_y; @@ -2615,7 +2620,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, slider_info.y=slider_info.max_y; slider_info.id=0; if (slider_info.y != slider_info.min_y) - slider_info.id=(int) ((colors*(slider_info.y- + slider_info.id=(int) (((int) colors*(slider_info.y- slider_info.min_y+1))/(slider_info.max_y-slider_info.min_y+1)); state|=RedrawListState; break; @@ -2694,7 +2699,7 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, if ((status != Success) || (type != XA_STRING) || (format == 32) || (length == 0)) break; - if ((Extent(reply_info.text)+length) >= (MagickPathExtent-1)) + if ((Extent(reply_info.text)+(int) length) >= (MagickPathExtent-1)) (void) XBell(display,0); else { @@ -2944,7 +2949,7 @@ MagickPrivate int XCommandWidget(Display *display,XWindows *windows, windows->command.width=width; } number_selections=(unsigned int) i; - windows->command.width+=3*QuantumMargin+10; + windows->command.width+=(unsigned int) (3*QuantumMargin+10); if ((int) windows->command.width < (tile_width+QuantumMargin+10)) windows->command.width=(unsigned int) (tile_width+QuantumMargin+10); windows->command.height=(unsigned int) (number_selections* @@ -3009,8 +3014,8 @@ MagickPrivate int XCommandWidget(Display *display,XWindows *windows, } submenu_info=selection_info[i]; submenu_info.active=MagickTrue; - toggle_info.y=submenu_info.y+(submenu_info.height >> 1)- - (toggle_info.height >> 1); + toggle_info.y=submenu_info.y+(int) (submenu_info.height >> 1)- + (int) (toggle_info.height >> 1); id=i; (void) XCheckWindowEvent(display,windows->widget.id,LeaveWindowMask, event); @@ -3107,8 +3112,8 @@ MagickPrivate int XCommandWidget(Display *display,XWindows *windows, submenu_info=selection_info[i]; submenu_info.active=MagickTrue; toggle_info.raised=MagickTrue; - toggle_info.y=submenu_info.y+(submenu_info.height >> 1)- - (toggle_info.height >> 1); + toggle_info.y=submenu_info.y+(int) (submenu_info.height >> 1)- + (int) (toggle_info.height >> 1); XDrawTriangleEast(display,&windows->command,&toggle_info); id=i; } @@ -3149,18 +3154,19 @@ MagickPrivate int XCommandWidget(Display *display,XWindows *windows, selection_info[i].bevel_width--; selection_info[i].height=(unsigned int) ((3*height) >> 1); selection_info[i].x=(QuantumMargin >> 1)+4; - selection_info[i].width=(unsigned int) (windows->command.width- + selection_info[i].width=(unsigned int) ((int) windows->command.width- (selection_info[i].x << 1)); selection_info[i].y=y; - y+=selection_info[i].height+(selection_info[i].bevel_width << 1)+6; + y+=(int) selection_info[i].height+(int) + (selection_info[i].bevel_width << 1)+6; } XGetWidgetInfo((char *) NULL,&toggle_info); toggle_info.bevel_width--; toggle_info.width=(unsigned int) (((5*height) >> 3)- (toggle_info.bevel_width << 1)); toggle_info.height=toggle_info.width; - toggle_info.x=selection_info[0].x+selection_info[0].width- - toggle_info.width-(QuantumMargin >> 1); + toggle_info.x=selection_info[0].x+(int) selection_info[0].width- + (int) toggle_info.width-(int) (QuantumMargin >> 1); if (windows->command.mapped) (void) XClearWindow(display,windows->command.id); } @@ -3187,8 +3193,8 @@ MagickPrivate int XCommandWidget(Display *display,XWindows *windows, if (i >= (int) windows->command.data) continue; toggle_info.raised=MagickFalse; - toggle_info.y=selection_info[i].y+(selection_info[i].height >> 1)- - (toggle_info.height >> 1); + toggle_info.y=selection_info[i].y+(int) (selection_info[i].height >> 1)- + (int) (toggle_info.height >> 1); XDrawTriangleEast(display,&windows->command,&toggle_info); } XHighlightWidget(display,&windows->command,BorderOffset,BorderOffset); @@ -3291,11 +3297,11 @@ MagickPrivate int XConfirmWidget(Display *display,XWindows *windows, /* Position Confirm widget. */ - windows->widget.width=(unsigned int) (width+9*QuantumMargin); - windows->widget.min_width=(unsigned int) (9*QuantumMargin+ + windows->widget.width=(unsigned int) ((int) width+9*QuantumMargin); + windows->widget.min_width=9*(unsigned int) QuantumMargin+ WidgetTextWidth(font_info,CancelButtonText)+ WidgetTextWidth(font_info,DismissButtonText)+ - WidgetTextWidth(font_info,YesButtonText)); + WidgetTextWidth(font_info,YesButtonText); if (windows->widget.width < windows->widget.min_width) windows->widget.width=windows->widget.min_width; windows->widget.height=(unsigned int) (12*height); @@ -3339,8 +3345,8 @@ MagickPrivate int XConfirmWidget(Display *display,XWindows *windows, cancel_info.width=(unsigned int) QuantumMargin+ WidgetTextWidth(font_info,CancelButtonText); cancel_info.height=(unsigned int) ((3*height) >> 1); - cancel_info.x=(int) (windows->widget.width-cancel_info.width- - QuantumMargin); + cancel_info.x=(int) windows->widget.width-(int) cancel_info.width- + QuantumMargin; cancel_info.y=(int) (windows->widget.height-(cancel_info.height << 1)); dismiss_info=cancel_info; dismiss_info.text=(char *) DismissButtonText; @@ -3359,7 +3365,7 @@ MagickPrivate int XConfirmWidget(Display *display,XWindows *windows, if (yes_info.width < cancel_info.width) yes_info.width=cancel_info.width; yes_info.x=QuantumMargin; - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); } if (state & RedrawWidgetState) { @@ -3379,8 +3385,8 @@ MagickPrivate int XConfirmWidget(Display *display,XWindows *windows, (void) CopyMagickString(question,description,MagickPathExtent); (void) ConcatenateMagickString(question,"?",MagickPathExtent); width=WidgetTextWidth(font_info,question); - x=(int) ((windows->widget.width >> 1)-(width >> 1)); - y+=height; + x=((int) (windows->widget.width >> 1)-(int) (width >> 1)); + y+=(int) height; (void) XDrawString(display,windows->widget.id, windows->widget.annotate_context,x,y,question,Extent(question)); } @@ -3388,7 +3394,7 @@ MagickPrivate int XConfirmWidget(Display *display,XWindows *windows, XDrawBeveledButton(display,&windows->widget,&dismiss_info); XDrawBeveledButton(display,&windows->widget,&yes_info); XHighlightWidget(display,&windows->widget,BorderOffset,BorderOffset); - state&=(~RedrawWidgetState); + state&=(unsigned int) (~RedrawWidgetState); } /* Wait for next event. @@ -3509,7 +3515,7 @@ MagickPrivate int XConfirmWidget(Display *display,XWindows *windows, { if (event.xcrossing.window != windows->widget.id) break; - state&=(~InactiveWidgetState); + state&=(unsigned int) (~InactiveWidgetState); break; } case Expose: @@ -3699,7 +3705,7 @@ MagickPrivate int XDialogWidget(Display *display,XWindows *windows, width=WidgetTextWidth(font_info,(char *) action); if (WidgetTextWidth(font_info,CancelButtonText) > width) width=WidgetTextWidth(font_info,CancelButtonText); - width+=(3*QuantumMargin) >> 1; + width+=(unsigned int) (3*QuantumMargin) >> 1; height=(unsigned int) (font_info->ascent+font_info->descent); /* Position Dialog widget. @@ -3708,12 +3714,12 @@ MagickPrivate int XDialogWidget(Display *display,XWindows *windows, WidgetTextWidth(font_info,(char *) query)); if (windows->widget.width < WidgetTextWidth(font_info,reply)) windows->widget.width=WidgetTextWidth(font_info,reply); - windows->widget.width+=6*QuantumMargin; + windows->widget.width+=(unsigned int) (6*QuantumMargin); windows->widget.min_width=(unsigned int) - (width+28*XTextWidth(font_info,"#",1)+4*QuantumMargin); + ((int) width+28*XTextWidth(font_info,"#",1)+4*QuantumMargin); if (windows->widget.width < windows->widget.min_width) windows->widget.width=windows->widget.min_width; - windows->widget.height=(unsigned int) (7*height+(QuantumMargin << 1)); + windows->widget.height=(unsigned int) (7*(int) height+(QuantumMargin << 1)); windows->widget.min_height=windows->widget.height; if (windows->widget.height < windows->widget.min_height) windows->widget.height=windows->widget.min_height; @@ -3758,15 +3764,15 @@ MagickPrivate int XDialogWidget(Display *display,XWindows *windows, XGetWidgetInfo(CancelButtonText,&cancel_info); cancel_info.width=width; cancel_info.height=(unsigned int) ((3*height) >> 1); - cancel_info.x=(int) - (windows->widget.width-cancel_info.width-((3*QuantumMargin) >> 1)); - cancel_info.y=(int) - (windows->widget.height-cancel_info.height-((3*QuantumMargin) >> 1)); + cancel_info.x=(int) windows->widget.width-(int) cancel_info.width- + ((3*QuantumMargin) >> 1); + cancel_info.y=(int) windows->widget.height-(int) cancel_info.height- + ((3*QuantumMargin) >> 1); XGetWidgetInfo(action,&action_info); action_info.width=width; action_info.height=(unsigned int) ((3*height) >> 1); - action_info.x=cancel_info.x-(cancel_info.width+QuantumMargin+ - (action_info.bevel_width << 1)); + action_info.x=cancel_info.x-((int) cancel_info.width+QuantumMargin+ + (int) (action_info.bevel_width << 1)); action_info.y=cancel_info.y; /* Initialize reply information. @@ -3774,10 +3780,11 @@ MagickPrivate int XDialogWidget(Display *display,XWindows *windows, XGetWidgetInfo(reply,&reply_info); reply_info.raised=MagickFalse; reply_info.bevel_width--; - reply_info.width=windows->widget.width-(3*QuantumMargin); + reply_info.width=(unsigned int) ((int) windows->widget.width- + (3*QuantumMargin)); reply_info.height=height << 1; reply_info.x=(3*QuantumMargin) >> 1; - reply_info.y=action_info.y-reply_info.height-QuantumMargin; + reply_info.y=action_info.y-(int) reply_info.height-QuantumMargin; /* Initialize option information. */ @@ -3787,7 +3794,8 @@ MagickPrivate int XDialogWidget(Display *display,XWindows *windows, special_info.width=(unsigned int) QuantumMargin >> 1; special_info.height=(unsigned int) QuantumMargin >> 1; special_info.x=reply_info.x; - special_info.y=action_info.y+action_info.height-special_info.height; + special_info.y=action_info.y+(int) action_info.height-(int) + special_info.height; if (LocaleCompare(action,"Background") == 0) special_info.text=(char *) "Backdrop"; if (LocaleCompare(action,"New") == 0) @@ -3804,10 +3812,10 @@ MagickPrivate int XDialogWidget(Display *display,XWindows *windows, XGetWidgetInfo(query,&text_info); text_info.width=reply_info.width; text_info.height=height; - text_info.x=reply_info.x-(QuantumMargin >> 1); + text_info.x=reply_info.x-(int) (QuantumMargin >> 1); text_info.y=QuantumMargin; text_info.center=MagickFalse; - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); } if (state & RedrawWidgetState) { @@ -3822,7 +3830,7 @@ MagickPrivate int XDialogWidget(Display *display,XWindows *windows, XDrawBeveledButton(display,&windows->widget,&action_info); XDrawBeveledButton(display,&windows->widget,&cancel_info); XHighlightWidget(display,&windows->widget,BorderOffset,BorderOffset); - state&=(~RedrawWidgetState); + state&=(unsigned int) (~RedrawWidgetState); } /* Wait for next event. @@ -3870,12 +3878,12 @@ MagickPrivate int XDialogWidget(Display *display,XWindows *windows, /* Move text cursor to position of button press. */ - x=event.xbutton.x-reply_info.x-(QuantumMargin >> 2); + x=event.xbutton.x-reply_info.x-(int) (QuantumMargin >> 2); for (i=1; i <= Extent(reply_info.marker); i++) if (XTextWidth(font_info,reply_info.marker,i) > x) break; reply_info.cursor=reply_info.marker+i-1; - if (event.xbutton.time > (click_time+DoubleClick)) + if (event.xbutton.time > (click_time+(unsigned long) DoubleClick)) reply_info.highlight=MagickFalse; else { @@ -3969,7 +3977,7 @@ MagickPrivate int XDialogWidget(Display *display,XWindows *windows, { if (event.xcrossing.window != windows->widget.id) break; - state&=(~InactiveWidgetState); + state&=(unsigned int) (~InactiveWidgetState); break; } case Expose: @@ -4050,7 +4058,7 @@ MagickPrivate int XDialogWidget(Display *display,XWindows *windows, (void) XLookupString((XKeyEvent *) &event.xkey,command, (int) sizeof(command),&key_symbol,(XComposeStatus *) NULL); if (key_symbol == XK_Control_L) - state&=(~ControlState); + state&=(unsigned int) (~ControlState); break; } case LeaveNotify: @@ -4122,7 +4130,7 @@ MagickPrivate int XDialogWidget(Display *display,XWindows *windows, if ((status != Success) || (type != XA_STRING) || (format == 32) || (length == 0)) break; - if ((Extent(reply_info.text)+length) >= (MagickPathExtent-1)) + if ((Extent(reply_info.text)+(int) length) >= (MagickPathExtent-1)) (void) XBell(display,0); else { @@ -4332,7 +4340,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, width=WidgetTextWidth(font_info,HomeButtonText); if (WidgetTextWidth(font_info,UpButtonText) > width) width=WidgetTextWidth(font_info,UpButtonText); - width+=QuantumMargin; + width+=(unsigned int) QuantumMargin; if (WidgetTextWidth(font_info,DirectoryText) > width) width=WidgetTextWidth(font_info,DirectoryText); if (WidgetTextWidth(font_info,FilenameText) > width) @@ -4341,15 +4349,15 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, /* Position File Browser widget. */ - windows->widget.width=width+MagickMin((int) text_width,(int) MaxTextWidth)+ - 6*QuantumMargin; - windows->widget.min_width=width+MinTextWidth+4*QuantumMargin; + windows->widget.width=width+MagickMin(text_width,MaxTextWidth)+ + (unsigned int) (6*QuantumMargin); + windows->widget.min_width=width+MinTextWidth+(unsigned int) (4*QuantumMargin); if (windows->widget.width < windows->widget.min_width) windows->widget.width=windows->widget.min_width; windows->widget.height=(unsigned int) - (((81*height) >> 2)+((13*QuantumMargin) >> 1)+4); + (((81*height) >> 2)+(unsigned int) ((13*QuantumMargin) >> 1)+4); windows->widget.min_height=(unsigned int) - (((23*height) >> 1)+((13*QuantumMargin) >> 1)+4); + (((23*height) >> 1)+(unsigned int) ((13*QuantumMargin) >> 1)+4); if (windows->widget.height < windows->widget.min_height) windows->widget.height=windows->widget.min_height; XConstrainWindowPosition(display,&windows->widget); @@ -4398,21 +4406,21 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, XGetWidgetInfo(CancelButtonText,&cancel_info); cancel_info.width=width; cancel_info.height=(unsigned int) ((3*height) >> 1); - cancel_info.x=(int) - (windows->widget.width-cancel_info.width-QuantumMargin-2); - cancel_info.y=(int) - (windows->widget.height-cancel_info.height-QuantumMargin); + cancel_info.x=(int) windows->widget.width-(int) cancel_info.width- + QuantumMargin-2; + cancel_info.y=(int) windows->widget.height-(int) cancel_info.height- + QuantumMargin; XGetWidgetInfo(action,&action_info); action_info.width=width; action_info.height=(unsigned int) ((3*height) >> 1); - action_info.x=cancel_info.x-(cancel_info.width+(QuantumMargin >> 1)+ - (action_info.bevel_width << 1)); + action_info.x=cancel_info.x-((int) cancel_info.width+ + (QuantumMargin >> 1)+(int) (action_info.bevel_width << 1)); action_info.y=cancel_info.y; XGetWidgetInfo(GrabButtonText,&special_info); special_info.width=width; special_info.height=(unsigned int) ((3*height) >> 1); - special_info.x=action_info.x-(action_info.width+(QuantumMargin >> 1)+ - (special_info.bevel_width << 1)); + special_info.x=action_info.x-((int) action_info.width+ + (QuantumMargin >> 1)+(int) (special_info.bevel_width << 1)); special_info.y=action_info.y; if (anomaly == MagickFalse) { @@ -4430,22 +4438,23 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, up_info.width=width; up_info.height=(unsigned int) ((3*height) >> 1); up_info.x=QuantumMargin; - up_info.y=((5*QuantumMargin) >> 1)+height; + up_info.y=(int) ((5*QuantumMargin) >> 1)+(int) height; XGetWidgetInfo(HomeButtonText,&home_info); home_info.width=width; home_info.height=(unsigned int) ((3*height) >> 1); home_info.x=QuantumMargin; - home_info.y=up_info.y+up_info.height+QuantumMargin; + home_info.y=up_info.y+(int) up_info.height+QuantumMargin; /* Initialize reply information. */ XGetWidgetInfo(reply,&reply_info); reply_info.raised=MagickFalse; reply_info.bevel_width--; - reply_info.width=windows->widget.width-width-((6*QuantumMargin) >> 1); + reply_info.width=windows->widget.width-width-(unsigned int) + ((6*QuantumMargin) >> 1); reply_info.height=height << 1; - reply_info.x=(int) (width+(QuantumMargin << 1)); - reply_info.y=action_info.y-reply_info.height-QuantumMargin; + reply_info.x=(int) width+(QuantumMargin << 1); + reply_info.y=action_info.y-(int) reply_info.height-QuantumMargin; /* Initialize scroll information. */ @@ -4453,36 +4462,36 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, scroll_info.bevel_width--; scroll_info.width=height; scroll_info.height=(unsigned int) - (reply_info.y-up_info.y-(QuantumMargin >> 1)); - scroll_info.x=reply_info.x+(reply_info.width-scroll_info.width); - scroll_info.y=up_info.y-reply_info.bevel_width; + (reply_info.y-up_info.y-(int) (QuantumMargin >> 1)); + scroll_info.x=reply_info.x+(int) (reply_info.width-scroll_info.width); + scroll_info.y=up_info.y-(int) reply_info.bevel_width; scroll_info.raised=MagickFalse; scroll_info.trough=MagickTrue; north_info=scroll_info; north_info.raised=MagickTrue; north_info.width-=(north_info.bevel_width << 1); north_info.height=north_info.width-1; - north_info.x+=north_info.bevel_width; - north_info.y+=north_info.bevel_width; + north_info.x+=(int) north_info.bevel_width; + north_info.y+=(int) north_info.bevel_width; south_info=north_info; - south_info.y=scroll_info.y+scroll_info.height-scroll_info.bevel_width- - south_info.height; + south_info.y=scroll_info.y+(int) scroll_info.height-(int) + scroll_info.bevel_width-(int) south_info.height; id=slider_info.id; slider_info=north_info; slider_info.id=id; slider_info.width-=2; - slider_info.min_y=north_info.y+north_info.height+north_info.bevel_width+ - slider_info.bevel_width+2; - slider_info.height=scroll_info.height-((slider_info.min_y- - scroll_info.y+1) << 1)+4; + slider_info.min_y=north_info.y+(int) north_info.height+(int) + north_info.bevel_width+(int) slider_info.bevel_width+2; + slider_info.height=(unsigned int) ((int) scroll_info.height- + ((slider_info.min_y-scroll_info.y+1) << 1)+4); visible_files=(unsigned int) (scroll_info.height* PerceptibleReciprocal((double) height+(height >> 3))); if (files > visible_files) slider_info.height=(unsigned int) ((visible_files*slider_info.height)/files); - slider_info.max_y=south_info.y-south_info.bevel_width- + slider_info.max_y=south_info.y-(int) south_info.bevel_width-(int) slider_info.bevel_width-2; - slider_info.x=scroll_info.x+slider_info.bevel_width+1; + slider_info.x=scroll_info.x+(int) slider_info.bevel_width+1; slider_info.y=slider_info.min_y; expose_info=scroll_info; expose_info.y=slider_info.y; @@ -4493,7 +4502,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, list_info.raised=MagickFalse; list_info.bevel_width--; list_info.width=(unsigned int) - (scroll_info.x-reply_info.x-(QuantumMargin >> 1)); + (scroll_info.x-reply_info.x-(int) (QuantumMargin >> 1)); list_info.height=scroll_info.height; list_info.x=reply_info.x; list_info.y=scroll_info.y; @@ -4507,7 +4516,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, text_info.center=MagickFalse; text_info.width=reply_info.width; text_info.height=height; - text_info.x=list_info.x-(QuantumMargin >> 1); + text_info.x=list_info.x-(int) (QuantumMargin >> 1); text_info.y=QuantumMargin; /* Initialize selection information. @@ -4517,7 +4526,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, selection_info.width=list_info.width; selection_info.height=(unsigned int) ((9*height) >> 3); selection_info.x=list_info.x; - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); } if (state & RedrawWidgetState) { @@ -4525,7 +4534,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, Redraw File Browser window. */ x=QuantumMargin; - y=text_info.y+((text_info.height-height) >> 1)+font_info->ascent; + y=text_info.y+(int) ((text_info.height-height) >> 1)+font_info->ascent; (void) XDrawString(display,windows->widget.id, windows->widget.annotate_context,x,y,DirectoryText, Extent(DirectoryText)); @@ -4543,7 +4552,8 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, XDrawBeveledButton(display,&windows->widget,&slider_info); XDrawTriangleSouth(display,&windows->widget,&south_info); x=QuantumMargin; - y=reply_info.y+((reply_info.height-height) >> 1)+font_info->ascent; + y=reply_info.y+(int) ((reply_info.height-height) >> 1)+ + font_info->ascent; (void) XDrawString(display,windows->widget.id, windows->widget.annotate_context,x,y,FilenameText, Extent(FilenameText)); @@ -4555,7 +4565,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, XHighlightWidget(display,&windows->widget,BorderOffset,BorderOffset); selection_info.id=(~0); state|=RedrawListState; - state&=(~RedrawWidgetState); + state&=(unsigned int) (~RedrawWidgetState); } if (state & UpdateListState) { @@ -4587,13 +4597,13 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, /* Update file list. */ - slider_info.height= - scroll_info.height-((slider_info.min_y-scroll_info.y+1) << 1)+1; + slider_info.height=(unsigned int) ((int) scroll_info.height- + ((slider_info.min_y-scroll_info.y+1) << 1)+1); if (files > visible_files) slider_info.height=(unsigned int) ((visible_files*slider_info.height)/files); - slider_info.max_y=south_info.y-south_info.bevel_width- - slider_info.bevel_width-2; + slider_info.max_y=south_info.y-(int) south_info.bevel_width- + (int) slider_info.bevel_width-2; slider_info.id=0; slider_info.y=slider_info.min_y; expose_info.y=slider_info.y; @@ -4620,7 +4630,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, XDrawBeveledButton(display,&windows->widget,&slider_info); XDrawTriangleSouth(display,&windows->widget,&south_info); XHighlightWidget(display,&windows->widget,BorderOffset,BorderOffset); - state&=(~UpdateListState); + state&=(unsigned int) (~UpdateListState); } if (state & JumpListState) { @@ -4636,11 +4646,11 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, break; } if ((i < (ssize_t) slider_info.id) || - (i >= (ssize_t) (slider_info.id+visible_files))) - slider_info.id=(int) i-(visible_files >> 1); + (i >= (slider_info.id+(ssize_t) visible_files))) + slider_info.id=i-(int) (visible_files >> 1); selection_info.id=(~0); state|=RedrawListState; - state&=(~JumpListState); + state&=(unsigned int) (~JumpListState); } if (state & RedrawListState) { @@ -4653,15 +4663,15 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, slider_info.id=0; slider_info.y=slider_info.min_y; if (files > 0) - slider_info.y+=((ssize_t) slider_info.id*(slider_info.max_y- - slider_info.min_y+1)/files); + slider_info.y+=((int) slider_info.id*(slider_info.max_y- + slider_info.min_y+1)/(int) files); if (slider_info.id != selection_info.id) { /* Redraw scroll bar and file names. */ selection_info.id=slider_info.id; - selection_info.y=list_info.y+(height >> 3)+2; + selection_info.y=list_info.y+(int) (height >> 3)+2; for (i=0; i < (ssize_t) visible_files; i++) { selection_info.raised=(int) (slider_info.id+i) != list_info.id ? @@ -4677,14 +4687,14 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, */ if (slider_info.y > expose_info.y) { - expose_info.height=(unsigned int) slider_info.y-expose_info.y; - expose_info.y=slider_info.y-expose_info.height- + expose_info.height=(unsigned int) (slider_info.y-expose_info.y); + expose_info.y=slider_info.y-(int) expose_info.height-(int) slider_info.bevel_width-1; } else { - expose_info.height=(unsigned int) expose_info.y-slider_info.y; - expose_info.y=slider_info.y+slider_info.height+ + expose_info.height=(unsigned int) (expose_info.y-slider_info.y); + expose_info.y=slider_info.y+(int) slider_info.height+(int) slider_info.bevel_width+1; } XDrawTriangleNorth(display,&windows->widget,&north_info); @@ -4693,7 +4703,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, XDrawTriangleSouth(display,&windows->widget,&south_info); expose_info.y=slider_info.y; } - state&=(~RedrawListState); + state&=(unsigned int) (~RedrawListState); } /* Wait for next event. @@ -4769,9 +4779,9 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, Move slider. */ if (event.xbutton.y < slider_info.y) - slider_info.id-=(visible_files-1); + slider_info.id-=(int) (visible_files-1); else - slider_info.id+=(visible_files-1); + slider_info.id+=(int) (visible_files-1); state|=RedrawListState; break; } @@ -4783,8 +4793,8 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, /* User pressed file matte. */ - id=slider_info.id+(event.xbutton.y-(list_info.y+(height >> 1))+1)/ - selection_info.height; + id=slider_info.id+(event.xbutton.y-(list_info.y+(int) + (height >> 1))+1)/(int) selection_info.height; if (id >= (int) files) break; (void) CopyMagickString(reply_info.text,filelist[id],MagickPathExtent); @@ -4867,12 +4877,12 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, /* Move text cursor to position of button press. */ - x=event.xbutton.x-reply_info.x-(QuantumMargin >> 2); + x=event.xbutton.x-reply_info.x-(int) (QuantumMargin >> 2); for (i=1; i <= (ssize_t) Extent(reply_info.marker); i++) if (XTextWidth(font_info,reply_info.marker,(int) i) > x) break; reply_info.cursor=reply_info.marker+i-1; - if (event.xbutton.time > (click_time+DoubleClick)) + if (event.xbutton.time > (click_time+(unsigned long) DoubleClick)) reply_info.highlight=MagickFalse; else { @@ -5077,7 +5087,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, { if (event.xcrossing.window != windows->widget.id) break; - state&=(~InactiveWidgetState); + state&=(unsigned int) (~InactiveWidgetState); break; } case Expose: @@ -5136,13 +5146,13 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, case XK_Prior: case XK_KP_Prior: { - slider_info.id-=visible_files; + slider_info.id-=(int) visible_files; break; } case XK_Next: case XK_KP_Next: { - slider_info.id+=visible_files; + slider_info.id+=(int) visible_files; break; } case XK_End: @@ -5222,7 +5232,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, (void) XLookupString((XKeyEvent *) &event.xkey,command, (int) sizeof(command),&key_symbol,(XComposeStatus *) NULL); if (key_symbol == XK_Control_L) - state&=(~ControlState); + state&=(unsigned int) (~ControlState); break; } case LeaveNotify: @@ -5234,8 +5244,8 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, } case MapNotify: { - mask&=(~CWX); - mask&=(~CWY); + mask&=(unsigned int) (~CWX); + mask&=(unsigned int) (~CWY); break; } case MotionNotify: @@ -5249,7 +5259,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, /* Move slider matte. */ - slider_info.y=event.xmotion.y- + slider_info.y=event.xmotion.y-(int) ((slider_info.height+slider_info.bevel_width) >> 1)+1; if (slider_info.y < slider_info.min_y) slider_info.y=slider_info.min_y; @@ -5257,8 +5267,8 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, slider_info.y=slider_info.max_y; slider_info.id=0; if (slider_info.y != slider_info.min_y) - slider_info.id=(int) ((files*(slider_info.y-slider_info.min_y+1))/ - (slider_info.max_y-slider_info.min_y+1)); + slider_info.id=((int) files*(slider_info.y-slider_info.min_y+1))/ + (slider_info.max_y-slider_info.min_y+1); state|=RedrawListState; break; } @@ -5345,7 +5355,7 @@ MagickPrivate void XFileBrowserWidget(Display *display,XWindows *windows, if ((status != Success) || (type != XA_STRING) || (format == 32) || (length == 0)) break; - if ((Extent(reply_info.text)+length) >= (MagickPathExtent-1)) + if ((Extent(reply_info.text)+(int) length) >= (MagickPathExtent-1)) (void) XBell(display,0); else { @@ -5606,7 +5616,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, width=WidgetTextWidth(font_info,ResetButtonText); if (WidgetTextWidth(font_info,BackButtonText) > width) width=WidgetTextWidth(font_info,BackButtonText); - width+=QuantumMargin; + width+=(unsigned int) QuantumMargin; if (WidgetTextWidth(font_info,FontPatternText) > width) width=WidgetTextWidth(font_info,FontPatternText); if (WidgetTextWidth(font_info,FontnameText) > width) @@ -5615,15 +5625,15 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, /* Position Font Browser widget. */ - windows->widget.width=width+MagickMin((int) text_width,(int) MaxTextWidth)+ - 6*QuantumMargin; - windows->widget.min_width=width+MinTextWidth+4*QuantumMargin; + windows->widget.width=width+MagickMin(text_width,MaxTextWidth)+(unsigned int) + (6*QuantumMargin); + windows->widget.min_width=width+MinTextWidth+(unsigned int) (4*QuantumMargin); if (windows->widget.width < windows->widget.min_width) windows->widget.width=windows->widget.min_width; windows->widget.height=(unsigned int) - (((85*height) >> 2)+((13*QuantumMargin) >> 1)+4); + (((85*(int) height) >> 2)+((13*QuantumMargin) >> 1)+4); windows->widget.min_height=(unsigned int) - (((27*height) >> 1)+((13*QuantumMargin) >> 1)+4); + (((27*(int) height) >> 1)+((13*QuantumMargin) >> 1)+4); if (windows->widget.height < windows->widget.min_height) windows->widget.height=windows->widget.min_height; XConstrainWindowPosition(display,&windows->widget); @@ -5671,36 +5681,38 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, XGetWidgetInfo(CancelButtonText,&cancel_info); cancel_info.width=width; cancel_info.height=(unsigned int) ((3*height) >> 1); - cancel_info.x=(int) - (windows->widget.width-cancel_info.width-QuantumMargin-2); - cancel_info.y=(int) - (windows->widget.height-cancel_info.height-QuantumMargin); + cancel_info.x=(int) windows->widget.width-(int) cancel_info.width- + QuantumMargin-2; + cancel_info.y=(int) windows->widget.height-(int) cancel_info.height- + QuantumMargin; XGetWidgetInfo(action,&action_info); action_info.width=width; action_info.height=(unsigned int) ((3*height) >> 1); - action_info.x=cancel_info.x-(cancel_info.width+(QuantumMargin >> 1)+ - (action_info.bevel_width << 1)); + action_info.x=cancel_info.x-(int) cancel_info.width+ + (QuantumMargin >> 1)+(int) (action_info.bevel_width << 1); action_info.y=cancel_info.y; XGetWidgetInfo(BackButtonText,&back_info); back_info.width=width; back_info.height=(unsigned int) ((3*height) >> 1); back_info.x=QuantumMargin; - back_info.y=((5*QuantumMargin) >> 1)+height; + back_info.y=((5*QuantumMargin) >> 1)+(int) height; XGetWidgetInfo(ResetButtonText,&reset_info); reset_info.width=width; reset_info.height=(unsigned int) ((3*height) >> 1); reset_info.x=QuantumMargin; - reset_info.y=back_info.y+back_info.height+QuantumMargin; + reset_info.y=back_info.y+(int) back_info.height+QuantumMargin; /* Initialize reply information. */ XGetWidgetInfo(reply,&reply_info); reply_info.raised=MagickFalse; reply_info.bevel_width--; - reply_info.width=windows->widget.width-width-((6*QuantumMargin) >> 1); + reply_info.width=(unsigned int) ((int) windows->widget.width-(int) + width-((6*QuantumMargin) >> 1)); reply_info.height=height << 1; - reply_info.x=(int) (width+(QuantumMargin << 1)); - reply_info.y=action_info.y-(action_info.height << 1)-QuantumMargin; + reply_info.x=(int) width+(QuantumMargin << 1); + reply_info.y=action_info.y-(int) (action_info.height << 1)- + QuantumMargin; /* Initialize mode information. */ @@ -5710,7 +5722,8 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, (action_info.x-reply_info.x-QuantumMargin); mode_info.height=action_info.height << 1; mode_info.x=reply_info.x; - mode_info.y=action_info.y-action_info.height+action_info.bevel_width; + mode_info.y=action_info.y-(int) action_info.height+(int) + action_info.bevel_width; /* Initialize scroll information. */ @@ -5718,35 +5731,36 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, scroll_info.bevel_width--; scroll_info.width=height; scroll_info.height=(unsigned int) - (reply_info.y-back_info.y-(QuantumMargin >> 1)); - scroll_info.x=reply_info.x+(reply_info.width-scroll_info.width); - scroll_info.y=back_info.y-reply_info.bevel_width; + (reply_info.y-back_info.y-(int) (QuantumMargin >> 1)); + scroll_info.x=reply_info.x+(int) (reply_info.width-scroll_info.width); + scroll_info.y=back_info.y-(int) reply_info.bevel_width; scroll_info.raised=MagickFalse; scroll_info.trough=MagickTrue; north_info=scroll_info; north_info.raised=MagickTrue; north_info.width-=(north_info.bevel_width << 1); north_info.height=north_info.width-1; - north_info.x+=north_info.bevel_width; - north_info.y+=north_info.bevel_width; + north_info.x+=(int) north_info.bevel_width; + north_info.y+=(int) north_info.bevel_width; south_info=north_info; - south_info.y=scroll_info.y+scroll_info.height-scroll_info.bevel_width- - south_info.height; + south_info.y=scroll_info.y+(int) scroll_info.height-(int) + scroll_info.bevel_width-(int) south_info.height; id=slider_info.id; slider_info=north_info; slider_info.id=id; slider_info.width-=2; - slider_info.min_y=north_info.y+north_info.height+north_info.bevel_width+ - slider_info.bevel_width+2; - slider_info.height=scroll_info.height-((slider_info.min_y- - scroll_info.y+1) << 1)+4; + slider_info.min_y=north_info.y+(int) north_info.height+(int) + north_info.bevel_width+(int) slider_info.bevel_width+2; + slider_info.height=(unsigned int) ((int) scroll_info.height- + ((slider_info.min_y-scroll_info.y+1) << 1)+4); visible_fonts=(unsigned int) (scroll_info.height* PerceptibleReciprocal((double) height+(height >> 3))); if (fonts > (int) visible_fonts) - slider_info.height=(visible_fonts*slider_info.height)/fonts; - slider_info.max_y=south_info.y-south_info.bevel_width- - slider_info.bevel_width-2; - slider_info.x=scroll_info.x+slider_info.bevel_width+1; + slider_info.height=(visible_fonts*slider_info.height)/(unsigned int) + fonts; + slider_info.max_y=south_info.y-(int) south_info.bevel_width- + (int) slider_info.bevel_width-2; + slider_info.x=scroll_info.x+(int) slider_info.bevel_width+1; slider_info.y=slider_info.min_y; expose_info=scroll_info; expose_info.y=slider_info.y; @@ -5756,8 +5770,8 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, XGetWidgetInfo((char *) NULL,&list_info); list_info.raised=MagickFalse; list_info.bevel_width--; - list_info.width=(unsigned int) - (scroll_info.x-reply_info.x-(QuantumMargin >> 1)); + list_info.width=(unsigned int) (scroll_info.x-reply_info.x- + (QuantumMargin >> 1)); list_info.height=scroll_info.height; list_info.x=reply_info.x; list_info.y=scroll_info.y; @@ -5781,7 +5795,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, selection_info.width=list_info.width; selection_info.height=(unsigned int) ((9*height) >> 3); selection_info.x=list_info.x; - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); } if (state & RedrawWidgetState) { @@ -5789,7 +5803,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, Redraw Font Browser window. */ x=QuantumMargin; - y=text_info.y+((text_info.height-height) >> 1)+font_info->ascent; + y=text_info.y+(int) ((text_info.height-height) >> 1)+font_info->ascent; (void) XDrawString(display,windows->widget.id, windows->widget.annotate_context,x,y,FontPatternText, Extent(FontPatternText)); @@ -5803,7 +5817,8 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, XDrawBeveledButton(display,&windows->widget,&slider_info); XDrawTriangleSouth(display,&windows->widget,&south_info); x=QuantumMargin; - y=reply_info.y+((reply_info.height-height) >> 1)+font_info->ascent; + y=reply_info.y+(int) ((reply_info.height-height) >> 1)+ + font_info->ascent; (void) XDrawString(display,windows->widget.id, windows->widget.annotate_context,x,y,FontnameText, Extent(FontnameText)); @@ -5815,7 +5830,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, selection_info.id=(~0); state|=RedrawActionState; state|=RedrawListState; - state&=(~RedrawWidgetState); + state&=(unsigned int) (~RedrawWidgetState); } if (state & UpdateListState) { @@ -5881,11 +5896,12 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, for (i=0; i < fonts; i++) fontlist[i]=listhead[i]; qsort((void *) fontlist,(size_t) fonts,sizeof(*fontlist),FontCompare); - slider_info.height= - scroll_info.height-((slider_info.min_y-scroll_info.y+1) << 1)+1; + slider_info.height=(unsigned int) ((int) scroll_info.height- + ((slider_info.min_y-scroll_info.y+1) << 1)+1); if (fonts > (int) visible_fonts) - slider_info.height=(visible_fonts*slider_info.height)/fonts; - slider_info.max_y=south_info.y-south_info.bevel_width- + slider_info.height=(visible_fonts*slider_info.height)/(unsigned int) + fonts; + slider_info.max_y=south_info.y-(int) south_info.bevel_width-(int) slider_info.bevel_width-2; slider_info.id=0; slider_info.y=slider_info.min_y; @@ -5906,7 +5922,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, XDrawBeveledButton(display,&windows->widget,&slider_info); XDrawTriangleSouth(display,&windows->widget,&south_info); XHighlightWidget(display,&windows->widget,BorderOffset,BorderOffset); - state&=(~UpdateListState); + state&=(unsigned int) (~UpdateListState); } if (state & JumpListState) { @@ -5920,19 +5936,19 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, list_info.id=LocaleCompare(fontlist[i],reply) == 0 ? i : ~0; break; } - if ((i < slider_info.id) || (i >= (int) (slider_info.id+visible_fonts))) - slider_info.id=i-(visible_fonts >> 1); + if ((i < slider_info.id) || (i >= (slider_info.id+(int) visible_fonts))) + slider_info.id=i-((int) visible_fonts >> 1); selection_info.id=(~0); state|=RedrawListState; - state&=(~JumpListState); + state&=(unsigned int) (~JumpListState); } if (state & RedrawListState) { /* Determine slider id and position. */ - if (slider_info.id >= (int) (fonts-visible_fonts)) - slider_info.id=fonts-visible_fonts; + if (slider_info.id >= (fonts-(int) visible_fonts)) + slider_info.id=fonts-(int) visible_fonts; if ((slider_info.id < 0) || (fonts <= (int) visible_fonts)) slider_info.id=0; slider_info.y=slider_info.min_y; @@ -5945,7 +5961,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, Redraw scroll bar and file names. */ selection_info.id=slider_info.id; - selection_info.y=list_info.y+(height >> 3)+2; + selection_info.y=list_info.y+(int) (height >> 3)+2; for (i=0; i < (int) visible_fonts; i++) { selection_info.raised=(slider_info.id+i) != list_info.id ? @@ -5961,14 +5977,14 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, */ if (slider_info.y > expose_info.y) { - expose_info.height=(unsigned int) slider_info.y-expose_info.y; - expose_info.y=slider_info.y-expose_info.height- + expose_info.height=(unsigned int) (slider_info.y-expose_info.y); + expose_info.y=slider_info.y-(int) expose_info.height-(int) slider_info.bevel_width-1; } else { - expose_info.height=(unsigned int) expose_info.y-slider_info.y; - expose_info.y=slider_info.y+slider_info.height+ + expose_info.height=(unsigned int) (expose_info.y-slider_info.y); + expose_info.y=slider_info.y+(int) slider_info.height+(int) slider_info.bevel_width+1; } XDrawTriangleNorth(display,&windows->widget,&north_info); @@ -5977,7 +5993,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, XDrawTriangleSouth(display,&windows->widget,&south_info); expose_info.y=slider_info.y; } - state&=(~RedrawListState); + state&=(unsigned int) (~RedrawListState); } if (state & RedrawActionState) { @@ -6005,7 +6021,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, } XHighlightWidget(display,&windows->widget,BorderOffset,BorderOffset); XDrawMatteText(display,&windows->widget,&reply_info); - state&=(~RedrawActionState); + state&=(unsigned int) (~RedrawActionState); } /* Wait for next event. @@ -6081,9 +6097,9 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, Move slider. */ if (event.xbutton.y < slider_info.y) - slider_info.id-=(visible_fonts-1); + slider_info.id-=((int) visible_fonts-1); else - slider_info.id+=(visible_fonts-1); + slider_info.id+=((int) visible_fonts-1); state|=RedrawListState; break; } @@ -6095,8 +6111,8 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, /* User pressed list matte. */ - id=slider_info.id+(event.xbutton.y-(list_info.y+(height >> 1))+1)/ - selection_info.height; + id=slider_info.id+(event.xbutton.y-(list_info.y+(int) + (height >> 1))+1)/(int) selection_info.height; if (id >= (int) fonts) break; (void) CopyMagickString(reply_info.text,fontlist[id],MagickPathExtent); @@ -6162,12 +6178,12 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, /* Move text cursor to position of button press. */ - x=event.xbutton.x-reply_info.x-(QuantumMargin >> 2); + x=event.xbutton.x-reply_info.x-(int) (QuantumMargin >> 2); for (i=1; i <= Extent(reply_info.marker); i++) if (XTextWidth(font_info,reply_info.marker,i) > x) break; reply_info.cursor=reply_info.marker+i-1; - if (event.xbutton.time > (click_time+DoubleClick)) + if (event.xbutton.time > (click_time+(unsigned long) DoubleClick)) reply_info.highlight=MagickFalse; else { @@ -6318,7 +6334,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, { if (event.xcrossing.window != windows->widget.id) break; - state&=(~InactiveWidgetState); + state&=(unsigned int) (~InactiveWidgetState); break; } case Expose: @@ -6377,13 +6393,13 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, case XK_Prior: case XK_KP_Prior: { - slider_info.id-=visible_fonts; + slider_info.id-=(int) visible_fonts; break; } case XK_Next: case XK_KP_Next: { - slider_info.id+=visible_fonts; + slider_info.id+=(int) visible_fonts; break; } case XK_End: @@ -6452,7 +6468,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, (void) XLookupString((XKeyEvent *) &event.xkey,command, (int) sizeof(command),&key_symbol,(XComposeStatus *) NULL); if (key_symbol == XK_Control_L) - state&=(~ControlState); + state&=(unsigned int) (~ControlState); break; } case LeaveNotify: @@ -6464,8 +6480,8 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, } case MapNotify: { - mask&=(~CWX); - mask&=(~CWY); + mask&=(unsigned int) (~CWX); + mask&=(unsigned int) (~CWY); break; } case MotionNotify: @@ -6479,7 +6495,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, /* Move slider matte. */ - slider_info.y=event.xmotion.y- + slider_info.y=event.xmotion.y-(int) ((slider_info.height+slider_info.bevel_width) >> 1)+1; if (slider_info.y < slider_info.min_y) slider_info.y=slider_info.min_y; @@ -6566,7 +6582,7 @@ MagickPrivate void XFontBrowserWidget(Display *display,XWindows *windows, if ((status != Success) || (type != XA_STRING) || (format == 32) || (length == 0)) break; - if ((Extent(reply_info.text)+length) >= (MagickPathExtent-1)) + if ((Extent(reply_info.text)+(int) length) >= (MagickPathExtent-1)) (void) XBell(display,0); else { @@ -6678,7 +6694,8 @@ MagickPrivate void XInfoWidget(Display *display,XWindows *windows, assert(windows != (XWindows *) NULL); assert(activity != (char *) NULL); font_info=windows->info.font_info; - width=WidgetTextWidth(font_info,(char *) activity)+((3*QuantumMargin) >> 1)+4; + width=WidgetTextWidth(font_info,(char *) activity)+(unsigned int) + ((3*QuantumMargin) >> 1)+4; height=(unsigned int) (((6*(font_info->ascent+font_info->descent)) >> 2)+4); if ((windows->info.width != width) || (windows->info.height != height)) { @@ -6847,20 +6864,20 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, width=WidgetTextWidth(font_info,(char *) action); if (WidgetTextWidth(font_info,CancelButtonText) > width) width=WidgetTextWidth(font_info,CancelButtonText); - width+=QuantumMargin; + width+=(unsigned int) QuantumMargin; height=(unsigned int) (font_info->ascent+font_info->descent); /* Position List Browser widget. */ - window_info->width=(unsigned int) MagickMin((int) text_width,(int) - MaxTextWidth)+((9*QuantumMargin) >> 1); - window_info->min_width=(unsigned int) (MinTextWidth+4*QuantumMargin); + window_info->width=MagickMin(text_width,MaxTextWidth)+(unsigned int) + ((9*QuantumMargin) >> 1); + window_info->min_width=(MinTextWidth+4*(unsigned int) QuantumMargin); if (window_info->width < window_info->min_width) window_info->width=window_info->min_width; - window_info->height=(unsigned int) - (((81*height) >> 2)+((13*QuantumMargin) >> 1)+4); - window_info->min_height=(unsigned int) - (((23*height) >> 1)+((13*QuantumMargin) >> 1)+4); + window_info->height=(((81*height) >> 2)+(unsigned int) + ((13*QuantumMargin) >> 1)+4); + window_info->min_height=(((23*height) >> 1)+(unsigned int) + ((13*QuantumMargin) >> 1)+4); if (window_info->height < window_info->min_height) window_info->height=window_info->min_height; XConstrainWindowPosition(display,window_info); @@ -6907,15 +6924,15 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, XGetWidgetInfo(CancelButtonText,&cancel_info); cancel_info.width=width; cancel_info.height=(unsigned int) ((3*height) >> 1); - cancel_info.x=(int) - (window_info->width-cancel_info.width-QuantumMargin-2); - cancel_info.y=(int) - (window_info->height-cancel_info.height-QuantumMargin); + cancel_info.x=(int) window_info->width-(int) cancel_info.width- + QuantumMargin-2; + cancel_info.y=(int) window_info->height-(int) cancel_info.height- + QuantumMargin; XGetWidgetInfo(action,&action_info); action_info.width=width; action_info.height=(unsigned int) ((3*height) >> 1); - action_info.x=cancel_info.x-(cancel_info.width+(QuantumMargin >> 1)+ - (action_info.bevel_width << 1)); + action_info.x=cancel_info.x-((int) cancel_info.width+ + (QuantumMargin >> 1)+(int) (action_info.bevel_width << 1)); action_info.y=cancel_info.y; /* Initialize reply information. @@ -6923,10 +6940,11 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, XGetWidgetInfo(reply,&reply_info); reply_info.raised=MagickFalse; reply_info.bevel_width--; - reply_info.width=window_info->width-((4*QuantumMargin) >> 1); + reply_info.width=(unsigned int) ((int) window_info->width- + (((4*QuantumMargin) >> 1))); reply_info.height=height << 1; reply_info.x=QuantumMargin; - reply_info.y=action_info.y-reply_info.height-QuantumMargin; + reply_info.y=action_info.y-(int) reply_info.height-QuantumMargin; /* Initialize scroll information. */ @@ -6934,35 +6952,36 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, scroll_info.bevel_width--; scroll_info.width=height; scroll_info.height=(unsigned int) - (reply_info.y-((6*QuantumMargin) >> 1)-height); - scroll_info.x=reply_info.x+(reply_info.width-scroll_info.width); - scroll_info.y=((5*QuantumMargin) >> 1)+height-reply_info.bevel_width; + (reply_info.y-((6*QuantumMargin) >> 1)-(int) height); + scroll_info.x=reply_info.x+(int) (reply_info.width-scroll_info.width); + scroll_info.y=((5*QuantumMargin) >> 1)+(int) height-(int) + reply_info.bevel_width; scroll_info.raised=MagickFalse; scroll_info.trough=MagickTrue; north_info=scroll_info; north_info.raised=MagickTrue; north_info.width-=(north_info.bevel_width << 1); north_info.height=north_info.width-1; - north_info.x+=north_info.bevel_width; - north_info.y+=north_info.bevel_width; + north_info.x+=(int) north_info.bevel_width; + north_info.y+=(int) north_info.bevel_width; south_info=north_info; - south_info.y=scroll_info.y+scroll_info.height-scroll_info.bevel_width- - south_info.height; + south_info.y=scroll_info.y+(int) scroll_info.height-(int) + scroll_info.bevel_width-(int) south_info.height; id=slider_info.id; slider_info=north_info; slider_info.id=id; slider_info.width-=2; - slider_info.min_y=north_info.y+north_info.height+north_info.bevel_width+ - slider_info.bevel_width+2; - slider_info.height=scroll_info.height-((slider_info.min_y- - scroll_info.y+1) << 1)+4; + slider_info.min_y=north_info.y+(int) north_info.height+(int) + north_info.bevel_width+(int) slider_info.bevel_width+2; + slider_info.height=(unsigned int) ((int) scroll_info.height- + ((slider_info.min_y-scroll_info.y+1) << 1)+4); visible_entries=(unsigned int) (scroll_info.height* PerceptibleReciprocal((double) height+(height >> 3))); if (entries > visible_entries) slider_info.height=(visible_entries*slider_info.height)/entries; - slider_info.max_y=south_info.y-south_info.bevel_width- + slider_info.max_y=south_info.y-(int) south_info.bevel_width-(int) slider_info.bevel_width-2; - slider_info.x=scroll_info.x+slider_info.bevel_width+1; + slider_info.x=scroll_info.x+(int) slider_info.bevel_width+1; slider_info.y=slider_info.min_y; expose_info=scroll_info; expose_info.y=slider_info.y; @@ -6973,7 +6992,7 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, list_info.raised=MagickFalse; list_info.bevel_width--; list_info.width=(unsigned int) - (scroll_info.x-reply_info.x-(QuantumMargin >> 1)); + (scroll_info.x-reply_info.x-(int) (QuantumMargin >> 1)); list_info.height=scroll_info.height; list_info.x=reply_info.x; list_info.y=scroll_info.y; @@ -6982,7 +7001,7 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, if (LocaleCompare(list[i],reply) == 0) { list_info.id=i; - slider_info.id=i-(visible_entries >> 1); + slider_info.id=i-(int) (visible_entries >> 1); if (slider_info.id < 0) slider_info.id=0; } @@ -6992,7 +7011,7 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, XGetWidgetInfo(query,&text_info); text_info.width=reply_info.width; text_info.height=height; - text_info.x=list_info.x-(QuantumMargin >> 1); + text_info.x=list_info.x-(int) (QuantumMargin >> 1); text_info.y=QuantumMargin; /* Initialize selection information. @@ -7002,7 +7021,7 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, selection_info.width=list_info.width; selection_info.height=(unsigned int) ((9*height) >> 3); selection_info.x=list_info.x; - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); } if (state & RedrawWidgetState) { @@ -7023,7 +7042,7 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, selection_info.id=(~0); state|=RedrawActionState; state|=RedrawListState; - state&=(~RedrawWidgetState); + state&=(unsigned int) (~RedrawWidgetState); } if (state & RedrawListState) { @@ -7036,15 +7055,15 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, slider_info.id=0; slider_info.y=slider_info.min_y; if (entries > 0) - slider_info.y+= - slider_info.id*(slider_info.max_y-slider_info.min_y+1)/entries; + slider_info.y+=slider_info.id*(slider_info.max_y- + slider_info.min_y+1)/(int) entries; if (slider_info.id != selection_info.id) { /* Redraw scroll bar and file names. */ selection_info.id=slider_info.id; - selection_info.y=list_info.y+(height >> 3)+2; + selection_info.y=list_info.y+(int) (height >> 3)+2; for (i=0; i < (int) visible_entries; i++) { selection_info.raised=(slider_info.id+i) != list_info.id ? @@ -7060,14 +7079,14 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, */ if (slider_info.y > expose_info.y) { - expose_info.height=(unsigned int) slider_info.y-expose_info.y; - expose_info.y=slider_info.y-expose_info.height- + expose_info.height=(unsigned int) (slider_info.y-expose_info.y); + expose_info.y=slider_info.y-(int) expose_info.height-(int) slider_info.bevel_width-1; } else { - expose_info.height=(unsigned int) expose_info.y-slider_info.y; - expose_info.y=slider_info.y+slider_info.height+ + expose_info.height=(unsigned int) (expose_info.y-slider_info.y); + expose_info.y=slider_info.y+(int) slider_info.height+(int) slider_info.bevel_width+1; } XDrawTriangleNorth(display,window_info,&north_info); @@ -7076,7 +7095,7 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, XDrawTriangleSouth(display,window_info,&south_info); expose_info.y=slider_info.y; } - state&=(~RedrawListState); + state&=(unsigned int) (~RedrawListState); } /* Wait for next event. @@ -7152,9 +7171,9 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, Move slider. */ if (event.xbutton.y < slider_info.y) - slider_info.id-=(visible_entries-1); + slider_info.id-=(int) (visible_entries-1); else - slider_info.id+=(visible_entries-1); + slider_info.id+=(int) (visible_entries-1); state|=RedrawListState; break; } @@ -7166,8 +7185,8 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, /* User pressed list matte. */ - id=slider_info.id+(event.xbutton.y-(list_info.y+(height >> 1))+1)/ - selection_info.height; + id=slider_info.id+(event.xbutton.y-(list_info.y+(int) + (height >> 1))+1)/(int) selection_info.height; if (id >= (int) entries) break; (void) CopyMagickString(reply_info.text,list[id],MagickPathExtent); @@ -7214,12 +7233,12 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, /* Move text cursor to position of button press. */ - x=event.xbutton.x-reply_info.x-(QuantumMargin >> 2); + x=event.xbutton.x-reply_info.x-(int) (QuantumMargin >> 2); for (i=1; i <= Extent(reply_info.marker); i++) if (XTextWidth(font_info,reply_info.marker,i) > x) break; reply_info.cursor=reply_info.marker+i-1; - if (event.xbutton.time > (click_time+DoubleClick)) + if (event.xbutton.time > (click_time+(unsigned long) DoubleClick)) reply_info.highlight=MagickFalse; else { @@ -7348,7 +7367,7 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, { if (event.xcrossing.window != window_info->id) break; - state&=(~InactiveWidgetState); + state&=(unsigned int) (~InactiveWidgetState); break; } case Expose: @@ -7407,13 +7426,13 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, case XK_Prior: case XK_KP_Prior: { - slider_info.id-=visible_entries; + slider_info.id-=(int) visible_entries; break; } case XK_Next: case XK_KP_Next: { - slider_info.id+=visible_entries; + slider_info.id+=(int) visible_entries; break; } case XK_End: @@ -7481,7 +7500,7 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, (void) XLookupString((XKeyEvent *) &event.xkey,command, (int) sizeof(command),&key_symbol,(XComposeStatus *) NULL); if (key_symbol == XK_Control_L) - state&=(~ControlState); + state&=(unsigned int) (~ControlState); break; } case LeaveNotify: @@ -7493,8 +7512,8 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, } case MapNotify: { - mask&=(~CWX); - mask&=(~CWY); + mask&=(unsigned int) (~CWX); + mask&=(unsigned int) (~CWY); break; } case MotionNotify: @@ -7508,7 +7527,7 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, /* Move slider matte. */ - slider_info.y=event.xmotion.y- + slider_info.y=event.xmotion.y-(int) ((slider_info.height+slider_info.bevel_width) >> 1)+1; if (slider_info.y < slider_info.min_y) slider_info.y=slider_info.min_y; @@ -7516,8 +7535,8 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, slider_info.y=slider_info.max_y; slider_info.id=0; if (slider_info.y != slider_info.min_y) - slider_info.id=(int) ((entries*(slider_info.y- - slider_info.min_y+1))/(slider_info.max_y-slider_info.min_y+1)); + slider_info.id=((int) entries*(slider_info.y- + slider_info.min_y+1))/(slider_info.max_y-slider_info.min_y+1); state|=RedrawListState; break; } @@ -7577,7 +7596,7 @@ MagickPrivate void XListBrowserWidget(Display *display,XWindows *windows, if ((status != Success) || (type != XA_STRING) || (format == 32) || (length == 0)) break; - if ((Extent(reply_info.text)+length) >= (MagickPathExtent-1)) + if ((Extent(reply_info.text)+(int) length) >= (MagickPathExtent-1)) (void) XBell(display,0); else { @@ -7737,17 +7756,18 @@ MagickPrivate int XMenuWidget(Display *display,XWindows *windows, /* Position Menu widget. */ - windows->widget.width+=QuantumMargin+(menu_info.bevel_width << 1); + windows->widget.width+=(unsigned int) QuantumMargin+ + (menu_info.bevel_width << 1); top_offset=title_height+menu_info.bevel_width-1; windows->widget.height=top_offset+number_selections*height+4; windows->widget.min_width=windows->widget.width; windows->widget.min_height=windows->widget.height; XQueryPosition(display,windows->widget.root,&x,&y); - windows->widget.x=x-(QuantumMargin >> 1); + windows->widget.x=x-(int) (QuantumMargin >> 1); if (submenu_info.active != 0) { - windows->widget.x= - windows->command.x+windows->command.width-QuantumMargin; + windows->widget.x=windows->command.x+(int) windows->command.width- + QuantumMargin; toggle_info.raised=MagickTrue; XDrawTriangleEast(display,&windows->command,&toggle_info); } @@ -7801,8 +7821,8 @@ MagickPrivate int XMenuWidget(Display *display,XWindows *windows, highlight_info.bevel_width--; highlight_info.width-=(highlight_info.bevel_width << 1); highlight_info.height-=(highlight_info.bevel_width << 1); - highlight_info.x+=highlight_info.bevel_width; - state&=(~UpdateConfigurationState); + highlight_info.x+=(int) highlight_info.bevel_width; + state&=(unsigned int) (~UpdateConfigurationState); } if (state & RedrawWidgetState) { @@ -7837,20 +7857,21 @@ MagickPrivate int XMenuWidget(Display *display,XWindows *windows, { selection_info.text=(char *) selections[id]; XDrawWidgetText(display,&windows->widget,&selection_info); - highlight_info.y=selection_info.y+highlight_info.bevel_width; + highlight_info.y=selection_info.y+(int) highlight_info.bevel_width; if (id == selection_info.id) XDrawBevel(display,&windows->widget,&highlight_info); selection_info.y+=(int) selection_info.height; } XDrawBevel(display,&windows->widget,&menu_info); - state&=(~RedrawWidgetState); + state&=(unsigned int) (~RedrawWidgetState); } if (number_selections > 2) { /* Redraw Menu line. */ - y=(int) (top_offset+selection_info.height*(number_selections-1)); + y=((int) top_offset+(int) selection_info.height*(int) + (number_selections-1)); XSetBevelColor(display,&windows->widget,MagickFalse); (void) XDrawLine(display,windows->widget.id, windows->widget.widget_context,selection_info.x,y-1, @@ -7881,20 +7902,20 @@ MagickPrivate int XMenuWidget(Display *display,XWindows *windows, state|=ExitState; break; } - state&=(~InactiveWidgetState); + state&=(unsigned int) (~InactiveWidgetState); if (selection_info.height == 0) break; - id=(event.xbutton.y-top_offset)/(int) selection_info.height; + id=(event.xbutton.y-(int) top_offset)/(int) selection_info.height; selection_info.id=id; if ((id < 0) || (id >= (int) number_selections)) break; /* Highlight this selection. */ - selection_info.y=(int) (top_offset+id*selection_info.height); + selection_info.y=((int) top_offset+id*(int) selection_info.height); selection_info.text=(char *) selections[id]; XDrawWidgetText(display,&windows->widget,&selection_info); - highlight_info.y=selection_info.y+highlight_info.bevel_width; + highlight_info.y=selection_info.y+(int) highlight_info.bevel_width; XDrawBevel(display,&windows->widget,&highlight_info); break; } @@ -7936,10 +7957,10 @@ MagickPrivate int XMenuWidget(Display *display,XWindows *windows, break; if (event.xcrossing.state == 0) break; - state&=(~InactiveWidgetState); + state&=(unsigned int) (~InactiveWidgetState); if (selection_info.height == 0) break; - id=((event.xcrossing.y-top_offset)/(int) selection_info.height); + id=((event.xcrossing.y-(int) top_offset)/(int) selection_info.height); if ((selection_info.id >= 0) && (selection_info.id < (int) number_selections)) { @@ -7948,8 +7969,8 @@ MagickPrivate int XMenuWidget(Display *display,XWindows *windows, */ if (id == selection_info.id) break; - selection_info.y=(int) - (top_offset+selection_info.id*selection_info.height); + selection_info.y=((int) top_offset+selection_info.id*(int) + selection_info.height); selection_info.text=(char *) selections[selection_info.id]; XDrawWidgetText(display,&windows->widget,&selection_info); } @@ -7959,11 +7980,11 @@ MagickPrivate int XMenuWidget(Display *display,XWindows *windows, Highlight this selection. */ selection_info.id=id; - selection_info.y=(int) - (top_offset+selection_info.id*selection_info.height); + selection_info.y=((int) top_offset+selection_info.id*(int) + selection_info.height); selection_info.text=(char *) selections[selection_info.id]; XDrawWidgetText(display,&windows->widget,&selection_info); - highlight_info.y=selection_info.y+highlight_info.bevel_width; + highlight_info.y=selection_info.y+(int) highlight_info.bevel_width; XDrawBevel(display,&windows->widget,&highlight_info); break; } @@ -7987,7 +8008,7 @@ MagickPrivate int XMenuWidget(Display *display,XWindows *windows, /* Unhighlight last selection. */ - selection_info.y=(int) (top_offset+id*selection_info.height); + selection_info.y=((int) top_offset+id*(int) selection_info.height); selection_info.id=(~0); selection_info.text=(char *) selections[id]; XDrawWidgetText(display,&windows->widget,&selection_info); @@ -8027,7 +8048,7 @@ MagickPrivate int XMenuWidget(Display *display,XWindows *windows, break; if (selection_info.height == 0) break; - id=(event.xmotion.y-top_offset)/(int) selection_info.height; + id=(event.xmotion.y-(int) top_offset)/(int) selection_info.height; if ((selection_info.id >= 0) && (selection_info.id < (int) number_selections)) { @@ -8036,8 +8057,8 @@ MagickPrivate int XMenuWidget(Display *display,XWindows *windows, */ if (id == selection_info.id) break; - selection_info.y=(int) - (top_offset+selection_info.id*selection_info.height); + selection_info.y=((int) top_offset+selection_info.id*(int) + selection_info.height); selection_info.text=(char *) selections[selection_info.id]; XDrawWidgetText(display,&windows->widget,&selection_info); } @@ -8047,10 +8068,10 @@ MagickPrivate int XMenuWidget(Display *display,XWindows *windows, /* Highlight this selection. */ - selection_info.y=(int) (top_offset+id*selection_info.height); + selection_info.y=((int) top_offset+id*(int) selection_info.height); selection_info.text=(char *) selections[id]; XDrawWidgetText(display,&windows->widget,&selection_info); - highlight_info.y=selection_info.y+highlight_info.bevel_width; + highlight_info.y=selection_info.y+(int) highlight_info.bevel_width; XDrawBevel(display,&windows->widget,&highlight_info); break; } @@ -8177,8 +8198,8 @@ MagickPrivate void XNoticeWidget(Display *display,XWindows *windows, /* Position Notice widget. */ - windows->widget.width=width+4*QuantumMargin; - windows->widget.min_width=width+QuantumMargin; + windows->widget.width=width+(unsigned int) (4*QuantumMargin); + windows->widget.min_width=width+(unsigned int) QuantumMargin; if (windows->widget.width < windows->widget.min_width) windows->widget.width=windows->widget.min_width; windows->widget.height=(unsigned int) (12*height); @@ -8228,7 +8249,7 @@ MagickPrivate void XNoticeWidget(Display *display,XWindows *windows, ((windows->widget.width >> 1)-(dismiss_info.width >> 1)); dismiss_info.y=(int) (windows->widget.height-(dismiss_info.height << 1)); - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); } if (state & RedrawWidgetState) { @@ -8244,14 +8265,14 @@ MagickPrivate void XNoticeWidget(Display *display,XWindows *windows, { width=WidgetTextWidth(font_info,(char *) description); x=(int) ((windows->widget.width >> 1)-(width >> 1)); - y+=height; + y+=(int) height; (void) XDrawString(display,windows->widget.id, windows->widget.annotate_context,x,y,(char *) description, Extent(description)); } XDrawBeveledButton(display,&windows->widget,&dismiss_info); XHighlightWidget(display,&windows->widget,BorderOffset,BorderOffset); - state&=(~RedrawWidgetState); + state&=(unsigned int) (~RedrawWidgetState); } /* Wait for next event. @@ -8336,7 +8357,7 @@ MagickPrivate void XNoticeWidget(Display *display,XWindows *windows, { if (event.xcrossing.window != windows->widget.id) break; - state&=(~InactiveWidgetState); + state&=(unsigned int) (~InactiveWidgetState); break; } case Expose: @@ -8522,13 +8543,13 @@ MagickPrivate MagickBooleanType XPreferencesWidget(Display *display, */ windows->widget.width=(unsigned int) (MagickMax((int) (width << 1), (int) text_width)+6*QuantumMargin); - windows->widget.min_width=(width << 1)+QuantumMargin; + windows->widget.min_width=(width << 1)+(unsigned int) QuantumMargin; if (windows->widget.width < windows->widget.min_width) windows->widget.width=windows->widget.min_width; - windows->widget.height=(unsigned int) - (7*height+NumberPreferences*(height+(QuantumMargin >> 1))); - windows->widget.min_height=(unsigned int) - (7*height+NumberPreferences*(height+(QuantumMargin >> 1))); + windows->widget.height=(unsigned int) (7*(int) height+NumberPreferences* + ((int) height+(QuantumMargin >> 1))); + windows->widget.min_height=(unsigned int) (7*(int) height+NumberPreferences* + ((int) height+(QuantumMargin >> 1))); if (windows->widget.height < windows->widget.min_height) windows->widget.height=windows->widget.min_height; XConstrainWindowPosition(display,&windows->widget); @@ -8566,10 +8587,10 @@ MagickPrivate MagickBooleanType XPreferencesWidget(Display *display, XGetWidgetInfo(CancelButtonText,&cancel_info); cancel_info.width=width; cancel_info.height=(unsigned int) (3*height) >> 1; - cancel_info.x=(int) windows->widget.width-cancel_info.width- + cancel_info.x=(int) windows->widget.width-(int) cancel_info.width- (QuantumMargin << 1); - cancel_info.y=(int) windows->widget.height- - cancel_info.height-QuantumMargin; + cancel_info.y=(int) windows->widget.height-(int) cancel_info.height- + QuantumMargin; XGetWidgetInfo(ApplyButtonText,&apply_info); apply_info.width=width; apply_info.height=(unsigned int) (3*height) >> 1; @@ -8584,7 +8605,7 @@ MagickPrivate MagickBooleanType XPreferencesWidget(Display *display, preferences_info[i].height=(unsigned int) QuantumMargin >> 1; preferences_info[i].x=QuantumMargin << 1; preferences_info[i].y=y; - y+=height+(QuantumMargin >> 1); + y+=(int) height+(QuantumMargin >> 1); } preferences_info[0].raised=resource_info->backdrop == MagickFalse ? MagickTrue : MagickFalse; @@ -8611,7 +8632,7 @@ MagickPrivate MagickBooleanType XPreferencesWidget(Display *display, cache_info.height=(unsigned int) QuantumMargin >> 1; cache_info.x=QuantumMargin << 1; cache_info.y=y; - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); } if (state & RedrawWidgetState) { @@ -8624,7 +8645,7 @@ MagickPrivate MagickBooleanType XPreferencesWidget(Display *display, XDrawBeveledButton(display,&windows->widget,&preferences_info[i]); XDrawTriangleEast(display,&windows->widget,&cache_info); XHighlightWidget(display,&windows->widget,BorderOffset,BorderOffset); - state&=(~RedrawWidgetState); + state&=(unsigned int) (~RedrawWidgetState); } /* Wait for next event. @@ -8668,9 +8689,9 @@ MagickPrivate MagickBooleanType XPreferencesWidget(Display *display, /* User pressed Cache button. */ - x=cache_info.x+cache_info.width+cache_info.bevel_width+ + x=cache_info.x+(int) cache_info.width+(int) cache_info.bevel_width+ (QuantumMargin >> 1); - y=cache_info.y+((cache_info.height-height) >> 1); + y=cache_info.y+(int) ((cache_info.height-height) >> 1); width=WidgetTextWidth(font_info,cache); (void) XClearArea(display,windows->widget.id,x,y,width,height, False); @@ -8756,7 +8777,7 @@ MagickPrivate MagickBooleanType XPreferencesWidget(Display *display, { if (event.xcrossing.window != windows->widget.id) break; - state&=(~InactiveWidgetState); + state&=(unsigned int) (~InactiveWidgetState); break; } case Expose: @@ -8930,8 +8951,8 @@ MagickPrivate void XProgressMonitorWidget(Display *display,XWindows *windows, */ if ((windows->info.mapped == MagickFalse) || (task != monitor_info.text)) XInfoWidget(display,windows,task); - width=(unsigned int) (((offset+1)*(windows->info.width- - (2*monitor_info.x)))/span); + width=(unsigned int) (((offset+1)*((int) windows->info.width- + (2*monitor_info.x)))/(int) span); if (width < monitor_info.width) { monitor_info.raised=MagickTrue; @@ -9064,19 +9085,19 @@ MagickPrivate void XTextViewWidget(Display *display, MagickMin(Extent(textlist[i]),160)); lines=(unsigned int) i; width=WidgetTextWidth(font_info,DismissButtonText); - width+=QuantumMargin; + width+=(unsigned int) QuantumMargin; height=(unsigned int) (text_info->ascent+text_info->descent); /* Position Text View widget. */ windows->widget.width=(unsigned int) (MagickMin((int) text_width, (int) MaxTextWidth)+5*QuantumMargin); - windows->widget.min_width=(unsigned int) (MinTextWidth+4*QuantumMargin); + windows->widget.min_width=(unsigned int) ((int) MinTextWidth+4*QuantumMargin); if (windows->widget.width < windows->widget.min_width) windows->widget.width=windows->widget.min_width; windows->widget.height=(unsigned int) (MagickMin(MagickMax((int) lines,3),32)* - height+((13*height) >> 1)+((9*QuantumMargin) >> 1)); - windows->widget.min_height=(unsigned int) (3*height+((13*height) >> 1)+((9* + (int) height+(int) ((13*height) >> 1)+((9*QuantumMargin) >> 1)); + windows->widget.min_height=(3*height+((13*height) >> 1)+(unsigned int) ((9* QuantumMargin) >> 1)); if (windows->widget.height < windows->widget.min_height) windows->widget.height=windows->widget.min_height; @@ -9125,9 +9146,9 @@ MagickPrivate void XTextViewWidget(Display *display, XGetWidgetInfo(DismissButtonText,&dismiss_info); dismiss_info.width=width; dismiss_info.height=(unsigned int) ((3*height) >> 1); - dismiss_info.x=(int) windows->widget.width-dismiss_info.width- + dismiss_info.x=(int) windows->widget.width-(int) dismiss_info.width- QuantumMargin-2; - dismiss_info.y=(int) windows->widget.height-dismiss_info.height- + dismiss_info.y=(int) windows->widget.height-(int) dismiss_info.height- QuantumMargin; /* Initialize scroll information. @@ -9137,7 +9158,7 @@ MagickPrivate void XTextViewWidget(Display *display, scroll_info.width=height; scroll_info.height=(unsigned int) (dismiss_info.y-((5*QuantumMargin) >> 1)); - scroll_info.x=(int) windows->widget.width-QuantumMargin- + scroll_info.x=(int) windows->widget.width-QuantumMargin-(int) scroll_info.width; scroll_info.y=(3*QuantumMargin) >> 1; scroll_info.raised=MagickFalse; @@ -9146,28 +9167,28 @@ MagickPrivate void XTextViewWidget(Display *display, north_info.raised=MagickTrue; north_info.width-=(north_info.bevel_width << 1); north_info.height=north_info.width-1; - north_info.x+=north_info.bevel_width; - north_info.y+=north_info.bevel_width; + north_info.x+=(int) north_info.bevel_width; + north_info.y+=(int) north_info.bevel_width; south_info=north_info; - south_info.y=scroll_info.y+scroll_info.height-scroll_info.bevel_width- - south_info.height; + south_info.y=scroll_info.y+(int) scroll_info.height-(int) + scroll_info.bevel_width-(int) south_info.height; id=slider_info.id; slider_info=north_info; slider_info.id=id; slider_info.width-=2; - slider_info.min_y=north_info.y+north_info.height+north_info.bevel_width+ - slider_info.bevel_width+2; - slider_info.height=scroll_info.height-((slider_info.min_y- - scroll_info.y+1) << 1)+4; + slider_info.min_y=north_info.y+(int) north_info.height+(int) + north_info.bevel_width+(int) slider_info.bevel_width+2; + slider_info.height=(unsigned int) ((int) scroll_info.height- + ((slider_info.min_y-scroll_info.y+1) << 1)+4); visible_lines=(unsigned int) (scroll_info.height*PerceptibleReciprocal( (double) text_info->ascent+text_info->descent+((text_info->ascent+ text_info->descent) >> 3))); if (lines > visible_lines) slider_info.height=(unsigned int) (visible_lines*slider_info.height)/ lines; - slider_info.max_y=south_info.y-south_info.bevel_width- + slider_info.max_y=south_info.y-(int) south_info.bevel_width-(int) slider_info.bevel_width-2; - slider_info.x=scroll_info.x+slider_info.bevel_width+1; + slider_info.x=scroll_info.x+(int) slider_info.bevel_width+1; slider_info.y=slider_info.min_y; expose_info=scroll_info; expose_info.y=slider_info.y; @@ -9177,7 +9198,7 @@ MagickPrivate void XTextViewWidget(Display *display, XGetWidgetInfo((char *) NULL,&list_info); list_info.raised=MagickFalse; list_info.bevel_width--; - list_info.width=(unsigned int) scroll_info.x-((3*QuantumMargin) >> 1); + list_info.width=(unsigned int) (scroll_info.x-((3*QuantumMargin) >> 1)); list_info.height=scroll_info.height; list_info.x=QuantumMargin; list_info.y=scroll_info.y; @@ -9190,7 +9211,7 @@ MagickPrivate void XTextViewWidget(Display *display, selection_info.height=(unsigned int) (9*(text_info->ascent+text_info->descent)) >> 3; selection_info.x=list_info.x; - state&=(~UpdateConfigurationState); + state&=(unsigned int) (~UpdateConfigurationState); } if (state & RedrawWidgetState) { @@ -9206,7 +9227,7 @@ MagickPrivate void XTextViewWidget(Display *display, XHighlightWidget(display,&windows->widget,BorderOffset,BorderOffset); selection_info.id=(~0); state|=RedrawListState; - state&=(~RedrawWidgetState); + state&=(unsigned int) (~RedrawWidgetState); } if (state & RedrawListState) { @@ -9214,13 +9235,13 @@ MagickPrivate void XTextViewWidget(Display *display, Determine slider id and position. */ if (slider_info.id >= (int) (lines-visible_lines)) - slider_info.id=(int) lines-visible_lines; + slider_info.id=(int) (lines-visible_lines); if ((slider_info.id < 0) || (lines <= visible_lines)) slider_info.id=0; slider_info.y=slider_info.min_y; if (lines != 0) - slider_info.y+= - slider_info.id*(slider_info.max_y-slider_info.min_y+1)/lines; + slider_info.y+=slider_info.id*(slider_info.max_y- + slider_info.min_y+1)/(int) lines; if (slider_info.id != selection_info.id) { /* @@ -9232,7 +9253,7 @@ MagickPrivate void XTextViewWidget(Display *display, (void) XSetFont(display,windows->widget.highlight_context, text_info->fid); selection_info.id=slider_info.id; - selection_info.y=list_info.y+(height >> 3)+2; + selection_info.y=list_info.y+(int) (height >> 3)+2; for (i=0; i < (int) visible_lines; i++) { selection_info.raised= @@ -9253,14 +9274,14 @@ MagickPrivate void XTextViewWidget(Display *display, */ if (slider_info.y > expose_info.y) { - expose_info.height=(unsigned int) slider_info.y-expose_info.y; - expose_info.y=slider_info.y-expose_info.height- + expose_info.height=(unsigned int) (slider_info.y-expose_info.y); + expose_info.y=slider_info.y-(int) expose_info.height-(int) slider_info.bevel_width-1; } else { - expose_info.height=(unsigned int) expose_info.y-slider_info.y; - expose_info.y=slider_info.y+slider_info.height+ + expose_info.height=(unsigned int) (expose_info.y-slider_info.y); + expose_info.y=slider_info.y+(int) slider_info.height+(int) slider_info.bevel_width+1; } XDrawTriangleNorth(display,&windows->widget,&north_info); @@ -9269,7 +9290,7 @@ MagickPrivate void XTextViewWidget(Display *display, XDrawTriangleSouth(display,&windows->widget,&south_info); expose_info.y=slider_info.y; } - state&=(~RedrawListState); + state&=(unsigned int) (~RedrawListState); } /* Wait for next event. @@ -9345,9 +9366,9 @@ MagickPrivate void XTextViewWidget(Display *display, Move slider. */ if (event.xbutton.y < slider_info.y) - slider_info.id-=(visible_lines-1); + slider_info.id-=(int) (visible_lines-1); else - slider_info.id+=(visible_lines-1); + slider_info.id+=(int) (visible_lines-1); state|=RedrawListState; break; } @@ -9371,8 +9392,8 @@ MagickPrivate void XTextViewWidget(Display *display, /* User pressed list matte. */ - id=slider_info.id+(event.xbutton.y-(list_info.y+(height >> 1))+1)/ - selection_info.height; + id=slider_info.id+(event.xbutton.y-(list_info.y+(int) + (height >> 1))+1)/(int) selection_info.height; if (id >= (int) lines) break; if (id != list_info.id) @@ -9382,7 +9403,7 @@ MagickPrivate void XTextViewWidget(Display *display, break; } list_info.id=id; - if (event.xbutton.time >= (click_time+DoubleClick)) + if (event.xbutton.time >= (click_time+(unsigned long) DoubleClick)) { click_time=event.xbutton.time; break; @@ -9487,7 +9508,7 @@ MagickPrivate void XTextViewWidget(Display *display, { if (event.xcrossing.window != windows->widget.id) break; - state&=(~InactiveWidgetState); + state&=(unsigned int) (~InactiveWidgetState); break; } case Expose: @@ -9553,13 +9574,13 @@ MagickPrivate void XTextViewWidget(Display *display, case XK_Prior: case XK_KP_Prior: { - slider_info.id-=visible_lines; + slider_info.id-=(int) visible_lines; break; } case XK_Next: case XK_KP_Next: { - slider_info.id+=visible_lines; + slider_info.id+=(int) visible_lines; break; } case XK_End: @@ -9585,8 +9606,8 @@ MagickPrivate void XTextViewWidget(Display *display, } case MapNotify: { - mask&=(~CWX); - mask&=(~CWY); + mask&=(unsigned int) (~CWX); + mask&=(unsigned int) (~CWY); break; } case MotionNotify: @@ -9600,7 +9621,7 @@ MagickPrivate void XTextViewWidget(Display *display, /* Move slider matte. */ - slider_info.y=event.xmotion.y- + slider_info.y=event.xmotion.y-(int) ((slider_info.height+slider_info.bevel_width) >> 1)+1; if (slider_info.y < slider_info.min_y) slider_info.y=slider_info.min_y; @@ -9608,7 +9629,7 @@ MagickPrivate void XTextViewWidget(Display *display, slider_info.y=slider_info.max_y; slider_info.id=0; if (slider_info.y != slider_info.min_y) - slider_info.id=(int) (lines*(slider_info.y-slider_info.min_y+1))/ + slider_info.id=((int) lines*(slider_info.y-slider_info.min_y+1))/ (slider_info.max_y-slider_info.min_y+1); state|=RedrawListState; break; diff --git a/ImageMagick-7.1.1-15/MagickCore/widget.h b/ImageMagick-7.1.1-16/MagickCore/widget.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/widget.h rename to ImageMagick-7.1.1-16/MagickCore/widget.h diff --git a/ImageMagick-7.1.1-15/MagickCore/xml-tree-private.h b/ImageMagick-7.1.1-16/MagickCore/xml-tree-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/xml-tree-private.h rename to ImageMagick-7.1.1-16/MagickCore/xml-tree-private.h diff --git a/ImageMagick-7.1.1-15/MagickCore/xml-tree.c b/ImageMagick-7.1.1-16/MagickCore/xml-tree.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/xml-tree.c rename to ImageMagick-7.1.1-16/MagickCore/xml-tree.c index ed0fb8f5..02e314f1 100644 --- a/ImageMagick-7.1.1-15/MagickCore/xml-tree.c +++ b/ImageMagick-7.1.1-16/MagickCore/xml-tree.c @@ -570,7 +570,7 @@ MagickPrivate char *FileToXML(const char *filename,const size_t extent) if ((fstat(file,&file_stats) == 0) && (file_stats.st_size > 0)) quantum=(size_t) MagickMin(file_stats.st_size,MagickMaxBufferExtent); xml=(char *) AcquireQuantumMemory(quantum,sizeof(*xml)); - for (i=0; xml != (char *) NULL; i+=count) + for (i=0; xml != (char *) NULL; i+=(size_t) count) { count=read(file,xml+i,quantum); if (count <= 0) @@ -585,7 +585,7 @@ MagickPrivate char *FileToXML(const char *filename,const size_t extent) break; } xml=(char *) ResizeQuantumMemory(xml,i+quantum+1,sizeof(*xml)); - if ((size_t) (i+count) >= extent) + if ((i+(size_t) count) >= extent) break; } if (LocaleCompare(filename,"-") != 0) @@ -597,7 +597,7 @@ MagickPrivate char *FileToXML(const char *filename,const size_t extent) xml=(char *) RelinquishMagickMemory(xml); return((char *) NULL); } - length=(size_t) MagickMin(i+count,extent); + length=MagickMin(i+(size_t) count,extent); xml[length]='\0'; return(xml); } @@ -619,9 +619,10 @@ MagickPrivate char *FileToXML(const char *filename,const size_t extent) else { (void) lseek(file,0,SEEK_SET); - for (i=0; i < length; i+=count) + for (i=0; i < length; i+=(size_t) count) { - count=read(file,xml+i,(size_t) MagickMin(length-i,(size_t) MAGICK_SSIZE_MAX)); + count=read(file,xml+i,(size_t) MagickMin(length-i,(size_t) + MAGICK_SSIZE_MAX)); if (count <= 0) { count=0; @@ -1282,7 +1283,7 @@ static char *ConvertUTF16ToUTF8(const char *content,size_t *length) while (bits != 0) { bits--; - utf8[j]=0x80 | ((c >> (6*bits)) & 0x3f); + utf8[j]=(char) (0x80 | ((c >> (6*bits)) & 0x3f)); j++; } } @@ -1407,7 +1408,7 @@ static char *ParseEntities(char *xml,char **entities,int state) ((length-1L) >= (size_t) (entity-xml))) { offset=(ssize_t) (xml-p); - extent=(size_t) (offset+length+strlen(entity)); + extent=((size_t) offset+length+strlen(entity)); if (p != q) { p=(char *) ResizeQuantumMemory(p,extent+1,sizeof(*p)); @@ -2571,7 +2572,7 @@ static char *EncodePredefinedEntities(const char *source,ssize_t offset, if (*destination == (char *) NULL) return(*destination); } - *length+=FormatLocaleString(*destination+(*length),*extent,"%s", + *length+=(size_t) FormatLocaleString(*destination+(*length),*extent,"%s", canonical_content); canonical_content=DestroyString(canonical_content); return(*destination); @@ -2608,7 +2609,8 @@ static char *XMLTreeTagToXML(XMLTreeInfo *xml_info,char **source,size_t *length, if (*source == (char *) NULL) return(*source); } - *length+=FormatLocaleString(*source+(*length),*extent,"<%s",xml_info->tag); + *length+=(size_t) FormatLocaleString(*source+(*length),*extent, + "<%s",xml_info->tag); for (i=0; xml_info->attributes[i]; i+=2) { attribute=GetXMLTreeAttribute(xml_info,xml_info->attributes[i]); @@ -2621,11 +2623,11 @@ static char *XMLTreeTagToXML(XMLTreeInfo *xml_info,char **source,size_t *length, if (*source == (char *) NULL) return((char *) NULL); } - *length+=FormatLocaleString(*source+(*length),*extent," %s=\"", + *length+=(size_t) FormatLocaleString(*source+(*length),*extent," %s=\"", xml_info->attributes[i]); (void) EncodePredefinedEntities(xml_info->attributes[i+1],-1,source,length, extent,MagickTrue); - *length+=FormatLocaleString(*source+(*length),*extent,"\""); + *length+=(size_t) FormatLocaleString(*source+(*length),*extent,"\""); } i=0; while ((attributes[i] != (char **) NULL) && @@ -2648,15 +2650,15 @@ static char *XMLTreeTagToXML(XMLTreeInfo *xml_info,char **source,size_t *length, if (*source == (char *) NULL) return((char *) NULL); } - *length+=FormatLocaleString(*source+(*length),*extent," %s=\"", + *length+=(size_t) FormatLocaleString(*source+(*length),*extent," %s=\"", attributes[i][j]); (void) EncodePredefinedEntities(attributes[i][j+1],-1,source,length,extent, MagickTrue); - *length+=FormatLocaleString(*source+(*length),*extent,"\""); + *length+=(size_t) FormatLocaleString(*source+(*length),*extent,"\""); j+=3; } - *length+=FormatLocaleString(*source+(*length),*extent,*xml_info->content ? - ">" : "/>"); + *length+=(size_t) FormatLocaleString(*source+(*length),*extent, + *xml_info->content ? ">" : "/>"); if (xml_info->child != (XMLTreeInfo *) NULL) *source=XMLTreeTagToXML(xml_info->child,source,length,extent,0,attributes); else @@ -2670,7 +2672,7 @@ static char *XMLTreeTagToXML(XMLTreeInfo *xml_info,char **source,size_t *length, return((char *) NULL); } if (*xml_info->content != '\0') - *length+=FormatLocaleString(*source+(*length),*extent,"", + *length+=(size_t) FormatLocaleString(*source+(*length),*extent,"", xml_info->tag); while ((offset < xml_info->offset) && (content[offset] != '\0')) offset++; @@ -2747,7 +2749,7 @@ MagickExport char *XMLTreeInfoToXML(XMLTreeInfo *xml_info) if (xml == (char *) NULL) return(xml); } - length+=FormatLocaleString(xml+length,extent,"\n",q, + length+=(size_t) FormatLocaleString(xml+length,extent,"\n",q, *p != '\0' ? " " : "",p); p=root->processing_instructions[i][j]; } @@ -2781,7 +2783,7 @@ MagickExport char *XMLTreeInfoToXML(XMLTreeInfo *xml_info) if (xml == (char *) NULL) return(xml); } - length+=FormatLocaleString(xml+length,extent,"\n",q, + length+=(size_t) FormatLocaleString(xml+length,extent,"\n",q, *p != '\0' ? " " : "",p); p=root->processing_instructions[i][j]; } diff --git a/ImageMagick-7.1.1-15/MagickCore/xml-tree.h b/ImageMagick-7.1.1-16/MagickCore/xml-tree.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/xml-tree.h rename to ImageMagick-7.1.1-16/MagickCore/xml-tree.h diff --git a/ImageMagick-7.1.1-15/MagickCore/xwindow-private.h b/ImageMagick-7.1.1-16/MagickCore/xwindow-private.h similarity index 97% rename from ImageMagick-7.1.1-15/MagickCore/xwindow-private.h rename to ImageMagick-7.1.1-16/MagickCore/xwindow-private.h index f656c749..029de91a 100644 --- a/ImageMagick-7.1.1-15/MagickCore/xwindow-private.h +++ b/ImageMagick-7.1.1-16/MagickCore/xwindow-private.h @@ -145,17 +145,17 @@ typedef struct _XDrawInfo typedef enum { - DefaultState = 0x0000, - EscapeState = 0x0001, - ExitState = 0x0002, - FormerImageState = 0x0004, - ModifierState = 0x0008, - MontageImageState = 0x0010, - NextImageState = 0x0020, - RetainColorsState = 0x0040, - SuspendTime = 50, - UpdateConfigurationState = 0x0080, - UpdateRegionState = 0x0100 + DefaultState = 0x0000U, + EscapeState = 0x0001U, + ExitState = 0x0002U, + FormerImageState = 0x0004U, + ModifierState = 0x0008U, + MontageImageState = 0x0010U, + NextImageState = 0x0020U, + RetainColorsState = 0x0040U, + SuspendTime = 50U, + UpdateConfigurationState = 0x0080U, + UpdateRegionState = 0x0100U } XState; typedef struct _XAnnotateInfo diff --git a/ImageMagick-7.1.1-15/MagickCore/xwindow.c b/ImageMagick-7.1.1-16/MagickCore/xwindow.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickCore/xwindow.c rename to ImageMagick-7.1.1-16/MagickCore/xwindow.c index 951c3137..f589f605 100644 --- a/ImageMagick-7.1.1-15/MagickCore/xwindow.c +++ b/ImageMagick-7.1.1-16/MagickCore/xwindow.c @@ -111,8 +111,8 @@ X defines. */ #define XBlueGamma(color) ClampToQuantum(blue_gamma == 1.0 ? (double) \ - (color) : ((pow(((double) QuantumScale*(color)),1.0* \ - PerceptibleReciprocal((double) blue_gamma))*QuantumRange))) + (color) : ((pow((QuantumScale*(double) (color)),1.0* \ + PerceptibleReciprocal((double) blue_gamma))*(double) QuantumRange))) #define XGammaPacket(map,color) (size_t) (map->base_pixel+ \ ((ScaleQuantumToShort(XRedGamma((color)->red))*map->red_max/65535L)* \ map->red_mult)+ \ @@ -128,11 +128,11 @@ ((ScaleQuantumToShort(XBlueGamma(GetPixelBlue(image,color)))*map->blue_max/65535L)* \ map->blue_mult)) #define XGreenGamma(color) ClampToQuantum(green_gamma == 1.0 ? (double) \ - (color) : ((pow(((double) QuantumScale*(color)),1.0* \ - PerceptibleReciprocal((double) green_gamma))*QuantumRange))) + (color) : ((pow((QuantumScale*(double) (color)),1.0* \ + PerceptibleReciprocal((double) green_gamma))*(double) QuantumRange))) #define XRedGamma(color) ClampToQuantum(red_gamma == 1.0 ? (double) \ - (color) : ((pow(((double) QuantumScale*(color)),1.0* \ - PerceptibleReciprocal((double) red_gamma))*QuantumRange))) + (color) : ((pow((QuantumScale*(double) (color)),1.0* \ + PerceptibleReciprocal((double) red_gamma))*(double) QuantumRange))) #define XStandardPixel(map,color) (size_t) (map->base_pixel+ \ (((color)->red*map->red_max/65535L)*map->red_mult)+ \ (((color)->green*map->green_max/65535L)*map->green_mult)+ \ @@ -431,7 +431,6 @@ MagickExport void DestroyXResources(void) XFree(windows->icon_visual); windows->icon_visual=(XVisualInfo *) NULL; } - (void) XSetWindows((XWindows *) NULL); } /* @@ -978,14 +977,14 @@ MagickPrivate void XBestIconSize(Display *display,XWindowInfo *window, { if (icon_width >= (unsigned int) (scale_factor*width+0.5)) break; - icon_width+=icon_size->width_inc; + icon_width+=(unsigned int) icon_size->width_inc; } icon_height=(unsigned int) icon_size->min_height; while ((int) icon_height < icon_size->max_height) { if (icon_height >= (unsigned int) (scale_factor*height+0.5)) break; - icon_height+=icon_size->height_inc; + icon_height+=(unsigned int) icon_size->height_inc; } (void) XFree((void *) icon_size); window->width=icon_width; @@ -1252,7 +1251,7 @@ MagickPrivate XVisualInfo *XBestVisualInfo(Display *display, if (isdigit((int) ((unsigned char) *visual_type)) != 0) { visual_mask|=VisualIDMask; - visual_template.visualid= + visual_template.visualid=(size_t) strtol(visual_type,(char **) NULL,0); } else @@ -1763,13 +1762,13 @@ MagickPrivate void XConstrainWindowPosition(Display *display, assert(window_info != (XWindowInfo *) NULL); if (IsEventLogging() != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); - limit=XDisplayWidth(display,window_info->screen)-window_info->width; + limit=XDisplayWidth(display,window_info->screen)-(int) window_info->width; if (window_info->x < 0) window_info->x=0; else if (window_info->x > (int) limit) window_info->x=(int) limit; - limit=XDisplayHeight(display,window_info->screen)-window_info->height; + limit=XDisplayHeight(display,window_info->screen)-(int) window_info->height; if (window_info->y < 0) window_info->y=0; else @@ -2047,7 +2046,7 @@ MagickPrivate void XDisplayImageInfo(Display *display, for (levels=0; undo_image != (Image *) NULL; levels++) { number_pixels=undo_image->list->columns*undo_image->list->rows; - bytes+=number_pixels*sizeof(PixelInfo); + bytes+=(ssize_t) (number_pixels*sizeof(PixelInfo)); undo_image=GetPreviousImageInList(undo_image); } (void) FormatLocaleFile(file,"Undo Edit Cache\n levels: %u\n",levels); @@ -2157,9 +2156,6 @@ static void XDitherImage(Image *image,XImage *ximage,ExceptionInfo *exception) PixelInfo color; - unsigned int - scanline_pad; - size_t pixel; @@ -2168,6 +2164,9 @@ static void XDitherImage(Image *image,XImage *ximage,ExceptionInfo *exception) *green_map[2][16], *red_map[2][16]; + unsigned int + scanline_pad; + /* Allocate and initialize dither maps. */ @@ -2203,15 +2202,15 @@ static void XDitherImage(Image *image,XImage *ximage,ExceptionInfo *exception) value=x-32; if (x < 112) value=x/2+24; - value+=((size_t) dither_blue[i][j] << 1); + value+=(int) (dither_blue[i][j] << 1); blue_map[i][j][x]=(unsigned char) ((value < 0) ? 0 : (value > 255) ? 255 : value); } /* Dither image. */ - scanline_pad=(unsigned int) (ximage->bytes_per_line- - ((size_t) (ximage->width*ximage->bits_per_pixel) >> 3)); + scanline_pad=(unsigned int) (ximage->bytes_per_line-(int) + ((ximage->width*ximage->bits_per_pixel) >> 3)); i=0; j=0; q=ximage->data; @@ -3232,7 +3231,7 @@ MagickPrivate void XGetPixelInfo(Display *display, for (i=0; i < (ssize_t) image->colors; i++) pixel->pixels[i]=XGammaPacket(map_info,image->colormap+i); for (i=0; i < MaxNumberPens; i++) - pixel->pixels[image->colors+i]=pixel->pen_colors[i].pixel; + pixel->pixels[image->colors+(size_t) i]=pixel->pen_colors[i].pixel; pixel->colors+=MaxNumberPens; } } @@ -3552,7 +3551,7 @@ MagickExport void XGetResourceInfo(const ImageInfo *image_info, client_name,"geometry",(char *) NULL)); resource_value=XGetResourceClass(database,client_name,"gravity", (char *) "Center"); - resource_info->gravity=(GravityType) ParseCommandOption(MagickGravityOptions, + resource_info->gravity=(int) ParseCommandOption(MagickGravityOptions, MagickFalse,resource_value); directory=getcwd(resource_info->home_directory,MagickPathExtent); (void) directory; @@ -4075,19 +4074,19 @@ static Image *XGetWindowImage(Display *display,const Window window, */ if (crop_info.x < 0) { - crop_info.width+=crop_info.x; + crop_info.width=(unsigned int) ((int) crop_info.width+crop_info.x); crop_info.x=0; } if (crop_info.y < 0) { - crop_info.height+=crop_info.y; + crop_info.height=(unsigned int) ((int) crop_info.height+crop_info.y); crop_info.y=0; } display_width=XDisplayWidth(display,XDefaultScreen(display)); - if ((int) (crop_info.x+crop_info.width) > display_width) + if ((crop_info.x+(int) crop_info.width) > display_width) crop_info.width=(size_t) (display_width-crop_info.x); display_height=XDisplayHeight(display,XDefaultScreen(display)); - if ((int) (crop_info.y+crop_info.height) > display_height) + if ((crop_info.y+(int) crop_info.height) > display_height) crop_info.height=(size_t) (display_height-crop_info.y); /* Initialize window info attributes. @@ -4406,7 +4405,8 @@ static Image *XGetWindowImage(Display *display,const Window window, ScaleShortToQuantum(colors[index].blue),q); q+=GetPixelChannels(composite_image); } - status=SyncCacheViewAuthenticPixels(composite_view,exception); + status=SyncCacheViewAuthenticPixels(composite_view,exception) + == MagickFalse ? 0 : 1; if (status == MagickFalse) break; } @@ -4437,7 +4437,8 @@ static Image *XGetWindowImage(Display *display,const Window window, (unsigned short) color),q); q+=GetPixelChannels(composite_image); } - status=SyncCacheViewAuthenticPixels(composite_view,exception); + status=SyncCacheViewAuthenticPixels(composite_view,exception) + == MagickFalse ? 0 : 1; if (status == MagickFalse) break; } @@ -4449,7 +4450,7 @@ static Image *XGetWindowImage(Display *display,const Window window, Create colormap. */ status=AcquireImageColormap(composite_image,number_colors, - exception); + exception) == MagickFalse ? 0 : 1; if (status == MagickFalse) { XDestroyImage(ximage); @@ -4484,7 +4485,8 @@ static Image *XGetWindowImage(Display *display,const Window window, composite_image->colormap+(ssize_t) index,q); q+=GetPixelChannels(composite_image); } - status=SyncCacheViewAuthenticPixels(composite_view,exception); + status=SyncCacheViewAuthenticPixels(composite_view,exception) + == MagickFalse ? 0 : 1; if (status == MagickFalse) break; } @@ -5027,8 +5029,8 @@ MagickExport Image *XImportImage(const ImageInfo *image_info, */ crop_info.x-=window_attributes.border_width; crop_info.y-=window_attributes.border_width; - crop_info.width+=window_attributes.border_width << 1; - crop_info.height+=window_attributes.border_width << 1; + crop_info.width+=(size_t) (window_attributes.border_width << 1); + crop_info.height+=(size_t) (window_attributes.border_width << 1); } target=root; } @@ -5554,7 +5556,7 @@ MagickPrivate MagickBooleanType XMakeImage(Display *display, window->shared_memory=MagickFalse; else { - length=(size_t) ximage->bytes_per_line*ximage->height; + length=(size_t) (ximage->bytes_per_line*ximage->height); if (CheckOverflowException(length,ximage->bytes_per_line,ximage->height)) window->shared_memory=MagickFalse; } @@ -5661,10 +5663,10 @@ MagickPrivate MagickBooleanType XMakeImage(Display *display, if (ximage->format == XYBitmap) { ximage->data=(char *) AcquireQuantumMemory((size_t) - ximage->bytes_per_line,(size_t) ximage->depth*ximage->height); + ximage->bytes_per_line,(size_t) (ximage->depth*ximage->height)); if (ximage->data != (char *) NULL) (void) memset(ximage->data,0,(size_t) - ximage->bytes_per_line*ximage->depth*ximage->height); + (ximage->bytes_per_line*ximage->depth*ximage->height)); } else { @@ -5672,7 +5674,7 @@ MagickPrivate MagickBooleanType XMakeImage(Display *display, ximage->bytes_per_line,(size_t) ximage->height); if (ximage->data != (char *) NULL) (void) memset(ximage->data,0,(size_t) - ximage->bytes_per_line*ximage->height); + (ximage->bytes_per_line*ximage->height)); } } if (ximage->data == (char *) NULL) @@ -5751,8 +5753,8 @@ MagickPrivate MagickBooleanType XMakeImage(Display *display, Allocate matte image pixel data. */ matte_image->data=(char *) malloc((size_t) - matte_image->bytes_per_line*matte_image->depth* - matte_image->height); + (matte_image->bytes_per_line*matte_image->depth* + matte_image->height)); if (matte_image->data == (char *) NULL) { XDestroyImage(matte_image); @@ -5974,7 +5976,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info, (XPixelIntensity(&window->pixel_info->background_color) < XPixelIntensity(&window->pixel_info->foreground_color) ? 0x80 : 0x00); polarity=(unsigned short) ((GetPixelInfoIntensity(image, - &canvas->colormap[0])) < (QuantumRange/2.0) ? 1 : 0); + &canvas->colormap[0])) < ((double) QuantumRange/2.0) ? 1 : 0); if (canvas->colors == 2) polarity=GetPixelInfoIntensity(image,&canvas->colormap[0]) < GetPixelInfoIntensity(image,&canvas->colormap[1]); @@ -6592,7 +6594,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info, (XPixelIntensity(&window->pixel_info->background_color) < XPixelIntensity(&window->pixel_info->foreground_color) ? 0x01 : 0x00); polarity=(unsigned short) ((GetPixelInfoIntensity(image, - &canvas->colormap[0])) < (QuantumRange/2.0) ? 1 : 0); + &canvas->colormap[0])) < ((double) QuantumRange/2.0) ? 1 : 0); if (canvas->colors == 2) polarity=GetPixelInfoIntensity(image,&canvas->colormap[0]) < GetPixelInfoIntensity(image,&canvas->colormap[1]); @@ -7164,9 +7166,9 @@ MagickPrivate void XMakeMagnifyImage(Display *display,XWindows *windows, magnify=1; for (n=1; n < (ssize_t) windows->magnify.data; n++) magnify<<=1; - while ((magnify*windows->image.ximage->width) < windows->magnify.width) + while ((magnify*(unsigned int) windows->image.ximage->width) < windows->magnify.width) magnify<<=1; - while ((magnify*windows->image.ximage->height) < windows->magnify.height) + while ((magnify*(unsigned int) windows->image.ximage->height) < windows->magnify.height) magnify<<=1; while (magnify > windows->magnify.width) magnify>>=1; @@ -7209,24 +7211,24 @@ MagickPrivate void XMakeMagnifyImage(Display *display,XWindows *windows, if ((windows->magnify.x < 0) || (windows->magnify.x >= windows->image.ximage->width)) windows->magnify.x=windows->image.ximage->width >> 1; - x=windows->magnify.x-((width/magnify) >> 1); + x=windows->magnify.x-(int) ((width/magnify) >> 1); if (x < 0) x=0; else - if (x > (int) (ximage->width-(width/magnify))) - x=ximage->width-width/magnify; + if (x > (ximage->width-(int) (width/magnify))) + x=ximage->width-(int) (width/magnify); if ((windows->magnify.y < 0) || (windows->magnify.y >= windows->image.ximage->height)) windows->magnify.y=windows->image.ximage->height >> 1; - y=windows->magnify.y-((height/magnify) >> 1); + y=windows->magnify.y-(int) ((height/magnify) >> 1); if (y < 0) y=0; else - if (y > (int) (ximage->height-(height/magnify))) - y=ximage->height-height/magnify; + if (y > (ximage->height-(int) (height/magnify))) + y=ximage->height-(int) (height/magnify); q=(unsigned char *) windows->magnify.ximage->data; scanline_pad=(unsigned int) (windows->magnify.ximage->bytes_per_line- - ((width*windows->magnify.ximage->bits_per_pixel) >> 3)); + (((int) width*windows->magnify.ximage->bits_per_pixel) >> 3)); if (ximage->bits_per_pixel < 8) { unsigned char @@ -7462,28 +7464,30 @@ MagickPrivate void XMakeMagnifyImage(Display *display,XWindows *windows, /* Copy X image to magnify pixmap. */ - x=windows->magnify.x-((width/magnify) >> 1); + x=windows->magnify.x-(int) ((width/magnify) >> 1); if (x < 0) - x=(int) ((width >> 1)-windows->magnify.x*magnify); + x=((int) (width >> 1)-windows->magnify.x*(int) magnify); else - if (x > (int) (ximage->width-(width/magnify))) - x=(int) ((ximage->width-windows->magnify.x)*magnify-(width >> 1)); + if (x > (ximage->width-(int) (width/magnify))) + x=(int) ((ximage->width-windows->magnify.x)*(int) magnify-(int) + (width >> 1)); else x=0; - y=windows->magnify.y-((height/magnify) >> 1); + y=windows->magnify.y-(int) ((height/magnify) >> 1); if (y < 0) - y=(int) ((height >> 1)-windows->magnify.y*magnify); + y=((int) (height >> 1)-windows->magnify.y*(int) magnify); else - if (y > (int) (ximage->height-(height/magnify))) - y=(int) ((ximage->height-windows->magnify.y)*magnify-(height >> 1)); + if (y > (ximage->height-(int) (height/magnify))) + y=(int) ((ximage->height-windows->magnify.y)*(int) magnify-(int) + (height >> 1)); else y=0; if ((x != 0) || (y != 0)) (void) XFillRectangle(display,windows->magnify.pixmap, windows->magnify.annotate_context,0,0,width,height); (void) XPutImage(display,windows->magnify.pixmap, - windows->magnify.annotate_context,windows->magnify.ximage,0,0,x,y,width-x, - height-y); + windows->magnify.annotate_context,windows->magnify.ximage,0,0,x,y, + (unsigned int) ((int) width-x),(unsigned int) ((int) height-y)); if ((magnify > 1) && ((magnify <= (width >> 1)) && (magnify <= (height >> 1)))) { @@ -7531,19 +7535,19 @@ MagickPrivate void XMakeMagnifyImage(Display *display,XWindows *windows, ConcatenateColorComponent(&pixel,AlphaPixelChannel,X11Compliance,tuple); } (void) ConcatenateMagickString(tuple,")",MagickPathExtent); - height=(unsigned int) windows->magnify.font_info->ascent+ - windows->magnify.font_info->descent; + height=(unsigned int) (windows->magnify.font_info->ascent+ + windows->magnify.font_info->descent); x=windows->magnify.font_info->max_bounds.width >> 1; - y=windows->magnify.font_info->ascent+(height >> 2); + y=windows->magnify.font_info->ascent+(int) (height >> 2); (void) XDrawImageString(display,windows->magnify.pixmap, windows->magnify.annotate_context,x,y,tuple,(int) strlen(tuple)); GetColorTuple(&pixel,MagickTrue,tuple); - y+=height; + y+=(int) height; (void) XDrawImageString(display,windows->magnify.pixmap, windows->magnify.annotate_context,x,y,tuple,(int) strlen(tuple)); (void) QueryColorname(windows->image.image,&pixel,SVGCompliance,tuple, exception); - y+=height; + y+=(int) height; (void) XDrawImageString(display,windows->magnify.pixmap, windows->magnify.annotate_context,x,y,tuple,(int) strlen(tuple)); /* @@ -7701,7 +7705,8 @@ static inline double DiversityPixelIntensity( double intensity; - intensity=0.212656*pixel->red+0.715158*pixel->green+0.072186*pixel->blue; + intensity=0.212656*(double) pixel->red+0.715158*(double) pixel->green+ + 0.072186*(double) pixel->blue; return(intensity); } @@ -7816,18 +7821,18 @@ MagickPrivate void XMakeStandardColormap(Display *display, SetPixelRed(affinity_image,0,q); if (map_info->red_max != 0) SetPixelRed(affinity_image,ScaleXToQuantum((size_t) - (i/map_info->red_mult),map_info->red_max),q); + (i/(ssize_t) map_info->red_mult),map_info->red_max),q); SetPixelGreen(affinity_image,0,q); if (map_info->green_max != 0) SetPixelGreen(affinity_image,ScaleXToQuantum((size_t) - ((i/map_info->green_mult) % (map_info->green_max+1)), - map_info->green_max),q); + ((i/(ssize_t) map_info->green_mult) % (ssize_t) + (map_info->green_max+1)),map_info->green_max),q); SetPixelBlue(affinity_image,0,q); if (map_info->blue_max != 0) SetPixelBlue(affinity_image,ScaleXToQuantum((size_t) - (i % map_info->green_mult),map_info->blue_max),q); - SetPixelAlpha(affinity_image, - TransparentAlpha,q); + (i % (ssize_t) map_info->green_mult),map_info->blue_max), + q); + SetPixelAlpha(affinity_image,TransparentAlpha,q); q+=GetPixelChannels(affinity_image); } (void) SyncAuthenticPixels(affinity_image,exception); @@ -8102,7 +8107,7 @@ MagickPrivate void XMakeStandardColormap(Display *display, Fill up colors array-- more choices for pen colors. */ retain_colors=MagickMin((unsigned int) - (visual_info->colormap_size-image->colors),256); + (visual_info->colormap_size-(int) image->colors),256); for (i=0; i < (ssize_t) retain_colors; i++) *p++=server_colors[i]; number_colors+=retain_colors; @@ -8133,7 +8138,7 @@ MagickPrivate void XMakeStandardColormap(Display *display, effects of colormap flashing. */ retain_colors=MagickMin((unsigned int) - (visual_info->colormap_size-image->colors),256); + (visual_info->colormap_size-(int) image->colors),256); p=colors+image->colors; for (i=0; i < (ssize_t) retain_colors; i++) { @@ -8223,8 +8228,8 @@ MagickPrivate void XMakeStandardColormap(Display *display, { color.blue=(unsigned short) 0; if (map_info->blue_max != 0) - color.blue=(unsigned short) ((size_t) - ((65535L*(i % map_info->green_mult))/map_info->blue_max)); + color.blue=(unsigned short) (((65535L*(i % (ssize_t) + map_info->green_mult))/(ssize_t) map_info->blue_max)); color.green=color.blue; color.red=color.blue; color.pixel=XStandardPixel(map_info,&color); @@ -8235,17 +8240,17 @@ MagickPrivate void XMakeStandardColormap(Display *display, { color.red=(unsigned short) 0; if (map_info->red_max != 0) - color.red=(unsigned short) ((size_t) - ((65535L*(i/map_info->red_mult))/map_info->red_max)); + color.red=(unsigned short) ((size_t) ((65535L*(i/(ssize_t) + map_info->red_mult))/(ssize_t) map_info->red_max)); color.green=(unsigned int) 0; if (map_info->green_max != 0) - color.green=(unsigned short) ((size_t) - ((65535L*((i/map_info->green_mult) % (map_info->green_max+1)))/ - map_info->green_max)); + color.green=(unsigned short) ((size_t) ((65535L*((i/(ssize_t) + map_info->green_mult) % (ssize_t) (map_info->green_max+1)))/ + (ssize_t) map_info->green_max)); color.blue=(unsigned short) 0; if (map_info->blue_max != 0) - color.blue=(unsigned short) ((size_t) - ((65535L*(i % map_info->green_mult))/map_info->blue_max)); + color.blue=(unsigned short) ((size_t) ((65535L*(i % (ssize_t) + map_info->green_mult))/(ssize_t) map_info->blue_max)); color.pixel=XStandardPixel(map_info,&color); *p++=color; } @@ -8297,7 +8302,7 @@ MagickPrivate void XMakeStandardColormap(Display *display, { XBestPixel(display,colormap,colors,(unsigned int) number_colors, &pixel->pen_colors[i]); - pixel->pixels[image->colors+i]=pixel->pen_colors[i].pixel; + pixel->pixels[(ssize_t) image->colors+i]=pixel->pen_colors[i].pixel; } pixel->colors=(ssize_t) (image->colors+MaxNumberPens); } @@ -8443,7 +8448,7 @@ MagickPrivate void XMakeWindow(Display *display,Window parent,char **argv, if ((isspace((int) ((unsigned char) *p)) == 0) && (*p != '%')) p++; else - (void) memmove(p,p+1,MagickPathExtent-(p-geometry)); + (void) memmove(p,p+1,(size_t) (MagickPathExtent-(p-geometry))); } flags=XWMGeometry(display,window_info->screen,geometry,default_geometry, window_info->border_width,size_hints,&size_hints->x,&size_hints->y, @@ -9149,7 +9154,7 @@ MagickPrivate MagickBooleanType XRenderImage(Image *image, annotate_info.text=(char *) draw_info->text; annotate_info.width=(unsigned int) XTextWidth(font_info,draw_info->text,(int) strlen(draw_info->text)); - annotate_info.height=(unsigned int) font_info->ascent+font_info->descent; + annotate_info.height=(unsigned int) (font_info->ascent+font_info->descent); metrics->pixels_per_em.x=(double) font_info->max_bounds.width; metrics->pixels_per_em.y=(double) font_info->ascent+font_info->descent; metrics->ascent=(double) font_info->ascent+4; @@ -9165,7 +9170,7 @@ MagickPrivate MagickBooleanType XRenderImage(Image *image, metrics->underline_thickness=1.0; if (draw_info->render == MagickFalse) return(MagickTrue); - if (draw_info->fill.alpha == TransparentAlpha) + if (draw_info->fill.alpha == (double) TransparentAlpha) return(MagickTrue); /* Render fill color. diff --git a/ImageMagick-7.1.1-15/MagickCore/xwindow.h b/ImageMagick-7.1.1-16/MagickCore/xwindow.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickCore/xwindow.h rename to ImageMagick-7.1.1-16/MagickCore/xwindow.h diff --git a/ImageMagick-7.1.1-15/MagickWand/MagickWand.h b/ImageMagick-7.1.1-16/MagickWand/MagickWand.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/MagickWand.h rename to ImageMagick-7.1.1-16/MagickWand/MagickWand.h diff --git a/ImageMagick-7.1.1-15/MagickWand/animate.c b/ImageMagick-7.1.1-16/MagickWand/animate.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickWand/animate.c rename to ImageMagick-7.1.1-16/MagickWand/animate.c index d8c098e2..8406cb72 100644 --- a/ImageMagick-7.1.1-15/MagickWand/animate.c +++ b/ImageMagick-7.1.1-16/MagickWand/animate.c @@ -423,7 +423,7 @@ WandExport MagickBooleanType AnimateImageCommand(ImageInfo *image_info, images=PingImages(image_info,filename,exception); else images=ReadImages(image_info,filename,exception); - status&=(images != (Image *) NULL) && + status&=(MagickStatusType) (images != (Image *) NULL) && (exception->severity < ErrorException); if (images == (Image *) NULL) continue; @@ -1420,7 +1420,7 @@ WandExport MagickBooleanType AnimateImageCommand(ImageInfo *image_info, if (resource_info.window_id != (char *) NULL) { XAnimateBackgroundImage(display,&resource_info,image,exception); - status&=MagickTrue; + status&=(MagickStatusType) MagickTrue; } else { diff --git a/ImageMagick-7.1.1-15/MagickWand/animate.h b/ImageMagick-7.1.1-16/MagickWand/animate.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/animate.h rename to ImageMagick-7.1.1-16/MagickWand/animate.h diff --git a/ImageMagick-7.1.1-15/MagickWand/compare.c b/ImageMagick-7.1.1-16/MagickWand/compare.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickWand/compare.c rename to ImageMagick-7.1.1-16/MagickWand/compare.c index e6878c9d..7a659932 100644 --- a/ImageMagick-7.1.1-15/MagickWand/compare.c +++ b/ImageMagick-7.1.1-16/MagickWand/compare.c @@ -350,7 +350,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1))) filename=argv[++i]; images=ReadImages(image_info,filename,exception); - status&=(images != (Image *) NULL) && + status&=(MagickStatusType) (images != (Image *) NULL) && (exception->severity < ErrorException); if (images == (Image *) NULL) continue; @@ -1249,7 +1249,8 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, case RootMeanSquaredErrorMetric: { (void) FormatLocaleFile(stderr,"%.*g (%.*g)",GetMagickPrecision(), - QuantumRange*distortion,GetMagickPrecision(),distortion); + (double) QuantumRange*distortion,GetMagickPrecision(), + distortion); break; } case PeakSignalToNoiseRatioErrorMetric: @@ -1312,20 +1313,20 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, default: { (void) FormatLocaleFile(stderr," red: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[RedPixelChannel],GetMagickPrecision(), channel_distortion[RedPixelChannel]); (void) FormatLocaleFile(stderr," green: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[GreenPixelChannel],GetMagickPrecision(), channel_distortion[GreenPixelChannel]); (void) FormatLocaleFile(stderr," blue: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[BluePixelChannel],GetMagickPrecision(), channel_distortion[BluePixelChannel]); if (image->alpha_trait != UndefinedPixelTrait) (void) FormatLocaleFile(stderr," alpha: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[AlphaPixelChannel], GetMagickPrecision(), channel_distortion[AlphaPixelChannel]); @@ -1334,25 +1335,25 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, case CMYKColorspace: { (void) FormatLocaleFile(stderr," cyan: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[CyanPixelChannel],GetMagickPrecision(), channel_distortion[CyanPixelChannel]); (void) FormatLocaleFile(stderr," magenta: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[MagentaPixelChannel], GetMagickPrecision(), channel_distortion[MagentaPixelChannel]); (void) FormatLocaleFile(stderr," yellow: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[YellowPixelChannel],GetMagickPrecision(), channel_distortion[YellowPixelChannel]); (void) FormatLocaleFile(stderr," black: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[BlackPixelChannel],GetMagickPrecision(), channel_distortion[BlackPixelChannel]); if (image->alpha_trait != UndefinedPixelTrait) (void) FormatLocaleFile(stderr," alpha: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[AlphaPixelChannel], GetMagickPrecision(), channel_distortion[AlphaPixelChannel]); @@ -1362,12 +1363,12 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, case GRAYColorspace: { (void) FormatLocaleFile(stderr," gray: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[GrayPixelChannel],GetMagickPrecision(), channel_distortion[GrayPixelChannel]); if (image->alpha_trait != UndefinedPixelTrait) (void) FormatLocaleFile(stderr," alpha: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[AlphaPixelChannel], GetMagickPrecision(), channel_distortion[AlphaPixelChannel]); @@ -1375,7 +1376,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, } } (void) FormatLocaleFile(stderr," all: %.*g (%.*g)\n", - GetMagickPrecision(),QuantumRange* + GetMagickPrecision(),(double) QuantumRange* channel_distortion[MaxPixelChannels],GetMagickPrecision(), channel_distortion[MaxPixelChannels]); break; @@ -1459,7 +1460,8 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, (void) ResetImagePage(difference_image,"0x0+0+0"); if (difference_image->next != (Image *) NULL) (void) ResetImagePage(difference_image->next,"0x0+0+0"); - status&=WriteImages(image_info,difference_image,argv[argc-1],exception); + status&=(MagickStatusType) WriteImages(image_info,difference_image, + argv[argc-1],exception); if ((metadata != (char **) NULL) && (format != (char *) NULL)) { char diff --git a/ImageMagick-7.1.1-15/MagickWand/compare.h b/ImageMagick-7.1.1-16/MagickWand/compare.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/compare.h rename to ImageMagick-7.1.1-16/MagickWand/compare.h diff --git a/ImageMagick-7.1.1-15/MagickWand/composite.c b/ImageMagick-7.1.1-16/MagickWand/composite.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickWand/composite.c rename to ImageMagick-7.1.1-16/MagickWand/composite.c index f6e13457..0992e962 100644 --- a/ImageMagick-7.1.1-15/MagickWand/composite.c +++ b/ImageMagick-7.1.1-16/MagickWand/composite.c @@ -210,8 +210,9 @@ static MagickBooleanType CompositeImageList(ImageInfo *image_info,Image **image, columns=composite_image->columns; for (y=0; y < (ssize_t) (*image)->rows; y+=(ssize_t) composite_image->rows) for (x=0; x < (ssize_t) (*image)->columns; x+=(ssize_t) columns) - status&=CompositeImage(*image,composite_image, - composite_options->compose,MagickTrue,x,y,exception); + status&=(MagickStatusType) CompositeImage(*image, + composite_image,composite_options->compose,MagickTrue,x,y, + exception); } else { @@ -233,9 +234,10 @@ static MagickBooleanType CompositeImageList(ImageInfo *image_info,Image **image, Digitally composite image. */ if (mask_image == (Image *) NULL) - status&=CompositeImage(*image,composite_image, - composite_options->compose,composite_options->clip_to_self, - geometry.x,geometry.y,exception); + status&=(MagickStatusType) CompositeImage(*image, + composite_image,composite_options->compose, + composite_options->clip_to_self,geometry.x,geometry.y, + exception); else { Image @@ -244,14 +246,16 @@ static MagickBooleanType CompositeImageList(ImageInfo *image_info,Image **image, clone_image=CloneImage(*image,0,0,MagickTrue,exception); if (clone_image != (Image *) NULL) { - status&=CompositeImage(*image,composite_image, - composite_options->compose, + status&=(MagickStatusType) CompositeImage(*image, + composite_image,composite_options->compose, composite_options->clip_to_self,geometry.x,geometry.y, exception); - status&=CompositeImage(*image,mask_image, - CopyAlphaCompositeOp,MagickTrue,0,0,exception); - status&=CompositeImage(clone_image,*image,OverCompositeOp, - composite_options->clip_to_self,0,0,exception); + status&=(MagickStatusType) CompositeImage(*image, + mask_image,CopyAlphaCompositeOp,MagickTrue,0,0, + exception); + status&=(MagickStatusType) CompositeImage(clone_image, + *image,OverCompositeOp,composite_options->clip_to_self, + 0,0,exception); *image=DestroyImageList(*image); *image=clone_image; } @@ -536,7 +540,7 @@ WandExport MagickBooleanType CompositeImageCommand(ImageInfo *image_info, if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1))) filename=argv[++i]; images=ReadImages(image_info,filename,exception); - status&=(images != (Image *) NULL) && + status&=(MagickStatusType) (images != (Image *) NULL) && (exception->severity < ErrorException); if (images == (Image *) NULL) continue; @@ -1663,13 +1667,14 @@ WandExport MagickBooleanType CompositeImageCommand(ImageInfo *image_info, } } RemoveImageStack(mask_image); - status&=CompositeImageList(image_info,&images,composite_image,mask_image, - &composite_options,exception); + status&=(MagickStatusType) CompositeImageList(image_info,&images, + composite_image,mask_image,&composite_options,exception); composite_image=DestroyImage(composite_image); /* Write composite images. */ - status&=WriteImages(image_info,images,argv[argc-1],exception); + status&=(MagickStatusType) WriteImages(image_info,images,argv[argc-1], + exception); if (metadata != (char **) NULL) { char diff --git a/ImageMagick-7.1.1-15/MagickWand/composite.h b/ImageMagick-7.1.1-16/MagickWand/composite.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/composite.h rename to ImageMagick-7.1.1-16/MagickWand/composite.h diff --git a/ImageMagick-7.1.1-15/MagickWand/conjure.c b/ImageMagick-7.1.1-16/MagickWand/conjure.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/conjure.c rename to ImageMagick-7.1.1-16/MagickWand/conjure.c diff --git a/ImageMagick-7.1.1-15/MagickWand/conjure.h b/ImageMagick-7.1.1-16/MagickWand/conjure.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/conjure.h rename to ImageMagick-7.1.1-16/MagickWand/conjure.h diff --git a/ImageMagick-7.1.1-15/MagickWand/convert.c b/ImageMagick-7.1.1-16/MagickWand/convert.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickWand/convert.c rename to ImageMagick-7.1.1-16/MagickWand/convert.c index 9611b5f8..1fec10da 100644 --- a/ImageMagick-7.1.1-15/MagickWand/convert.c +++ b/ImageMagick-7.1.1-16/MagickWand/convert.c @@ -614,7 +614,7 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info, images=PingImages(image_info,filename,exception); else images=ReadImages(image_info,filename,exception); - status&=(images != (Image *) NULL) && + status&=(MagickStatusType) (images != (Image *) NULL) && (exception->severity < ErrorException); if (images == (Image *) NULL) continue; @@ -3356,7 +3356,8 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info, ThrowConvertException(OptionError,"MissingAnImageFilename",argv[argc-1]); if (LocaleCompare(" ",argv[argc-1]) == 0) /* common line continuation error */ ThrowConvertException(OptionError,"MissingAnImageFilename",argv[argc-1]); - status&=WriteImages(image_info,image,argv[argc-1],exception); + status&=(MagickStatusType) WriteImages(image_info,image,argv[argc-1], + exception); if (metadata != (char **) NULL) { char diff --git a/ImageMagick-7.1.1-15/MagickWand/convert.h b/ImageMagick-7.1.1-16/MagickWand/convert.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/convert.h rename to ImageMagick-7.1.1-16/MagickWand/convert.h diff --git a/ImageMagick-7.1.1-15/MagickWand/deprecate.c b/ImageMagick-7.1.1-16/MagickWand/deprecate.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/deprecate.c rename to ImageMagick-7.1.1-16/MagickWand/deprecate.c diff --git a/ImageMagick-7.1.1-15/MagickWand/deprecate.h b/ImageMagick-7.1.1-16/MagickWand/deprecate.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/deprecate.h rename to ImageMagick-7.1.1-16/MagickWand/deprecate.h diff --git a/ImageMagick-7.1.1-15/MagickWand/display.c b/ImageMagick-7.1.1-16/MagickWand/display.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickWand/display.c rename to ImageMagick-7.1.1-16/MagickWand/display.c index d92cb681..357429ce 100644 --- a/ImageMagick-7.1.1-15/MagickWand/display.c +++ b/ImageMagick-7.1.1-16/MagickWand/display.c @@ -493,7 +493,7 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, (void) CopyMagickString(image_info->filename,filename,MagickPathExtent); images=ReadImage(image_info,exception); CatchException(exception); - status&=(images != (Image *) NULL) && + status&=(MagickStatusType) (images != (Image *) NULL) && (exception->severity < ErrorException); if (images == (Image *) NULL) continue; @@ -578,7 +578,8 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, (void) CopyMagickString(display_image->filename, resource_info.write_filename,MagickPathExtent); (void) SetImageInfo(image_info,1,exception); - status&=WriteImage(image_info,display_image,exception); + status&=(MagickStatusType) WriteImage(image_info,display_image, + exception); } /* Proceed to next/previous image. diff --git a/ImageMagick-7.1.1-15/MagickWand/display.h b/ImageMagick-7.1.1-16/MagickWand/display.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/display.h rename to ImageMagick-7.1.1-16/MagickWand/display.h diff --git a/ImageMagick-7.1.1-15/MagickWand/drawing-wand.c b/ImageMagick-7.1.1-16/MagickWand/drawing-wand.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickWand/drawing-wand.c rename to ImageMagick-7.1.1-16/MagickWand/drawing-wand.c index 158f3591..a78c418e 100644 --- a/ImageMagick-7.1.1-15/MagickWand/drawing-wand.c +++ b/ImageMagick-7.1.1-16/MagickWand/drawing-wand.c @@ -221,7 +221,7 @@ static int MVGPrintf(DrawingWand *wand,const char *format,...) } wand->mvg[wand->mvg_length]='\0'; count=(-1); - offset=(ssize_t) wand->mvg_alloc-wand->mvg_length-1; + offset=(ssize_t) (wand->mvg_alloc-wand->mvg_length-1); if (offset > 0) { va_start(argp,format); @@ -236,8 +236,8 @@ static int MVGPrintf(DrawingWand *wand,const char *format,...) ThrowDrawException(DrawError,"UnableToPrint",format) else { - wand->mvg_length+=count; - wand->mvg_width+=count; + wand->mvg_length+=(size_t) count; + wand->mvg_width+=(size_t) count; } wand->mvg[wand->mvg_length]='\0'; if ((wand->mvg_length > 1) && (wand->mvg[wand->mvg_length-1] == '\n')) @@ -270,7 +270,7 @@ static int MVGAutoWrapPrintf(DrawingWand *wand,const char *format,...) ThrowDrawException(DrawError,"UnableToPrint",format) else { - if (((wand->mvg_width + count) > 78) && (buffer[count-1] != '\n')) + if (((wand->mvg_width+(size_t) count) > 78) && (buffer[count-1] != '\n')) (void) MVGPrintf(wand, "\n"); (void) MVGPrintf(wand,"%s",buffer); } @@ -280,7 +280,7 @@ static int MVGAutoWrapPrintf(DrawingWand *wand,const char *format,...) static void MVGAppendColor(DrawingWand *wand,const PixelInfo *packet) { if ((packet->red == 0) && (packet->green == 0) && (packet->blue == 0) && - (packet->alpha == (Quantum) TransparentAlpha)) + (packet->alpha == (double) TransparentAlpha)) (void) MVGPrintf(wand,"none"); else { @@ -292,8 +292,8 @@ static void MVGAppendColor(DrawingWand *wand,const PixelInfo *packet) GetPixelInfo(wand->image,&pixel); pixel.colorspace=sRGBColorspace; - pixel.alpha_trait=packet->alpha != OpaqueAlpha ? BlendPixelTrait : - UndefinedPixelTrait; + pixel.alpha_trait=packet->alpha != (double) OpaqueAlpha ? + BlendPixelTrait : UndefinedPixelTrait; pixel.red=(double) packet->red; pixel.green=(double) packet->green; pixel.blue=(double) packet->blue; @@ -382,11 +382,9 @@ WandExport DrawingWand *AcquireDrawingWand(const DrawInfo *draw_info, CurrentContext=DestroyDrawInfo(CurrentContext); CurrentContext=CloneDrawInfo((ImageInfo *) NULL,draw_info); } + wand->image=DestroyImage(wand->image); if (image != (Image *) NULL) - { - wand->image=DestroyImage(wand->image); - wand->destroy=MagickFalse; - } + wand->destroy=MagickFalse; wand->image=image; return(wand); } @@ -1825,7 +1823,7 @@ WandExport double DrawGetOpacity(const DrawingWand *wand) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - alpha=(double) QuantumScale*CurrentContext->alpha; + alpha=QuantumScale*(double) CurrentContext->alpha; return(alpha); } @@ -2580,8 +2578,8 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand) child=AddChildToXMLTree(xml_info,"fill",0); if (child != (XMLTreeInfo *) NULL) { - if (CurrentContext->fill.alpha != OpaqueAlpha) - pixel.alpha_trait=CurrentContext->fill.alpha != OpaqueAlpha ? + if (CurrentContext->fill.alpha != (double) OpaqueAlpha) + pixel.alpha_trait=CurrentContext->fill.alpha != (double) OpaqueAlpha ? BlendPixelTrait : UndefinedPixelTrait; pixel=CurrentContext->fill; GetColorTuple(&pixel,MagickTrue,value); @@ -2648,8 +2646,8 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand) child=AddChildToXMLTree(xml_info,"stroke",0); if (child != (XMLTreeInfo *) NULL) { - if (CurrentContext->stroke.alpha != OpaqueAlpha) - pixel.alpha_trait=CurrentContext->stroke.alpha != OpaqueAlpha ? + if (CurrentContext->stroke.alpha != (double) OpaqueAlpha) + pixel.alpha_trait=CurrentContext->stroke.alpha != (double) OpaqueAlpha ? BlendPixelTrait : UndefinedPixelTrait; pixel=CurrentContext->stroke; GetColorTuple(&pixel,MagickTrue,value); @@ -2742,8 +2740,8 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand) child=AddChildToXMLTree(xml_info,"text-undercolor",0); if (child != (XMLTreeInfo *) NULL) { - if (CurrentContext->undercolor.alpha != OpaqueAlpha) - pixel.alpha_trait=CurrentContext->undercolor.alpha != OpaqueAlpha ? + if (CurrentContext->undercolor.alpha != (double) OpaqueAlpha) + pixel.alpha_trait=CurrentContext->undercolor.alpha != (double) OpaqueAlpha ? BlendPixelTrait : UndefinedPixelTrait; pixel=CurrentContext->undercolor; GetColorTuple(&pixel,MagickTrue,value); @@ -4851,7 +4849,7 @@ WandExport void DrawSetFillOpacity(DrawingWand *wand,const double fill_opacity) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - alpha=(double) ClampToQuantum(QuantumRange*fill_opacity); + alpha=(double) ClampToQuantum((double) QuantumRange*fill_opacity); if ((wand->filter_off != MagickFalse) || (CurrentContext->fill.alpha != alpha)) { @@ -4937,7 +4935,7 @@ WandExport void DrawSetOpacity(DrawingWand *wand,const double opacity) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - quantum_alpha=ClampToQuantum(QuantumRange*opacity); + quantum_alpha=ClampToQuantum((double) QuantumRange*opacity); if ((wand->filter_off != MagickFalse) || (CurrentContext->alpha != quantum_alpha)) { @@ -5004,7 +5002,7 @@ WandExport MagickBooleanType DrawSetFillPatternURL(DrawingWand *wand, DrawPatternPath(wand->image,CurrentContext,pattern_spec, &CurrentContext->fill_pattern,wand->exception); #endif - if (CurrentContext->fill.alpha != (Quantum) TransparentAlpha) + if (CurrentContext->fill.alpha != (double) TransparentAlpha) CurrentContext->fill.alpha=(double) CurrentContext->alpha; (void) MVGPrintf(wand,"fill %s\n",pattern_spec); return(MagickTrue); @@ -5444,7 +5442,7 @@ WandExport MagickBooleanType DrawSetStrokePatternURL(DrawingWand *wand, DrawPatternPath(wand->image,CurrentContext,pattern_spec, &CurrentContext->stroke_pattern,wand->exception); #endif - if (CurrentContext->stroke.alpha != (Quantum) TransparentAlpha) + if (CurrentContext->stroke.alpha != (double) TransparentAlpha) CurrentContext->stroke.alpha=(double) CurrentContext->alpha; (void) MVGPrintf(wand,"stroke %s\n",pattern_spec); return(MagickTrue); @@ -5824,7 +5822,7 @@ WandExport void DrawSetStrokeOpacity(DrawingWand *wand, assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - alpha=(double) ClampToQuantum(QuantumRange*opacity); + alpha=(double) ClampToQuantum((double) QuantumRange*opacity); if ((wand->filter_off != MagickFalse) || (CurrentContext->stroke.alpha != alpha)) { @@ -6357,8 +6355,8 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand, { value=GetXMLTreeContent(child); if (value != (const char *) NULL) - CurrentContext->fill.alpha=(double) ClampToQuantum(QuantumRange* - (1.0-StringToDouble(value,(char **) NULL))); + CurrentContext->fill.alpha=(double) ClampToQuantum((double) + QuantumRange*(1.0-StringToDouble(value,(char **) NULL))); } child=GetXMLTreeChild(xml_info,"fill-rule"); if (child != (XMLTreeInfo *) NULL) @@ -6474,7 +6472,7 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand, (void) GetNextToken(p,&p,MagickPathExtent,token); } CurrentContext->dash_pattern=(double *) AcquireQuantumMemory( - (size_t) (2UL*x)+1UL,sizeof(*CurrentContext->dash_pattern)); + (size_t) (2*x)+1UL,sizeof(*CurrentContext->dash_pattern)); if (CurrentContext->dash_pattern == (double *) NULL) ThrowWandFatalException(ResourceLimitFatalError, "MemoryAllocationFailed",wand->name); @@ -6529,8 +6527,8 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand, { value=GetXMLTreeContent(child); if (value != (const char *) NULL) - CurrentContext->stroke.alpha=(double) ClampToQuantum(QuantumRange* - (1.0-StringToDouble(value,(char **) NULL))); + CurrentContext->stroke.alpha=(double) ClampToQuantum((double) + QuantumRange*(1.0-StringToDouble(value,(char **) NULL))); } child=GetXMLTreeChild(xml_info,"stroke-width"); if (child != (XMLTreeInfo *) NULL) diff --git a/ImageMagick-7.1.1-15/MagickWand/drawing-wand.h b/ImageMagick-7.1.1-16/MagickWand/drawing-wand.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/drawing-wand.h rename to ImageMagick-7.1.1-16/MagickWand/drawing-wand.h diff --git a/ImageMagick-7.1.1-15/MagickWand/identify.c b/ImageMagick-7.1.1-16/MagickWand/identify.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickWand/identify.c rename to ImageMagick-7.1.1-16/MagickWand/identify.c index 7d17aa2b..cd4e3919 100644 --- a/ImageMagick-7.1.1-15/MagickWand/identify.c +++ b/ImageMagick-7.1.1-16/MagickWand/identify.c @@ -305,7 +305,7 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info, else images=ReadImages(identify_info,filename,exception); identify_info=DestroyImageInfo(identify_info); - status&=(images != (Image *) NULL) && + status&=(MagickStatusType) (images != (Image *) NULL) && (exception->severity < ErrorException); if (images == (Image *) NULL) continue; diff --git a/ImageMagick-7.1.1-15/MagickWand/identify.h b/ImageMagick-7.1.1-16/MagickWand/identify.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/identify.h rename to ImageMagick-7.1.1-16/MagickWand/identify.h diff --git a/ImageMagick-7.1.1-15/MagickWand/import.c b/ImageMagick-7.1.1-16/MagickWand/import.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickWand/import.c rename to ImageMagick-7.1.1-16/MagickWand/import.c index ee71ff10..aad92820 100644 --- a/ImageMagick-7.1.1-15/MagickWand/import.c +++ b/ImageMagick-7.1.1-16/MagickWand/import.c @@ -448,7 +448,7 @@ WandExport MagickBooleanType ImportImageCommand(ImageInfo *image_info, { MagickDelay(1000*resource_info.pause); images=XImportImage(image_info,&ximage_info,exception); - status&=(images != (Image *) NULL) && + status&=(MagickStatusType) (images != (Image *) NULL) && (exception->severity < ErrorException); if (images == (Image *) NULL) continue; @@ -1288,7 +1288,7 @@ WandExport MagickBooleanType ImportImageCommand(ImageInfo *image_info, if (image == (Image *) NULL) ThrowImportException(OptionError,"MissingAnImageFilename",argv[argc-1]); FinalizeImageSettings(image_info,image,MagickTrue); - status&=WriteImages(image_info,image,filename,exception); + status&=(MagickStatusType) WriteImages(image_info,image,filename,exception); DestroyImport(); return(status != 0 ? MagickTrue : MagickFalse); #else diff --git a/ImageMagick-7.1.1-15/MagickWand/import.h b/ImageMagick-7.1.1-16/MagickWand/import.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/import.h rename to ImageMagick-7.1.1-16/MagickWand/import.h diff --git a/ImageMagick-7.1.1-15/MagickWand/magick-cli.c b/ImageMagick-7.1.1-16/MagickWand/magick-cli.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickWand/magick-cli.c rename to ImageMagick-7.1.1-16/MagickWand/magick-cli.c index 4a7c26e6..a4c94218 100644 --- a/ImageMagick-7.1.1-15/MagickWand/magick-cli.c +++ b/ImageMagick-7.1.1-16/MagickWand/magick-cli.c @@ -611,7 +611,7 @@ WandExport int ProcessCommandOptions(MagickCLI *cli_wand,int argc,char **argv, order of location format escapes: filename, line, column */ cli_wand->location="at %s arg %u"; cli_wand->filename="CLI"; - cli_wand->line=index; /* note first argument we will process */ + cli_wand->line=(size_t) index; /* note first argument we will process */ if (cli_wand->wand.debug != MagickFalse) (void) CLILogEvent(cli_wand,CommandEvent,GetMagickModule(), @@ -629,7 +629,7 @@ WandExport int ProcessCommandOptions(MagickCLI *cli_wand,int argc,char **argv, do { /* use break to loop to exception handler and loop */ option=argv[i]; - cli_wand->line=i; /* note the argument for this option */ + cli_wand->line=(size_t) i; /* note the argument for this option */ /* get option, its argument count, and option type */ cli_wand->command = GetCommandOptionInfo(argv[i]); @@ -727,7 +727,7 @@ RestoreMSCWarning Implicit Write of images to final CLI argument */ option=argv[i]; - cli_wand->line=i; + cli_wand->line=(size_t) i; /* check that stacks are empty - or cause exception */ if (cli_wand->image_list_stack != (CLIStack *) NULL) diff --git a/ImageMagick-7.1.1-15/MagickWand/magick-cli.h b/ImageMagick-7.1.1-16/MagickWand/magick-cli.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/magick-cli.h rename to ImageMagick-7.1.1-16/MagickWand/magick-cli.h diff --git a/ImageMagick-7.1.1-15/MagickWand/magick-image.c b/ImageMagick-7.1.1-16/MagickWand/magick-image.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickWand/magick-image.c rename to ImageMagick-7.1.1-16/MagickWand/magick-image.c index 2d39b775..9b442228 100644 --- a/ImageMagick-7.1.1-15/MagickWand/magick-image.c +++ b/ImageMagick-7.1.1-16/MagickWand/magick-image.c @@ -976,9 +976,11 @@ WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand, if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); (void) FormatLocaleString(thresholds,MagickPathExtent, - QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat, - PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold), - PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold)); + "%g" "," "%g" "," "%g" "," "%g", + (double) PixelGetRedQuantum(threshold), + (double) PixelGetGreenQuantum(threshold), + (double) PixelGetBlueQuantum(threshold), + (double) PixelGetAlphaQuantum(threshold)); return(BlackThresholdImage(wand->images,thresholds,wand->exception)); } @@ -1772,18 +1774,18 @@ WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand, if (target.colorspace != CMYKColorspace) (void) FormatLocaleString(percent_blend,MagickPathExtent, "%g,%g,%g,%g",(double) (100.0*QuantumScale* - PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetAlphaQuantum(blend))); + (double) PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetAlphaQuantum(blend))); else (void) FormatLocaleString(percent_blend,MagickPathExtent, "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale* - PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetAlphaQuantum(blend))); + (double) PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetAlphaQuantum(blend))); target=PixelGetPixel(colorize); colorize_image=ColorizeImage(wand->images,percent_blend,&target, wand->exception); @@ -3616,7 +3618,8 @@ WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL); PixelGetQuantumPacket(fill,&draw_info->fill); (void) GetOneVirtualPixelInfo(wand->images,TileVirtualPixelMethod,x % - wand->images->columns,y % wand->images->rows,&target,wand->exception); + (ssize_t) wand->images->columns,y % (ssize_t) wand->images->rows,&target, + wand->exception); if (bordercolor != (PixelWand *) NULL) PixelGetMagickColor(bordercolor,&target); wand->images->fuzz=fuzz; @@ -10998,7 +11001,7 @@ WandExport MagickBooleanType MagickSetImageAlpha(MagickWand *wand, (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); - status=SetImageAlpha(wand->images,ClampToQuantum(QuantumRange*alpha), + status=SetImageAlpha(wand->images,ClampToQuantum((double) QuantumRange*alpha), wand->exception); return(status); } @@ -12717,18 +12720,18 @@ WandExport MagickBooleanType MagickTintImage(MagickWand *wand, if (wand->images->colorspace != CMYKColorspace) (void) FormatLocaleString(percent_blend,MagickPathExtent, "%g,%g,%g,%g",(double) (100.0*QuantumScale* - PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetAlphaQuantum(blend))); + (double) PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetAlphaQuantum(blend))); else (void) FormatLocaleString(percent_blend,MagickPathExtent, "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale* - PixelGetCyanQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetMagentaQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetYellowQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale* - PixelGetAlphaQuantum(blend))); + (double) PixelGetCyanQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetMagentaQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetYellowQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale* + (double) PixelGetAlphaQuantum(blend))); target=PixelGetPixel(tint); tint_image=TintImage(wand->images,percent_blend,&target,wand->exception); if (tint_image == (Image *) NULL) @@ -12840,7 +12843,7 @@ WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand, PixelGetMagickColor(target,&target_pixel); wand->images->fuzz=fuzz; status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum( - QuantumRange*alpha),invert,wand->exception); + (double) QuantumRange*alpha),invert,wand->exception); return(status); } @@ -13303,9 +13306,11 @@ WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand, if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); (void) FormatLocaleString(thresholds,MagickPathExtent, - QuantumFormat "," QuantumFormat "," QuantumFormat "," QuantumFormat, - PixelGetRedQuantum(threshold),PixelGetGreenQuantum(threshold), - PixelGetBlueQuantum(threshold),PixelGetAlphaQuantum(threshold)); + "%g" "," "%g" "," "%g" "," "%g", + (double) PixelGetRedQuantum(threshold), + (double) PixelGetGreenQuantum(threshold), + (double) PixelGetBlueQuantum(threshold), + (double) PixelGetAlphaQuantum(threshold)); return(WhiteThresholdImage(wand->images,thresholds,wand->exception)); } diff --git a/ImageMagick-7.1.1-15/MagickWand/magick-image.h b/ImageMagick-7.1.1-16/MagickWand/magick-image.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/magick-image.h rename to ImageMagick-7.1.1-16/MagickWand/magick-image.h diff --git a/ImageMagick-7.1.1-15/MagickWand/magick-property.c b/ImageMagick-7.1.1-16/MagickWand/magick-property.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/magick-property.c rename to ImageMagick-7.1.1-16/MagickWand/magick-property.c diff --git a/ImageMagick-7.1.1-15/MagickWand/magick-property.h b/ImageMagick-7.1.1-16/MagickWand/magick-property.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/magick-property.h rename to ImageMagick-7.1.1-16/MagickWand/magick-property.h diff --git a/ImageMagick-7.1.1-15/MagickWand/magick-wand-private.h b/ImageMagick-7.1.1-16/MagickWand/magick-wand-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/magick-wand-private.h rename to ImageMagick-7.1.1-16/MagickWand/magick-wand-private.h diff --git a/ImageMagick-7.1.1-15/MagickWand/magick-wand.c b/ImageMagick-7.1.1-16/MagickWand/magick-wand.c similarity index 96% rename from ImageMagick-7.1.1-15/MagickWand/magick-wand.c rename to ImageMagick-7.1.1-16/MagickWand/magick-wand.c index c7f57bdc..7fe5d77b 100644 --- a/ImageMagick-7.1.1-15/MagickWand/magick-wand.c +++ b/ImageMagick-7.1.1-16/MagickWand/magick-wand.c @@ -1014,7 +1014,29 @@ WandExport void MagickWandGenesis(void) % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% MagickWandTerminus() terminates the MagickWand environment. +% MagickWandTerminus() is a function in the ImageMagick library that is +% used to clean up and release resources when shutting down an application +% that uses ImageMagick. This function should be called in the primary thread +% of the application's process during the shutdown process. It's crucial that +% this function is invoked only after any threads that are using ImageMagick +% functions have terminated. +% +% ImageMagick might internally use threads via OpenMP (a method for parallel +% programming). As a result, it's important to ensure that any function calls +% into ImageMagick have completed before calling MagickWandTerminus(). This +% prevents issues with OpenMP worker threads accessing resources that are +% destroyed by this termination function. +% +% If OpenMP is being used (starting from version 5.0), the OpenMP +% implementation itself handles starting and stopping worker threads and +% allocating and freeing resources using its own methods. This means that +% after calling MagickWandTerminus(), some OpenMP resources and worker +% threads might still remain allocated. To address this, the function +% omp_pause_resource_all(omp_pause_hard) can be invoked. This function, +% introduced in OpenMP version 5.0, ensures that any resources allocated by +% OpenMP (such as threads and thread-specific memory) are freed. It's +% recommended to call this function after MagickWandTerminus() has completed +% its execution. % % The format of the MagickWandTerminus method is: % diff --git a/ImageMagick-7.1.1-15/MagickWand/method-attribute.h b/ImageMagick-7.1.1-16/MagickWand/method-attribute.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/method-attribute.h rename to ImageMagick-7.1.1-16/MagickWand/method-attribute.h diff --git a/ImageMagick-7.1.1-15/MagickWand/mogrify-private.h b/ImageMagick-7.1.1-16/MagickWand/mogrify-private.h similarity index 91% rename from ImageMagick-7.1.1-15/MagickWand/mogrify-private.h rename to ImageMagick-7.1.1-16/MagickWand/mogrify-private.h index 287d31e3..98695ad3 100644 --- a/ImageMagick-7.1.1-15/MagickWand/mogrify-private.h +++ b/ImageMagick-7.1.1-16/MagickWand/mogrify-private.h @@ -47,14 +47,14 @@ extern "C" { { \ DisableMSCWarning(4127) \ if (image_stack[k].image == (Image *) NULL) \ - status&=MogrifyImageInfo(image_stack[k].image_info,(int) (i-j+1), \ - (const char **) (argv+j),exception); \ + status&=(MagickStatusType) MogrifyImageInfo(image_stack[k].image_info, \ + (int) (i-j+1),(const char **) (argv+j),exception); \ else \ if ((fire) != MagickFalse) \ { \ - status&=MogrifyImages(image_stack[k].image_info,postfix,(int) \ - (i-j+1),(const char **) (argv+j),&image_stack[k].image, \ - exception); \ + status&=(MagickStatusType) MogrifyImages(image_stack[k].image_info,\ + postfix,(int) (i-j+1),(const char **) (argv+j), \ + &image_stack[k].image,exception); \ image=image_stack[k].image; \ if ((advance) != MagickFalse) \ j=i+1; \ diff --git a/ImageMagick-7.1.1-15/MagickWand/mogrify.c b/ImageMagick-7.1.1-16/MagickWand/mogrify.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickWand/mogrify.c rename to ImageMagick-7.1.1-16/MagickWand/mogrify.c index b29d5a52..45a09201 100644 --- a/ImageMagick-7.1.1-15/MagickWand/mogrify.c +++ b/ImageMagick-7.1.1-16/MagickWand/mogrify.c @@ -17,7 +17,7 @@ % March 2000 % % % % % -% Copyright @ 2000 ImageMagick Studio LLC, a non-profit organization % +% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % @@ -1175,7 +1175,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, */ (void) SyncImageSettings(mogrify_info,*image,exception); if (*option == '+') - threshold=40.0*QuantumRange/100.0; + threshold=40.0*(double) QuantumRange/100.0; else threshold=StringToDoubleInterval(argv[i+1],(double) QuantumRange+ 1.0); @@ -1834,8 +1834,8 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, gamma=geometry_info.xi; if ((flags & PercentValue) != 0) { - black_point*=(double) (QuantumRange/100.0); - white_point*=(double) (QuantumRange/100.0); + black_point*=(double) QuantumRange/100.0; + white_point*=(double) QuantumRange/100.0; } if ((flags & SigmaValue) == 0) white_point=(double) QuantumRange-black_point; @@ -2012,7 +2012,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, if ((flags & SigmaValue) == 0) geometry_info.sigma=geometry_info.rho; if ((flags & XiValue) == 0) - geometry_info.xi=0.10*QuantumRange; + geometry_info.xi=0.10*(double) QuantumRange; if ((flags & PercentValue) != 0) geometry_info.xi=(double) QuantumRange*geometry_info.xi/100.0; mogrify_image=MeanShiftImage(*image,(size_t) geometry_info.rho, @@ -2416,8 +2416,8 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, max_threshold=min_threshold; if (strchr(argv[i+1],'%') != (char *) NULL) { - max_threshold*=(double) (0.01*QuantumRange); - min_threshold*=(double) (0.01*QuantumRange); + max_threshold*=0.01*(double) QuantumRange; + min_threshold*=0.01*(double) QuantumRange; } (void) RandomThresholdImage(*image,min_threshold,max_threshold, exception); @@ -2438,10 +2438,10 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, geometry_info.psi=geometry_info.xi; if (strchr(argv[i+1],'%') != (char *) NULL) { - geometry_info.rho*=(double) (0.01*QuantumRange); - geometry_info.sigma*=(double) (0.01*QuantumRange); - geometry_info.xi*=(double) (0.01*QuantumRange); - geometry_info.psi*=(double) (0.01*QuantumRange); + geometry_info.rho*=0.01*(double) QuantumRange; + geometry_info.sigma*=0.01*(double) QuantumRange; + geometry_info.xi*=0.01*(double) QuantumRange; + geometry_info.psi*=0.01*(double) QuantumRange; } (void) RangeThresholdImage(*image,geometry_info.rho, geometry_info.sigma,geometry_info.xi,geometry_info.psi,exception); @@ -3226,8 +3226,9 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, flags=ParseGeometry(argv[i+1],&geometry_info); if ((flags & PercentValue) != 0) { - geometry_info.rho=QuantumRange*geometry_info.rho/100.0; - geometry_info.sigma=QuantumRange*geometry_info.sigma/100.0; + geometry_info.rho=(double) QuantumRange*geometry_info.rho/100.0; + geometry_info.sigma=(double) QuantumRange*geometry_info.sigma/ + 100.0; } if ((flags & SigmaValue) == 0) geometry_info.sigma=0.0; @@ -3848,7 +3849,7 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info, if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1))) filename=argv[++i]; images=ReadImages(image_info,filename,exception); - status&=(images != (Image *) NULL) && + status&=(MagickStatusType) (images != (Image *) NULL) && (exception->severity < ErrorException); if (images == (Image *) NULL) continue; @@ -3914,7 +3915,8 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info, Write transmogrified image to disk. */ image_info->synchronize=MagickTrue; - status&=WriteImages(image_info,image,image->filename,exception); + status&=(MagickStatusType) WriteImages(image_info,image,image->filename, + exception); if (status != MagickFalse) { #if defined(MAGICKCORE_HAVE_UTIME) @@ -8073,8 +8075,8 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, new_images->gravity,&geometry); mask_image=RemoveFirstImageFromList(images); if (mask_image == (Image *) NULL) - status&=CompositeImage(new_images,source_image,compose, - clip_to_self,geometry.x,geometry.y,exception); + status&=(MagickStatusType) CompositeImage(new_images,source_image, + compose,clip_to_self,geometry.x,geometry.y,exception); else { Image @@ -8087,30 +8089,33 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, { case BlendCompositeOp: { - status&=CompositeImage(new_images,source_image,compose, - clip_to_self,geometry.x,geometry.y,exception); - status&=CompositeImage(new_images,mask_image, - CopyAlphaCompositeOp,MagickTrue,0,0,exception); + status&=(MagickStatusType) CompositeImage(new_images, + source_image,compose,clip_to_self,geometry.x,geometry.y, + exception); + status&=(MagickStatusType) CompositeImage(new_images, + mask_image,CopyAlphaCompositeOp,MagickTrue,0,0,exception); break; } case DisplaceCompositeOp: case DistortCompositeOp: { - status&=CompositeImage(source_image,mask_image, - CopyGreenCompositeOp,MagickTrue,0,0,exception); + status&=(MagickStatusType) CompositeImage(source_image, + mask_image,CopyGreenCompositeOp,MagickTrue,0,0,exception); (void) SetImageColorspace(source_image,sRGBColorspace, exception); - status&=CompositeImage(new_images,source_image,compose, - clip_to_self,geometry.x,geometry.y,exception); + status&=(MagickStatusType) CompositeImage(new_images, + source_image,compose,clip_to_self,geometry.x,geometry.y, + exception); break; } case SaliencyBlendCompositeOp: case SeamlessBlendCompositeOp: { - status&=CompositeImage(source_image,mask_image, - CopyAlphaCompositeOp,MagickTrue,0,0,exception); - status&=CompositeImage(new_images,source_image,compose, - clip_to_self,geometry.x,geometry.y,exception); + status&=(MagickStatusType) CompositeImage(source_image, + mask_image,CopyAlphaCompositeOp,MagickTrue,0,0,exception); + status&=(MagickStatusType) CompositeImage(new_images, + source_image,compose,clip_to_self,geometry.x,geometry.y, + exception); break; } default: @@ -8121,12 +8126,13 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, clone_image=CloneImage(new_images,0,0,MagickTrue,exception); if (clone_image == (Image *) NULL) break; - status&=CompositeImage(new_images,source_image,compose, - clip_to_self,geometry.x,geometry.y,exception); - status&=CompositeImage(new_images,mask_image, - CopyAlphaCompositeOp,MagickTrue,0,0,exception); - status&=CompositeImage(clone_image,new_images, - OverCompositeOp,clip_to_self,0,0,exception); + status&=(MagickStatusType) CompositeImage(new_images, + source_image,compose,clip_to_self,geometry.x,geometry.y, + exception); + status&=(MagickStatusType) CompositeImage(new_images, + mask_image,CopyAlphaCompositeOp,MagickTrue,0,0,exception); + status&=(MagickStatusType) CompositeImage(clone_image, + new_images,OverCompositeOp,clip_to_self,0,0,exception); new_images=DestroyImageList(new_images); new_images=clone_image; break; @@ -8137,14 +8143,14 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, case DisplaceCompositeOp: case DistortCompositeOp: { - status&=CompositeImage(canvas_image,new_images, - CopyCompositeOp,clip_to_self,0,0,exception); + status&=(MagickStatusType) CompositeImage(canvas_image, + new_images,CopyCompositeOp,clip_to_self,0,0,exception); break; } default: { - status&=CompositeImage(canvas_image,new_images, - OverCompositeOp,clip_to_self,0,0,exception); + status&=(MagickStatusType) CompositeImage(canvas_image, + new_images,OverCompositeOp,clip_to_self,0,0,exception); break; } } @@ -8950,7 +8956,8 @@ puts("list"); (void) DeleteImageRegistry(key); write_images=CloneImageList(*images,exception); write_info=CloneImageInfo(mogrify_info); - status&=WriteImages(write_info,write_images,argv[i+1],exception); + status&=(MagickStatusType) WriteImages(write_info,write_images, + argv[i+1],exception); write_info=DestroyImageInfo(write_info); write_images=DestroyImageList(write_images); break; @@ -8964,7 +8971,7 @@ puts("list"); } quantize_info=DestroyQuantizeInfo(quantize_info); mogrify_info=DestroyImageInfo(mogrify_info); - status&=MogrifyImageInfo(image_info,argc,argv,exception); + status&=(MagickStatusType) MogrifyImageInfo(image_info,argc,argv,exception); return(status != 0 ? MagickTrue : MagickFalse); } @@ -9045,7 +9052,8 @@ WandExport MagickBooleanType MogrifyImages(ImageInfo *image_info, Pre-process multi-image sequence operators */ if (post == MagickFalse) - status&=MogrifyImageList(image_info,argc,argv,images,exception); + status&=(MagickStatusType) MogrifyImageList(image_info,argc,argv,images, + exception); /* For each image, process simple single image operators */ @@ -9057,7 +9065,8 @@ WandExport MagickBooleanType MogrifyImages(ImageInfo *image_info, (void) FormatLocaleFile(stderr,"mogrify %ld of %ld\n",(long) GetImageIndexInList(*images),(long)GetImageListLength(*images)); #endif - status&=MogrifyImage(image_info,argc,argv,images,exception); + status&=(MagickStatusType) MogrifyImage(image_info,argc,argv,images, + exception); proceed=SetImageProgress(*images,MogrifyImageTag,(MagickOffsetType) i, n); if (proceed == MagickFalse) break; @@ -9076,6 +9085,7 @@ WandExport MagickBooleanType MogrifyImages(ImageInfo *image_info, */ *images=GetFirstImageInList(*images); if (post != MagickFalse) - status&=MogrifyImageList(image_info,argc,argv,images,exception); + status&=(MagickStatusType) MogrifyImageList(image_info,argc,argv,images, + exception); return(status != 0 ? MagickTrue : MagickFalse); } diff --git a/ImageMagick-7.1.1-15/MagickWand/mogrify.h b/ImageMagick-7.1.1-16/MagickWand/mogrify.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/mogrify.h rename to ImageMagick-7.1.1-16/MagickWand/mogrify.h diff --git a/ImageMagick-7.1.1-15/MagickWand/montage.c b/ImageMagick-7.1.1-16/MagickWand/montage.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickWand/montage.c rename to ImageMagick-7.1.1-16/MagickWand/montage.c index 6eb1c81a..875d8f40 100644 --- a/ImageMagick-7.1.1-15/MagickWand/montage.c +++ b/ImageMagick-7.1.1-16/MagickWand/montage.c @@ -405,7 +405,7 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info, "%s.%.20g",image_info->filename,(double) scene); images=ReadImages(image_info,scene_filename,exception); } - status&=(images != (Image *) NULL) && + status&=(MagickStatusType) (images != (Image *) NULL) && (exception->severity < ErrorException); if (images == (Image *) NULL) continue; @@ -1833,7 +1833,8 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info, if (*montage_image->magick == '\0') (void) CopyMagickString(montage_image->magick,image->magick, MagickPathExtent); - status&=WriteImages(image_info,montage_image,argv[argc-1],exception); + status&=(MagickStatusType) WriteImages(image_info,montage_image, + argv[argc-1],exception); if (metadata != (char **) NULL) { char diff --git a/ImageMagick-7.1.1-15/MagickWand/montage.h b/ImageMagick-7.1.1-16/MagickWand/montage.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/montage.h rename to ImageMagick-7.1.1-16/MagickWand/montage.h diff --git a/ImageMagick-7.1.1-15/MagickWand/operation-private.h b/ImageMagick-7.1.1-16/MagickWand/operation-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/operation-private.h rename to ImageMagick-7.1.1-16/MagickWand/operation-private.h diff --git a/ImageMagick-7.1.1-15/MagickWand/operation.c b/ImageMagick-7.1.1-16/MagickWand/operation.c similarity index 98% rename from ImageMagick-7.1.1-15/MagickWand/operation.c rename to ImageMagick-7.1.1-16/MagickWand/operation.c index 1921985f..c2512357 100644 --- a/ImageMagick-7.1.1-15/MagickWand/operation.c +++ b/ImageMagick-7.1.1-16/MagickWand/operation.c @@ -2234,7 +2234,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, threshold=StringToDoubleInterval(arg1,(double) QuantumRange+1.0); } else - threshold=40.0*QuantumRange/100.0; + threshold=40.0*(double) QuantumRange/100.0; new_image=DeskewImage(_image,threshold,_exception); break; } @@ -2678,8 +2678,8 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, gamma=geometry_info.xi; if ((flags & PercentValue) != 0) { - black_point*=(double) (QuantumRange/100.0); - white_point*=(double) (QuantumRange/100.0); + black_point*=(double) QuantumRange/100.0; + white_point*=(double) QuantumRange/100.0; } if ((flags & SigmaValue) == 0) white_point=(double) QuantumRange-black_point; @@ -2831,7 +2831,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, if ((flags & SigmaValue) == 0) geometry_info.sigma=1.0; if ((flags & XiValue) == 0) - geometry_info.xi=0.10*QuantumRange; + geometry_info.xi=0.10*(double) QuantumRange; if ((flags & PercentValue) != 0) geometry_info.xi=(double) QuantumRange*geometry_info.xi/100.0; new_image=MeanShiftImage(_image,(size_t) geometry_info.rho, @@ -3147,8 +3147,8 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, break; if (strchr(arg1,'%') != (char *) NULL) { - max_threshold*=(double) (0.01*QuantumRange); - min_threshold*=(double) (0.01*QuantumRange); + max_threshold*=(0.01*(double) QuantumRange); + min_threshold*=(0.01*(double) QuantumRange); } (void) RandomThresholdImage(_image,min_threshold,max_threshold, _exception); @@ -3170,10 +3170,10 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, geometry_info.psi=geometry_info.xi; if (strchr(arg1,'%') != (char *) NULL) { - geometry_info.rho*=(double) (0.01*QuantumRange); - geometry_info.sigma*=(double) (0.01*QuantumRange); - geometry_info.xi*=(double) (0.01*QuantumRange); - geometry_info.psi*=(double) (0.01*QuantumRange); + geometry_info.rho*=(0.01*(double) QuantumRange); + geometry_info.sigma*=(0.01*(double) QuantumRange); + geometry_info.xi*=(0.01*(double) QuantumRange); + geometry_info.psi*=(0.01*(double) QuantumRange); } (void) RangeThresholdImage(_image,geometry_info.rho, geometry_info.sigma,geometry_info.xi,geometry_info.psi,exception); @@ -3690,8 +3690,9 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); if ((flags & PercentValue) != 0) { - geometry_info.rho=QuantumRange*geometry_info.rho/100.0; - geometry_info.sigma=QuantumRange*geometry_info.sigma/100.0; + geometry_info.rho=(double) QuantumRange*geometry_info.rho/100.0; + geometry_info.sigma=(double) QuantumRange*geometry_info.sigma/ + 100.0; } if ((flags & SigmaValue) == 0) geometry_info.sigma=0.0; @@ -4089,8 +4090,8 @@ static MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand, new_images->gravity, &geometry); mask_image=RemoveFirstImageFromList(&_images); if (mask_image == (Image *) NULL) - status&=CompositeImage(new_images,source_image,compose,clip_to_self, - geometry.x,geometry.y,_exception); + status&=(MagickStatusType) CompositeImage(new_images,source_image, + compose,clip_to_self,geometry.x,geometry.y,_exception); else { Image @@ -4103,30 +4104,33 @@ static MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand, { case BlendCompositeOp: { - status&=CompositeImage(new_images,source_image,compose, - clip_to_self,geometry.x,geometry.y,_exception); - status&=CompositeImage(new_images,mask_image, - CopyAlphaCompositeOp,MagickTrue,0,0,_exception); + status&=(MagickStatusType) CompositeImage(new_images, + source_image,compose,clip_to_self,geometry.x,geometry.y, + _exception); + status&=(MagickStatusType) CompositeImage(new_images, + mask_image,CopyAlphaCompositeOp,MagickTrue,0,0,_exception); break; } case DisplaceCompositeOp: case DistortCompositeOp: { - status&=CompositeImage(source_image,mask_image, - CopyGreenCompositeOp,MagickTrue,0,0,_exception); + status&=(MagickStatusType) CompositeImage(source_image, + mask_image,CopyGreenCompositeOp,MagickTrue,0,0,_exception); (void) SetImageColorspace(source_image,sRGBColorspace, _exception); - status&=CompositeImage(new_images,source_image,compose, - clip_to_self,geometry.x,geometry.y,_exception); + status&=(MagickStatusType) CompositeImage(new_images, + source_image,compose,clip_to_self,geometry.x,geometry.y, + _exception); break; } case SaliencyBlendCompositeOp: case SeamlessBlendCompositeOp: { - status&=CompositeImage(source_image,mask_image, - CopyAlphaCompositeOp,MagickTrue,0,0,_exception); - status&=CompositeImage(new_images,source_image,compose, - clip_to_self,geometry.x,geometry.y,_exception); + status&=(MagickStatusType) CompositeImage(source_image, + mask_image,CopyAlphaCompositeOp,MagickTrue,0,0,_exception); + status&=(MagickStatusType) CompositeImage(new_images, + source_image,compose,clip_to_self,geometry.x,geometry.y, + _exception); break; } default: @@ -4137,12 +4141,13 @@ static MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand, clone_image=CloneImage(new_images,0,0,MagickTrue,_exception); if (clone_image == (Image *) NULL) break; - status&=CompositeImage(new_images,source_image,compose, - clip_to_self,geometry.x,geometry.y,_exception); - status&=CompositeImage(new_images,mask_image, - CopyAlphaCompositeOp,MagickTrue,0,0,_exception); - status&=CompositeImage(clone_image,new_images,OverCompositeOp, - clip_to_self,0,0,_exception); + status&=(MagickStatusType) CompositeImage(new_images, + source_image,compose,clip_to_self,geometry.x,geometry.y, + _exception); + status&=(MagickStatusType) CompositeImage(new_images, + mask_image,CopyAlphaCompositeOp,MagickTrue,0,0,_exception); + status&=(MagickStatusType) CompositeImage(clone_image, + new_images,OverCompositeOp,clip_to_self,0,0,_exception); new_images=DestroyImageList(new_images); new_images=clone_image; break; @@ -4153,14 +4158,14 @@ static MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand, case DisplaceCompositeOp: case DistortCompositeOp: { - status&=CompositeImage(canvas_image,new_images, - CopyCompositeOp,clip_to_self,0,0,_exception); + status&=(MagickStatusType) CompositeImage(canvas_image, + new_images,CopyCompositeOp,clip_to_self,0,0,_exception); break; } default: { - status&=CompositeImage(canvas_image,new_images, - OverCompositeOp,clip_to_self,0,0,_exception); + status&=(MagickStatusType) CompositeImage(canvas_image, + new_images,OverCompositeOp,clip_to_self,0,0,_exception); break; } } diff --git a/ImageMagick-7.1.1-15/MagickWand/operation.h b/ImageMagick-7.1.1-16/MagickWand/operation.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/operation.h rename to ImageMagick-7.1.1-16/MagickWand/operation.h diff --git a/ImageMagick-7.1.1-15/MagickWand/pixel-iterator.c b/ImageMagick-7.1.1-16/MagickWand/pixel-iterator.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/pixel-iterator.c rename to ImageMagick-7.1.1-16/MagickWand/pixel-iterator.c diff --git a/ImageMagick-7.1.1-15/MagickWand/pixel-iterator.h b/ImageMagick-7.1.1-16/MagickWand/pixel-iterator.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/pixel-iterator.h rename to ImageMagick-7.1.1-16/MagickWand/pixel-iterator.h diff --git a/ImageMagick-7.1.1-15/MagickWand/pixel-wand-private.h b/ImageMagick-7.1.1-16/MagickWand/pixel-wand-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/pixel-wand-private.h rename to ImageMagick-7.1.1-16/MagickWand/pixel-wand-private.h diff --git a/ImageMagick-7.1.1-15/MagickWand/pixel-wand.c b/ImageMagick-7.1.1-16/MagickWand/pixel-wand.c similarity index 97% rename from ImageMagick-7.1.1-15/MagickWand/pixel-wand.c rename to ImageMagick-7.1.1-16/MagickWand/pixel-wand.c index abf86628..7e22d053 100644 --- a/ImageMagick-7.1.1-15/MagickWand/pixel-wand.c +++ b/ImageMagick-7.1.1-16/MagickWand/pixel-wand.c @@ -496,7 +496,7 @@ WandExport double PixelGetAlpha(const PixelWand *wand) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - return((double) QuantumScale*wand->pixel.alpha); + return(QuantumScale*(double) wand->pixel.alpha); } /* @@ -558,7 +558,7 @@ WandExport double PixelGetBlack(const PixelWand *wand) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - return((double) QuantumScale*wand->pixel.black); + return(QuantumScale*(double) wand->pixel.black); } /* @@ -620,7 +620,7 @@ WandExport double PixelGetBlue(const PixelWand *wand) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - return((double) QuantumScale*wand->pixel.blue); + return(QuantumScale*(double) wand->pixel.blue); } /* @@ -797,7 +797,7 @@ WandExport double PixelGetCyan(const PixelWand *wand) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - return((double) QuantumScale*wand->pixel.red); + return(QuantumScale*(double) wand->pixel.red); } /* @@ -979,7 +979,7 @@ WandExport double PixelGetGreen(const PixelWand *wand) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - return((double) QuantumScale*wand->pixel.green); + return(QuantumScale*(double) wand->pixel.green); } /* @@ -1110,7 +1110,7 @@ WandExport double PixelGetMagenta(const PixelWand *wand) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - return((double) QuantumScale*wand->pixel.green); + return(QuantumScale*(double) wand->pixel.green); } /* @@ -1251,12 +1251,12 @@ WandExport void PixelGetQuantumPacket(const PixelWand *wand,PixelInfo *packet) packet->alpha_trait=wand->pixel.alpha_trait; if (wand->pixel.colorspace == CMYKColorspace) { - packet->red=(double) ClampToQuantum(QuantumRange-(wand->pixel.red* - (QuantumRange-wand->pixel.black)+wand->pixel.black)); - packet->green=(double) ClampToQuantum(QuantumRange-(wand->pixel.green* - (QuantumRange-wand->pixel.black)+wand->pixel.black)); - packet->blue=(double) ClampToQuantum(QuantumRange-(wand->pixel.blue* - (QuantumRange-wand->pixel.black)+wand->pixel.black)); + packet->red=(double) ClampToQuantum((double) QuantumRange-(wand->pixel.red* + ((double) QuantumRange-wand->pixel.black)+wand->pixel.black)); + packet->green=(double) ClampToQuantum((double) QuantumRange-(wand->pixel.green* + ((double) QuantumRange-wand->pixel.black)+wand->pixel.black)); + packet->blue=(double) ClampToQuantum((double) QuantumRange-(wand->pixel.blue* + ((double) QuantumRange-wand->pixel.black)+wand->pixel.black)); packet->black=(double) ClampToQuantum(wand->pixel.black); return; } @@ -1301,14 +1301,14 @@ WandExport void PixelGetQuantumPixel(const Image *image,const PixelWand *wand, SetPixelAlpha(image,ClampToQuantum(wand->pixel.alpha),pixel); if (wand->pixel.colorspace == CMYKColorspace) { - SetPixelRed(image,ClampToQuantum(QuantumRange- - (wand->pixel.red*(QuantumRange-wand->pixel.black)+wand->pixel.black)), + SetPixelRed(image,ClampToQuantum((double) QuantumRange- + (wand->pixel.red*((double) QuantumRange-wand->pixel.black)+wand->pixel.black)), pixel); - SetPixelGreen(image,ClampToQuantum(QuantumRange- - (wand->pixel.green*(QuantumRange-wand->pixel.black)+wand->pixel.black)), + SetPixelGreen(image,ClampToQuantum((double) QuantumRange- + (wand->pixel.green*((double) QuantumRange-wand->pixel.black)+wand->pixel.black)), pixel); - SetPixelBlue(image,ClampToQuantum(QuantumRange- - (wand->pixel.blue*(QuantumRange-wand->pixel.black)+wand->pixel.black)), + SetPixelBlue(image,ClampToQuantum((double) QuantumRange- + (wand->pixel.blue*((double) QuantumRange-wand->pixel.black)+wand->pixel.black)), pixel); SetPixelBlack(image,ClampToQuantum(wand->pixel.black),pixel); return; @@ -1346,7 +1346,7 @@ WandExport double PixelGetRed(const PixelWand *wand) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - return((double) QuantumScale*wand->pixel.red); + return(QuantumScale*(double) wand->pixel.red); } /* @@ -1408,7 +1408,7 @@ WandExport double PixelGetYellow(const PixelWand *wand) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - return((double) QuantumScale*wand->pixel.blue); + return(QuantumScale*(double) wand->pixel.blue); } /* @@ -1473,7 +1473,7 @@ WandExport void PixelSetAlpha(PixelWand *wand,const double alpha) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - wand->pixel.alpha=(double) ClampToQuantum(QuantumRange*alpha); + wand->pixel.alpha=(double) ClampToQuantum((double) QuantumRange*alpha); } /* @@ -1539,7 +1539,7 @@ WandExport void PixelSetBlack(PixelWand *wand,const double black) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - wand->pixel.black=(double) ClampToQuantum(QuantumRange*black); + wand->pixel.black=(double) ClampToQuantum((double) QuantumRange*black); } /* @@ -1605,7 +1605,7 @@ WandExport void PixelSetBlue(PixelWand *wand,const double blue) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - wand->pixel.blue=(double) ClampToQuantum(QuantumRange*blue); + wand->pixel.blue=(double) ClampToQuantum((double) QuantumRange*blue); } /* @@ -1781,7 +1781,7 @@ WandExport void PixelSetCyan(PixelWand *wand,const double cyan) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - wand->pixel.red=(double) ClampToQuantum(QuantumRange*cyan); + wand->pixel.red=(double) ClampToQuantum((double) QuantumRange*cyan); } /* @@ -1880,7 +1880,7 @@ WandExport void PixelSetGreen(PixelWand *wand,const double green) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - wand->pixel.green=(double) ClampToQuantum(QuantumRange*green); + wand->pixel.green=(double) ClampToQuantum((double) QuantumRange*green); } /* @@ -2023,7 +2023,7 @@ WandExport void PixelSetMagenta(PixelWand *wand,const double magenta) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - wand->pixel.green=(double) ClampToQuantum(QuantumRange*magenta); + wand->pixel.green=(double) ClampToQuantum((double) QuantumRange*magenta); } /* @@ -2166,7 +2166,7 @@ WandExport void PixelSetRed(PixelWand *wand,const double red) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - wand->pixel.red=(double) ClampToQuantum(QuantumRange*red); + wand->pixel.red=(double) ClampToQuantum((double) QuantumRange*red); } /* @@ -2232,7 +2232,7 @@ WandExport void PixelSetYellow(PixelWand *wand,const double yellow) assert(wand->signature == MagickWandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - wand->pixel.blue=(double) ClampToQuantum(QuantumRange*yellow); + wand->pixel.blue=(double) ClampToQuantum((double) QuantumRange*yellow); } /* diff --git a/ImageMagick-7.1.1-15/MagickWand/pixel-wand.h b/ImageMagick-7.1.1-16/MagickWand/pixel-wand.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/pixel-wand.h rename to ImageMagick-7.1.1-16/MagickWand/pixel-wand.h diff --git a/ImageMagick-7.1.1-15/MagickWand/script-token.c b/ImageMagick-7.1.1-16/MagickWand/script-token.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/script-token.c rename to ImageMagick-7.1.1-16/MagickWand/script-token.c diff --git a/ImageMagick-7.1.1-15/MagickWand/script-token.h b/ImageMagick-7.1.1-16/MagickWand/script-token.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/script-token.h rename to ImageMagick-7.1.1-16/MagickWand/script-token.h diff --git a/ImageMagick-7.1.1-15/MagickWand/stream.c b/ImageMagick-7.1.1-16/MagickWand/stream.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickWand/stream.c rename to ImageMagick-7.1.1-16/MagickWand/stream.c index 1587d2b7..b395298f 100644 --- a/ImageMagick-7.1.1-15/MagickWand/stream.c +++ b/ImageMagick-7.1.1-16/MagickWand/stream.c @@ -282,7 +282,7 @@ WandExport MagickBooleanType StreamImageCommand(ImageInfo *image_info, filename=argv[++i]; (void) CopyMagickString(image_info->filename,filename,MagickPathExtent); images=StreamImage(image_info,stream_info,exception); - status&=(images != (Image *) NULL) && + status&=(MagickStatusType) (images != (Image *) NULL) && (exception->severity < ErrorException); if (images == (Image *) NULL) continue; diff --git a/ImageMagick-7.1.1-15/MagickWand/stream.h b/ImageMagick-7.1.1-16/MagickWand/stream.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/stream.h rename to ImageMagick-7.1.1-16/MagickWand/stream.h diff --git a/ImageMagick-7.1.1-15/MagickWand/studio.h b/ImageMagick-7.1.1-16/MagickWand/studio.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/studio.h rename to ImageMagick-7.1.1-16/MagickWand/studio.h diff --git a/ImageMagick-7.1.1-15/MagickWand/wand-view.c b/ImageMagick-7.1.1-16/MagickWand/wand-view.c similarity index 99% rename from ImageMagick-7.1.1-15/MagickWand/wand-view.c rename to ImageMagick-7.1.1-16/MagickWand/wand-view.c index b751f6af..21c3748f 100644 --- a/ImageMagick-7.1.1-15/MagickWand/wand-view.c +++ b/ImageMagick-7.1.1-16/MagickWand/wand-view.c @@ -286,7 +286,7 @@ WandExport MagickBooleanType DuplexTransferWandViewIterator(WandView *source, status=MagickTrue; progress=0; #if defined(MAGICKCORE_OPENMP_SUPPORT) - height=source->extent.height-source->extent.y; + height=(size_t) ((ssize_t) source->extent.height-source->extent.y); #pragma omp parallel for schedule(static) shared(progress,status) \ magick_number_threads(source_image,destination_image,height,1) #endif @@ -540,7 +540,7 @@ WandExport MagickBooleanType GetWandViewIterator(WandView *source, status=MagickTrue; progress=0; #if defined(MAGICKCORE_OPENMP_SUPPORT) - height=source->extent.height-source->extent.y; + height=(size_t) ((ssize_t) source->extent.height-source->extent.y); #pragma omp parallel for schedule(static) shared(progress,status) \ magick_number_threads(source_image,source_image,height,1) #endif @@ -939,7 +939,7 @@ WandExport MagickBooleanType SetWandViewIterator(WandView *destination, status=MagickTrue; progress=0; #if defined(MAGICKCORE_OPENMP_SUPPORT) - height=destination->extent.height-destination->extent.y; + height=(size_t) ((ssize_t) destination->extent.height-destination->extent.y); #pragma omp parallel for schedule(static) shared(progress,status) \ magick_number_threads(destination_image,destination_image,height,1) #endif @@ -1077,7 +1077,7 @@ WandExport MagickBooleanType TransferWandViewIterator(WandView *source, status=MagickTrue; progress=0; #if defined(MAGICKCORE_OPENMP_SUPPORT) - height=source->extent.height-source->extent.y; + height=(size_t) ((ssize_t) source->extent.height-source->extent.y); #pragma omp parallel for schedule(static) shared(progress,status) \ magick_number_threads(source_image,destination_image,height,1) #endif @@ -1232,7 +1232,7 @@ WandExport MagickBooleanType UpdateWandViewIterator(WandView *source, status=MagickTrue; progress=0; #if defined(MAGICKCORE_OPENMP_SUPPORT) - height=source->extent.height-source->extent.y; + height=(size_t) ((ssize_t) source->extent.height-source->extent.y); #pragma omp parallel for schedule(static) shared(progress,status) \ magick_number_threads(source_image,source_image,height,1) #endif diff --git a/ImageMagick-7.1.1-15/MagickWand/wand-view.h b/ImageMagick-7.1.1-16/MagickWand/wand-view.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/wand-view.h rename to ImageMagick-7.1.1-16/MagickWand/wand-view.h diff --git a/ImageMagick-7.1.1-15/MagickWand/wand.c b/ImageMagick-7.1.1-16/MagickWand/wand.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/wand.c rename to ImageMagick-7.1.1-16/MagickWand/wand.c diff --git a/ImageMagick-7.1.1-15/MagickWand/wand.h b/ImageMagick-7.1.1-16/MagickWand/wand.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/wand.h rename to ImageMagick-7.1.1-16/MagickWand/wand.h diff --git a/ImageMagick-7.1.1-15/MagickWand/wandcli-private.h b/ImageMagick-7.1.1-16/MagickWand/wandcli-private.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/wandcli-private.h rename to ImageMagick-7.1.1-16/MagickWand/wandcli-private.h diff --git a/ImageMagick-7.1.1-15/MagickWand/wandcli.c b/ImageMagick-7.1.1-16/MagickWand/wandcli.c similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/wandcli.c rename to ImageMagick-7.1.1-16/MagickWand/wandcli.c diff --git a/ImageMagick-7.1.1-15/MagickWand/wandcli.h b/ImageMagick-7.1.1-16/MagickWand/wandcli.h similarity index 100% rename from ImageMagick-7.1.1-15/MagickWand/wandcli.h rename to ImageMagick-7.1.1-16/MagickWand/wandcli.h diff --git a/ImageMagick-7.1.1-15/coders/aai.c b/ImageMagick-7.1.1-16/coders/aai.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/aai.c rename to ImageMagick-7.1.1-16/coders/aai.c diff --git a/ImageMagick-7.1.1-15/coders/aai.h b/ImageMagick-7.1.1-16/coders/aai.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/aai.h rename to ImageMagick-7.1.1-16/coders/aai.h diff --git a/ImageMagick-7.1.1-15/coders/art.c b/ImageMagick-7.1.1-16/coders/art.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/art.c rename to ImageMagick-7.1.1-16/coders/art.c diff --git a/ImageMagick-7.1.1-15/coders/art.h b/ImageMagick-7.1.1-16/coders/art.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/art.h rename to ImageMagick-7.1.1-16/coders/art.h diff --git a/ImageMagick-7.1.1-15/coders/ashlar.c b/ImageMagick-7.1.1-16/coders/ashlar.c similarity index 94% rename from ImageMagick-7.1.1-15/coders/ashlar.c rename to ImageMagick-7.1.1-16/coders/ashlar.c index 1dfa141c..64e6c0bf 100644 --- a/ImageMagick-7.1.1-15/coders/ashlar.c +++ b/ImageMagick-7.1.1-16/coders/ashlar.c @@ -231,7 +231,7 @@ static inline ssize_t FindMinimumTileLocation(NodeInfo *first,const ssize_t x, y=0; extent=0; node=first; - while (node->x < (ssize_t) (x+width)) + while (node->x < (x+(ssize_t) width)) { if (node->y > y) { @@ -245,10 +245,10 @@ static inline ssize_t FindMinimumTileLocation(NodeInfo *first,const ssize_t x, else { size_t delta = (size_t) (node->next->x-node->x); - if ((delta+extent) > width) - delta=width-extent; - *excess+=delta*(y-node->y); - extent+=delta; + if ((delta+(size_t) extent) > width) + delta=width-(size_t) extent; + *excess+=(ssize_t) delta*(y-node->y); + extent+=(ssize_t) delta; } node=node->next; } @@ -276,8 +276,8 @@ static inline TileInfo AssignBestTileLocation(AshlarInfo *ashlar_info, Align along left edge. */ tile.previous=(NodeInfo **) NULL; - ashlar_width=(width+ashlar_info->align-1); - ashlar_width-=ashlar_width % ashlar_info->align; + ashlar_width=(size_t) ((ssize_t) width+ashlar_info->align-1); + ashlar_width-=(size_t) ((ssize_t) ashlar_width % ashlar_info->align); if ((ashlar_width > ashlar_info->width) || (height > ashlar_info->height)) { /* @@ -292,7 +292,7 @@ static inline TileInfo AssignBestTileLocation(AshlarInfo *ashlar_info, min_excess=(ssize_t) MAGICK_SSIZE_MAX; node=ashlar_info->current; previous=(&ashlar_info->current); - while ((ashlar_width+node->x) <= ashlar_info->width) + while (((ssize_t) ashlar_width+node->x) <= (ssize_t) ashlar_info->width) { ssize_t excess, @@ -309,7 +309,7 @@ static inline TileInfo AssignBestTileLocation(AshlarInfo *ashlar_info, } else { - if ((height+y) <= ashlar_info->height) + if (((ssize_t) height+y) <= (ssize_t) ashlar_info->height) if ((y < tile.y) || ((y == tile.y) && (excess < min_excess))) { tile.y=y; @@ -338,14 +338,14 @@ static inline TileInfo AssignBestTileLocation(AshlarInfo *ashlar_info, x, y; - x=tail->x-ashlar_width; + x=tail->x-(ssize_t) ashlar_width; while (node->next->x <= x) { previous=(&node->next); node=node->next; } y=FindMinimumTileLocation(node,x,ashlar_width,&excess); - if ((height+y) <= ashlar_info->height) + if (((ssize_t) height+y) <= (ssize_t) ashlar_info->height) { if (y <= tile.y) if ((y < tile.y) || (excess < min_excess) || @@ -389,7 +389,7 @@ static inline TileInfo AssignTileLocation(AshlarInfo *ashlar_info, */ node=ashlar_info->free; node->x=(ssize_t) tile.x; - node->y=(ssize_t) (tile.y+height); + node->y=tile.y+(ssize_t) height; ashlar_info->free=node->next; /* Insert node. @@ -416,7 +416,7 @@ static inline TileInfo AssignTileLocation(AshlarInfo *ashlar_info, } node->next=current; if (current->x < (tile.x+(ssize_t) width)) - current->x=(ssize_t) (tile.x+width); + current->x=tile.x+(ssize_t) width; return(tile); } @@ -627,8 +627,8 @@ static Image *ASHLARImage(ImageInfo *image_info,Image *image, (tiles[i].y == (ssize_t) MAGICK_SSIZE_MAX)) continue; tile_image=ResizeImage(GetImageFromList(image,tiles[i].id),(size_t) - (tiles[i].width-2*geometry.x),(size_t) (tiles[i].height-2*geometry.y), - image->filter,exception); + ((ssize_t) tiles[i].width-2*geometry.x),(size_t) + ((ssize_t) tiles[i].height-2*geometry.y),image->filter,exception); if (tile_image == (Image *) NULL) continue; (void) CompositeImage(ashlar_image,tile_image,image->compose,MagickTrue, @@ -655,10 +655,11 @@ static Image *ASHLARImage(ImageInfo *image_info,Image *image, (void) AnnotateImage(ashlar_image,draw_info,exception); } } - if ((tiles[i].width+tiles[i].x) > extent.width) - extent.width=(size_t) (tiles[i].width+tiles[i].x); - if ((tiles[i].height+tiles[i].y+geometry.y+2) > extent.height) - extent.height=(size_t) (tiles[i].height+tiles[i].y+geometry.y+2); + if (((ssize_t) tiles[i].width+tiles[i].x) > (ssize_t) extent.width) + extent.width=(size_t) ((ssize_t) tiles[i].width+tiles[i].x); + if (((ssize_t) tiles[i].height+tiles[i].y+geometry.y+2) > (ssize_t) extent.height) + extent.height=(size_t) ((ssize_t) tiles[i].height+tiles[i].y+ + geometry.y+2); tile_image=DestroyImage(tile_image); } (void) SetImageExtent(ashlar_image,extent.width,extent.height,exception); @@ -706,7 +707,7 @@ static MagickBooleanType WriteASHLARImage(const ImageInfo *image_info, tiles_per_page=(size_t) MagickMax(StringToInteger(value),1); ashlar_images=NewImageList(); write_info=CloneImageInfo(image_info); - for (i=0; i < (ssize_t) GetImageListLength(image); i+=tiles_per_page) + for (i=0; i < (ssize_t) GetImageListLength(image); i+=(ssize_t) tiles_per_page) { char scenes[MagickPathExtent]; @@ -716,7 +717,7 @@ static MagickBooleanType WriteASHLARImage(const ImageInfo *image_info, *clone_images; (void) FormatLocaleString(scenes,MagickPathExtent,"%g-%g",(double) i, - (double) (i+tiles_per_page-1)); + (double) (i+(ssize_t) tiles_per_page-1)); clone_images=CloneImages(image,scenes,exception); if (clone_images == (Image *) NULL) { diff --git a/ImageMagick-7.1.1-15/coders/ashlar.h b/ImageMagick-7.1.1-16/coders/ashlar.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/ashlar.h rename to ImageMagick-7.1.1-16/coders/ashlar.h diff --git a/ImageMagick-7.1.1-15/coders/avs.c b/ImageMagick-7.1.1-16/coders/avs.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/avs.c rename to ImageMagick-7.1.1-16/coders/avs.c diff --git a/ImageMagick-7.1.1-15/coders/avs.h b/ImageMagick-7.1.1-16/coders/avs.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/avs.h rename to ImageMagick-7.1.1-16/coders/avs.h diff --git a/ImageMagick-7.1.1-15/coders/bayer.c b/ImageMagick-7.1.1-16/coders/bayer.c similarity index 97% rename from ImageMagick-7.1.1-15/coders/bayer.c rename to ImageMagick-7.1.1-16/coders/bayer.c index 2cdaba2f..5489a04a 100644 --- a/ImageMagick-7.1.1-15/coders/bayer.c +++ b/ImageMagick-7.1.1-16/coders/bayer.c @@ -325,7 +325,8 @@ static Image* BayerApplyMask(Image *images,size_t index_a,size_t index_b, (void) QueryColorCompliance("#000",AllCompliance, &draw_info->fill_pattern->background_color,exception); (void) SetImageBackgroundColor(draw_info->fill_pattern,exception); - q=GetAuthenticPixels(draw_info->fill_pattern,fill_x,fill_y,1,1,exception); + q=GetAuthenticPixels(draw_info->fill_pattern,(ssize_t) fill_x,(ssize_t) + fill_y,1,1,exception); if (q == (Quantum *) NULL) { draw_info=DestroyDrawInfo(draw_info); @@ -333,8 +334,8 @@ static Image* BayerApplyMask(Image *images,size_t index_a,size_t index_b, } (void) QueryColorCompliance("#fff",AllCompliance,&pixel,exception); SetPixelViaPixelInfo(draw_info->fill_pattern,&pixel,q); - mask_image=CloneImage(GetImageFromList(images,index_a),0,0,MagickTrue, - exception); + mask_image=CloneImage(GetImageFromList(images,(ssize_t) index_a),0,0, + MagickTrue,exception); if (mask_image == (Image *) NULL) { draw_info=DestroyDrawInfo(draw_info); @@ -344,7 +345,8 @@ static Image* BayerApplyMask(Image *images,size_t index_a,size_t index_b, (void) DrawImage(mask_image,draw_info,exception); (void) SetImageAlphaChannel(mask_image,OffAlphaChannel,exception); draw_info=DestroyDrawInfo(draw_info); - canvas=CloneImage(GetImageFromList(images,index_b),0,0,MagickTrue,exception); + canvas=CloneImage(GetImageFromList(images,(ssize_t) index_b),0,0,MagickTrue, + exception); if (canvas == (Image *) NULL) { mask_image=DestroyImage(mask_image); @@ -353,7 +355,8 @@ static Image* BayerApplyMask(Image *images,size_t index_a,size_t index_b, (void) CompositeImage(canvas,mask_image,CopyAlphaCompositeOp,MagickTrue,0,0, exception); mask_image=DestroyImage(mask_image); - result=CloneImage(GetImageFromList(images,index_a),0,0,MagickTrue,exception); + result=CloneImage(GetImageFromList(images,(ssize_t) index_a),0,0,MagickTrue, + exception); if (result != (Image *) NULL) { (void) CompositeImage(result,canvas,OverCompositeOp,MagickTrue,0,0, diff --git a/ImageMagick-7.1.1-15/coders/bayer.h b/ImageMagick-7.1.1-16/coders/bayer.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/bayer.h rename to ImageMagick-7.1.1-16/coders/bayer.h diff --git a/ImageMagick-7.1.1-15/coders/bgr.c b/ImageMagick-7.1.1-16/coders/bgr.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/bgr.c rename to ImageMagick-7.1.1-16/coders/bgr.c index fb1e5788..3b1d6bdf 100644 --- a/ImageMagick-7.1.1-15/coders/bgr.c +++ b/ImageMagick-7.1.1-16/coders/bgr.c @@ -152,7 +152,7 @@ static Image *ReadBGRImage(const ImageInfo *image_info,ExceptionInfo *exception) image=DestroyImageList(image); return((Image *) NULL); } - if (DiscardBlobBytes(image,image->offset) == MagickFalse) + if (DiscardBlobBytes(image,(MagickSizeType) image->offset) == MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); } diff --git a/ImageMagick-7.1.1-15/coders/bgr.h b/ImageMagick-7.1.1-16/coders/bgr.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/bgr.h rename to ImageMagick-7.1.1-16/coders/bgr.h diff --git a/ImageMagick-7.1.1-15/coders/bmp.c b/ImageMagick-7.1.1-16/coders/bmp.c similarity index 93% rename from ImageMagick-7.1.1-15/coders/bmp.c rename to ImageMagick-7.1.1-16/coders/bmp.c index ccd8f094..94ec6628 100644 --- a/ImageMagick-7.1.1-15/coders/bmp.c +++ b/ImageMagick-7.1.1-16/coders/bmp.c @@ -75,6 +75,9 @@ #define BI_JPEG 4 #undef BI_PNG #define BI_PNG 5 +#ifndef BI_ALPHABITFIELDS + #define BI_ALPHABITFIELDS 6 +#endif #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__MINGW32__) #undef BI_RGB #define BI_RGB 0 @@ -278,7 +281,7 @@ static MagickBooleanType DecodeImage(Image *image,const size_t compression, */ x=0; y++; - p=pixels+y*image->columns; + p=pixels+y*(ssize_t) image->columns; break; } case 0x02: @@ -294,7 +297,7 @@ static MagickBooleanType DecodeImage(Image *image,const size_t compression, if (byte == EOF) return(MagickFalse); y+=byte; - p=pixels+y*image->columns+x; + p=pixels+y*(ssize_t) image->columns+x; break; } default: @@ -515,6 +518,63 @@ static MagickBooleanType IsBMP(const unsigned char *magick,const size_t length) % */ +static Image *ReadEmbedImage(const ImageInfo *image_info,Image *image, + const char *magick,ExceptionInfo *exception) +{ + const void + *stream; + + Image + *embed_image; + + ImageInfo + *embed_info; + + MemoryInfo + *pixel_info; + + size_t + length; + + ssize_t + count; + + unsigned char + *pixels; + + /* + Read embedded image. + */ + length=(size_t) ((MagickOffsetType) GetBlobSize(image)-TellBlob(image)); + pixel_info=AcquireVirtualMemory(length,sizeof(*pixels)); + if (pixel_info == (MemoryInfo *) NULL) + ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + pixels=(unsigned char *) GetVirtualMemoryBlob(pixel_info); + stream=ReadBlobStream(image,length,pixels,&count); + if (count != (ssize_t) length) + { + pixel_info=RelinquishVirtualMemory(pixel_info); + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + } + embed_info=AcquireImageInfo(); + (void) FormatLocaleString(embed_info->filename,MagickPathExtent, + "%s:%s",magick,image_info->filename); + embed_image=BlobToImage(embed_info,stream,(size_t) count,exception); + embed_info=DestroyImageInfo(embed_info); + pixel_info=RelinquishVirtualMemory(pixel_info); + (void) CloseBlob(image); + if (embed_image != (Image *) NULL) + { + (void) CopyMagickString(embed_image->filename,image->filename, + MagickPathExtent); + (void) CopyMagickString(embed_image->magick_filename, + image->magick_filename,MagickPathExtent); + (void) CopyMagickString(embed_image->magick,image->magick, + MagickPathExtent); + } + return(embed_image); +} + static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) { BMPInfo @@ -627,6 +687,12 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " BMP header size: %u",bmp_info.size); + if (LocaleNCompare((char *) magick,"CI",2) == 0) + { + if ((bmp_info.size != 12) && (bmp_info.size != 40) && + (bmp_info.size != 64)) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + } if (bmp_info.size > 124) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); if (bmp_info.offset_bits < bmp_info.size) @@ -717,6 +783,12 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) " Compression: BI_BITFIELDS"); break; } + case BI_ALPHABITFIELDS: + { + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + " Compression: BI_ALPHABITFIELDS"); + break; + } case BI_PNG: { (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -738,11 +810,15 @@ 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)) + if ((bmp_info.size > 40) || (bmp_info.compression == BI_BITFIELDS) || + (bmp_info.compression == BI_ALPHABITFIELDS)) + { bmp_info.red_mask=ReadBlobLSBLong(image); bmp_info.green_mask=ReadBlobLSBLong(image); bmp_info.blue_mask=ReadBlobLSBLong(image); + if (bmp_info.compression == BI_ALPHABITFIELDS) + bmp_info.alpha_mask=ReadBlobLSBLong(image); } if (bmp_info.size > 40) { @@ -843,8 +919,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } - profile_data=(MagickOffsetType)ReadBlobLSBLong(image); - profile_size=(MagickOffsetType)ReadBlobLSBLong(image); + profile_data=(MagickOffsetType) ReadBlobLSBLong(image); + profile_size=(MagickOffsetType) ReadBlobLSBLong(image); (void) ReadBlobLSBLong(image); /* Reserved byte */ } } @@ -863,6 +939,26 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowReaderException(CorruptImageError,"NegativeOrZeroImageSize"); if (bmp_info.height == 0) ThrowReaderException(CorruptImageError,"NegativeOrZeroImageSize"); + if (bmp_info.compression == BI_JPEG) + { + /* + Read embedded JPEG image. + */ + Image *embed_image = ReadEmbedImage(image_info,image,"jpeg",exception); + (void) CloseBlob(image); + image=DestroyImageList(image); + return(embed_image); + } + if (bmp_info.compression == BI_PNG) + { + /* + Read embedded PNG image. + */ + Image *embed_image = ReadEmbedImage(image_info,image,"png",exception); + (void) CloseBlob(image); + image=DestroyImageList(image); + return(embed_image); + } if (bmp_info.planes != 1) ThrowReaderException(CorruptImageError,"StaticPlanesValueNotEqualToOne"); if ((bmp_info.bits_per_pixel != 1) && (bmp_info.bits_per_pixel != 4) && @@ -889,6 +985,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) break; case BI_BITFIELDS: break; + case BI_ALPHABITFIELDS: + break; case BI_JPEG: ThrowReaderException(CoderError,"JPEGCompressNotSupported"); case BI_PNG: @@ -986,7 +1084,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) if ((MagickSizeType) (length/256) > blob_size) ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); if ((bmp_info.compression == BI_RGB) || - (bmp_info.compression == BI_BITFIELDS)) + (bmp_info.compression == BI_BITFIELDS) || + (bmp_info.compression == BI_ALPHABITFIELDS)) { pixel_info=AcquireVirtualMemory(image->rows, MagickMax(bytes_per_line,image->columns+256UL)*sizeof(*pixels)); @@ -1041,7 +1140,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) bytes_per_line=4*(image->columns); for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; for (x=0; x < (ssize_t) image->columns; x++) { if (*(p+3) != 0) @@ -1149,7 +1248,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) */ for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -1177,8 +1276,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) break; if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) - (image->rows-y),image->rows); + status=SetImageProgress(image,LoadImageTag,((MagickOffsetType) + image->rows-y),image->rows); if (status == MagickFalse) break; } @@ -1193,7 +1292,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) */ for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -1223,8 +1322,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) break; if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) - (image->rows-y),image->rows); + status=SetImageProgress(image,LoadImageTag,((MagickOffsetType) + image->rows-y),image->rows); if (status == MagickFalse) break; } @@ -1242,7 +1341,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) bytes_per_line=image->columns; for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -1254,11 +1353,11 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; - offset=(MagickOffsetType) (image->rows-y-1); + offset=((MagickOffsetType) image->rows-y-1); if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) - (image->rows-y),image->rows); + status=SetImageProgress(image,LoadImageTag,((MagickOffsetType) + image->rows-y),image->rows); if (status == MagickFalse) break; } @@ -1286,14 +1385,14 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) image->storage_class=DirectClass; for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { pixel=(unsigned int) (*p++); - pixel|=(*p++) << 8; + pixel|=(unsigned int) (*p++) << 8; red=((pixel & bmp_info.red_mask) << shift.red) >> 16; if (quantum_bits.red == 5) red|=((red & 0xe000) >> 5); @@ -1327,11 +1426,11 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; - offset=(MagickOffsetType) (image->rows-y-1); + offset=((MagickOffsetType) image->rows-y-1); if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) - (image->rows-y),image->rows); + status=SetImageProgress(image,LoadImageTag,((MagickOffsetType) + image->rows-y),image->rows); if (status == MagickFalse) break; } @@ -1346,7 +1445,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) bytes_per_line=4*((image->columns*24+31)/32); for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -1360,11 +1459,11 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; - offset=(MagickOffsetType) (image->rows-y-1); + offset=((MagickOffsetType) image->rows-y-1); if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) - (image->rows-y),image->rows); + status=SetImageProgress(image,LoadImageTag,((MagickOffsetType) + image->rows-y),image->rows); if (status == MagickFalse) break; } @@ -1390,7 +1489,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) alpha, pixel; - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -1425,11 +1524,11 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; - offset=(MagickOffsetType) (image->rows-y-1); + offset=((MagickOffsetType) image->rows-y-1); if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) - (image->rows-y),image->rows); + status=SetImageProgress(image,LoadImageTag,((MagickOffsetType) + image->rows-y),image->rows); if (status == MagickFalse) break; } @@ -1886,8 +1985,8 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, bmp_info.size=124; extra_size+=16; } - bmp_info.file_size+=extra_size; - bmp_info.offset_bits+=extra_size; + bmp_info.file_size+=(unsigned int) extra_size; + bmp_info.offset_bits+=(unsigned int) extra_size; } if (((ssize_t) image->columns != (ssize_t) ((signed int) image->columns)) || ((ssize_t) image->rows != (ssize_t) ((signed int) image->rows))) @@ -1944,13 +2043,13 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, p=GetVirtualPixels(image,0,y,image->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(image->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; bit=0; byte=0; for (x=0; x < (ssize_t) image->columns; x++) { byte<<=1; - byte|=GetPixelIndex(image,p) != 0 ? 0x01 : 0x00; + byte|=(size_t) (GetPixelIndex(image,p) != 0 ? 0x01 : 0x00); bit++; if (bit == 8) { @@ -1995,7 +2094,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, p=GetVirtualPixels(image,0,y,image->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(image->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; nibble=0; byte=0; for (x=0; x < (ssize_t) image->columns; x++) @@ -2039,7 +2138,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, p=GetVirtualPixels(image,0,y,image->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(image->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; for (x=0; x < (ssize_t) image->columns; x++) { *q++=(unsigned char) ((ssize_t) GetPixelIndex(image,p)); @@ -2067,7 +2166,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, p=GetVirtualPixels(image,0,y,image->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(image->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; for (x=0; x < (ssize_t) image->columns; x++) { unsigned short @@ -2132,7 +2231,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, p=GetVirtualPixels(image,0,y,image->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(image->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; for (x=0; x < (ssize_t) image->columns; x++) { *q++=ScaleQuantumToChar(GetPixelBlue(image,p)); @@ -2162,7 +2261,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, p=GetVirtualPixels(image,0,y,image->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(image->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; for (x=0; x < (ssize_t) image->columns; x++) { Quantum alpha=GetPixelAlpha(image,p); @@ -2261,6 +2360,12 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, " Compression=BI_BITFIELDS"); break; } + case BI_ALPHABITFIELDS: + { + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + " Compression=BI_BITFIELDS"); + break; + } default: { (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -2332,8 +2437,8 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, (void) WriteBlobLSBLong(image,0x4D424544U); /* PROFILE_EMBEDDED */ else (void) WriteBlobLSBLong(image,0x73524742U); /* sRGB */ - - // bounds check, assign .0 if invalid value + + /* bounds check, assign .0 if invalid value */ if (isgreater(image->chromaticity.red_primary.x, 1.0) || !isgreater(image->chromaticity.red_primary.x, 0.0)) image->chromaticity.red_primary.x = 0.0; @@ -2367,21 +2472,21 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, (void) WriteBlobLSBLong(image,(unsigned int) (image->chromaticity.red_primary.y*0x40000000)); (void) WriteBlobLSBLong(image,(unsigned int) - ((1.000f-(image->chromaticity.red_primary.x+ + ((1.000-(image->chromaticity.red_primary.x+ image->chromaticity.red_primary.y))*0x40000000)); (void) WriteBlobLSBLong(image,(unsigned int) (image->chromaticity.green_primary.x*0x40000000)); (void) WriteBlobLSBLong(image,(unsigned int) (image->chromaticity.green_primary.y*0x40000000)); (void) WriteBlobLSBLong(image,(unsigned int) - ((1.000f-(image->chromaticity.green_primary.x+ + ((1.000-(image->chromaticity.green_primary.x+ image->chromaticity.green_primary.y))*0x40000000)); (void) WriteBlobLSBLong(image,(unsigned int) (image->chromaticity.blue_primary.x*0x40000000)); (void) WriteBlobLSBLong(image,(unsigned int) (image->chromaticity.blue_primary.y*0x40000000)); (void) WriteBlobLSBLong(image,(unsigned int) - ((1.000f-(image->chromaticity.blue_primary.x+ + ((1.000-(image->chromaticity.blue_primary.x+ image->chromaticity.blue_primary.y))*0x40000000)); (void) WriteBlobLSBLong(image,(unsigned int) (bmp_info.gamma_scale.x*0x10000)); @@ -2441,15 +2546,15 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Colormap: %.20g entries",(double) image->colors); - bmp_colormap=(unsigned char *) AcquireQuantumMemory((size_t) (1UL << - bmp_info.bits_per_pixel),4*sizeof(*bmp_colormap)); + bmp_colormap=(unsigned char *) AcquireQuantumMemory((size_t) 1UL << + bmp_info.bits_per_pixel,4*sizeof(*bmp_colormap)); if (bmp_colormap == (unsigned char *) NULL) { pixel_info=RelinquishVirtualMemory(pixel_info); ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); } q=bmp_colormap; - for (i=0; i < (ssize_t) MagickMin((ssize_t) image->colors,(ssize_t) bmp_info.number_colors); i++) + for (i=0; i < MagickMin((ssize_t) image->colors,(ssize_t) bmp_info.number_colors); i++) { *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].blue)); *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].green)); @@ -2457,7 +2562,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image, if (type > 2) *q++=(unsigned char) 0x0; } - for ( ; i < (ssize_t) (1UL << bmp_info.bits_per_pixel); i++) + for ( ; i < (ssize_t) 1UL << bmp_info.bits_per_pixel; i++) { *q++=(unsigned char) 0x00; *q++=(unsigned char) 0x00; diff --git a/ImageMagick-7.1.1-15/coders/bmp.h b/ImageMagick-7.1.1-16/coders/bmp.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/bmp.h rename to ImageMagick-7.1.1-16/coders/bmp.h diff --git a/ImageMagick-7.1.1-15/coders/braille.c b/ImageMagick-7.1.1-16/coders/braille.c similarity index 96% rename from ImageMagick-7.1.1-15/coders/braille.c rename to ImageMagick-7.1.1-16/coders/braille.c index 6befa802..57f65e03 100644 --- a/ImageMagick-7.1.1-15/coders/braille.c +++ b/ImageMagick-7.1.1-16/coders/braille.c @@ -180,11 +180,13 @@ static MagickBooleanType WriteBRAILLEImage(const ImageInfo *image_info, #define do_cell(dx,dy,bit) \ { \ if (image->storage_class == PseudoClass) \ - cell|=(GetPixelIndex(image,p+(x+dx)*GetImageChannels(image)+ \ - dy*(image->columns*GetImageChannels(image))) == polarity) << bit; \ + cell|=(GetPixelIndex(image,p+(x+(ssize_t) (dx))*(ssize_t) \ + GetImageChannels(image)+(dy)*(ssize_t) (image->columns* \ + GetImageChannels(image))) == polarity) << bit; \ else \ - cell|=(GetPixelGreen(image,p+(x+dx)*GetImageChannels(image)+ \ - dy*(image->columns*GetImageChannels(image))) == 0) << bit; \ + cell|=(GetPixelGreen(image,p+(x+(ssize_t) (dx))*(ssize_t) \ + GetImageChannels(image)+(dy)*((ssize_t) image->columns*(ssize_t) \ + GetImageChannels(image))) == 0) << bit; \ } char @@ -280,15 +282,15 @@ static MagickBooleanType WriteBRAILLEImage(const ImageInfo *image_info, if (image->storage_class == PseudoClass) { polarity=(Quantum) (GetPixelInfoIntensity(image,&image->colormap[0]) >= - (QuantumRange/2.0)); + ((double) QuantumRange/2.0)); if (image->colors == 2) polarity=(Quantum) (GetPixelInfoIntensity(image,&image->colormap[0]) >= GetPixelInfoIntensity(image,&image->colormap[1])); } for (y=0; y < (ssize_t) image->rows; y+=(ssize_t) cell_height) { - if ((y+cell_height) > image->rows) - cell_height=(size_t) (image->rows-y); + if ((size_t) (y+(ssize_t) cell_height) > image->rows) + cell_height=(size_t) ((ssize_t) image->rows-y); p=GetVirtualPixels(image,0,y,image->columns,cell_height,exception); if (p == (const Quantum *) NULL) break; diff --git a/ImageMagick-7.1.1-15/coders/braille.h b/ImageMagick-7.1.1-16/coders/braille.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/braille.h rename to ImageMagick-7.1.1-16/coders/braille.h diff --git a/ImageMagick-7.1.1-15/coders/bytebuffer-private.h b/ImageMagick-7.1.1-16/coders/bytebuffer-private.h similarity index 91% rename from ImageMagick-7.1.1-15/coders/bytebuffer-private.h rename to ImageMagick-7.1.1-16/coders/bytebuffer-private.h index eb90f209..46478ef7 100644 --- a/ImageMagick-7.1.1-15/coders/bytebuffer-private.h +++ b/ImageMagick-7.1.1-16/coders/bytebuffer-private.h @@ -73,7 +73,8 @@ static inline char *GetMagickByteBufferDatum(MagickByteBuffer *buffer) i=0; while (buffer->offset < buffer->count) buffer->data[i++]=buffer->data[buffer->offset++]; - count=ReadBlob(buffer->image,sizeof(buffer->data)-1-i,buffer->data+i); + count=ReadBlob(buffer->image,(size_t) ((ssize_t) sizeof(buffer->data)-1- + i),buffer->data+i); buffer->count=i; if (count > 0) buffer->count+=count; @@ -85,7 +86,7 @@ static inline char *GetMagickByteBufferDatum(MagickByteBuffer *buffer) static void CheckMagickByteBuffer(MagickByteBuffer *buffer, const size_t length) { - if ((buffer->offset+length) > (ssize_t) sizeof(buffer->data)) + if ((buffer->offset+(ssize_t) length) > (ssize_t) sizeof(buffer->data)) (void) GetMagickByteBufferDatum(buffer); } @@ -106,8 +107,8 @@ static inline void SkipMagickByteBuffer(MagickByteBuffer *buffer, const size_t length) { CheckMagickByteBuffer(buffer,length); - if ((ssize_t) (buffer->offset+length) < buffer->count) - buffer->offset+=length; + if ((buffer->offset+(ssize_t) length) < buffer->count) + buffer->offset+=(ssize_t) length; } static inline MagickBooleanType SkipMagickByteBufferUntilNewline( diff --git a/ImageMagick-7.1.1-15/coders/cals.c b/ImageMagick-7.1.1-16/coders/cals.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/cals.c rename to ImageMagick-7.1.1-16/coders/cals.c diff --git a/ImageMagick-7.1.1-15/coders/cals.h b/ImageMagick-7.1.1-16/coders/cals.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/cals.h rename to ImageMagick-7.1.1-16/coders/cals.h diff --git a/ImageMagick-7.1.1-15/coders/caption.c b/ImageMagick-7.1.1-16/coders/caption.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/caption.c rename to ImageMagick-7.1.1-16/coders/caption.c index 35f551b3..af4a82f4 100644 --- a/ImageMagick-7.1.1-15/coders/caption.c +++ b/ImageMagick-7.1.1-16/coders/caption.c @@ -17,7 +17,7 @@ % February 2002 % % % % % -% Copyright @ 2002 ImageMagick Studio LLC, a non-profit organization % +% Copyright @ 1999 ImageMagick Studio LLC, a non-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/ImageMagick-7.1.1-15/coders/caption.h b/ImageMagick-7.1.1-16/coders/caption.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/caption.h rename to ImageMagick-7.1.1-16/coders/caption.h diff --git a/ImageMagick-7.1.1-15/coders/cin.c b/ImageMagick-7.1.1-16/coders/cin.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/cin.c rename to ImageMagick-7.1.1-16/coders/cin.c index b9bfe69e..1e409773 100644 --- a/ImageMagick-7.1.1-15/coders/cin.c +++ b/ImageMagick-7.1.1-16/coders/cin.c @@ -687,7 +687,7 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception) offset+=4; if (IsFloatDefined(cin.film.frame_rate) != MagickFalse) (void) FormatImageProperty(image,"dpx:film.frame_rate","%g", - cin.film.frame_rate); + (double) cin.film.frame_rate); offset+=ReadBlob(image,sizeof(cin.film.frame_id),(unsigned char *) cin.film.frame_id); (void) CopyMagickString(property,cin.film.frame_id, diff --git a/ImageMagick-7.1.1-15/coders/cin.h b/ImageMagick-7.1.1-16/coders/cin.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/cin.h rename to ImageMagick-7.1.1-16/coders/cin.h diff --git a/ImageMagick-7.1.1-15/coders/cip.c b/ImageMagick-7.1.1-16/coders/cip.c similarity index 97% rename from ImageMagick-7.1.1-15/coders/cip.c rename to ImageMagick-7.1.1-16/coders/cip.c index 0605dffd..d5ed31a5 100644 --- a/ImageMagick-7.1.1-15/coders/cip.c +++ b/ImageMagick-7.1.1-16/coders/cip.c @@ -255,28 +255,28 @@ static MagickBooleanType WriteCIPImage(const ImageInfo *image_info,Image *image, case 0: { byte|=(unsigned char) (((size_t) (3*ClampToQuantum(GetPixelLuma( - image,p+MagickMin(i,3)*GetPixelChannels(image)))/ + image,p+MagickMin(i,3)*(ssize_t) GetPixelChannels(image)))/ QuantumRange) & 0x03) << 6); break; } case 1: { byte|=(unsigned char) (((size_t) (3*ClampToQuantum(GetPixelLuma( - image,p+MagickMin(i,2)*GetPixelChannels(image)))/ + image,p+MagickMin(i,2)*(ssize_t) GetPixelChannels(image)))/ QuantumRange) & 0x03) << 4); break; } case 2: { byte|=(unsigned char) (((size_t) (3*ClampToQuantum(GetPixelLuma( - image,p+MagickMin(i,1)*GetPixelChannels(image)))/ + image,p+MagickMin(i,1)*(ssize_t) GetPixelChannels(image)))/ QuantumRange) & 0x03) << 2); break; } case 3: { byte|=(unsigned char) (((size_t) (3*ClampToQuantum(GetPixelLuma( - image,p+MagickMin(i,0)*GetPixelChannels(image)))/ + image,p+MagickMin(i,0)*(ssize_t) GetPixelChannels(image)))/ QuantumRange) & 0x03) << 0); break; } diff --git a/ImageMagick-7.1.1-15/coders/cip.h b/ImageMagick-7.1.1-16/coders/cip.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/cip.h rename to ImageMagick-7.1.1-16/coders/cip.h diff --git a/ImageMagick-7.1.1-15/coders/clip.c b/ImageMagick-7.1.1-16/coders/clip.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/clip.c rename to ImageMagick-7.1.1-16/coders/clip.c diff --git a/ImageMagick-7.1.1-15/coders/clip.h b/ImageMagick-7.1.1-16/coders/clip.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/clip.h rename to ImageMagick-7.1.1-16/coders/clip.h diff --git a/ImageMagick-7.1.1-15/coders/clipboard.c b/ImageMagick-7.1.1-16/coders/clipboard.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/clipboard.c rename to ImageMagick-7.1.1-16/coders/clipboard.c diff --git a/ImageMagick-7.1.1-15/coders/clipboard.h b/ImageMagick-7.1.1-16/coders/clipboard.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/clipboard.h rename to ImageMagick-7.1.1-16/coders/clipboard.h diff --git a/ImageMagick-7.1.1-15/coders/cmyk.c b/ImageMagick-7.1.1-16/coders/cmyk.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/cmyk.c rename to ImageMagick-7.1.1-16/coders/cmyk.c diff --git a/ImageMagick-7.1.1-15/coders/cmyk.h b/ImageMagick-7.1.1-16/coders/cmyk.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/cmyk.h rename to ImageMagick-7.1.1-16/coders/cmyk.h diff --git a/ImageMagick-7.1.1-15/coders/coders-list.h b/ImageMagick-7.1.1-16/coders/coders-list.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/coders-list.h rename to ImageMagick-7.1.1-16/coders/coders-list.h diff --git a/ImageMagick-7.1.1-15/coders/coders-private.h b/ImageMagick-7.1.1-16/coders/coders-private.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/coders-private.h rename to ImageMagick-7.1.1-16/coders/coders-private.h diff --git a/ImageMagick-7.1.1-15/coders/coders.h b/ImageMagick-7.1.1-16/coders/coders.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/coders.h rename to ImageMagick-7.1.1-16/coders/coders.h diff --git a/ImageMagick-7.1.1-15/coders/cube.c b/ImageMagick-7.1.1-16/coders/cube.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/cube.c rename to ImageMagick-7.1.1-16/coders/cube.c index d56b72cb..905445b7 100644 --- a/ImageMagick-7.1.1-15/coders/cube.c +++ b/ImageMagick-7.1.1-16/coders/cube.c @@ -255,9 +255,10 @@ static Image *ReadCUBEImage(const ImageInfo *image_info, if (status == MagickFalse) continue; - q=QueueAuthenticPixels(image,(g % hald_level)*(hald_level*hald_level), - (b*hald_level)+((g/hald_level) % (hald_level*hald_level)),hald_level* - hald_level,1,exception); + q=QueueAuthenticPixels(image,(g % (ssize_t) hald_level)*((ssize_t) + hald_level*(ssize_t) hald_level),(b*(ssize_t) hald_level)+((g/(ssize_t) + hald_level) % ((ssize_t) hald_level*(ssize_t) hald_level)), + hald_level*hald_level,1,exception); if (q == (Quantum *) NULL) { status=MagickFalse; diff --git a/ImageMagick-7.1.1-15/coders/cube.h b/ImageMagick-7.1.1-16/coders/cube.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/cube.h rename to ImageMagick-7.1.1-16/coders/cube.h diff --git a/ImageMagick-7.1.1-15/coders/cut.c b/ImageMagick-7.1.1-16/coders/cut.c similarity index 96% rename from ImageMagick-7.1.1-15/coders/cut.c rename to ImageMagick-7.1.1-16/coders/cut.c index 8d30519f..cd712aaf 100644 --- a/ImageMagick-7.1.1-15/coders/cut.c +++ b/ImageMagick-7.1.1-16/coders/cut.c @@ -384,7 +384,7 @@ static Image *ReadCUTImage(const ImageInfo *image_info,ExceptionInfo *exception) if (offset < 0) ThrowCUTReaderException(CorruptImageError,"ImproperImageHeader"); if(EOFBlob(image) != MagickFalse) goto CUT_KO; /*wrong data*/ - EncodedByte-=i+1; + EncodedByte=(size_t) ((ssize_t) EncodedByte-i+1); ldblk+=(ssize_t) RunCountMasked; RunCount=(unsigned char) ReadBlobByte(image); @@ -402,7 +402,7 @@ static Image *ReadCUTImage(const ImageInfo *image_info,ExceptionInfo *exception) image->columns=Header.Width; image->rows=Header.Height; image->depth=8; - image->colors=(size_t) (GetQuantumRange(1UL*i)+1); + image->colors=(size_t) (GetQuantumRange((size_t) i)+1); if (image_info->ping != MagickFalse) goto Finish; status=SetImageExtent(image,image->columns,image->rows,exception); @@ -497,21 +497,23 @@ static Image *ReadCUTImage(const ImageInfo *image_info,ExceptionInfo *exception) image->colormap[i].red=(Quantum) ReadBlobLSBShort(palette); if (QuantumRange != (Quantum) PalHeader.MaxRed) { - image->colormap[i].red=ClampToQuantum(((double) - image->colormap[i].red*QuantumRange+(PalHeader.MaxRed>>1))/ + image->colormap[i].red=ClampToQuantum((image->colormap[i].red* + (double) QuantumRange+(PalHeader.MaxRed >> 1))/ PalHeader.MaxRed); } image->colormap[i].green=(Quantum) ReadBlobLSBShort(palette); if (QuantumRange != (Quantum) PalHeader.MaxGreen) { - image->colormap[i].green=ClampToQuantum - (((double) image->colormap[i].green*QuantumRange+(PalHeader.MaxGreen>>1))/PalHeader.MaxGreen); + image->colormap[i].green=ClampToQuantum((image->colormap[i].green* + (double) QuantumRange+(PalHeader.MaxGreen >> 1))/ + PalHeader.MaxGreen); } image->colormap[i].blue=(Quantum) ReadBlobLSBShort(palette); if (QuantumRange != (Quantum) PalHeader.MaxBlue) { - image->colormap[i].blue=ClampToQuantum - (((double)image->colormap[i].blue*QuantumRange+(PalHeader.MaxBlue>>1))/PalHeader.MaxBlue); + image->colormap[i].blue=ClampToQuantum((image->colormap[i].blue* + (double) QuantumRange+(PalHeader.MaxBlue >> 1))/ + PalHeader.MaxBlue); } } @@ -615,9 +617,9 @@ static Image *ReadCUTImage(const ImageInfo *image_info,ExceptionInfo *exception) sample; sample=ScaleCharToQuantum((unsigned char) i); - if (image->colormap[i].red!=sample) goto Finish; - if (image->colormap[i].green!=sample) goto Finish; - if (image->colormap[i].blue!=sample) goto Finish; + if (image->colormap[i].red != (double) sample) goto Finish; + if (image->colormap[i].green != (double) sample) goto Finish; + if (image->colormap[i].blue != (double) sample) goto Finish; } image->colormap[1].red=image->colormap[1].green= diff --git a/ImageMagick-7.1.1-15/coders/cut.h b/ImageMagick-7.1.1-16/coders/cut.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/cut.h rename to ImageMagick-7.1.1-16/coders/cut.h diff --git a/ImageMagick-7.1.1-15/coders/dcm.c b/ImageMagick-7.1.1-16/coders/dcm.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/dcm.c rename to ImageMagick-7.1.1-16/coders/dcm.c index 36a73474..094f0e31 100644 --- a/ImageMagick-7.1.1-15/coders/dcm.c +++ b/ImageMagick-7.1.1-16/coders/dcm.c @@ -2807,8 +2807,7 @@ static int ReadDCMByte(DCMStreamInfo *stream_info,Image *image) static unsigned short ReadDCMShort(DCMStreamInfo *stream_info,Image *image) { int - shift, - byte; + shift; unsigned short value; @@ -2816,11 +2815,8 @@ static unsigned short ReadDCMShort(DCMStreamInfo *stream_info,Image *image) if (image->compression != RLECompression) return(ReadBlobLSBShort(image)); shift=image->depth < 16 ? 4 : 8; - value=(unsigned short) ReadDCMByte(stream_info,image); - byte=ReadDCMByte(stream_info,image); - if (byte < 0) - return(0); - value|=(unsigned short) (byte << shift); + value=(((unsigned short) ReadDCMByte(stream_info,image) << shift) | + (unsigned short) ReadDCMByte(stream_info,image)); return(value); } @@ -2944,7 +2940,7 @@ static MagickBooleanType ReadDCMPixels(Image *image,DCMInfo *info, info->window_center-0.5)/(info->window_width-1))+0.5)); } } - index&=info->mask; + index&=(ssize_t) info->mask; index=(int) ConstrainColormapIndex(image,(ssize_t) index,exception); if (first_segment != MagickFalse) SetPixelIndex(image,(Quantum) index,q); @@ -3090,14 +3086,10 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) use_explicit; MagickOffsetType - blob_size, offset; - unsigned char - *p; - - ssize_t - i; + MagickSizeType + blob_size; size_t colors, @@ -3108,11 +3100,13 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) ssize_t count, + i, scene, sequence_depth; unsigned char - *data; + *data, + *p; unsigned short group, @@ -3178,8 +3172,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) number_scenes=1; use_explicit=MagickFalse; explicit_retry=MagickFalse; - blob_size=(MagickOffsetType) GetBlobSize(image); - while (TellBlob(image) < blob_size) + blob_size=GetBlobSize(image); + while (TellBlob(image) < ((MagickOffsetType) blob_size-10)) { for (group=0; (group != 0x7FE0) || (element != 0x0010) ; ) { @@ -3384,7 +3378,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) else if ((quantum != 0) && (length != 0)) { - if (length > (size_t) GetBlobSize(image)) + if (length > (size_t) blob_size) ThrowDCMException(CorruptImageError, "InsufficientImageDataInFile") if (~length >= 1) @@ -3892,7 +3886,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) (((ssize_t) ReadBlobLSBShort(image) << 16) | ReadBlobLSBShort(image)); length=(size_t) ReadBlobLSBLong(image); - if (length > (size_t) GetBlobSize(image)) + if (length > (size_t) blob_size) ThrowDCMException(CorruptImageError,"InsufficientImageDataInFile") stream_info->offset_count=length >> 2; if (stream_info->offset_count != 0) @@ -3939,7 +3933,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) tag=((unsigned int) ReadBlobLSBShort(image) << 16) | ReadBlobLSBShort(image); length=(size_t) ReadBlobLSBLong(image); - if (length > (size_t) GetBlobSize(image)) + if (length > (size_t) blob_size) { images=DestroyImageList(images); read_info=DestroyImageInfo(read_info); @@ -4023,7 +4017,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) Compute pixel scaling table. */ length=(size_t) (GetQuantumRange(info.depth)+1); - if (length > (size_t) GetBlobSize(image)) + if (length > (size_t) blob_size) ThrowDCMException(CorruptImageError,"InsufficientImageDataInFile") if (info.scale != (Quantum *) NULL) info.scale=(Quantum *) RelinquishMagickMemory(info.scale); @@ -4055,11 +4049,11 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (c == EOF) break; } - tag=((unsigned int) ReadBlobLSBShort(image) << 16) | - ReadBlobLSBShort(image); + tag=(((unsigned int) ReadBlobLSBShort(image)) << 16) | + (unsigned int) ReadBlobLSBShort(image); (void) tag; length=(size_t) ReadBlobLSBLong(image); - if (length > (size_t) GetBlobSize(image)) + if (length > (size_t) blob_size) ThrowDCMException(CorruptImageError,"InsufficientImageDataInFile") stream_info->offset_count=length >> 2; if (stream_info->offset_count != 0) @@ -4073,15 +4067,11 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed") for (i=0; i < (ssize_t) stream_info->offset_count; i++) { - offset=(MagickOffsetType) ReadBlobLSBSignedLong(image); - if (offset > (MagickOffsetType) GetBlobSize(image)) - ThrowDCMException(CorruptImageError, - "InsufficientImageDataInFile") - stream_info->offsets[i]=(ssize_t) offset; + stream_info->offsets[i]=(ssize_t) ReadBlobLSBSignedLong(image); if (EOFBlob(image) != MagickFalse) break; } - offset=TellBlob(image)+8; + offset=TellBlob(image); for (i=0; i < (ssize_t) stream_info->offset_count; i++) stream_info->offsets[i]+=offset; } @@ -4099,8 +4089,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) if ((image->colormap == (PixelInfo *) NULL) && (info.samples_per_pixel == 1)) { - int - index; + Quantum + color; size_t one; @@ -4109,44 +4099,32 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (colors == 0) colors=one << info.depth; if (AcquireImageColormap(image,colors,exception) == MagickFalse) - ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed") + ThrowDCMException(ResourceLimitError,"UnableToCreateColormap") if (map.red != (int *) NULL) for (i=0; i < (ssize_t) colors; i++) { - index=map.red[i]; - if ((info.scale != (Quantum *) NULL) && (index >= 0) && - (index < (int) info.scale_size)) - index=(int) info.scale[index]; - image->colormap[i].red=(MagickRealType) index; + color=ScaleShortToQuantum(map.red[i]); + image->colormap[i].red=(MagickRealType) color; } if (map.green != (int *) NULL) for (i=0; i < (ssize_t) colors; i++) { - index=map.green[i]; - if ((info.scale != (Quantum *) NULL) && (index >= 0) && - (index < (int) info.scale_size)) - index=(int) info.scale[index]; - image->colormap[i].green=(MagickRealType) index; + color=ScaleShortToQuantum(map.green[i]); + image->colormap[i].green=(MagickRealType) color; } if (map.blue != (int *) NULL) for (i=0; i < (ssize_t) colors; i++) { - index=map.blue[i]; - if ((info.scale != (Quantum *) NULL) && (index >= 0) && - (index < (int) info.scale_size)) - index=(int) info.scale[index]; - image->colormap[i].blue=(MagickRealType) index; + color=ScaleShortToQuantum(map.blue[i]); + image->colormap[i].blue=(MagickRealType) color; } if (map.gray != (int *) NULL) for (i=0; i < (ssize_t) colors; i++) { - index=map.gray[i]; - if ((info.scale != (Quantum *) NULL) && (index >= 0) && - (index < (int) info.scale_size)) - index=(int) info.scale[index]; - image->colormap[i].red=(MagickRealType) index; - image->colormap[i].green=(MagickRealType) index; - image->colormap[i].blue=(MagickRealType) index; + color=ScaleShortToQuantum(map.gray[i]); + image->colormap[i].red=(MagickRealType) color; + image->colormap[i].green=(MagickRealType) color; + image->colormap[i].blue=(MagickRealType) color; } } if (image->compression == RLECompression) @@ -4166,8 +4144,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (c == EOF) break; } - tag=((unsigned int) ReadBlobLSBShort(image) << 16) | - ReadBlobLSBShort(image); + tag=(((unsigned int) ReadBlobLSBShort(image) << 16)) | + (unsigned int) ReadBlobLSBShort(image); stream_info->remaining=(size_t) ReadBlobLSBLong(image); if ((tag != 0xFFFEE000) || (stream_info->remaining <= 64) || (EOFBlob(image) != MagickFalse)) @@ -4327,12 +4305,12 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) } image=SyncNextImageInList(image); status=SetImageProgress(image,LoadImagesTag,TellBlob(image), - GetBlobSize(image)); + blob_size); if (status == MagickFalse) break; } } - if (TellBlob(image) < (MagickOffsetType) GetBlobSize(image)) + if (TellBlob(image) < ((MagickOffsetType) blob_size-10)) { /* Allocate next image structure. diff --git a/ImageMagick-7.1.1-15/coders/dcm.h b/ImageMagick-7.1.1-16/coders/dcm.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/dcm.h rename to ImageMagick-7.1.1-16/coders/dcm.h diff --git a/ImageMagick-7.1.1-15/coders/dds.c b/ImageMagick-7.1.1-16/coders/dds.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/dds.c rename to ImageMagick-7.1.1-16/coders/dds.c index 9a446513..01a09ac1 100644 --- a/ImageMagick-7.1.1-15/coders/dds.c +++ b/ImageMagick-7.1.1-16/coders/dds.c @@ -1097,10 +1097,10 @@ static const unsigned char BC7_anchor_index_table[4][64] = #define FixRange(min, max, steps) \ if (min > max) \ min = max; \ -if ((ssize_t) max - min < steps) \ - max = MagickMin(min + steps, 255); \ -if ((ssize_t) max - min < steps) \ - min = MagickMax(0, (ssize_t) max - steps) +if ((max-min) < steps) \ + max = MagickMin(min+(ssize_t) steps, 255); \ +if ((max- min) < steps) \ + min = (size_t) MagickMax(0L, (ssize_t) max-(ssize_t) steps) #define Dot(left, right) (left.x*right.x) + (left.y*right.y) + (left.z*right.z) @@ -1245,7 +1245,7 @@ static inline void VectorTruncate3(DDSVector3 *value) static inline size_t ClampToLimit(const float value, const size_t limit) { size_t - result = (int) (value + 0.5f); + result = (size_t) (value + 0.5f); if (result < 0.0f) return(0); @@ -1528,8 +1528,9 @@ static MagickBooleanType ReadDXT1Pixels(Image *image, for (x = 0; x < (ssize_t) image->columns; x += 4) { /* Get 4x4 patch of pixels to write on */ - q=QueueAuthenticPixels(image,x,y,MagickMin(4,image->columns-x), - MagickMin(4,image->rows-y),exception); + q=QueueAuthenticPixels(image,x,y,(size_t) + (MagickMin(4,(ssize_t) image->columns-x)),(size_t) + (MagickMin(4,(ssize_t) image->rows-y)),exception); if (q == (Quantum *) NULL) return(MagickFalse); @@ -1548,8 +1549,9 @@ static MagickBooleanType ReadDXT1Pixels(Image *image, { /* Correct alpha */ SetImageAlpha(image,QuantumRange,exception); - q=QueueAuthenticPixels(image,x,y,MagickMin(4,image->columns-x), - MagickMin(4,image->rows-y),exception); + q=QueueAuthenticPixels(image,x,y,(size_t) MagickMin(4,(ssize_t) + image->columns-x),(size_t) MagickMin(4,(ssize_t) image->rows-y), + exception); if (q != (Quantum *) NULL) SetDXT1Pixels(image,x,y,colors,bits,q); } @@ -1584,13 +1586,13 @@ static MagickBooleanType SkipDXTMipmaps(Image *image,const DDSInfo *dds_info, MagickOffsetType offset; - ssize_t - i; - size_t h, w; + ssize_t + i; + w=DIV2(dds_info->width); h=DIV2(dds_info->height); @@ -1599,7 +1601,8 @@ static MagickBooleanType SkipDXTMipmaps(Image *image,const DDSInfo *dds_info, */ for (i = 1; (i < (ssize_t) dds_info->mipmapcount) && w && h; i++) { - offset=(MagickOffsetType)((w+3)/4)*((h+3)/4)*texel_size; + offset=(MagickOffsetType) (((w+3U)/4U)*((h+3U)/4U)*(size_t) + texel_size); if (SeekBlob(image,offset,SEEK_CUR) < 0) break; w=DIV2(w); @@ -1660,8 +1663,9 @@ static MagickBooleanType ReadDXT3Pixels(Image *image, for (x = 0; x < (ssize_t) image->columns; x += 4) { /* Get 4x4 patch of pixels to write on */ - q = QueueAuthenticPixels(image, x, y, MagickMin(4, image->columns - x), - MagickMin(4, image->rows - y),exception); + q = QueueAuthenticPixels(image, x, y, (size_t) + MagickMin(4, (ssize_t) image->columns - x),(size_t) + MagickMin(4, (ssize_t) image->rows - y),exception); if (q == (Quantum *) NULL) return(MagickFalse); @@ -1765,8 +1769,8 @@ static MagickBooleanType ReadDXT5Pixels(Image *image, for (x = 0; x < (ssize_t) image->columns; x += 4) { /* Get 4x4 patch of pixels to write on */ - q = QueueAuthenticPixels(image, x, y, MagickMin(4, image->columns - x), - MagickMin(4, image->rows - y),exception); + q = QueueAuthenticPixels(image, x, y, (size_t) MagickMin(4, (ssize_t) image->columns - x),(size_t) + MagickMin(4, (ssize_t) image->rows - y),exception); if (q == (Quantum *) NULL) return(MagickFalse); @@ -2057,12 +2061,15 @@ static MagickBooleanType ReadBC5Pixels(Image *image, for (x = 0; x < (ssize_t)image->columns; x += 4) { size_t - area, + area; + + ssize_t count; /* Get 4x4 patch of pixels to write on */ - q=QueueAuthenticPixels(image,x,y,MagickMin(4,image->columns-x), - MagickMin(4,image->rows-y),exception); + q=QueueAuthenticPixels(image,x,y,(size_t) + MagickMin(4,(ssize_t) image->columns-x),(size_t) + MagickMin(4,(ssize_t) image->rows-y),exception); if (q == (Quantum *)NULL) return(MagickFalse); @@ -2108,8 +2115,8 @@ static MagickBooleanType ReadBC5Pixels(Image *image, } /* Write the pixels */ - area=MagickMin(MagickMin(4,image->columns-x)*MagickMin(4,image->rows-y), - 16); + area=(size_t) (MagickMin(MagickMin(4,(ssize_t) image->columns-x)* + MagickMin(4,(ssize_t) image->rows-y),16)); start_bit_r=16; start_bit_g=80; for (i = 0; i < (ssize_t) area; i++) @@ -2198,8 +2205,9 @@ static MagickBooleanType ReadBC7Pixels(Image *image, area; /* Get 4x4 patch of pixels to write on */ - q=QueueAuthenticPixels(image,x,y,MagickMin(4,image->columns-x), - MagickMin(4,image->rows-y),exception); + q=QueueAuthenticPixels(image,x,y,(size_t) + MagickMin(4,(ssize_t) image->columns-x),(size_t) + MagickMin(4,(ssize_t) image->rows-y),exception); if (q == (Quantum *) NULL) return(MagickFalse); @@ -2256,9 +2264,9 @@ static MagickBooleanType ReadBC7Pixels(Image *image, /* get color and subset indices */ for (i=0; i < 16; i++) { - subset_indices[i]=GetSubsetIndex(num_subsets,partition_id,i); + subset_indices[i]=GetSubsetIndex(num_subsets,partition_id,(size_t) i); num_bits=index_prec; - if (IsPixelAnchorIndex(subset_indices[i],num_subsets,i,partition_id)) + if (IsPixelAnchorIndex(subset_indices[i],num_subsets,(size_t) i,partition_id)) num_bits--; color_indices[i]=GetBits(block,&start_bit,num_bits); } @@ -2272,8 +2280,8 @@ static MagickBooleanType ReadBC7Pixels(Image *image, } /* Write the pixels */ - area=MagickMin(MagickMin(4,image->columns-x)*MagickMin(4,image->rows-y), - 16); + area=(size_t) (MagickMin(MagickMin(4,(ssize_t) image->columns-x)* + MagickMin(4,(ssize_t) image->rows-y),16)); for (i=0; i < (ssize_t) area; i++) { unsigned char @@ -2455,7 +2463,7 @@ static MagickBooleanType SkipRGBMipmaps(Image *image,const DDSInfo *dds_info, */ for (i=1; (i < (ssize_t) dds_info->mipmapcount) && w && h; i++) { - offset=(MagickOffsetType)w*h*pixel_size; + offset=(MagickOffsetType) (w*h*(size_t) pixel_size); if (SeekBlob(image,offset,SEEK_CUR) < 0) break; w=DIV2(w); @@ -3089,9 +3097,6 @@ static size_t CompressAlpha(const size_t min, const size_t max, unsigned char codes[8]; - ssize_t - i; - size_t error, index, @@ -3099,13 +3104,17 @@ static size_t CompressAlpha(const size_t min, const size_t max, least, value; + ssize_t + i; + codes[0] = (unsigned char) min; codes[1] = (unsigned char) max; codes[6] = 0; codes[7] = 255; for (i=1; i < (ssize_t) steps; i++) - codes[i+1] = (unsigned char) (((steps-i)*min + i*max) / steps); + codes[i+1] = (unsigned char) ((((ssize_t) steps-i)*(ssize_t) min + + i*(ssize_t) max) / (ssize_t) steps); error = 0; for (i=0; i<16; i++) @@ -3116,7 +3125,7 @@ static size_t CompressAlpha(const size_t min, const size_t max, continue; } - value = alphas[i]; + value = (size_t) alphas[i]; least = SIZE_MAX; index = 0; for (j=0; j<8; j++) @@ -3150,9 +3159,7 @@ static MagickBooleanType ConstructOrdering(const size_t count, f; ssize_t - i; - - size_t + i, j; unsigned char @@ -3190,7 +3197,7 @@ static MagickBooleanType ConstructOrdering(const size_t count, p = order + (16*i); same = MagickTrue; - for (j=0; j < count; j++) + for (j=0; j < (ssize_t) count; j++) { if (o[j] != p[j]) { @@ -3213,7 +3220,7 @@ static MagickBooleanType ConstructOrdering(const size_t count, DDSVector4 v; - j = (size_t) o[i]; + j = (ssize_t) o[i]; v.x = points[j].w * points[j].x; v.y = points[j].w * points[j].y; @@ -3251,12 +3258,12 @@ static void CompressClusterFit(const size_t count, size_t bestIteration = 0, - besti = 0, - bestj = 0, - bestk = 0, iterationIndex; ssize_t + besti = 0, + bestj = 0, + bestk = 0, i; unsigned char @@ -3303,18 +3310,18 @@ static void CompressClusterFit(const size_t count, part1, part2; - size_t + ssize_t ii, j, k, kmin; VectorInit(part0,0.0f); - for(ii=0; ii < (size_t) i; ii++) + for (ii=0; ii < i; ii++) VectorAdd(pointsWeights[ii],part0,&part0); VectorInit(part1,0.0f); - for (j=(size_t) i;;) + for (j=i; ; ) { if (j == 0) { @@ -3417,14 +3424,14 @@ static void CompressClusterFit(const size_t count, } } - if (k == count) + if (k == (ssize_t) count) break; VectorAdd(pointsWeights[k],part2,&part2); k++; } - if (j == count) + if (j == (ssize_t) count) break; VectorAdd(pointsWeights[j],part1,&part1); @@ -3726,12 +3733,12 @@ static void ComputeWeightedCovariance(const size_t count, static void WriteAlphas(Image *image, const ssize_t *alphas, size_t min5, size_t max5, size_t min7, size_t max7) { - ssize_t - i; - size_t err5, - err7, + err7; + + ssize_t + i, j; unsigned char @@ -3897,13 +3904,11 @@ static void WriteFourCC(Image *image, const size_t compression, ExceptionInfo *exception) { ssize_t - x; - - ssize_t + bx, + by, i, y, - bx, - by; + x; const Quantum *p; @@ -3935,11 +3940,11 @@ static void WriteFourCC(Image *image, const size_t compression, unsigned char alpha; - if (x + columns >= image->columns) - columns = image->columns - x; + if ((size_t) (x+(ssize_t) columns) >= image->columns) + columns = (size_t) ((ssize_t) image->columns-x); - if (y + rows >= image->rows) - rows = image->rows - y; + if ((size_t) (y+(ssize_t) rows) >= image->rows) + rows = (size_t) ((ssize_t) image->rows-y); p=GetVirtualPixels(image,x,y,columns,rows,exception); if (p == (const Quantum *) NULL) @@ -3972,7 +3977,7 @@ static void WriteFourCC(Image *image, const size_t compression, max5 = alpha; } - alphas[4*by + bx] = (size_t)alpha; + alphas[4*by + bx] = (ssize_t)alpha; point.x = (float)ScaleQuantumToChar(GetPixelRed(image,p)) / 255.0f; point.y = (float)ScaleQuantumToChar(GetPixelGreen(image,p)) / 255.0f; @@ -4002,7 +4007,7 @@ static void WriteFourCC(Image *image, const size_t compression, points[count].y = point.y; points[count].z = point.z; points[count].w = point.w; - map[4*by + bx] = count; + map[4*by + bx] = (ssize_t) count; count++; } } diff --git a/ImageMagick-7.1.1-15/coders/dds.h b/ImageMagick-7.1.1-16/coders/dds.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/dds.h rename to ImageMagick-7.1.1-16/coders/dds.h diff --git a/ImageMagick-7.1.1-15/coders/debug.c b/ImageMagick-7.1.1-16/coders/debug.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/debug.c rename to ImageMagick-7.1.1-16/coders/debug.c diff --git a/ImageMagick-7.1.1-15/coders/debug.h b/ImageMagick-7.1.1-16/coders/debug.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/debug.h rename to ImageMagick-7.1.1-16/coders/debug.h diff --git a/ImageMagick-7.1.1-15/coders/dib.c b/ImageMagick-7.1.1-16/coders/dib.c similarity index 97% rename from ImageMagick-7.1.1-15/coders/dib.c rename to ImageMagick-7.1.1-16/coders/dib.c index 919d76a4..d91cbabc 100644 --- a/ImageMagick-7.1.1-15/coders/dib.c +++ b/ImageMagick-7.1.1-16/coders/dib.c @@ -236,7 +236,7 @@ static MagickBooleanType DecodeImage(Image *image, */ x=0; y++; - p=pixels+y*image->columns; + p=pixels+y*(ssize_t) image->columns; break; } case 0x02: @@ -252,7 +252,7 @@ static MagickBooleanType DecodeImage(Image *image, if (byte == EOF) return(MagickFalse); y+=byte; - p=pixels+y*image->columns+x; + p=pixels+y*(ssize_t) image->columns+x; break; } default: @@ -719,7 +719,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) */ for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -763,7 +763,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) */ for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -810,7 +810,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) bytes_per_line=image->columns; for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -847,7 +847,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) bytes_per_line=2*image->columns; for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -895,7 +895,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) */ for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=pixels+(image->rows-y-1)*bytes_per_line; + p=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -946,7 +946,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) if (c & (0x80 >> bit)) image->alpha_trait=BlendPixelTrait; SetPixelAlpha(image,c & (0x80 >> bit) ? TransparentAlpha : - OpaqueAlpha,q+x*GetPixelChannels(image)+bit); + OpaqueAlpha,q+x*(ssize_t) GetPixelChannels(image)+bit); } } if ((image->columns % 8) != 0) @@ -957,7 +957,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) if (c & (0x80 >> bit)) image->alpha_trait=BlendPixelTrait; SetPixelAlpha(image,c & (0x80 >> bit) ? TransparentAlpha : - OpaqueAlpha,q+x*GetPixelChannels(image)+bit); + OpaqueAlpha,q+x*(ssize_t) GetPixelChannels(image)+bit); } } if (image->columns % 32) @@ -1214,7 +1214,7 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image, p=GetVirtualPixels(image,0,y,image->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(image->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; bit=0; byte=0; for (x=0; x < (ssize_t) image->columns; x++) @@ -1254,7 +1254,7 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image, p=GetVirtualPixels(image,0,y,image->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(image->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; for (x=0; x < (ssize_t) image->columns; x++) { *q++=(unsigned char) ((ssize_t) GetPixelIndex(image,p)); @@ -1281,7 +1281,7 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image, p=GetVirtualPixels(image,0,y,image->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(image->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; for (x=0; x < (ssize_t) image->columns; x++) { word=(unsigned short) ((ScaleColor8to5((unsigned char) @@ -1313,7 +1313,7 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image, p=GetVirtualPixels(image,0,y,image->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(image->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) image->rows-y-1)*(ssize_t) bytes_per_line; for (x=0; x < (ssize_t) image->columns; x++) { *q++=ScaleQuantumToChar(GetPixelBlue(image,p)); @@ -1381,8 +1381,8 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image, /* Dump colormap to file. */ - dib_colormap=(unsigned char *) AcquireQuantumMemory((size_t) - (1UL << dib_info.bits_per_pixel),4*sizeof(*dib_colormap)); + dib_colormap=(unsigned char *) AcquireQuantumMemory((size_t) 1UL << + dib_info.bits_per_pixel,4*sizeof(*dib_colormap)); if (dib_colormap == (unsigned char *) NULL) { pixels=(unsigned char *) RelinquishMagickMemory(pixels); @@ -1396,7 +1396,7 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image, *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].red)); *q++=(Quantum) 0x0; } - for ( ; i < (ssize_t) (1L << dib_info.bits_per_pixel); i++) + for ( ; i < (ssize_t) 1L << dib_info.bits_per_pixel; i++) { *q++=(Quantum) 0x0; *q++=(Quantum) 0x0; diff --git a/ImageMagick-7.1.1-15/coders/dib.h b/ImageMagick-7.1.1-16/coders/dib.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/dib.h rename to ImageMagick-7.1.1-16/coders/dib.h diff --git a/ImageMagick-7.1.1-15/coders/djvu.c b/ImageMagick-7.1.1-16/coders/djvu.c similarity index 97% rename from ImageMagick-7.1.1-15/coders/djvu.c rename to ImageMagick-7.1.1-16/coders/djvu.c index 973ba18c..a81a1cf7 100644 --- a/ImageMagick-7.1.1-15/coders/djvu.c +++ b/ImageMagick-7.1.1-16/coders/djvu.c @@ -306,7 +306,7 @@ process_message(ddjvu_message_t *message) default: printf("unexpected\n"); }; - return(message->m_any.tag); + return((int) message->m_any.tag); } @@ -349,7 +349,7 @@ get_page_image(LoadContext *lc, ddjvu_page_t *page, int x, int y, int w, int h, stride = (type == DDJVU_PAGETYPE_BITONAL)? (image->columns + 7)/8 : image->columns *3; - q = (unsigned char *) AcquireQuantumMemory(image->rows,stride); + q = (unsigned char *) AcquireQuantumMemory(image->rows,(size_t) stride); if (q == (unsigned char *) NULL) return; @@ -377,7 +377,7 @@ get_page_image(LoadContext *lc, ddjvu_page_t *page, int x, int y, int w, int h, &rect, &rect, /* mmc: ?? */ format, - stride, /* ?? */ + (size_t) stride, /* ?? */ (char*)q); (void) ret; ddjvu_format_release(format); @@ -566,7 +566,7 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum, ddjvu_pageinfo_t info; ddjvu_message_t *message; Image *image; - int logging; + MagickBooleanType logging; int tag; MagickBooleanType status; @@ -622,7 +622,7 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum, /* Set rendering resolution. */ - flags=ParseGeometry(image_info->density,&geometry_info); + flags=(int) ParseGeometry(image_info->density,&geometry_info); image->resolution.x=geometry_info.rho; image->resolution.y=geometry_info.sigma; if ((flags & SigmaValue) == 0) @@ -656,13 +656,7 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum, image->storage_class = DirectClass; /* fixme: MAGICKCORE_QUANTUM_DEPTH ?*/ image->depth = 8UL; /* i only support that? */ - - image->alpha_trait = BlendPixelTrait; - /* is this useful? */ } - status=SetImageExtent(image,image->columns,image->rows,exception); - if (status == MagickFalse) - return(DestroyImageList(image)); #if DEBUG printf("now filling %.20g x %.20g\n",(double) image->columns,(double) image->rows); @@ -672,7 +666,14 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum, #if 1 /* per_line */ /* q = QueueAuthenticPixels(image,0,0,image->columns,image->rows); */ - get_page_image(lc, lc->page, 0, 0, info.width, info.height, exception); + if (image->ping == MagickFalse) + { + status=SetImageExtent(image,image->columns,image->rows,exception); + if (status == MagickFalse) + return(DestroyImageList(image)); + get_page_image(lc, lc->page, 0, 0, image->columns, image->rows, + exception); + } #else int i; for (i = 0;i< image->rows; i++) @@ -750,13 +751,13 @@ static Image *ReadDJVUImage(const ImageInfo *image_info, *images; int - logging = MagickFalse, use_cache; LoadContext *lc; MagickBooleanType + logging = MagickFalse, status; ssize_t @@ -856,13 +857,13 @@ static Image *ReadDJVUImage(const ImageInfo *image_info, images=NewImageList(); i=0; if (image_info->number_scenes != 0) - i=image_info->scene; + i=(ssize_t) image_info->scene; for ( ; i < (ssize_t) lc->pages; i++) { image=ReadOneDJVUImage(lc,i,image_info,exception); if (image == (Image *) NULL) break; - image->scene=i; + image->scene=(size_t) i; AppendImageToList(&images,CloneImageList(image,exception)); images->extent=GetBlobSize(image); if (image_info->number_scenes != 0) diff --git a/ImageMagick-7.1.1-15/coders/djvu.h b/ImageMagick-7.1.1-16/coders/djvu.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/djvu.h rename to ImageMagick-7.1.1-16/coders/djvu.h diff --git a/ImageMagick-7.1.1-15/coders/dmr.c b/ImageMagick-7.1.1-16/coders/dmr.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/dmr.c rename to ImageMagick-7.1.1-16/coders/dmr.c index aea1e036..cffaaf26 100644 --- a/ImageMagick-7.1.1-15/coders/dmr.c +++ b/ImageMagick-7.1.1-16/coders/dmr.c @@ -369,13 +369,13 @@ static MagickBooleanType WriteDMRImage(const ImageInfo *image_info,Image *image, MagickCacheResourceType type; - size_t - ttl = 0; - StringInfo *passkey = (StringInfo *) NULL, *passphrase = (StringInfo *) NULL; + time_t + ttl = 0; + assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickCoreSignature); assert(image != (const Image *) NULL); @@ -421,7 +421,7 @@ static MagickBooleanType WriteDMRImage(const ImageInfo *image_info,Image *image, /* Time to live, absolute or relative, e.g. 1440, 2 hours, 3 days, ... */ - ttl=(size_t) InterpretLocaleValue(option,&q); + ttl=(time_t) InterpretLocaleValue(option,&q); if (q != option) { while (isspace((int) ((unsigned char) *q)) != 0) diff --git a/ImageMagick-7.1.1-15/coders/dmr.h b/ImageMagick-7.1.1-16/coders/dmr.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/dmr.h rename to ImageMagick-7.1.1-16/coders/dmr.h diff --git a/ImageMagick-7.1.1-15/coders/dng.c b/ImageMagick-7.1.1-16/coders/dng.c similarity index 94% rename from ImageMagick-7.1.1-15/coders/dng.c rename to ImageMagick-7.1.1-16/coders/dng.c index 1dd85baf..426c4376 100644 --- a/ImageMagick-7.1.1-15/coders/dng.c +++ b/ImageMagick-7.1.1-16/coders/dng.c @@ -170,8 +170,8 @@ static void SetDNGProperties(Image *image,const libraw_data_t *raw_info, (void) FormatMagickTime(raw_info->other.timestamp,sizeof(timestamp), timestamp); (void) SetImageProperty(image,"dng:create.date",timestamp,exception); - (void) FormatImageProperty(image,"dng:iso.setting","%.0f", - raw_info->other.iso_speed); + (void) FormatImageProperty(image,"dng:iso.setting","%.0g", + (double) raw_info->other.iso_speed); #if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0,18) (void) SetImageProperty(image,"dng:software",raw_info->idata.software, exception); @@ -180,47 +180,48 @@ static void SetDNGProperties(Image *image,const libraw_data_t *raw_info, raw_info->shootinginfo.BodySerial,exception); (void) FormatImageProperty(image,"dng:exposure.time","1/%.0f", PerceptibleReciprocal(raw_info->other.shutter)); - (void) FormatImageProperty(image,"dng:f.number","%0.1f", - raw_info->other.aperture); - (void) FormatImageProperty(image,"dng:max.aperture.value","%0.1f", - raw_info->lens.EXIF_MaxAp); - (void) FormatImageProperty(image,"dng:focal.length","%0.1f mm", - raw_info->other.focal_len); - (void) FormatImageProperty(image,"dng:wb.rb.levels","%f %f %f %f", - raw_info->color.cam_mul[0],raw_info->color.cam_mul[2], - raw_info->color.cam_mul[1],raw_info->color.cam_mul[3]); + (void) FormatImageProperty(image,"dng:f.number","%0.1g", + (double) raw_info->other.aperture); + (void) FormatImageProperty(image,"dng:max.aperture.value","%0.1g", + (double) raw_info->lens.EXIF_MaxAp); + (void) FormatImageProperty(image,"dng:focal.length","%0.1g mm", + (double) raw_info->other.focal_len); + (void) FormatImageProperty(image,"dng:wb.rb.levels","%g %g %g %g", + (double) raw_info->color.cam_mul[0],(double) raw_info->color.cam_mul[2], + (double) raw_info->color.cam_mul[1],(double) raw_info->color.cam_mul[3]); (void) SetImageProperty(image,"dng:lens.type", raw_info->lens.makernotes.LensFeatures_suf,exception); - (void) FormatImageProperty(image,"dng:lens","%0.1f-%0.1fmm f/%0.1f-%0.1f", - raw_info->lens.makernotes.MinFocal,raw_info->lens.makernotes.MaxFocal, - raw_info->lens.makernotes.MaxAp4MinFocal, - raw_info->lens.makernotes.MaxAp4MaxFocal); + (void) FormatImageProperty(image,"dng:lens","%0.1g-%0.1gmm f/%0.1g-%0.1g", + (double) raw_info->lens.makernotes.MinFocal, + (double) raw_info->lens.makernotes.MaxFocal, + (double) raw_info->lens.makernotes.MaxAp4MinFocal, + (double) raw_info->lens.makernotes.MaxAp4MaxFocal); (void) FormatImageProperty(image,"dng:lens.f.stops","%0.2f", - raw_info->lens.makernotes.LensFStops); + (double) raw_info->lens.makernotes.LensFStops); (void) FormatImageProperty(image,"dng:min.focal.length","%0.1f mm", - raw_info->lens.makernotes.MinFocal); - (void) FormatImageProperty(image,"dng:max.focal.length","%0.1f mm", - raw_info->lens.makernotes.MaxFocal); - (void) FormatImageProperty(image,"dng:max.aperture.at.min.focal","%0.1f", - raw_info->lens.makernotes.MaxAp4MinFocal); - (void) FormatImageProperty(image,"dng:max.aperture.at.max.focal","%0.1f", - raw_info->lens.makernotes.MaxAp4MaxFocal); + (double) raw_info->lens.makernotes.MinFocal); + (void) FormatImageProperty(image,"dng:max.focal.length","%0.1g mm", + (double) raw_info->lens.makernotes.MaxFocal); + (void) FormatImageProperty(image,"dng:max.aperture.at.min.focal","%0.1g", + (double) raw_info->lens.makernotes.MaxAp4MinFocal); + (void) FormatImageProperty(image,"dng:max.aperture.at.max.focal","%0.1g", + (double) raw_info->lens.makernotes.MaxAp4MaxFocal); (void) FormatImageProperty(image,"dng:focal.length.in.35mm.format","%d mm", raw_info->lens.FocalLengthIn35mmFormat); #endif #if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0,20) (void) FormatImageProperty(image,"dng:gps.latitude", - "%.0f deg %.0f' %.2f\" N", - raw_info->other.parsed_gps.latitude[0], - raw_info->other.parsed_gps.latitude[1], - raw_info->other.parsed_gps.latitude[2]); + "%.0g deg %.0g' %.2g\" N", + (double) raw_info->other.parsed_gps.latitude[0], + (double) raw_info->other.parsed_gps.latitude[1], + (double) raw_info->other.parsed_gps.latitude[2]); (void) FormatImageProperty(image,"dng:gps.longitude", - "%.0f deg %.0f' %.2f\" W", - raw_info->other.parsed_gps.longitude[0], - raw_info->other.parsed_gps.longitude[1], - raw_info->other.parsed_gps.longitude[2]); - (void) FormatImageProperty(image,"dng:gps.altitude","%.1f m", - raw_info->other.parsed_gps.altitude); + "%.0g deg %.0g' %.2g\" W", + (double) raw_info->other.parsed_gps.longitude[0], + (double) raw_info->other.parsed_gps.longitude[1], + (double) raw_info->other.parsed_gps.longitude[2]); + (void) FormatImageProperty(image,"dng:gps.altitude","%.1g m", + (double) raw_info->other.parsed_gps.altitude); #endif } #endif @@ -334,21 +335,22 @@ static void SetLibRawParams(const ImageInfo *image_info,Image *image, raw_info->params.user_flip=0; raw_info->params.output_bps=16; + raw_info->params.use_camera_wb=1; option=GetImageOption(image_info,"dng:use-camera-wb"); if (option == (const char *) NULL) option=GetImageOption(image_info,"dng:use_camera_wb"); if (option != (const char *) NULL) - raw_info->params.use_camera_wb=IsStringTrue(option); + raw_info->params.use_camera_wb=IsStringTrue(option) != MagickFalse ? 1 : 0; option=GetImageOption(image_info,"dng:use-auto-wb"); if (option == (const char *) NULL) option=GetImageOption(image_info,"dng:use_auto_wb"); if (option != (const char *) NULL) - raw_info->params.use_auto_wb=IsStringTrue(option); + raw_info->params.use_auto_wb=IsStringTrue(option) != MagickFalse ? 1 : 0; option=GetImageOption(image_info,"dng:no-auto-bright"); if (option == (const char *) NULL) option=GetImageOption(image_info,"dng:no_auto_bright"); if (option != (const char *) NULL) - raw_info->params.no_auto_bright=IsStringTrue(option); + raw_info->params.no_auto_bright=IsStringTrue(option) != MagickFalse ? 1 : 0; option=GetImageOption(image_info,"dng:output-color"); if (option == (const char *) NULL) option=GetImageOption(image_info,"dng:output_color"); @@ -444,11 +446,17 @@ static OrientationType LibRawFlipToOrientation(int flip) switch(flip) { case 5: + { return(LeftBottomOrientation); + } case 8: + { return(LeftTopOrientation); + } default: + { return((OrientationType) flip); + } } } diff --git a/ImageMagick-7.1.1-15/coders/dng.h b/ImageMagick-7.1.1-16/coders/dng.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/dng.h rename to ImageMagick-7.1.1-16/coders/dng.h diff --git a/ImageMagick-7.1.1-15/coders/dot.c b/ImageMagick-7.1.1-16/coders/dot.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/dot.c rename to ImageMagick-7.1.1-16/coders/dot.c diff --git a/ImageMagick-7.1.1-15/coders/dot.h b/ImageMagick-7.1.1-16/coders/dot.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/dot.h rename to ImageMagick-7.1.1-16/coders/dot.h diff --git a/ImageMagick-7.1.1-15/coders/dps.c b/ImageMagick-7.1.1-16/coders/dps.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/dps.c rename to ImageMagick-7.1.1-16/coders/dps.c diff --git a/ImageMagick-7.1.1-15/coders/dps.h b/ImageMagick-7.1.1-16/coders/dps.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/dps.h rename to ImageMagick-7.1.1-16/coders/dps.h diff --git a/ImageMagick-7.1.1-15/coders/dpx.c b/ImageMagick-7.1.1-16/coders/dpx.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/dpx.c rename to ImageMagick-7.1.1-16/coders/dpx.c index 59b31fdc..1b035a0c 100644 --- a/ImageMagick-7.1.1-15/coders/dpx.c +++ b/ImageMagick-7.1.1-16/coders/dpx.c @@ -880,12 +880,12 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) offset+=4; if (IsFloatDefined(dpx.orientation.x_center) != MagickFalse) (void) FormatImageProperty(image,"dpx:orientation.x_center","%g", - dpx.orientation.x_center); + (double) dpx.orientation.x_center); dpx.orientation.y_center=ReadBlobFloat(image); offset+=4; if (IsFloatDefined(dpx.orientation.y_center) != MagickFalse) (void) FormatImageProperty(image,"dpx:orientation.y_center","%g", - dpx.orientation.y_center); + (double) dpx.orientation.y_center); dpx.orientation.x_size=ReadBlobLong(image); offset+=4; if (dpx.orientation.x_size != ~0U) @@ -990,12 +990,12 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) offset+=4; if (IsFloatDefined(dpx.film.frame_rate) != MagickFalse) (void) FormatImageProperty(image,"dpx:film.frame_rate","%g", - dpx.film.frame_rate); + (double) dpx.film.frame_rate); dpx.film.shutter_angle=ReadBlobFloat(image); offset+=4; if (IsFloatDefined(dpx.film.shutter_angle) != MagickFalse) (void) FormatImageProperty(image,"dpx:film.shutter_angle","%g", - dpx.film.shutter_angle); + (double) dpx.film.shutter_angle); offset+=ReadBlob(image,sizeof(dpx.film.frame_id),(unsigned char *) dpx.film.frame_id); if (*dpx.film.frame_id != '\0') @@ -1047,52 +1047,52 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) if (IsFloatDefined(dpx.television.horizontal_sample_rate) != MagickFalse) (void) FormatImageProperty(image, "dpx:television.horizontal_sample_rate","%g", - dpx.television.horizontal_sample_rate); + (double) dpx.television.horizontal_sample_rate); dpx.television.vertical_sample_rate=ReadBlobFloat(image); offset+=4; if (IsFloatDefined(dpx.television.vertical_sample_rate) != MagickFalse) (void) FormatImageProperty(image,"dpx:television.vertical_sample_rate", - "%g",dpx.television.vertical_sample_rate); + "%g",(double) dpx.television.vertical_sample_rate); dpx.television.frame_rate=ReadBlobFloat(image); offset+=4; if (IsFloatDefined(dpx.television.frame_rate) != MagickFalse) (void) FormatImageProperty(image,"dpx:television.frame_rate","%g", - dpx.television.frame_rate); + (double) dpx.television.frame_rate); dpx.television.time_offset=ReadBlobFloat(image); offset+=4; if (IsFloatDefined(dpx.television.time_offset) != MagickFalse) (void) FormatImageProperty(image,"dpx:television.time_offset","%g", - dpx.television.time_offset); + (double) dpx.television.time_offset); dpx.television.gamma=ReadBlobFloat(image); offset+=4; if (IsFloatDefined(dpx.television.gamma) != MagickFalse) (void) FormatImageProperty(image,"dpx:television.gamma","%g", - dpx.television.gamma); + (double) dpx.television.gamma); dpx.television.black_level=ReadBlobFloat(image); offset+=4; if (IsFloatDefined(dpx.television.black_level) != MagickFalse) (void) FormatImageProperty(image,"dpx:television.black_level","%g", - dpx.television.black_level); + (double) dpx.television.black_level); dpx.television.black_gain=ReadBlobFloat(image); offset+=4; if (IsFloatDefined(dpx.television.black_gain) != MagickFalse) (void) FormatImageProperty(image,"dpx:television.black_gain","%g", - dpx.television.black_gain); + (double) dpx.television.black_gain); dpx.television.break_point=ReadBlobFloat(image); offset+=4; if (IsFloatDefined(dpx.television.break_point) != MagickFalse) (void) FormatImageProperty(image,"dpx:television.break_point","%g", - dpx.television.break_point); + (double) dpx.television.break_point); dpx.television.white_level=ReadBlobFloat(image); offset+=4; if (IsFloatDefined(dpx.television.white_level) != MagickFalse) (void) FormatImageProperty(image,"dpx:television.white_level","%g", - dpx.television.white_level); + (double) dpx.television.white_level); dpx.television.integration_times=ReadBlobFloat(image); offset+=4; if (IsFloatDefined(dpx.television.integration_times) != MagickFalse) (void) FormatImageProperty(image,"dpx:television.integration_times", - "%g",dpx.television.integration_times); + "%g",(double) dpx.television.integration_times); offset+=ReadBlob(image,sizeof(dpx.television.reserve),(unsigned char *) dpx.television.reserve); } diff --git a/ImageMagick-7.1.1-15/coders/dpx.h b/ImageMagick-7.1.1-16/coders/dpx.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/dpx.h rename to ImageMagick-7.1.1-16/coders/dpx.h diff --git a/ImageMagick-7.1.1-15/coders/emf.c b/ImageMagick-7.1.1-16/coders/emf.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/emf.c rename to ImageMagick-7.1.1-16/coders/emf.c diff --git a/ImageMagick-7.1.1-15/coders/emf.h b/ImageMagick-7.1.1-16/coders/emf.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/emf.h rename to ImageMagick-7.1.1-16/coders/emf.h diff --git a/ImageMagick-7.1.1-15/coders/ept.c b/ImageMagick-7.1.1-16/coders/ept.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/ept.c rename to ImageMagick-7.1.1-16/coders/ept.c diff --git a/ImageMagick-7.1.1-15/coders/ept.h b/ImageMagick-7.1.1-16/coders/ept.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/ept.h rename to ImageMagick-7.1.1-16/coders/ept.h diff --git a/ImageMagick-7.1.1-15/coders/exr.c b/ImageMagick-7.1.1-16/coders/exr.c similarity index 94% rename from ImageMagick-7.1.1-15/coders/exr.c rename to ImageMagick-7.1.1-16/coders/exr.c index baffe55f..bf46541d 100644 --- a/ImageMagick-7.1.1-15/coders/exr.c +++ b/ImageMagick-7.1.1-16/coders/exr.c @@ -206,8 +206,8 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) hdr_info=ImfInputHeader(file); ImfHeaderDataWindow(hdr_info,&display_window.min_x,&display_window.min_y, &display_window.max_x,&display_window.max_y); - image->columns=((size_t) display_window.max_x-display_window.min_x+1UL); - image->rows=((size_t) display_window.max_y-display_window.min_y+1UL); + image->columns=(size_t) (display_window.max_x-display_window.min_x+1L); + image->rows=(size_t) (display_window.max_y-display_window.min_y+1L); image->alpha_trait=BlendPixelTrait; (void) SetImageColorspace(image,RGBColorspace,exception); image->gamma=1.0; @@ -253,7 +253,7 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) } ImfHeaderDataWindow(hdr_info,&data_window.min_x,&data_window.min_y, &data_window.max_x,&data_window.max_y); - columns=((size_t) data_window.max_x-data_window.min_x+1UL); + columns=(size_t) (data_window.max_x-data_window.min_x+1L); if ((display_window.min_x > data_window.max_x) || (display_window.min_x+(int) image->columns <= data_window.min_x)) scanline=(ImfRgba *) NULL; @@ -292,8 +292,7 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) continue; } (void) memset(scanline,0,columns*sizeof(*scanline)); - if (ImfInputSetFrameBuffer(file,scanline-data_window.min_x-columns*yy,1, - columns) == 0) + if (ImfInputSetFrameBuffer(file,scanline-data_window.min_x-(ssize_t) columns*yy,1,columns) == 0) { status=MagickFalse; break; @@ -313,14 +312,14 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) SetPixelViaPixelInfo(image,&image->background_color,q); else { - SetPixelRed(image,ClampToQuantum((MagickRealType) QuantumRange* - ImfHalfToFloat(scanline[xx].r)),q); - SetPixelGreen(image,ClampToQuantum((MagickRealType) QuantumRange* - ImfHalfToFloat(scanline[xx].g)),q); - SetPixelBlue(image,ClampToQuantum((MagickRealType) QuantumRange* - ImfHalfToFloat(scanline[xx].b)),q); - SetPixelAlpha(image,ClampToQuantum((MagickRealType) QuantumRange* - ImfHalfToFloat(scanline[xx].a)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange* + (double) ImfHalfToFloat(scanline[xx].r)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange* + (double) ImfHalfToFloat(scanline[xx].g)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange* + (double) ImfHalfToFloat(scanline[xx].b)),q); + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange* + (double) ImfHalfToFloat(scanline[xx].a)),q); } q+=GetPixelChannels(image); } @@ -634,20 +633,23 @@ static MagickBooleanType WriteEXRImage(const ImageInfo *image_info,Image *image, break; for (x=0; x < (ssize_t) image->columns; x++) { - ImfFloatToHalf(QuantumScale*GetPixelRed(image,p),&half_quantum); + ImfFloatToHalf(QuantumScale*(double) GetPixelRed(image,p),&half_quantum); scanline[x].r=half_quantum; - ImfFloatToHalf(QuantumScale*GetPixelGreen(image,p),&half_quantum); + ImfFloatToHalf(QuantumScale*(double) GetPixelGreen(image,p), + &half_quantum); scanline[x].g=half_quantum; - ImfFloatToHalf(QuantumScale*GetPixelBlue(image,p),&half_quantum); + ImfFloatToHalf(QuantumScale*(double) GetPixelBlue(image,p),&half_quantum); scanline[x].b=half_quantum; if ((image->alpha_trait & BlendPixelTrait) == 0) ImfFloatToHalf(1.0,&half_quantum); else - ImfFloatToHalf(QuantumScale*GetPixelAlpha(image,p),&half_quantum); + ImfFloatToHalf(QuantumScale*(double) GetPixelAlpha(image,p), + &half_quantum); scanline[x].a=half_quantum; p+=GetPixelChannels(image); } - ImfOutputSetFrameBuffer(file,scanline-(y*image->columns),1,image->columns); + ImfOutputSetFrameBuffer(file,scanline-(y*(ssize_t) image->columns),1, + image->columns); ImfOutputWritePixels(file,1); } (void) ImfCloseOutputFile(file); diff --git a/ImageMagick-7.1.1-15/coders/exr.h b/ImageMagick-7.1.1-16/coders/exr.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/exr.h rename to ImageMagick-7.1.1-16/coders/exr.h diff --git a/ImageMagick-7.1.1-15/coders/farbfeld.c b/ImageMagick-7.1.1-16/coders/farbfeld.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/farbfeld.c rename to ImageMagick-7.1.1-16/coders/farbfeld.c diff --git a/ImageMagick-7.1.1-15/coders/farbfeld.h b/ImageMagick-7.1.1-16/coders/farbfeld.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/farbfeld.h rename to ImageMagick-7.1.1-16/coders/farbfeld.h diff --git a/ImageMagick-7.1.1-15/coders/fax.c b/ImageMagick-7.1.1-16/coders/fax.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/fax.c rename to ImageMagick-7.1.1-16/coders/fax.c diff --git a/ImageMagick-7.1.1-15/coders/fax.h b/ImageMagick-7.1.1-16/coders/fax.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/fax.h rename to ImageMagick-7.1.1-16/coders/fax.h diff --git a/ImageMagick-7.1.1-15/coders/fits.c b/ImageMagick-7.1.1-16/coders/fits.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/fits.c rename to ImageMagick-7.1.1-16/coders/fits.c index c0c97629..f09207ec 100644 --- a/ImageMagick-7.1.1-15/coders/fits.c +++ b/ImageMagick-7.1.1-16/coders/fits.c @@ -71,7 +71,7 @@ /* Forward declarations. */ -#define FITSBlocksize 2880UL +#define FITSBlocksize 2880L /* Forward declarations. @@ -415,7 +415,7 @@ static Image *ReadFITSImage(const ImageInfo *image_info, comment=DestroyString(comment); ThrowReaderException(CorruptImageError,"ImproperImageHeader"); } - number_pixels=(MagickSizeType) fits_info.columns*fits_info.rows; + number_pixels=(MagickSizeType) (fits_info.columns*fits_info.rows); if ((fits_info.simple != MagickFalse) && (fits_info.number_axes >= 1) && (fits_info.number_axes <= 4) && (number_pixels != 0)) break; @@ -431,7 +431,7 @@ static Image *ReadFITSImage(const ImageInfo *image_info, if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - number_pixels=(MagickSizeType) fits_info.columns*fits_info.rows; + number_pixels=(MagickSizeType) (fits_info.columns*fits_info.rows); if ((fits_info.simple == MagickFalse) || (fits_info.number_axes < 1) || (fits_info.number_axes > 4) || (number_pixels == 0) || (fits_info.number_planes <= 0)) @@ -440,8 +440,8 @@ static Image *ReadFITSImage(const ImageInfo *image_info, { image->columns=(size_t) fits_info.columns; image->rows=(size_t) fits_info.rows; - image->depth=(size_t) (fits_info.bits_per_pixel < 0 ? -1 : 1)* - fits_info.bits_per_pixel; + image->depth=(size_t) ((fits_info.bits_per_pixel < 0 ? -1L : 1L)* + (ssize_t) fits_info.bits_per_pixel); image->endian=fits_info.endian; image->scene=(size_t) scene; if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0)) @@ -469,7 +469,7 @@ static Image *ReadFITSImage(const ImageInfo *image_info, /* Convert FITS pixels to pixel packets. */ - scale=QuantumRange*PerceptibleReciprocal(fits_info.max_data- + scale=(double) QuantumRange*PerceptibleReciprocal(fits_info.max_data- fits_info.min_data); for (y=(ssize_t) image->rows-1; y >= 0; y--) { @@ -752,8 +752,8 @@ static MagickBooleanType WriteFITSImage(const ImageInfo *image_info, "SIMPLE = T"); offset+=CopyFITSRecord(fits_info,header,offset); (void) FormatLocaleString(header,FITSBlocksize,"BITPIX = %10ld", - (long) ((quantum_info->format == FloatingPointQuantumFormat ? -1 : 1)* - image->depth)); + (long) ((quantum_info->format == FloatingPointQuantumFormat ? -1L : 1L)* + (ssize_t) image->depth)); offset+=CopyFITSRecord(fits_info,header,offset); is_gray=IdentifyImageCoderGray(image,exception); (void) FormatLocaleString(header,FITSBlocksize,"NAXIS = %10lu", diff --git a/ImageMagick-7.1.1-15/coders/fits.h b/ImageMagick-7.1.1-16/coders/fits.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/fits.h rename to ImageMagick-7.1.1-16/coders/fits.h diff --git a/ImageMagick-7.1.1-15/coders/fl32.c b/ImageMagick-7.1.1-16/coders/fl32.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/fl32.c rename to ImageMagick-7.1.1-16/coders/fl32.c index 7b2cd43f..b0e1bb05 100644 --- a/ImageMagick-7.1.1-15/coders/fl32.c +++ b/ImageMagick-7.1.1-16/coders/fl32.c @@ -426,7 +426,7 @@ static MagickBooleanType WriteFL32Image(const ImageInfo *image_info, channels=1; break; } - case 3: + case 4: { if (image->alpha_trait != UndefinedPixelTrait) { diff --git a/ImageMagick-7.1.1-15/coders/fl32.h b/ImageMagick-7.1.1-16/coders/fl32.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/fl32.h rename to ImageMagick-7.1.1-16/coders/fl32.h diff --git a/ImageMagick-7.1.1-15/coders/flif.c b/ImageMagick-7.1.1-16/coders/flif.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/flif.c rename to ImageMagick-7.1.1-16/coders/flif.c index f66e7ff2..d6e4a9f9 100644 --- a/ImageMagick-7.1.1-15/coders/flif.c +++ b/ImageMagick-7.1.1-16/coders/flif.c @@ -493,7 +493,7 @@ static MagickBooleanType WriteFLIFImage(const ImageInfo *image_info, } else { - qc=pixels; + qc=(unsigned char *) pixels; for (x=0; x < (ssize_t) image->columns; x++) { *qc++=ScaleQuantumToChar(GetPixelRed(image,p)); diff --git a/ImageMagick-7.1.1-15/coders/flif.h b/ImageMagick-7.1.1-16/coders/flif.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/flif.h rename to ImageMagick-7.1.1-16/coders/flif.h diff --git a/ImageMagick-7.1.1-15/coders/fpx.c b/ImageMagick-7.1.1-16/coders/fpx.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/fpx.c rename to ImageMagick-7.1.1-16/coders/fpx.c diff --git a/ImageMagick-7.1.1-15/coders/fpx.h b/ImageMagick-7.1.1-16/coders/fpx.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/fpx.h rename to ImageMagick-7.1.1-16/coders/fpx.h diff --git a/ImageMagick-7.1.1-15/coders/ftxt.c b/ImageMagick-7.1.1-16/coders/ftxt.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/ftxt.c rename to ImageMagick-7.1.1-16/coders/ftxt.c index aed776ee..f50d95be 100644 --- a/ImageMagick-7.1.1-15/coders/ftxt.c +++ b/ImageMagick-7.1.1-16/coders/ftxt.c @@ -277,7 +277,7 @@ static long double BufToFlt(char * buffer,char ** tail,ValueTypeT expectType, if (**tail=='%') { (*tail)++; - val*=QuantumRange/100.0; + val*=(double) QuantumRange/100.0; if ((expectType != vtAny) && (expectType != vtPercent)) *err=MagickTrue; } @@ -435,7 +435,7 @@ static Image *ReadFTXTImage(const ImageInfo *image_info, } if (numMeta) { - if (SetPixelMetaChannels (image, numMeta, exception) == MagickFalse) + if (SetPixelMetaChannels (image, (size_t) numMeta, exception) == MagickFalse) ThrowReaderException(OptionError,"SetPixelMetaChannelsFailure"); } /* make image zero (if RGB channels, transparent black). */ diff --git a/ImageMagick-7.1.1-15/coders/ftxt.h b/ImageMagick-7.1.1-16/coders/ftxt.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/ftxt.h rename to ImageMagick-7.1.1-16/coders/ftxt.h diff --git a/ImageMagick-7.1.1-15/coders/ghostscript-private.h b/ImageMagick-7.1.1-16/coders/ghostscript-private.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/ghostscript-private.h rename to ImageMagick-7.1.1-16/coders/ghostscript-private.h diff --git a/ImageMagick-7.1.1-15/coders/gif.c b/ImageMagick-7.1.1-16/coders/gif.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/gif.c rename to ImageMagick-7.1.1-16/coders/gif.c index 161887c3..51573f76 100644 --- a/ImageMagick-7.1.1-15/coders/gif.c +++ b/ImageMagick-7.1.1-16/coders/gif.c @@ -287,7 +287,7 @@ static inline int GetNextLZWCode(LZWInfo *lzw_info,const size_t bits) count=ReadBlobBlock(lzw_info->image,&lzw_info->code_info.buffer[ lzw_info->code_info.count]); if (count > 0) - lzw_info->code_info.count+=count; + lzw_info->code_info.count+=(size_t) count; else lzw_info->code_info.eof=MagickTrue; } @@ -638,7 +638,7 @@ static MagickBooleanType EncodeImage(const ImageInfo *image_info,Image *image, (void) memset(hash_suffix,0,MaxHashTable*sizeof(*hash_suffix)); number_bits=data_size; max_code=MaxCode(number_bits); - clear_code=((short) one << (data_size-1)); + clear_code=(size_t) ((short) one << (data_size-1)); end_of_information_code=clear_code+1; free_code=clear_code+2; length=0; @@ -676,7 +676,7 @@ static MagickBooleanType EncodeImage(const ImageInfo *image_info,Image *image, displacement=1; index=(Quantum) ((size_t) GetPixelIndex(image,p) & 0xff); p+=GetPixelChannels(image); - k=(ssize_t) (((size_t) index << (MaxGIFBits-8))+waiting_code); + k=(ssize_t) (((size_t) index << (MaxGIFBits-8))+(size_t) waiting_code); if (k >= MaxHashTable) k-=MaxHashTable; if (k < 0) @@ -1092,13 +1092,13 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) comments=AcquireString((char *) NULL); extent=MagickPathExtent; - for (offset=0; ; offset+=count) + for (offset=0; ; offset+=(size_t) count) { count=ReadBlobBlock(image,buffer); if (count == 0) break; buffer[count]='\0'; - if ((ssize_t) (count+offset+MagickPathExtent) >= (ssize_t) extent) + if ((count+(ssize_t) offset+MagickPathExtent) >= (ssize_t) extent) { extent<<=1; comments=(char *) ResizeQuantumMemory(comments, @@ -1175,7 +1175,7 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) if (info == (unsigned char *) NULL) ThrowGIFException(ResourceLimitError, "MemoryAllocationFailed"); - (void) memset(info,0,reserved_length*sizeof(*info)); + (void) memset(info,0,(size_t) reserved_length*sizeof(*info)); for (info_length=0; ; ) { block_length=(int) ReadBlobBlock(image,info+info_length); @@ -1627,15 +1627,16 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image, if ((image->storage_class == DirectClass) || (image->colors > 256)) (void) SetImageType(image,PaletteBilevelAlphaType,exception); for (i=0; i < (ssize_t) image->colors; i++) - if (image->colormap[i].alpha != OpaqueAlpha) + if (image->colormap[i].alpha != (double) OpaqueAlpha) { if (opacity < 0) { opacity=i; continue; } - alpha=fabs(image->colormap[i].alpha-TransparentAlpha); - beta=fabs(image->colormap[opacity].alpha-TransparentAlpha); + alpha=fabs(image->colormap[i].alpha-(double) TransparentAlpha); + beta=fabs(image->colormap[opacity].alpha-(double) + TransparentAlpha); if (alpha < beta) opacity=i; } @@ -1643,15 +1644,17 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image, { (void) SetImageType(image,PaletteBilevelAlphaType,exception); for (i=0; i < (ssize_t) image->colors; i++) - if (image->colormap[i].alpha != OpaqueAlpha) + if (image->colormap[i].alpha != (double) OpaqueAlpha) { if (opacity < 0) { opacity=i; continue; } - alpha=fabs(image->colormap[i].alpha-TransparentAlpha); - beta=fabs(image->colormap[opacity].alpha-TransparentAlpha); + alpha=fabs(image->colormap[i].alpha-(double) + TransparentAlpha); + beta=fabs(image->colormap[opacity].alpha-(double) + TransparentAlpha); if (alpha < beta) opacity=i; } @@ -1689,7 +1692,7 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image, */ c=0x80; c|=(8-1) << 4; /* color resolution */ - c|=(bits_per_pixel-1); /* size of global colormap */ + c|=(int) (bits_per_pixel-1); /* size of global colormap */ (void) WriteBlobByte(image,(unsigned char) c); for (j=0; j < (ssize_t) image->colors; j++) if (IsPixelInfoEquivalent(&image->background_color,image->colormap+j)) @@ -1732,7 +1735,7 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image, (void) WriteBlobByte(image,(unsigned char) 0x21); (void) WriteBlobByte(image,(unsigned char) 0xf9); (void) WriteBlobByte(image,(unsigned char) 0x04); - c=image->dispose << 2; + c=(int) (image->dispose << 2); if (opacity >= 0) c|=0x01; (void) WriteBlobByte(image,(unsigned char) c); @@ -1742,7 +1745,7 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image, (void) WriteBlobByte(image,(unsigned char) (opacity >= 0 ? opacity : 0)); (void) WriteBlobByte(image,(unsigned char) 0x00); - if (fabs(image->gamma - 1.0f/2.2f) > MagickEpsilon) + if (fabs(image->gamma-1.0/2.2) > MagickEpsilon) { char attributes[MagickPathExtent]; @@ -1872,8 +1875,8 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image, size_t block_length; - if ((length-offset) < 255) - block_length=length-offset; + if (((ssize_t) length-offset) < 255) + block_length=(size_t) ((ssize_t) length-offset); else block_length=255; (void) WriteBlobByte(image,(unsigned char) block_length); @@ -1908,7 +1911,7 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image, else { c|=0x80; - c|=(bits_per_pixel-1); /* size of local colormap */ + c|=(int) (bits_per_pixel-1); /* size of local colormap */ (void) WriteBlobByte(image,(unsigned char) c); length=(size_t) (3*(one << bits_per_pixel)); (void) WriteBlob(image,length,colormap); diff --git a/ImageMagick-7.1.1-15/coders/gif.h b/ImageMagick-7.1.1-16/coders/gif.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/gif.h rename to ImageMagick-7.1.1-16/coders/gif.h diff --git a/ImageMagick-7.1.1-15/coders/gradient.c b/ImageMagick-7.1.1-16/coders/gradient.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/gradient.c rename to ImageMagick-7.1.1-16/coders/gradient.c diff --git a/ImageMagick-7.1.1-15/coders/gradient.h b/ImageMagick-7.1.1-16/coders/gradient.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/gradient.h rename to ImageMagick-7.1.1-16/coders/gradient.h diff --git a/ImageMagick-7.1.1-15/coders/gray.c b/ImageMagick-7.1.1-16/coders/gray.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/gray.c rename to ImageMagick-7.1.1-16/coders/gray.c diff --git a/ImageMagick-7.1.1-15/coders/gray.h b/ImageMagick-7.1.1-16/coders/gray.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/gray.h rename to ImageMagick-7.1.1-16/coders/gray.h diff --git a/ImageMagick-7.1.1-15/coders/hald.c b/ImageMagick-7.1.1-16/coders/hald.c similarity index 94% rename from ImageMagick-7.1.1-15/coders/hald.c rename to ImageMagick-7.1.1-16/coders/hald.c index 1e6174d9..86d72674 100644 --- a/ImageMagick-7.1.1-15/coders/hald.c +++ b/ImageMagick-7.1.1-16/coders/hald.c @@ -160,19 +160,21 @@ static Image *ReadHALDImage(const ImageInfo *image_info, { for (red=0; red < (ssize_t) cube_size; red++) { - SetPixelRed(image,ClampToQuantum(QuantumRange*red/(cube_size-1.0)),q); - SetPixelGreen(image,ClampToQuantum(QuantumRange*green/(cube_size-1.0)), - q); - SetPixelBlue(image,ClampToQuantum(QuantumRange*blue/(cube_size-1.0)),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*red/ + (cube_size-1.0)),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*green/ + (cube_size-1.0)),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*blue/ + (cube_size-1.0)),q); SetPixelAlpha(image,OpaqueAlpha,q); if (image->storage_class == PseudoClass) { image->colormap[index].red= - ClampToQuantum(QuantumRange*red/(cube_size-1.0)); + ClampToQuantum((double) QuantumRange*red/(cube_size-1.0)); image->colormap[index].green= - ClampToQuantum(QuantumRange*green/(cube_size-1.0)); + ClampToQuantum((double) QuantumRange*green/(cube_size-1.0)); image->colormap[index].blue= - ClampToQuantum(QuantumRange*blue/(cube_size-1.0)); + ClampToQuantum((double) QuantumRange*blue/(cube_size-1.0)); image->colormap[index].alpha=OpaqueAlpha; SetPixelIndex(image,(Quantum) index++,q); } diff --git a/ImageMagick-7.1.1-15/coders/hald.h b/ImageMagick-7.1.1-16/coders/hald.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/hald.h rename to ImageMagick-7.1.1-16/coders/hald.h diff --git a/ImageMagick-7.1.1-15/coders/hdr.c b/ImageMagick-7.1.1-16/coders/hdr.c similarity index 95% rename from ImageMagick-7.1.1-15/coders/hdr.c rename to ImageMagick-7.1.1-16/coders/hdr.c index 7d1ec615..f9a46496 100644 --- a/ImageMagick-7.1.1-15/coders/hdr.c +++ b/ImageMagick-7.1.1-16/coders/hdr.c @@ -428,7 +428,7 @@ static Image *ReadHDRImage(const ImageInfo *image_info,ExceptionInfo *exception) p=pixels; for (i=0; i < 4; i++) { - end=&pixels[(i+1)*image->columns]; + end=&pixels[(i+1)*(ssize_t) image->columns]; while (p < end) { count=ReadBlob(image,2*sizeof(*pixel),pixel); @@ -469,9 +469,9 @@ static Image *ReadHDRImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image->compression == RLECompression) { pixel[0]=pixels[x]; - pixel[1]=pixels[x+image->columns]; - pixel[2]=pixels[x+2*image->columns]; - pixel[3]=pixels[x+3*image->columns]; + pixel[1]=pixels[x+(ssize_t) image->columns]; + pixel[2]=pixels[x+2*(ssize_t) image->columns]; + pixel[3]=pixels[x+3*(ssize_t) image->columns]; } else { @@ -486,9 +486,12 @@ static Image *ReadHDRImage(const ImageInfo *image_info,ExceptionInfo *exception) if (pixel[3] != 0) { gamma=pow(2.0,pixel[3]-(128.0+8.0)); - SetPixelRed(image,ClampToQuantum(QuantumRange*gamma*pixel[0]),q); - SetPixelGreen(image,ClampToQuantum(QuantumRange*gamma*pixel[1]),q); - SetPixelBlue(image,ClampToQuantum(QuantumRange*gamma*pixel[2]),q); + SetPixelRed(image,ClampToQuantum((double) QuantumRange*gamma* + (double) pixel[0]),q); + SetPixelGreen(image,ClampToQuantum((double) QuantumRange*gamma* + (double) pixel[1]),q); + SetPixelBlue(image,ClampToQuantum((double) QuantumRange*gamma* + (double) pixel[2]),q); } q+=GetPixelChannels(image); } @@ -642,7 +645,7 @@ static size_t HDRWriteRunlengthPixels(Image *image,unsigned char *pixels) break; if (WriteBlob(image,(size_t) count*sizeof(*pixel),&pixels[p]) < 1) break; - p+=count; + p+=(size_t) count; } if (runlength >= MinimumRunlength) { @@ -774,11 +777,11 @@ static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, pixel[1]=0; pixel[2]=0; pixel[3]=0; - gamma=QuantumScale*GetPixelRed(image,p); - if ((QuantumScale*GetPixelGreen(image,p)) > gamma) - gamma=QuantumScale*GetPixelGreen(image,p); - if ((QuantumScale*GetPixelBlue(image,p)) > gamma) - gamma=QuantumScale*GetPixelBlue(image,p); + gamma=QuantumScale*(double) GetPixelRed(image,p); + if ((QuantumScale*(double) GetPixelGreen(image,p)) > gamma) + gamma=QuantumScale*(double) GetPixelGreen(image,p); + if ((QuantumScale*(double) GetPixelBlue(image,p)) > gamma) + gamma=QuantumScale*(double) GetPixelBlue(image,p); if (gamma > MagickEpsilon) { int @@ -786,20 +789,22 @@ static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, gamma=frexp(gamma,&exponent)*256.0/gamma; if (GetPixelRed(image,p) > 0) - pixel[0]=(unsigned char) (gamma*QuantumScale*GetPixelRed(image,p)); + pixel[0]=(unsigned char) (gamma*QuantumScale*(double) + GetPixelRed(image,p)); if (GetPixelGreen(image,p) > 0) pixel[1]=(unsigned char) (gamma*QuantumScale* - GetPixelGreen(image,p)); + (double) GetPixelGreen(image,p)); if (GetPixelBlue(image,p) > 0) - pixel[2]=(unsigned char) (gamma*QuantumScale*GetPixelBlue(image,p)); + pixel[2]=(unsigned char) (gamma*QuantumScale*(double) + GetPixelBlue(image,p)); pixel[3]=(unsigned char) (exponent+128); } if ((image->columns >= 8) && (image->columns <= 0x7ffff)) { pixels[x]=pixel[0]; - pixels[x+image->columns]=pixel[1]; - pixels[x+2*image->columns]=pixel[2]; - pixels[x+3*image->columns]=pixel[3]; + pixels[x+(ssize_t) image->columns]=pixel[1]; + pixels[x+2*(ssize_t) image->columns]=pixel[2]; + pixels[x+3*(ssize_t) image->columns]=pixel[3]; } else { @@ -813,7 +818,8 @@ static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, if ((image->columns >= 8) && (image->columns <= 0x7ffff)) { for (i=0; i < 4; i++) - length=HDRWriteRunlengthPixels(image,&pixels[i*image->columns]); + length=HDRWriteRunlengthPixels(image, + &pixels[i*(ssize_t) image->columns]); } else { diff --git a/ImageMagick-7.1.1-15/coders/hdr.h b/ImageMagick-7.1.1-16/coders/hdr.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/hdr.h rename to ImageMagick-7.1.1-16/coders/hdr.h diff --git a/ImageMagick-7.1.1-15/coders/heic.c b/ImageMagick-7.1.1-16/coders/heic.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/heic.c rename to ImageMagick-7.1.1-16/coders/heic.c index 8560f6bb..e0833eda 100644 --- a/ImageMagick-7.1.1-15/coders/heic.c +++ b/ImageMagick-7.1.1-16/coders/heic.c @@ -596,7 +596,7 @@ static Image *ReadHEICImage(const ImageInfo *image_info, } status=ReadHEICImageHandle(image_info,image,image_handle,exception); heif_image_handle_release(image_handle); - count=(size_t) heif_context_get_number_of_top_level_images(heif_context); + count=(ssize_t) heif_context_get_number_of_top_level_images(heif_context); if ((status != MagickFalse) && (count > 1)) { heif_item_id @@ -883,7 +883,8 @@ static void WriteProfile(struct heif_context *context,Image *image, if (LocaleCompare(name,"XMP") == 0) for (i=0; i < (ssize_t) GetStringInfoLength(profile); i+=65533L) { - length=MagickMin(GetStringInfoLength(profile)-i,65533L); + length=(size_t) MagickMin((ssize_t) GetStringInfoLength(profile)-i, + 65533L); error=heif_context_add_XMP_metadata(context,image_handle, (void*) (GetStringInfoDatum(profile)+i),(int) length); if (IsHEIFSuccess(image,&error,exception) == MagickFalse) diff --git a/ImageMagick-7.1.1-15/coders/heic.h b/ImageMagick-7.1.1-16/coders/heic.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/heic.h rename to ImageMagick-7.1.1-16/coders/heic.h diff --git a/ImageMagick-7.1.1-15/coders/histogram.c b/ImageMagick-7.1.1-16/coders/histogram.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/histogram.c rename to ImageMagick-7.1.1-16/coders/histogram.c index 69d39ff0..c5e5379b 100644 --- a/ImageMagick-7.1.1-15/coders/histogram.c +++ b/ImageMagick-7.1.1-16/coders/histogram.c @@ -300,7 +300,7 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info, { y=CastDoubleToLong(ceil((double) histogram_image->rows-scale* histogram[x].red-0.5)); - r=q+y*GetPixelChannels(histogram_image); + r=q+y*(ssize_t) GetPixelChannels(histogram_image); for ( ; y < (ssize_t) histogram_image->rows; y++) { SetPixelRed(histogram_image,QuantumRange,r); @@ -311,7 +311,7 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info, { y=CastDoubleToLong(ceil((double) histogram_image->rows-scale* histogram[x].green-0.5)); - r=q+y*GetPixelChannels(histogram_image); + r=q+y*(ssize_t) GetPixelChannels(histogram_image); for ( ; y < (ssize_t) histogram_image->rows; y++) { SetPixelGreen(histogram_image,QuantumRange,r); @@ -322,7 +322,7 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info, { y=CastDoubleToLong(ceil((double) histogram_image->rows-scale* histogram[x].blue-0.5)); - r=q+y*GetPixelChannels(histogram_image); + r=q+y*(ssize_t) GetPixelChannels(histogram_image); for ( ; y < (ssize_t) histogram_image->rows; y++) { SetPixelBlue(histogram_image,QuantumRange,r); diff --git a/ImageMagick-7.1.1-15/coders/histogram.h b/ImageMagick-7.1.1-16/coders/histogram.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/histogram.h rename to ImageMagick-7.1.1-16/coders/histogram.h diff --git a/ImageMagick-7.1.1-15/coders/hrz.c b/ImageMagick-7.1.1-16/coders/hrz.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/hrz.c rename to ImageMagick-7.1.1-16/coders/hrz.c diff --git a/ImageMagick-7.1.1-15/coders/hrz.h b/ImageMagick-7.1.1-16/coders/hrz.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/hrz.h rename to ImageMagick-7.1.1-16/coders/hrz.h diff --git a/ImageMagick-7.1.1-15/coders/html.c b/ImageMagick-7.1.1-16/coders/html.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/html.c rename to ImageMagick-7.1.1-16/coders/html.c index 2875a1b2..739cb126 100644 --- a/ImageMagick-7.1.1-15/coders/html.c +++ b/ImageMagick-7.1.1-16/coders/html.c @@ -277,8 +277,8 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info, (void) CopyMagickString(url,image_info->magick,MagickPathExtent); (void) ConcatenateMagickString(url,":",MagickPathExtent); url[strlen(url)+p-image->filename]='\0'; - (void) ConcatenateMagickString(url,image->filename, - p-image->filename+2); + (void) ConcatenateMagickString(url,image->filename,(size_t) + (p-image->filename+2)); (void) CopyMagickString(image->filename,p,MagickPathExtent); } } @@ -373,7 +373,8 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info, (void) FormatLocaleString(buffer,MagickPathExtent,"\" shape=" "\"rect\" coords=\"%.20g,%.20g,%.20g,%.20g\" alt=\"\" />\n", (double) geometry.x,(double) geometry.y,(double) (geometry.x+ - geometry.width-1),(double) (geometry.y+geometry.height-1)); + (ssize_t) geometry.width-1),(double) (geometry.y+(ssize_t) + geometry.height-1)); (void) WriteBlobString(image,buffer); if (*(p+1) != '\0') { diff --git a/ImageMagick-7.1.1-15/coders/html.h b/ImageMagick-7.1.1-16/coders/html.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/html.h rename to ImageMagick-7.1.1-16/coders/html.h diff --git a/ImageMagick-7.1.1-15/coders/icon.c b/ImageMagick-7.1.1-16/coders/icon.c similarity index 96% rename from ImageMagick-7.1.1-15/coders/icon.c rename to ImageMagick-7.1.1-16/coders/icon.c index 3d9fb186..70999414 100644 --- a/ImageMagick-7.1.1-15/coders/icon.c +++ b/ImageMagick-7.1.1-16/coders/icon.c @@ -416,11 +416,11 @@ static Image *ReadICONImage(const ImageInfo *image_info, status=SetImageExtent(image,image->columns,image->rows,exception); if (status == MagickFalse) return(DestroyImageList(image)); - bytes_per_line=(((image->columns*icon_info.bits_per_pixel)+31) & - ~31) >> 3; + bytes_per_line=(((image->columns*icon_info.bits_per_pixel)+31U) & + ~31U) >> 3; (void) bytes_per_line; - scanline_pad=((((image->columns*icon_info.bits_per_pixel)+31) & ~31)- - (image->columns*icon_info.bits_per_pixel)) >> 3; + scanline_pad=((((image->columns*icon_info.bits_per_pixel)+31U) & + ~31U)-(image->columns*icon_info.bits_per_pixel)) >> 3; switch (icon_info.bits_per_pixel) { case 1: @@ -459,8 +459,8 @@ static Image *ReadICONImage(const ImageInfo *image_info, break; if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,image->rows-y-1, - image->rows); + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) + image->rows-y-1,(MagickSizeType) image->rows); if (status == MagickFalse) break; } @@ -497,8 +497,8 @@ static Image *ReadICONImage(const ImageInfo *image_info, break; if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,image->rows-y-1, - image->rows); + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) + image->rows-y-1,(MagickSizeType) image->rows); if (status == MagickFalse) break; } @@ -527,8 +527,8 @@ static Image *ReadICONImage(const ImageInfo *image_info, break; if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,image->rows-y-1, - image->rows); + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) + image->rows-y-1,(MagickSizeType) image->rows); if (status == MagickFalse) break; } @@ -558,8 +558,8 @@ static Image *ReadICONImage(const ImageInfo *image_info, break; if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,image->rows-y-1, - image->rows); + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) + image->rows-y-1,(MagickSizeType) image->rows); if (status == MagickFalse) break; } @@ -597,8 +597,8 @@ static Image *ReadICONImage(const ImageInfo *image_info, break; if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,image->rows-y-1, - image->rows); + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) + image->rows-y-1,(MagickSizeType) image->rows); if (status == MagickFalse) break; } @@ -1064,8 +1064,8 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, icon_info.offset_bits+=(one << icon_info.bits_per_pixel); } } - bytes_per_line=(((next->columns*icon_info.bits_per_pixel)+31) & ~31) >> - 3; + bytes_per_line=(((next->columns*icon_info.bits_per_pixel)+31U) & + ~31U) >> 3; icon_info.ba_offset=0; icon_info.width=(ssize_t) next->columns; icon_info.height=(ssize_t) next->rows; @@ -1074,7 +1074,8 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, icon_info.size=40; icon_info.size+=(4*icon_info.number_colors); icon_info.size+=icon_info.image_size; - icon_info.size+=(((icon_info.width+31) & ~31) >> 3)*icon_info.height; + icon_info.size+=(size_t) ((((icon_info.width+31U) & ~31U) >> 3)* + icon_info.height); icon_info.file_size+=icon_info.image_size; icon_info.x_pixels=0; icon_info.y_pixels=0; @@ -1122,13 +1123,13 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, p=GetVirtualPixels(next,0,y,next->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(next->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) next->rows-y-1)*(ssize_t) bytes_per_line; bit=0; byte=0; for (x=0; x < (ssize_t) next->columns; x++) { byte<<=1; - byte|=GetPixelIndex(next,p) != 0 ? 0x01 : 0x00; + byte|=(size_t) (GetPixelIndex(next,p) != 0 ? 0x01 : 0x00); bit++; if (bit == 8) { @@ -1163,7 +1164,7 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, p=GetVirtualPixels(next,0,y,next->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(next->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) next->rows-y-1)*(ssize_t) bytes_per_line; nibble=0; byte=0; for (x=0; x < (ssize_t) next->columns; x++) @@ -1200,7 +1201,7 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, p=GetVirtualPixels(next,0,y,next->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(next->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) next->rows-y-1)*(ssize_t) bytes_per_line; for (x=0; x < (ssize_t) next->columns; x++) { *q++=(unsigned char) GetPixelIndex(next,p); @@ -1226,7 +1227,7 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, p=GetVirtualPixels(next,0,y,next->columns,1,exception); if (p == (const Quantum *) NULL) break; - q=pixels+(next->rows-y-1)*bytes_per_line; + q=pixels+((ssize_t) next->rows-y-1)*(ssize_t) bytes_per_line; for (x=0; x < (ssize_t) next->columns; x++) { *q++=ScaleQuantumToChar(GetPixelBlue(next,p)); @@ -1283,8 +1284,8 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, /* Dump colormap to file. */ - icon_colormap=(unsigned char *) AcquireQuantumMemory((size_t) - (1UL << icon_info.bits_per_pixel),4UL*sizeof(*icon_colormap)); + icon_colormap=(unsigned char *) AcquireQuantumMemory((size_t) 1UL + << icon_info.bits_per_pixel,4UL*sizeof(*icon_colormap)); if (icon_colormap == (unsigned char *) NULL) { images=DestroyImageList(images); @@ -1299,7 +1300,7 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, *q++=ScaleQuantumToChar(next->colormap[i].red); *q++=(unsigned char) 0x0; } - for ( ; i < (ssize_t) (1UL << icon_info.bits_per_pixel); i++) + for ( ; i < (ssize_t) 1UL << icon_info.bits_per_pixel; i++) { *q++=(unsigned char) 0x00; *q++=(unsigned char) 0x00; @@ -1316,7 +1317,7 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, /* Write matte mask. */ - scanline_pad=(((next->columns+31) & ~31)-next->columns) >> 3; + scanline_pad=(((next->columns+31U) & ~31U)-next->columns) >> 3; for (y=((ssize_t) next->rows - 1); y >= 0; y--) { unsigned char diff --git a/ImageMagick-7.1.1-15/coders/icon.h b/ImageMagick-7.1.1-16/coders/icon.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/icon.h rename to ImageMagick-7.1.1-16/coders/icon.h diff --git a/ImageMagick-7.1.1-15/coders/info.c b/ImageMagick-7.1.1-16/coders/info.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/info.c rename to ImageMagick-7.1.1-16/coders/info.c diff --git a/ImageMagick-7.1.1-15/coders/info.h b/ImageMagick-7.1.1-16/coders/info.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/info.h rename to ImageMagick-7.1.1-16/coders/info.h diff --git a/ImageMagick-7.1.1-15/coders/inline.c b/ImageMagick-7.1.1-16/coders/inline.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/inline.c rename to ImageMagick-7.1.1-16/coders/inline.c index 2d039625..3382c82c 100644 --- a/ImageMagick-7.1.1-15/coders/inline.c +++ b/ImageMagick-7.1.1-16/coders/inline.c @@ -101,14 +101,12 @@ static Image *ReadINLINEImage(const ImageInfo *image_info, MagickBooleanType status; - size_t - i; - size_t quantum; ssize_t - count; + count, + i; unsigned char *inline_image; @@ -165,8 +163,8 @@ static Image *ReadINLINEImage(const ImageInfo *image_info, inline_image=(unsigned char *) RelinquishMagickMemory(inline_image); break; } - inline_image=(unsigned char *) ResizeQuantumMemory(inline_image,i+count+ - quantum+1,sizeof(*inline_image)); + inline_image=(unsigned char *) ResizeQuantumMemory(inline_image,(size_t) + (i+count+(ssize_t) quantum+1),sizeof(*inline_image)); } if (inline_image == (unsigned char *) NULL) { diff --git a/ImageMagick-7.1.1-15/coders/inline.h b/ImageMagick-7.1.1-16/coders/inline.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/inline.h rename to ImageMagick-7.1.1-16/coders/inline.h diff --git a/ImageMagick-7.1.1-15/coders/ipl.c b/ImageMagick-7.1.1-16/coders/ipl.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/ipl.c rename to ImageMagick-7.1.1-16/coders/ipl.c diff --git a/ImageMagick-7.1.1-15/coders/ipl.h b/ImageMagick-7.1.1-16/coders/ipl.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/ipl.h rename to ImageMagick-7.1.1-16/coders/ipl.h diff --git a/ImageMagick-7.1.1-15/coders/jbig.c b/ImageMagick-7.1.1-16/coders/jbig.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/jbig.c rename to ImageMagick-7.1.1-16/coders/jbig.c index 0b253c93..d9119b2e 100644 --- a/ImageMagick-7.1.1-15/coders/jbig.c +++ b/ImageMagick-7.1.1-16/coders/jbig.c @@ -195,7 +195,7 @@ static Image *ReadJBIGImage(const ImageInfo *image_info, size_t count; - status=jbg_dec_in(&jbig_info,p,length,&count); + status=(MagickStatusType) jbg_dec_in(&jbig_info,p,(size_t) length,&count); p+=count; length-=(ssize_t) count; } @@ -487,7 +487,7 @@ static MagickBooleanType WriteJBIGImage(const ImageInfo *image_info, for (x=0; x < (ssize_t) image->columns; x++) { byte<<=1; - if (GetPixelLuma(image,p) < (QuantumRange/2.0)) + if (GetPixelLuma(image,p) < ((double) QuantumRange/2.0)) byte|=0x01; bit++; if (bit == 8) @@ -548,7 +548,7 @@ static MagickBooleanType WriteJBIGImage(const ImageInfo *image_info, } (void) jbg_enc_lrange(&jbig_info,-1,-1); jbg_enc_options(&jbig_info,JBG_ILEAVE | JBG_SMID,JBG_TPDON | JBG_TPBON | - JBG_DPON,version < 1.6 ? -1 : 0,-1,-1); + JBG_DPON,version < 1.6 ? ~0UL : 0UL,-1,-1); /* Write JBIG image. */ diff --git a/ImageMagick-7.1.1-15/coders/jbig.h b/ImageMagick-7.1.1-16/coders/jbig.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/jbig.h rename to ImageMagick-7.1.1-16/coders/jbig.h diff --git a/ImageMagick-7.1.1-15/coders/jnx.c b/ImageMagick-7.1.1-16/coders/jnx.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/jnx.c rename to ImageMagick-7.1.1-16/coders/jnx.c diff --git a/ImageMagick-7.1.1-15/coders/jnx.h b/ImageMagick-7.1.1-16/coders/jnx.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/jnx.h rename to ImageMagick-7.1.1-16/coders/jnx.h diff --git a/ImageMagick-7.1.1-15/coders/jp2.c b/ImageMagick-7.1.1-16/coders/jp2.c similarity index 94% rename from ImageMagick-7.1.1-15/coders/jp2.c rename to ImageMagick-7.1.1-16/coders/jp2.c index c7fce9df..a5b6e6ed 100644 --- a/ImageMagick-7.1.1-15/coders/jp2.c +++ b/ImageMagick-7.1.1-16/coders/jp2.c @@ -17,7 +17,7 @@ % June 2001 % % % % % -% Copyright @ 2001 ImageMagick Studio LLC, a non-profit organization % +% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % @@ -207,7 +207,7 @@ static OPJ_SIZE_T JP2ReadHandler(void *buffer,OPJ_SIZE_T length,void *context) count; image=(Image *) context; - count=ReadBlob(image,(ssize_t) length,(unsigned char *) buffer); + count=ReadBlob(image,(size_t) length,(unsigned char *) buffer); if (count == 0) return((OPJ_SIZE_T) -1); return((OPJ_SIZE_T) count); @@ -250,7 +250,7 @@ static OPJ_SIZE_T JP2WriteHandler(void *buffer,OPJ_SIZE_T length,void *context) count; image=(Image *) context; - count=WriteBlob(image,(ssize_t) length,(unsigned char *) buffer); + count=WriteBlob(image,(size_t) length,(unsigned char *) buffer); return((OPJ_SIZE_T) count); } @@ -328,10 +328,10 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception) opj_set_default_decoder_parameters(¶meters); option=GetImageOption(image_info,"jp2:reduce-factor"); if (option != (const char *) NULL) - parameters.cp_reduce=StringToInteger(option); + parameters.cp_reduce=(unsigned int) StringToInteger(option); option=GetImageOption(image_info,"jp2:quality-layers"); if (option != (const char *) NULL) - parameters.cp_layer=StringToInteger(option); + parameters.cp_layer=(unsigned int) StringToInteger(option); if (opj_setup_decoder(jp2_codec,¶meters) == 0) { opj_destroy_codec(jp2_codec); @@ -371,7 +371,7 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception) (OPJ_INT32) (image->extract_info.y+(ssize_t) image->rows)); else jp2_status=opj_set_decode_area(jp2_codec,jp2_image,0,0, - jp2_image->comps[0].w,jp2_image->comps[0].h); + (int) jp2_image->comps[0].w,(int) jp2_image->comps[0].h); if (jp2_status == OPJ_FALSE) { opj_stream_destroy(jp2_stream); @@ -489,8 +489,8 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception) index, pad; - pad=image->columns % jp2_image->comps[i].dx; - index=y/jp2_image->comps[i].dy*(image->columns+pad)/ + pad=(ssize_t) image->columns % jp2_image->comps[i].dx; + index=y/jp2_image->comps[i].dy*((ssize_t) image->columns+pad)/ jp2_image->comps[i].dx+x/jp2_image->comps[i].dx; if ((index < 0) || (index >= (jp2_image->comps[i].h*jp2_image->comps[i].w))) @@ -500,10 +500,11 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception) ThrowReaderException(CoderError, "IrregularChannelGeometryNotSupported") } - scale=QuantumRange/(double) ((MagickULLConstant(1) << + scale=(double) QuantumRange/(double) ((MagickULLConstant(1) << jp2_image->comps[i].prec)-1); - pixel=scale*(jp2_image->comps[i].data[index]+(jp2_image->comps[i].sgnd ? - MagickULLConstant(1) << (jp2_image->comps[i].prec-1) : 0)); + pixel=scale*(jp2_image->comps[i].data[index]+(ssize_t) + (jp2_image->comps[i].sgnd ? MagickULLConstant(1) << + (jp2_image->comps[i].prec-1) : 0)); switch (i) { case 0: @@ -801,21 +802,21 @@ static void CinemaProfileCompliance(const opj_image_t *jp2_image, parameters->POC[0].resno0=0; parameters->POC[0].compno0=0; parameters->POC[0].layno1=1; - parameters->POC[0].resno1=parameters->numresolution-1; + parameters->POC[0].resno1=(unsigned int) parameters->numresolution-1; parameters->POC[0].compno1=3; parameters->POC[0].prg1=OPJ_CPRL; parameters->POC[1].tile=1; - parameters->POC[1].resno0=parameters->numresolution-1; + parameters->POC[1].resno0=(unsigned int) parameters->numresolution-1; parameters->POC[1].compno0=0; parameters->POC[1].layno1=1; - parameters->POC[1].resno1=parameters->numresolution; + parameters->POC[1].resno1=(unsigned int) parameters->numresolution; parameters->POC[1].compno1=3; parameters->POC[1].prg1=OPJ_CPRL; } parameters->tcp_numlayers=1; - parameters->tcp_rates[0]=((float) (jp2_image->numcomps*jp2_image->comps[0].w* - jp2_image->comps[0].h*jp2_image->comps[0].prec))/(parameters->max_comp_size* - 8*jp2_image->comps[0].dx*jp2_image->comps[0].dy); + parameters->tcp_rates[0]=(((float) jp2_image->numcomps*jp2_image->comps[0].w* + jp2_image->comps[0].h*jp2_image->comps[0].prec))/((float) + parameters->max_comp_size*8*jp2_image->comps[0].dx*jp2_image->comps[0].dy); parameters->cp_disto_alloc=OPJ_TRUE; } @@ -919,7 +920,7 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image, Set tile size. */ (void) memset(&geometry,0,sizeof(geometry)); - flags=ParseAbsoluteGeometry(image_info->extract,&geometry); + flags=(int) ParseAbsoluteGeometry(image_info->extract,&geometry); parameters->cp_tdx=(int) geometry.width; parameters->cp_tdy=(int) geometry.width; if ((flags & HeightValue) != 0) @@ -929,8 +930,8 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image, if ((flags & YValue) != 0) parameters->cp_ty0=geometry.y; parameters->tile_size_on=OPJ_TRUE; - parameters->numresolution=CalculateNumResolutions(parameters->cp_tdx, - parameters->cp_tdy); + parameters->numresolution=CalculateNumResolutions((size_t) + parameters->cp_tdx,(size_t) parameters->cp_tdy); } option=GetImageOption(image_info,"jp2:quality"); if (option != (const char *) NULL) @@ -1029,8 +1030,8 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image, (LocaleCompare(image_info->magick,"JP2") == 0))) jp2_info[i].prec++; /* OpenJPEG returns exception for depth @ 1 */ jp2_info[i].sgnd=0; - jp2_info[i].dx=parameters->subsampling_dx; - jp2_info[i].dy=parameters->subsampling_dy; + jp2_info[i].dx=(unsigned int) parameters->subsampling_dx; + jp2_info[i].dy=(unsigned int) parameters->subsampling_dy; jp2_info[i].w=(OPJ_UINT32) image->columns; jp2_info[i].h=(OPJ_UINT32) image->rows; } @@ -1040,12 +1041,12 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image, parameters=(opj_cparameters_t *) RelinquishMagickMemory(parameters); ThrowWriterException(DelegateError,"UnableToEncodeImageFile"); } - jp2_image->x0=parameters->image_offset_x0; - jp2_image->y0=parameters->image_offset_y0; + jp2_image->x0=(unsigned int) parameters->image_offset_x0; + jp2_image->y0=(unsigned int) parameters->image_offset_y0; jp2_image->x1=(unsigned int) (2*parameters->image_offset_x0+ - (image->columns-1)*parameters->subsampling_dx+1); + ((ssize_t) image->columns-1)*parameters->subsampling_dx+1); jp2_image->y1=(unsigned int) (2*parameters->image_offset_y0+ - (image->rows-1)*parameters->subsampling_dx+1); + ((ssize_t) image->rows-1)*parameters->subsampling_dx+1); if ((image->depth == 12) && ((image->columns == 2048) || (image->rows == 1080) || (image->columns == 4096) || (image->rows == 2160))) @@ -1080,7 +1081,7 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image, *q; scale=(double) (((size_t) MagickULLConstant(1) << - jp2_image->comps[i].prec)-1)/QuantumRange; + jp2_image->comps[i].prec)-1)/(double) QuantumRange; q=jp2_image->comps[i].data+(ssize_t) (y*PerceptibleReciprocal( jp2_image->comps[i].dy)*image->columns*PerceptibleReciprocal( jp2_image->comps[i].dx)+x*PerceptibleReciprocal( @@ -1091,30 +1092,30 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image, { if (jp2_colorspace == OPJ_CLRSPC_GRAY) { - *q=(int) (scale*GetPixelGray(image,p)); + *q=(int) (scale*(double) GetPixelGray(image,p)); break; } - *q=(int) (scale*GetPixelRed(image,p)); + *q=(int) (scale*(double) GetPixelRed(image,p)); break; } case 1: { if (jp2_colorspace == OPJ_CLRSPC_GRAY) { - *q=(int) (scale*GetPixelAlpha(image,p)); + *q=(int) (scale*(double) GetPixelAlpha(image,p)); break; } - *q=(int) (scale*GetPixelGreen(image,p)); + *q=(int) (scale*(double) GetPixelGreen(image,p)); break; } case 2: { - *q=(int) (scale*GetPixelBlue(image,p)); + *q=(int) (scale*(double) GetPixelBlue(image,p)); break; } case 3: { - *q=(int) (scale*GetPixelAlpha(image,p)); + *q=(int) (scale*(double) GetPixelAlpha(image,p)); break; } } diff --git a/ImageMagick-7.1.1-15/coders/jp2.h b/ImageMagick-7.1.1-16/coders/jp2.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/jp2.h rename to ImageMagick-7.1.1-16/coders/jp2.h diff --git a/ImageMagick-7.1.1-15/coders/jpeg.c b/ImageMagick-7.1.1-16/coders/jpeg.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/jpeg.c rename to ImageMagick-7.1.1-16/coders/jpeg.c index 869a04f1..682c4061 100644 --- a/ImageMagick-7.1.1-15/coders/jpeg.c +++ b/ImageMagick-7.1.1-16/coders/jpeg.c @@ -498,11 +498,11 @@ do \ length=0; \ else \ { \ - length=256*c; \ + length=(size_t) (256*c); \ if (((c=GetCharacter(jpeg_info)) == EOF) || (c < 0)) \ length=0; \ else \ - length+=c; \ + length+=(unsigned char) c; \ } \ } while(0) @@ -565,7 +565,8 @@ static boolean ReadICCProfile(j_decompress_ptr jpeg_info) return(status); client_info=(JPEGClientInfo *) jpeg_info->client_data; status=SetImageProfile(client_info->image,"MPF", - client_info->profiles[ICC_INDEX],client_info->exception); + client_info->profiles[ICC_INDEX],client_info->exception) == + MagickFalse ? FALSE : TRUE; client_info->profiles[ICC_INDEX]=DestroyStringInfo( client_info->profiles[ICC_INDEX]); return(TRUE); @@ -746,7 +747,7 @@ static void SkipInputData(j_decompress_ptr compress_info,long number_bytes) (void) FillInputBuffer(compress_info); } source->manager.next_input_byte+=number_bytes; - source->manager.bytes_in_buffer-=number_bytes; + source->manager.bytes_in_buffer-=(size_t) number_bytes; } static void TerminateSource(j_decompress_ptr compress_info) @@ -791,13 +792,11 @@ static void JPEGSetImageQuality(struct jpeg_decompress_struct *jpeg_info, #endif { ssize_t + i, j, qvalue, sum; - ssize_t - i; - /* Determine the JPEG compression quality from the quantization tables. */ @@ -1407,15 +1406,15 @@ static Image *ReadOneJPEGImage(const ImageInfo *image_info, ThrowJPEGReaderException(CorruptImageError,"ImageTypeNotSupported"); } memory_info=AcquireVirtualMemory((size_t) image->columns, - jpeg_info->output_components*sizeof(*jpeg_pixels)); + (size_t) jpeg_info->output_components*sizeof(*jpeg_pixels)); if (memory_info == (MemoryInfo *) NULL) { JPEGDestroyDecompress(jpeg_info); ThrowJPEGReaderException(ResourceLimitError,"MemoryAllocationFailed"); } jpeg_pixels=(JSAMPLE *) GetVirtualMemoryBlob(memory_info); - (void) memset(jpeg_pixels,0,image->columns* - jpeg_info->output_components*sizeof(*jpeg_pixels)); + (void) memset(jpeg_pixels,0,(size_t) (image->columns* + (size_t) jpeg_info->output_components*sizeof(*jpeg_pixels))); /* Convert JPEG pixels to pixel packets. */ @@ -2194,7 +2193,7 @@ static void WriteProfiles(j_compress_ptr jpeg_info,Image *image, id=JPEG_APP0+StringToInteger(name+3); for (i=0; i < (ssize_t) length; i+=65533L) jpeg_write_marker(jpeg_info,id,GetStringInfoDatum(profile)+i, - (unsigned int) MagickMin(length-i,65533)); + MagickMin((unsigned int) length-i,65533)); } if (LocaleCompare(name,"EXIF") == 0) { @@ -2220,7 +2219,8 @@ static void WriteProfiles(j_compress_ptr jpeg_info,Image *image, p[tag_length]='\0'; for (i=0; i < (ssize_t) GetStringInfoLength(profile); i+=65519L) { - length=MagickMin(GetStringInfoLength(profile)-i,65519L); + length=(size_t) MagickMin((ssize_t) GetStringInfoLength(profile)-i, + 65519L); p[12]=(unsigned char) ((i/65519L)+1); p[13]=(unsigned char) (GetStringInfoLength(profile)/65519L+1); (void) memcpy(p+tag_length+3,GetStringInfoDatum(profile)+i, @@ -2242,7 +2242,8 @@ static void WriteProfiles(j_compress_ptr jpeg_info,Image *image, p=GetStringInfoDatum(custom_profile); for (i=0; i < (ssize_t) GetStringInfoLength(profile); i+=65500L) { - length=MagickMin(GetStringInfoLength(profile)-i,65500L); + length=(size_t) MagickMin((ssize_t) GetStringInfoLength(profile)-i, + 65500L); roundup=(size_t) (length & 0x01); if (LocaleNCompare((char *) GetStringInfoDatum(profile),"8BIM",4) == 0) { @@ -2729,7 +2730,7 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info, } } #endif - colorspace=jpeg_info->in_color_space; + colorspace=(int) jpeg_info->in_color_space; value=GetImageOption(image_info,"jpeg:colorspace"); if (value == (char *) NULL) value=GetImageProperty(image,"jpeg:colorspace",exception); @@ -2941,7 +2942,7 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info, Convert MIFF to JPEG raster pixels. */ memory_info=AcquireVirtualMemory((size_t) image->columns, - jpeg_info->input_components*sizeof(*jpeg_pixels)); + (size_t) (jpeg_info->input_components*(ssize_t) sizeof(*jpeg_pixels))); if (memory_info == (MemoryInfo *) NULL) ThrowJPEGWriterException(ResourceLimitError,"MemoryAllocationFailed"); jpeg_pixels=(JSAMPLE *) GetVirtualMemoryBlob(memory_info); diff --git a/ImageMagick-7.1.1-15/coders/jpeg.h b/ImageMagick-7.1.1-16/coders/jpeg.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/jpeg.h rename to ImageMagick-7.1.1-16/coders/jpeg.h diff --git a/ImageMagick-7.1.1-15/coders/json.c b/ImageMagick-7.1.1-16/coders/json.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/json.c rename to ImageMagick-7.1.1-16/coders/json.c index 91419995..a6fc4034 100644 --- a/ImageMagick-7.1.1-15/coders/json.c +++ b/ImageMagick-7.1.1-16/coders/json.c @@ -590,7 +590,7 @@ static ssize_t PrintChannelLocations(FILE *file,const Image *image, if (traits == UndefinedPixelTrait) continue; offset=GetPixelChannelOffset(image,channel); - match=fabs((double) (p[offset]-target)) < 0.5 ? MagickTrue : MagickFalse; + match=fabs((double) p[offset]-target) < 0.5 ? MagickTrue : MagickFalse; if (match != MagickFalse) { if ((max_locations != 0) && (n >= (ssize_t) max_locations)) diff --git a/ImageMagick-7.1.1-15/coders/json.h b/ImageMagick-7.1.1-16/coders/json.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/json.h rename to ImageMagick-7.1.1-16/coders/json.h diff --git a/ImageMagick-7.1.1-15/coders/jxl.c b/ImageMagick-7.1.1-16/coders/jxl.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/jxl.c rename to ImageMagick-7.1.1-16/coders/jxl.c index b9aae0b9..02418095 100644 --- a/ImageMagick-7.1.1-15/coders/jxl.c +++ b/ImageMagick-7.1.1-16/coders/jxl.c @@ -367,7 +367,7 @@ static Image *ReadJXLImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowReaderException(CoderError,"MemoryAllocationFailed"); } } - if (JxlDecoderSubscribeEvents(jxl_info,events_wanted) != JXL_DEC_SUCCESS) + if (JxlDecoderSubscribeEvents(jxl_info,(int) events_wanted) != JXL_DEC_SUCCESS) { if (runner != NULL) JxlThreadParallelRunnerDestroy(runner); @@ -873,7 +873,7 @@ static inline float JXLGetDistance(const ImageInfo *image_info) return(1.0f); if (image_info->quality >= 30) return(0.1f+(float) (100-MagickMin(100,image_info->quality))*0.09f); - return(6.24f+(float) pow(2.5f,(30.0-image_info->quality)/5.0f)/6.25f); + return(6.24f+(float) pow(2.5f,(30.0-image_info->quality)/5.0)/6.25f); } static MagickBooleanType WriteJXLImage(const ImageInfo *image_info,Image *image, diff --git a/ImageMagick-7.1.1-15/coders/jxl.h b/ImageMagick-7.1.1-16/coders/jxl.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/jxl.h rename to ImageMagick-7.1.1-16/coders/jxl.h diff --git a/ImageMagick-7.1.1-15/coders/kernel.c b/ImageMagick-7.1.1-16/coders/kernel.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/kernel.c rename to ImageMagick-7.1.1-16/coders/kernel.c diff --git a/ImageMagick-7.1.1-15/coders/kernel.h b/ImageMagick-7.1.1-16/coders/kernel.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/kernel.h rename to ImageMagick-7.1.1-16/coders/kernel.h diff --git a/ImageMagick-7.1.1-15/coders/label.c b/ImageMagick-7.1.1-16/coders/label.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/label.c rename to ImageMagick-7.1.1-16/coders/label.c diff --git a/ImageMagick-7.1.1-15/coders/label.h b/ImageMagick-7.1.1-16/coders/label.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/label.h rename to ImageMagick-7.1.1-16/coders/label.h diff --git a/ImageMagick-7.1.1-15/coders/mac.c b/ImageMagick-7.1.1-16/coders/mac.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/mac.c rename to ImageMagick-7.1.1-16/coders/mac.c diff --git a/ImageMagick-7.1.1-15/coders/mac.h b/ImageMagick-7.1.1-16/coders/mac.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/mac.h rename to ImageMagick-7.1.1-16/coders/mac.h diff --git a/ImageMagick-7.1.1-15/coders/magick.c b/ImageMagick-7.1.1-16/coders/magick.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/magick.c rename to ImageMagick-7.1.1-16/coders/magick.c diff --git a/ImageMagick-7.1.1-15/coders/magick.h b/ImageMagick-7.1.1-16/coders/magick.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/magick.h rename to ImageMagick-7.1.1-16/coders/magick.h diff --git a/ImageMagick-7.1.1-15/coders/map.c b/ImageMagick-7.1.1-16/coders/map.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/map.c rename to ImageMagick-7.1.1-16/coders/map.c index b214b416..015efb71 100644 --- a/ImageMagick-7.1.1-15/coders/map.c +++ b/ImageMagick-7.1.1-16/coders/map.c @@ -108,18 +108,9 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception) Quantum index; - ssize_t - x; - Quantum *q; - ssize_t - i; - - unsigned char - *p; - size_t depth, packet_size, @@ -127,10 +118,13 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception) ssize_t count, + i, + x, y; unsigned char *colormap, + *p, *pixels; /* @@ -197,13 +191,13 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception) else for (i=0; i < (ssize_t) image->colors; i++) { - quantum=(*p++ << 8); + quantum=(size_t) (*p++ << 8); quantum|=(*p++); image->colormap[i].red=(Quantum) quantum; - quantum=(*p++ << 8); - quantum|=(*p++); + quantum=(size_t) (*p++ << 8); + quantum|=(size_t) (*p++); image->colormap[i].green=(Quantum) quantum; - quantum=(*p++ << 8); + quantum=(size_t) (*p++ << 8); quantum|=(*p++); image->colormap[i].blue=(Quantum) quantum; } @@ -239,8 +233,8 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception) p++; if (image->colors > 256) { - index=ConstrainColormapIndex(image,((size_t) index << 8)+(*p), - exception); + index=ConstrainColormapIndex(image,(ssize_t) (((size_t) index << 8)+ + (size_t) (*p)),exception); p++; } SetPixelIndex(image,index,q); diff --git a/ImageMagick-7.1.1-15/coders/map.h b/ImageMagick-7.1.1-16/coders/map.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/map.h rename to ImageMagick-7.1.1-16/coders/map.h diff --git a/ImageMagick-7.1.1-15/coders/mask.c b/ImageMagick-7.1.1-16/coders/mask.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/mask.c rename to ImageMagick-7.1.1-16/coders/mask.c diff --git a/ImageMagick-7.1.1-15/coders/mask.h b/ImageMagick-7.1.1-16/coders/mask.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/mask.h rename to ImageMagick-7.1.1-16/coders/mask.h diff --git a/ImageMagick-7.1.1-15/coders/mat.c b/ImageMagick-7.1.1-16/coders/mat.c similarity index 96% rename from ImageMagick-7.1.1-15/coders/mat.c rename to ImageMagick-7.1.1-16/coders/mat.c index 812e6f43..cc50e923 100644 --- a/ImageMagick-7.1.1-15/coders/mat.c +++ b/ImageMagick-7.1.1-16/coders/mat.c @@ -195,14 +195,14 @@ static void InsertComplexDoubleRow(Image *image,double *p,int y,double MinVal, { if (*p > 0) { - f=(*p/MaxVal)*(Quantum) (QuantumRange-GetPixelRed(image,q)); + f=(*p/MaxVal)*((double) QuantumRange-(double) GetPixelRed(image,q)); if (IsNaN(f) != 0) f=0.0; - if ((f+GetPixelRed(image,q)) >= QuantumRange) + if ((f+(double) GetPixelRed(image,q)) >= (double) QuantumRange) SetPixelRed(image,QuantumRange,q); else - SetPixelRed(image,GetPixelRed(image,q)+ClampToQuantum(f),q); - f=GetPixelGreen(image,q)-f/2.0; + SetPixelRed(image,(double) GetPixelRed(image,q)+ClampToQuantum(f),q); + f=(double) GetPixelGreen(image,q)-f/2.0; if (IsNaN(f) != 0) f=0.0; if (f <= 0.0) @@ -221,7 +221,7 @@ static void InsertComplexDoubleRow(Image *image,double *p,int y,double MinVal, f=(*p/MinVal)*(Quantum) (QuantumRange-GetPixelBlue(image,q)); if (IsNaN(f) != 0) f=0.0; - if ((f+GetPixelBlue(image,q)) >= QuantumRange) + if ((f+(double) GetPixelBlue(image,q)) >= (double) QuantumRange) SetPixelBlue(image,QuantumRange,q); else SetPixelBlue(image,GetPixelBlue(image,q)+ClampToQuantum(f),q); @@ -264,7 +264,8 @@ static void InsertComplexFloatRow(Image *image,float *p,int y,double MinVal, { if (*p > 0) { - f=(*p/MaxVal)*(Quantum) (QuantumRange-GetPixelRed(image,q)); + f=((double) *p/MaxVal)*((double) QuantumRange-(double) + GetPixelRed(image,q)); if (IsNaN(f) != 0) f=0.0; if ((f+GetPixelRed(image,q)) < QuantumRange) @@ -324,7 +325,7 @@ static void ReadBlobFloatsLSB(Image * image, size_t len, float *data) len -= sizeof(float); } if (len > 0) - (void) SeekBlob(image, len, SEEK_CUR); + (void) SeekBlob(image, (MagickOffsetType) len, SEEK_CUR); } static void ReadBlobFloatsMSB(Image * image, size_t len, float *data) @@ -335,7 +336,7 @@ static void ReadBlobFloatsMSB(Image * image, size_t len, float *data) len -= sizeof(float); } if (len > 0) - (void) SeekBlob(image, len, SEEK_CUR); + (void) SeekBlob(image, (MagickOffsetType) len, SEEK_CUR); } /* This function reads one block of doubles*/ @@ -347,7 +348,7 @@ static void ReadBlobDoublesLSB(Image * image, size_t len, double *data) len -= sizeof(double); } if (len > 0) - (void) SeekBlob(image, len, SEEK_CUR); + (void) SeekBlob(image, (MagickOffsetType) len, SEEK_CUR); } static void ReadBlobDoublesMSB(Image * image, size_t len, double *data) @@ -358,7 +359,7 @@ static void ReadBlobDoublesMSB(Image * image, size_t len, double *data) len -= sizeof(double); } if (len > 0) - (void) SeekBlob(image, len, SEEK_CUR); + (void) SeekBlob(image, (MagickOffsetType) len, SEEK_CUR); } /* Calculate minimum and maximum from a given block of data */ @@ -420,7 +421,7 @@ float *fltrow; } } } - (void) SeekBlob(image, filepos, SEEK_SET); + (void) SeekBlob(image, (MagickOffsetType) filepos, SEEK_SET); } @@ -490,11 +491,11 @@ Image *image2; void *cache_block, *decompress_block; z_stream zip_info; FILE *mat_file; -size_t magick_size; +ssize_t magick_size; size_t extent; int file; -int status; +MagickBooleanType status; int zip_status; ssize_t TotalSize = 0; @@ -651,10 +652,10 @@ static Image *ReadMATImageV4(const ImageInfo *image_info,Image *image, if(EOFBlob(image)) break; if ((ldblk > 9999) || (ldblk < 0)) break; - HDR.Type[3]=ldblk % 10; ldblk /= 10; /* T digit */ - HDR.Type[2]=ldblk % 10; ldblk /= 10; /* P digit */ - HDR.Type[1]=ldblk % 10; ldblk /= 10; /* O digit */ - HDR.Type[0]=ldblk; /* M digit */ + HDR.Type[3]=(unsigned char) (ldblk % 10); ldblk /= 10; /* T digit */ + HDR.Type[2]=(unsigned char) (ldblk % 10); ldblk /= 10; /* P digit */ + HDR.Type[1]=(unsigned char) (ldblk % 10); ldblk /= 10; /* O digit */ + HDR.Type[0]=(unsigned char) (ldblk); /* M digit */ if (HDR.Type[3] != 0) break; /* Data format */ if (HDR.Type[2] != 0) @@ -703,7 +704,7 @@ static Image *ReadMATImageV4(const ImageInfo *image_info,Image *image, { Swap(image->columns,image->rows); if(HDR.imagf==1) ldblk *= 2; - SeekBlob(image, HDR.nCols*ldblk, SEEK_CUR); + SeekBlob(image, (MagickOffsetType) HDR.nCols*ldblk, SEEK_CUR); if ((image->columns == 0) || (image->rows == 0)) return(image->previous == (Image *) NULL ? DestroyImageList(image) : image); @@ -760,7 +761,7 @@ static Image *ReadMATImageV4(const ImageInfo *image_info,Image *image, count=ReadBlob(image,depth/8*image->columns,(char *) pixels); if (count == -1) break; - q=QueueAuthenticPixels(image,0,image->rows-y-1,image->columns,1, + q=QueueAuthenticPixels(image,0,(ssize_t) image->rows-y-1,image->columns,1, exception); if (q == (Quantum *) NULL) break; @@ -890,7 +891,7 @@ static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) double MinVal, MaxVal; unsigned z, z2; unsigned Frames; - int logging; + MagickBooleanType logging; int sample_size; MagickOffsetType filepos=0x80; @@ -977,7 +978,7 @@ static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) Frames = 1; if(filepos > (MagickOffsetType) GetBlobSize(image) || filepos < 0) break; - if(SeekBlob(image,filepos,SEEK_SET) != filepos) break; + if(SeekBlob(image,(MagickOffsetType) filepos,SEEK_SET) != filepos) break; /* printf("pos=%X\n",TellBlob(image)); */ MATLAB_HDR.DataType = ReadBlobXXXLong(image); @@ -1112,7 +1113,7 @@ static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) case 0: size = ReadBlobXXXLong(image2); /* Object name string size */ size = 4 * (((size_t) size + 3 + 1) / 4); - (void) SeekBlob(image2, size, SEEK_CUR); + (void) SeekBlob(image2, (MagickOffsetType) size, SEEK_CUR); break; case 1: case 2: @@ -1258,14 +1259,14 @@ RestoreMSCWarning quantum_info=DestroyQuantumInfo(quantum_info); ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } - (void) memset(BImgBuff,0,ldblk*sizeof(double)); + (void) memset(BImgBuff,0,(size_t) ldblk*sizeof(double)); MinVal = 0; MaxVal = 0; if (CellType==miDOUBLE || CellType==miSINGLE) /* Find Min and Max Values for floats */ { - CalcMinMax(image2,image_info->endian,MATLAB_HDR.SizeX,MATLAB_HDR.SizeY, - CellType,ldblk,BImgBuff,&quantum_info->minimum, + CalcMinMax(image2,(int) image_info->endian,MATLAB_HDR.SizeX, + MATLAB_HDR.SizeY,CellType,ldblk,BImgBuff,&quantum_info->minimum, &quantum_info->maximum); } @@ -1283,7 +1284,7 @@ RestoreMSCWarning " MAT set image pixels returns unexpected NULL on a row %u.", (unsigned)(MATLAB_HDR.SizeY-i-1)); goto done_reading; /* Skip image rotation, when cannot set image pixels */ } - if(ReadBlob(image2,ldblk,(unsigned char *)BImgBuff) != (ssize_t) ldblk) + if(ReadBlob(image2,(size_t) ldblk,(unsigned char *) BImgBuff) != (ssize_t) ldblk) { if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), " MAT cannot read scanrow %u from a file.", (unsigned)(MATLAB_HDR.SizeY-i-1)); @@ -1338,13 +1339,14 @@ RestoreMSCWarning if (CellType==miDOUBLE || CellType==miSINGLE) { - CalcMinMax(image2, image_info->endian, MATLAB_HDR.SizeX, MATLAB_HDR.SizeY, CellType, ldblk, BImgBuff, &MinVal, &MaxVal); + CalcMinMax(image2, (int) image_info->endian, MATLAB_HDR.SizeX, + MATLAB_HDR.SizeY, CellType, ldblk, BImgBuff, &MinVal, &MaxVal); } if (CellType==miDOUBLE) for (i = 0; i < (ssize_t) MATLAB_HDR.SizeY; i++) { - ReadBlobDoublesXXX(image2, ldblk, (double *)BImgBuff); + ReadBlobDoublesXXX(image2, (size_t) ldblk, (double *)BImgBuff); if (EOFBlob(image) != MagickFalse) break; InsertComplexDoubleRow(image, (double *)BImgBuff, i, MinVal, MaxVal, @@ -1354,7 +1356,7 @@ RestoreMSCWarning if (CellType==miSINGLE) for (i = 0; i < (ssize_t) MATLAB_HDR.SizeY; i++) { - ReadBlobFloatsXXX(image2, ldblk, (float *)BImgBuff); + ReadBlobFloatsXXX(image2, (size_t) ldblk, (float *)BImgBuff); if (EOFBlob(image) != MagickFalse) break; InsertComplexFloatRow(image,(float *)BImgBuff,i,MinVal,MaxVal, @@ -1481,7 +1483,7 @@ RestoreMSCWarning Fix scene numbers */ for (p=image; p != (Image *) NULL; p=p->next) - p->scene=scene++; + p->scene=(size_t) scene++; } if(clone_info != NULL) /* cleanup garbage file from compression */ @@ -1676,8 +1678,8 @@ static MagickBooleanType WriteMATImage(const ImageInfo *image_info,Image *image, padding=((unsigned char)(data_size-1) & 0x7) ^ 0x7; (void) WriteBlobLSBLong(image,miMATRIX); - (void) WriteBlobLSBLong(image,(unsigned int) data_size+padding+ - ((is_gray != MagickFalse) ? 48 : 56)); + (void) WriteBlobLSBLong(image,(unsigned int) ((ssize_t) data_size+padding+ + ((is_gray != MagickFalse) ? 48 : 56))); (void) WriteBlobLSBLong(image,0x6); /* 0x88 */ (void) WriteBlobLSBLong(image,0x8); /* 0x8C */ (void) WriteBlobLSBLong(image,0x6); /* 0x90 */ diff --git a/ImageMagick-7.1.1-15/coders/mat.h b/ImageMagick-7.1.1-16/coders/mat.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/mat.h rename to ImageMagick-7.1.1-16/coders/mat.h diff --git a/ImageMagick-7.1.1-15/coders/matte.c b/ImageMagick-7.1.1-16/coders/matte.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/matte.c rename to ImageMagick-7.1.1-16/coders/matte.c diff --git a/ImageMagick-7.1.1-15/coders/matte.h b/ImageMagick-7.1.1-16/coders/matte.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/matte.h rename to ImageMagick-7.1.1-16/coders/matte.h diff --git a/ImageMagick-7.1.1-15/coders/meta.c b/ImageMagick-7.1.1-16/coders/meta.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/meta.c rename to ImageMagick-7.1.1-16/coders/meta.c index 8ffd23f9..a845363f 100644 --- a/ImageMagick-7.1.1-15/coders/meta.c +++ b/ImageMagick-7.1.1-16/coders/meta.c @@ -316,12 +316,6 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile) state, next; - unsigned char - dataset; - - unsigned int - recnum; - MagickOffsetType savedpos, currentpos; @@ -336,6 +330,12 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile) TokenInfo *token_info; + unsigned char + dataset; + + unsigned int + recnum; + dataset = 0; recnum = 0; line = (char *) AcquireQuantumMemory(inputlen,sizeof(*line)); @@ -418,7 +418,7 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile) if ((ssize_t) codes_length > len) len=0; else - len-=codes_length; + len-=(ssize_t) codes_length; } } @@ -728,7 +728,7 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile) if ((ssize_t) codes_length > len) len=0; else - len-=codes_length; + len-=(ssize_t) codes_length; } } @@ -1618,22 +1618,20 @@ static size_t GetIPTCStream(unsigned char **info,size_t length) int c; - ssize_t - i; + size_t + extent, + info_length, + tag_length; unsigned char *p; - size_t - extent, - info_length; + ssize_t + i; unsigned int marker; - size_t - tag_length; - p=(*info); extent=length; if ((*p == 0x1c) && (*(p+1) == 0x02)) @@ -1656,7 +1654,7 @@ static size_t GetIPTCStream(unsigned char **info,size_t length) if ((size_t) c >= extent) break; p+=c; - extent-=c; + extent=(size_t) ((ssize_t) extent-c); if (extent < 4) break; tag_length=(((size_t) *p) << 24) | (((size_t) *(p+1)) << 16) | @@ -1759,13 +1757,13 @@ static size_t GetIPTCStream(unsigned char **info,size_t length) /* Short format. */ - tag_length=((long) c) << 8; + tag_length=(size_t) (c << 8); c=(*p++); length--; if (length == 0) break; info_length++; - tag_length|=(long) c; + tag_length|=(unsigned int) c; } if (tag_length > (length+1)) break; diff --git a/ImageMagick-7.1.1-15/coders/meta.h b/ImageMagick-7.1.1-16/coders/meta.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/meta.h rename to ImageMagick-7.1.1-16/coders/meta.h diff --git a/ImageMagick-7.1.1-15/coders/miff.c b/ImageMagick-7.1.1-16/coders/miff.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/miff.c rename to ImageMagick-7.1.1-16/coders/miff.c index 3d1df0dc..13611269 100644 --- a/ImageMagick-7.1.1-15/coders/miff.c +++ b/ImageMagick-7.1.1-16/coders/miff.c @@ -712,7 +712,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, if (LocaleCompare(keyword,"channel-mask") == 0) { image->channel_mask=(ChannelType) - StringToUnsignedLong(options); + strtol(options,(char **) NULL,16); break; } if (LocaleCompare(keyword,"class") == 0) @@ -1431,7 +1431,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, allocator.opaque=(void *) image; lzma_info=initialize_lzma; lzma_info.allocator=(&allocator); - code=lzma_auto_decoder(&lzma_info,(uint64_t) -1,0); + code=(int) lzma_auto_decoder(&lzma_info,(uint64_t) -1,0); if (code != LZMA_OK) status=MagickFalse; break; @@ -1542,7 +1542,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, "UnableToReadImageData"); } } - code=lzma_code(&lzma_info,LZMA_RUN); + code=(int) lzma_code(&lzma_info,LZMA_RUN); if ((code != LZMA_OK) && (code != LZMA_STREAM_END)) { status=MagickFalse; @@ -1679,7 +1679,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, int code; - code=lzma_code(&lzma_info,LZMA_FINISH); + code=(int) lzma_code(&lzma_info,LZMA_FINISH); if ((code != LZMA_STREAM_END) && (code != LZMA_OK)) status=MagickFalse; lzma_end(&lzma_info); @@ -2191,10 +2191,10 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, CommandOptionToMnemonic(MagickPixelTraitOptions,(ssize_t) image->alpha_trait)); (void) WriteBlobString(image,buffer); - (void) FormatLocaleString(buffer,MagickPathExtent, - "number-channels=%.20g number-meta-channels=%.20g channel-mask=%.20g\n", + (void) FormatLocaleString(buffer,MagickPathExtent, "number-channels=%.20g " + "number-meta-channels=%.20g channel-mask=0x%016llx\n", (double) image->number_channels,(double) image->number_meta_channels, - (double) image->channel_mask); + (MagickOffsetType) image->channel_mask); (void) WriteBlobString(image,buffer); if (image->alpha_trait != UndefinedPixelTrait) (void) WriteBlobString(image,"matte=True\n"); @@ -2571,7 +2571,7 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, allocator.opaque=(void *) NULL; lzma_info=initialize_lzma; lzma_info.allocator=&allocator; - code=lzma_easy_encoder(&lzma_info,(uint32_t) (image->quality/10), + code=(int) lzma_easy_encoder(&lzma_info,(uint32_t) (image->quality/10), LZMA_CHECK_SHA256); if (code != LZMA_OK) status=MagickTrue; @@ -2661,7 +2661,7 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, lzma_info.next_out=compress_pixels; lzma_info.avail_out=LZMAMaxExtent(packet_size*image->columns); - code=lzma_code(&lzma_info,LZMA_RUN); + code=(int) lzma_code(&lzma_info,LZMA_RUN); if (code != LZMA_OK) status=MagickFalse; length=(size_t) (lzma_info.next_out-compress_pixels); @@ -2793,7 +2793,7 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, break; lzma_info.next_out=compress_pixels; lzma_info.avail_out=packet_size*image->columns; - code=lzma_code(&lzma_info,LZMA_FINISH); + code=(int) lzma_code(&lzma_info,LZMA_FINISH); length=(size_t) (lzma_info.next_out-compress_pixels); if (length > 6) { diff --git a/ImageMagick-7.1.1-15/coders/miff.h b/ImageMagick-7.1.1-16/coders/miff.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/miff.h rename to ImageMagick-7.1.1-16/coders/miff.h diff --git a/ImageMagick-7.1.1-15/coders/mono.c b/ImageMagick-7.1.1-16/coders/mono.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/mono.c rename to ImageMagick-7.1.1-16/coders/mono.c index 8e5c28ef..5f12a28b 100644 --- a/ImageMagick-7.1.1-15/coders/mono.c +++ b/ImageMagick-7.1.1-16/coders/mono.c @@ -137,7 +137,7 @@ static Image *ReadMONOImage(const ImageInfo *image_info, image=DestroyImageList(image); return((Image *) NULL); } - if (DiscardBlobBytes(image,image->offset) == MagickFalse) + if (DiscardBlobBytes(image,(MagickSizeType) image->offset) == MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); /* @@ -333,11 +333,11 @@ static MagickBooleanType WriteMONOImage(const ImageInfo *image_info, byte>>=1; if (image->endian == LSBEndian) { - if (GetPixelLuma(image,p) < (QuantumRange/2.0)) + if (GetPixelLuma(image,p) < ((double) QuantumRange/2.0)) byte|=0x80; } else - if (GetPixelLuma(image,p) >= (QuantumRange/2.0)) + if (GetPixelLuma(image,p) >= ((double) QuantumRange/2.0)) byte|=0x80; bit++; if (bit == 8) diff --git a/ImageMagick-7.1.1-15/coders/mono.h b/ImageMagick-7.1.1-16/coders/mono.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/mono.h rename to ImageMagick-7.1.1-16/coders/mono.h diff --git a/ImageMagick-7.1.1-15/coders/mpc.c b/ImageMagick-7.1.1-16/coders/mpc.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/mpc.c rename to ImageMagick-7.1.1-16/coders/mpc.c index e993132a..df7f2c53 100644 --- a/ImageMagick-7.1.1-15/coders/mpc.c +++ b/ImageMagick-7.1.1-16/coders/mpc.c @@ -17,7 +17,7 @@ % March 2000 % % % % % -% Copyright @ 2000 ImageMagick Studio LLC, a non-profit organization % +% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % @@ -398,7 +398,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) if (LocaleCompare(keyword,"channel-mask") == 0) { image->channel_mask=(ChannelType) - StringToUnsignedLong(options); + strtol(options,(char **) NULL,16); break; } if (LocaleCompare(keyword,"class") == 0) @@ -1204,10 +1204,10 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image, CommandOptionToMnemonic(MagickPixelTraitOptions,(ssize_t) image->alpha_trait)); (void) WriteBlobString(image,buffer); - (void) FormatLocaleString(buffer,MagickPathExtent, - "number-channels=%.20g number-meta-channels=%.20g channel-mask=%.20g\n", + (void) FormatLocaleString(buffer,MagickPathExtent,"number-channels=%.20g " + "number-meta-channels=%.20g channel-mask=0x%016llx\n", (double) image->number_channels,(double) image->number_meta_channels, - (double) image->channel_mask); + (MagickOffsetType) image->channel_mask); (void) WriteBlobString(image,buffer); (void) FormatLocaleString(buffer,MagickPathExtent, "columns=%.20g rows=%.20g depth=%.20g\n",(double) image->columns, diff --git a/ImageMagick-7.1.1-15/coders/mpc.h b/ImageMagick-7.1.1-16/coders/mpc.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/mpc.h rename to ImageMagick-7.1.1-16/coders/mpc.h diff --git a/ImageMagick-7.1.1-15/coders/mpr.c b/ImageMagick-7.1.1-16/coders/mpr.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/mpr.c rename to ImageMagick-7.1.1-16/coders/mpr.c diff --git a/ImageMagick-7.1.1-15/coders/mpr.h b/ImageMagick-7.1.1-16/coders/mpr.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/mpr.h rename to ImageMagick-7.1.1-16/coders/mpr.h diff --git a/ImageMagick-7.1.1-15/coders/msl.c b/ImageMagick-7.1.1-16/coders/msl.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/msl.c rename to ImageMagick-7.1.1-16/coders/msl.c index cd6a9d89..2e286e12 100644 --- a/ImageMagick-7.1.1-15/coders/msl.c +++ b/ImageMagick-7.1.1-16/coders/msl.c @@ -569,13 +569,13 @@ static void MSLPushImage(MSLInfo *msl_info,Image *image) msl_info->n++; n=msl_info->n; msl_info->image_info=(ImageInfo **) ResizeQuantumMemory(msl_info->image_info, - (n+1),sizeof(*msl_info->image_info)); + (size_t) (n+1),sizeof(*msl_info->image_info)); msl_info->draw_info=(DrawInfo **) ResizeQuantumMemory(msl_info->draw_info, - (n+1),sizeof(*msl_info->draw_info)); + (size_t) (n+1),sizeof(*msl_info->draw_info)); msl_info->attributes=(Image **) ResizeQuantumMemory(msl_info->attributes, - (n+1),sizeof(*msl_info->attributes)); - msl_info->image=(Image **) ResizeQuantumMemory(msl_info->image,(n+1), - sizeof(*msl_info->image)); + (size_t) (n+1),sizeof(*msl_info->attributes)); + msl_info->image=(Image **) ResizeQuantumMemory(msl_info->image, + (size_t) (n+1),sizeof(*msl_info->image)); if ((msl_info->image_info == (ImageInfo **) NULL) || (msl_info->draw_info == (DrawInfo **) NULL) || (msl_info->attributes == (Image **) NULL) || @@ -645,16 +645,9 @@ static void MSLStartElement(void *context,const xmlChar *tag, Image *image; - int + MagickStatusType flags; - ssize_t - option, - j, - n, - x, - y; - MSLInfo *msl_info; @@ -662,7 +655,13 @@ static void MSLStartElement(void *context,const xmlChar *tag, geometry; ssize_t - i; + i, + j, + n, + option, + x, + y; + size_t height, @@ -988,7 +987,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, } if (LocaleCompare(keyword,"strokewidth") == 0) { - draw_info->stroke_width=StringToLong(value); + draw_info->stroke_width=(size_t) StringToLong(value); break; } if (LocaleCompare(keyword,"style") == 0) @@ -1044,7 +1043,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"weight") == 0) { - draw_info->weight=StringToLong(value); + draw_info->weight=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -1359,7 +1358,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"height") == 0) { - geometry.height=StringToLong(value); + geometry.height=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -1371,7 +1370,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"width") == 0) { - geometry.width=StringToLong(value); + geometry.width=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -1591,7 +1590,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"height") == 0) { - geometry.height=StringToLong(value); + geometry.height=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -1603,7 +1602,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"width") == 0) { - geometry.width=StringToLong(value); + geometry.width=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -1995,7 +1994,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, for (r=0; r < (ssize_t) composite_image->rows ; r++) { q=GetCacheViewAuthenticPixels(composite_view,0,r, - (ssize_t) composite_image->columns,1,exception); + composite_image->columns,1,exception); for (k=0; k < (ssize_t) composite_image->columns; k++) { if (GetPixelAlpha(composite_image,q) == OpaqueAlpha) @@ -2225,7 +2224,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"height") == 0) { - geometry.height=StringToLong(value); + geometry.height=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -2237,7 +2236,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"width") == 0) { - geometry.width=StringToLong(value); + geometry.width=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -2386,15 +2385,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, msl_info->attributes[n],(const char *) attributes[i],exception); CloneString(&value,attribute); attribute=DestroyString(attribute); - switch (*keyword) - { - default: - { - ThrowMSLException(OptionError,"UnrecognizedAttribute", - keyword); - break; - } - } + ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); } (void) DisplayImages(msl_info->image_info[n],msl_info->image[n], msl_info->exception); @@ -2644,7 +2635,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, } if (LocaleCompare(keyword,"strokewidth") == 0) { - draw_info->stroke_width=StringToLong(value); + draw_info->stroke_width=(size_t) StringToLong(value); break; } if (LocaleCompare(keyword,"style") == 0) @@ -2702,7 +2693,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"weight") == 0) { - draw_info->weight=StringToLong(value); + draw_info->weight=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -2959,15 +2950,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, msl_info->attributes[n],(const char *) attributes[i],exception); CloneString(&value,attribute); attribute=DestroyString(attribute); - switch (*keyword) - { - default: - { - ThrowMSLException(OptionError,"UnrecognizedAttribute", - keyword); - break; - } - } + ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); } (void) EqualizeImage(msl_info->image[n], msl_info->exception); @@ -3151,7 +3134,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"height") == 0) { - frame_info.height=StringToLong(value); + frame_info.height=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3187,7 +3170,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"width") == 0) { - frame_info.width=StringToLong(value); + frame_info.width=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -3204,8 +3187,10 @@ static void MSLStartElement(void *context,const xmlChar *tag, } frame_info.x=(ssize_t) frame_info.width; frame_info.y=(ssize_t) frame_info.height; - frame_info.width=msl_info->image[n]->columns+2*frame_info.x; - frame_info.height=msl_info->image[n]->rows+2*frame_info.y; + frame_info.width=(size_t) ((ssize_t) msl_info->image[n]->columns+2* + frame_info.x); + frame_info.height=(size_t) ((ssize_t) msl_info->image[n]->rows+2* + frame_info.y); frame_image=FrameImage(msl_info->image[n],&frame_info, msl_info->image[n]->compose,msl_info->exception); if (frame_image == (Image *) NULL) @@ -3382,7 +3367,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { msl_info->number_groups++; msl_info->group_info=(MSLGroupInfo *) ResizeQuantumMemory( - msl_info->group_info,msl_info->number_groups+1UL, + msl_info->group_info,(size_t) (msl_info->number_groups+1), sizeof(*msl_info->group_info)); break; } @@ -4538,7 +4523,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"colors") == 0) { - quantize_info.number_colors=StringToLong(value); + quantize_info.number_colors=(size_t) StringToLong(value); break; } if (LocaleCompare(keyword,"colorspace") == 0) @@ -4594,7 +4579,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"treedepth") == 0) { - quantize_info.tree_depth=StringToLong(value); + quantize_info.tree_depth=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -4836,7 +4821,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, } if (LocaleCompare(keyword,"strokewidth") == 0) { - draw_info->stroke_width=StringToLong(value); + draw_info->stroke_width=(size_t) StringToLong(value); break; } if (LocaleCompare(keyword,"style") == 0) @@ -4892,7 +4877,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"weight") == 0) { - draw_info->weight=StringToLong(value); + draw_info->weight=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -5033,7 +5018,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"height") == 0) { - geometry.height=StringToLong(value); + geometry.height=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -5062,7 +5047,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"width") == 0) { - geometry.width=StringToLong(value); + geometry.width=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -5247,13 +5232,15 @@ static void MSLStartElement(void *context,const xmlChar *tag, { x=region.x; if ((width == 0) && (region.x > 0)) - width=msl_info->image[n]->columns+region.x; + width=(size_t) ((ssize_t) msl_info->image[n]->columns+ + region.x); } if ((flags & YValue) != 0) { y=region.y; if ((height == 0) && (region.y > 0)) - height=msl_info->image[n]->rows+region.y; + height=(size_t) ((ssize_t) msl_info->image[n]->rows+ + region.y); } } break; @@ -5266,8 +5253,8 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"height") == 0) { - height = StringToLong( value ); - break; + height=(size_t) StringToLong(value); + break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); break; @@ -5277,7 +5264,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"width") == 0) { - width = StringToLong( value ); + width=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -5479,7 +5466,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"height") == 0) { - geometry.height=StringToUnsignedLong(value); + geometry.height=(size_t) StringToUnsignedLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -5491,7 +5478,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"width") == 0) { - geometry.width=StringToLong(value); + geometry.width=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -5847,7 +5834,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"height") == 0) { - geometry.height=StringToUnsignedLong(value); + geometry.height=(size_t) StringToUnsignedLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -5859,7 +5846,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"width") == 0) { - geometry.width=StringToLong(value); + geometry.width=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -5924,7 +5911,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"height") == 0) { - geometry.height=StringToUnsignedLong(value); + geometry.height=(size_t) StringToUnsignedLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -5936,7 +5923,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"width") == 0) { - geometry.width=StringToLong(value); + geometry.width=(size_t) StringToLong(value); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -6157,7 +6144,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, if (value[len-1] == '%') { char tmp[100]; - (void) CopyMagickString(tmp,value,len); + (void) CopyMagickString(tmp,value,(size_t) len); opac = StringToLong( tmp ); opac = (int)(QuantumRange * ((float)opac/100)); } else @@ -6525,7 +6512,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"height") == 0) { - height = StringToLong( value ); + height = (size_t) StringToLong( value ); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -6536,7 +6523,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, { if (LocaleCompare(keyword,"width") == 0) { - width = StringToLong( value ); + width = (size_t) StringToLong( value ); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); @@ -6686,15 +6673,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, msl_info->attributes[n],(const char *) attributes[i],exception); CloneString(&value,attribute); attribute=DestroyString(attribute); - switch (*keyword) - { - default: - { - ThrowMSLException(OptionError,"UnrecognizedAttribute", - keyword); - break; - } - } + ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); } (void) SignatureImage(msl_info->image[n],exception); break; @@ -6710,7 +6689,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, (const char *) tag); break; } - geometry_info.rho=QuantumRange/2.0; + geometry_info.rho=(double) QuantumRange/2.0; if (attributes != (const xmlChar **) NULL) for (i=0; (attributes[i] != (const xmlChar *) NULL); i++) { @@ -7140,15 +7119,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, msl_info->attributes[n],(const char *) attributes[i],exception); CloneString(&value,attribute); attribute=DestroyString(attribute); - switch (*keyword) - { - default: - { - ThrowMSLException(OptionError,"UnrecognizedAttribute", - keyword); - break; - } - } + ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); } (void) SyncImage(msl_info->image[n],exception); break; @@ -7526,14 +7497,14 @@ static void MSLCharacters(void *context,const xmlChar *c,int length) msl_info=(MSLInfo *) context; if (msl_info->content != (char *) NULL) msl_info->content=(char *) ResizeQuantumMemory(msl_info->content, - strlen(msl_info->content)+length+MagickPathExtent, + strlen(msl_info->content)+(size_t) length+MagickPathExtent, sizeof(*msl_info->content)); else { msl_info->content=(char *) NULL; if (~(size_t) length >= (MagickPathExtent-1)) - msl_info->content=(char *) AcquireQuantumMemory(length+MagickPathExtent, - sizeof(*msl_info->content)); + msl_info->content=(char *) AcquireQuantumMemory((size_t) (length+ + MagickPathExtent),sizeof(*msl_info->content)); if (msl_info->content != (char *) NULL) *msl_info->content='\0'; } @@ -7541,7 +7512,7 @@ static void MSLCharacters(void *context,const xmlChar *c,int length) return; p=msl_info->content+strlen(msl_info->content); for (i=0; i < length; i++) - *p++=c[i]; + *p++=(char) c[i]; *p='\0'; } @@ -7792,7 +7763,7 @@ static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info, Image *msl_image; - int + MagickStatusType status; MSLInfo @@ -7903,10 +7874,11 @@ static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info, n=(ssize_t) strlen(message); if (n == 0) continue; - status=xmlParseChunk(msl_info.parser,message,(int) n,MagickFalse); + status=(MagickStatusType) xmlParseChunk(msl_info.parser,message,(int) n, + MagickFalse); if (status != 0) break; - status=xmlParseChunk(msl_info.parser," ",1,MagickFalse); + status=(MagickStatusType) xmlParseChunk(msl_info.parser," ",1,MagickFalse); if (status != 0) break; if (msl_info.exception->severity >= ErrorException) @@ -8039,9 +8011,6 @@ ModuleExport size_t RegisterMSLImage(void) static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword, const char *value) { - Image - *attributes; - DrawInfo *draw_info; @@ -8052,12 +8021,13 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword, geometry_info; Image + *attributes, *image; ImageInfo *image_info; - int + MagickStatusType flags; ssize_t @@ -8262,10 +8232,10 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword, { if (LocaleCompare(keyword,"quality") == 0) { - image_info->quality=StringToLong(value); + image_info->quality=(size_t) StringToLong(value); if (image == (Image *) NULL) break; - image->quality=StringToLong(value); + image->quality=(size_t) StringToLong(value); break; } break; diff --git a/ImageMagick-7.1.1-15/coders/msl.h b/ImageMagick-7.1.1-16/coders/msl.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/msl.h rename to ImageMagick-7.1.1-16/coders/msl.h diff --git a/ImageMagick-7.1.1-15/coders/mtv.c b/ImageMagick-7.1.1-16/coders/mtv.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/mtv.c rename to ImageMagick-7.1.1-16/coders/mtv.c diff --git a/ImageMagick-7.1.1-15/coders/mtv.h b/ImageMagick-7.1.1-16/coders/mtv.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/mtv.h rename to ImageMagick-7.1.1-16/coders/mtv.h diff --git a/ImageMagick-7.1.1-15/coders/mvg.c b/ImageMagick-7.1.1-16/coders/mvg.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/mvg.c rename to ImageMagick-7.1.1-16/coders/mvg.c diff --git a/ImageMagick-7.1.1-15/coders/mvg.h b/ImageMagick-7.1.1-16/coders/mvg.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/mvg.h rename to ImageMagick-7.1.1-16/coders/mvg.h diff --git a/ImageMagick-7.1.1-15/coders/null.c b/ImageMagick-7.1.1-16/coders/null.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/null.c rename to ImageMagick-7.1.1-16/coders/null.c diff --git a/ImageMagick-7.1.1-15/coders/null.h b/ImageMagick-7.1.1-16/coders/null.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/null.h rename to ImageMagick-7.1.1-16/coders/null.h diff --git a/ImageMagick-7.1.1-15/coders/ora.c b/ImageMagick-7.1.1-16/coders/ora.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/ora.c rename to ImageMagick-7.1.1-16/coders/ora.c diff --git a/ImageMagick-7.1.1-15/coders/ora.h b/ImageMagick-7.1.1-16/coders/ora.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/ora.h rename to ImageMagick-7.1.1-16/coders/ora.h diff --git a/ImageMagick-7.1.1-15/coders/otb.c b/ImageMagick-7.1.1-16/coders/otb.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/otb.c rename to ImageMagick-7.1.1-16/coders/otb.c index 4af112d9..53d5fe57 100644 --- a/ImageMagick-7.1.1-15/coders/otb.c +++ b/ImageMagick-7.1.1-16/coders/otb.c @@ -365,7 +365,7 @@ static MagickBooleanType WriteOTBImage(const ImageInfo *image_info,Image *image, byte=0; for (x=0; x < (ssize_t) image->columns; x++) { - if (GetPixelLuma(image,p) < (QuantumRange/2.0)) + if (GetPixelLuma(image,p) < ((double) QuantumRange/2.0)) byte|=0x1 << (7-bit); bit++; if (bit == 8) diff --git a/ImageMagick-7.1.1-15/coders/otb.h b/ImageMagick-7.1.1-16/coders/otb.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/otb.h rename to ImageMagick-7.1.1-16/coders/otb.h diff --git a/ImageMagick-7.1.1-15/coders/palm.c b/ImageMagick-7.1.1-16/coders/palm.c similarity index 97% rename from ImageMagick-7.1.1-15/coders/palm.c rename to ImageMagick-7.1.1-16/coders/palm.c index 4a159cb8..fa6e3d98 100644 --- a/ImageMagick-7.1.1-15/coders/palm.c +++ b/ImageMagick-7.1.1-16/coders/palm.c @@ -233,11 +233,14 @@ static Image *ReadPALMImage(const ImageInfo *image_info, ExceptionInfo *exception) { const size_t - one=1; + one = 1; Image *image; + int + bit; + MagickBooleanType status; @@ -249,13 +252,7 @@ static Image *ReadPALMImage(const ImageInfo *image_info, transpix; Quantum - index; - - ssize_t - i, - x; - - Quantum + index, *q; size_t @@ -273,11 +270,12 @@ static Image *ReadPALMImage(const ImageInfo *image_info, greenbits, bluebits, pad, - size, - bit; + size; ssize_t count, + i, + x, y; unsigned char @@ -425,7 +423,7 @@ static Image *ReadPALMImage(const ImageInfo *image_info, (void) memset(last_row,0,MagickMax(bytes_per_row,2*image->columns)* sizeof(*last_row)); } - mask=(size_t) (1U << bits_per_pixel)-1; + mask=((size_t) 1U << bits_per_pixel)-1; for (y=0; y < (ssize_t) image->rows; y++) { if ((flags & PALM_IS_COMPRESSED_FLAG) == 0) @@ -464,10 +462,11 @@ static Image *ReadPALMImage(const ImageInfo *image_info, if (count < 0) break; byte=(size_t) MagickMin((ssize_t) bytes_per_row-i,8); - for (bit=0; bit < byte; bit++) + for (bit=0; bit < (int) byte; bit++) { - if ((y == 0) || (count & (one << (7 - bit)))) - one_row[i+bit]=(unsigned char) ReadBlobByte(image); + if ((y == 0) || ((size_t) count & (one << (7-bit)))) + one_row[i+bit]=(unsigned char) + ReadBlobByte(image); else one_row[i+bit]=last_row[i+bit]; } @@ -504,7 +503,7 @@ static Image *ReadPALMImage(const ImageInfo *image_info, } else { - bit=8-bits_per_pixel; + bit=(int) (8-bits_per_pixel); for (x=0; x < (ssize_t) image->columns; x++) { if ((size_t) (ptr-one_row) >= bytes_per_row) @@ -518,11 +517,11 @@ static Image *ReadPALMImage(const ImageInfo *image_info, SetPixelIndex(image,index,q); SetPixelViaPixelInfo(image,image->colormap+(ssize_t) index,q); if (bit) - bit-=bits_per_pixel; + bit-=(int) bits_per_pixel; else { ptr++; - bit=8-bits_per_pixel; + bit=(int) (8-bits_per_pixel); } q+=GetPixelChannels(image); } @@ -687,12 +686,12 @@ ModuleExport void UnregisterPALMImage(void) static MagickBooleanType WritePALMImage(const ImageInfo *image_info, Image *image,ExceptionInfo *exception) { - int - bit; - const Quantum *p; + int + bit; + MagickBooleanType status; @@ -844,7 +843,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info, (void) WriteBlobByte(image,ScaleQuantumToChar(ClampToQuantum( image->colormap[count].blue))); } - offset+=2+count*4; + offset+=2+(MagickOffsetType) count*4; } else /* Map colors to Palm standard colormap */ { @@ -979,7 +978,8 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info, } } (void) WriteBlobByte(image, byte); - (void) WriteBlob(image,tptr-tmpbuf,(unsigned char *) tmpbuf); + (void) WriteBlob(image,(size_t) (tptr-tmpbuf),(unsigned char *) + tmpbuf); } (void) memcpy(last_row,one_row,bytes_per_row); } @@ -998,17 +998,17 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info, offset=SeekBlob(image,currentOffset+20,SEEK_SET); (void) WriteBlobByte(image,0); /* reserved by Palm */ (void) WriteBlobByte(image,(unsigned char) ((31*transpix.red)/ - QuantumRange)); + (double) QuantumRange)); (void) WriteBlobByte(image,(unsigned char) ((63*transpix.green)/ - QuantumRange)); + (double) QuantumRange)); (void) WriteBlobByte(image,(unsigned char) ((31*transpix.blue)/ - QuantumRange)); + (double) QuantumRange)); } if (flags & PALM_IS_COMPRESSED_FLAG) /* fill in size now */ { offset=SeekBlob(image,currentOffset+offset,SEEK_SET); - (void) WriteBlobMSBShort(image,(unsigned short) (GetBlobSize(image)- - currentOffset-offset)); + (void) WriteBlobMSBShort(image,(unsigned short) ((MagickOffsetType) + GetBlobSize(image)-currentOffset-offset)); } if (one_row != (unsigned char *) NULL) one_row=(unsigned char *) RelinquishMagickMemory(one_row); @@ -1021,7 +1021,8 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info, (void) WriteBlobByte(image,0); /* write nextDepthOffset and return to end of image */ offset=SeekBlob(image,currentOffset+10,SEEK_SET); - nextDepthOffset=(size_t) ((GetBlobSize(image)-currentOffset)/4); + nextDepthOffset=(size_t) (((MagickOffsetType) GetBlobSize(image)- + currentOffset)/4); (void) WriteBlobMSBShort(image,(unsigned short) nextDepthOffset); currentOffset=(MagickOffsetType) GetBlobSize(image); offset=SeekBlob(image,currentOffset,SEEK_SET); diff --git a/ImageMagick-7.1.1-15/coders/palm.h b/ImageMagick-7.1.1-16/coders/palm.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/palm.h rename to ImageMagick-7.1.1-16/coders/palm.h diff --git a/ImageMagick-7.1.1-15/coders/pango.c b/ImageMagick-7.1.1-16/coders/pango.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/pango.c rename to ImageMagick-7.1.1-16/coders/pango.c index 2695a029..fe3a45eb 100644 --- a/ImageMagick-7.1.1-15/coders/pango.c +++ b/ImageMagick-7.1.1-16/coders/pango.c @@ -384,22 +384,24 @@ static Image *ReadPANGOImage(const ImageInfo *image_info, if (image->columns == 0) { pango_layout_get_extents(layout,NULL,&extent); - image->columns=(extent.x+extent.width+PANGO_SCALE/2)/PANGO_SCALE+2*page.x; + image->columns=(size_t) ((extent.x+extent.width+PANGO_SCALE/2)/ + PANGO_SCALE+2*page.x); } else { - image->columns-=2*page.x; + image->columns=(size_t) ((ssize_t) image->columns-2*page.x); pango_layout_set_width(layout,ScalePangoValue((double) image->columns, image->resolution.x)); } if (image->rows == 0) { pango_layout_get_extents(layout,NULL,&extent); - image->rows=(extent.y+extent.height+PANGO_SCALE/2)/PANGO_SCALE+2*page.y; + image->rows=(size_t) ((extent.y+extent.height+PANGO_SCALE/2)/ + PANGO_SCALE+2*page.y); } else { - image->rows-=2*page.y; + image->rows=(size_t) ((ssize_t) image->rows-2*page.y); pango_layout_set_height(layout,ScalePangoValue((double) image->rows, image->resolution.y)); } diff --git a/ImageMagick-7.1.1-15/coders/pango.h b/ImageMagick-7.1.1-16/coders/pango.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pango.h rename to ImageMagick-7.1.1-16/coders/pango.h diff --git a/ImageMagick-7.1.1-15/coders/pattern.c b/ImageMagick-7.1.1-16/coders/pattern.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/pattern.c rename to ImageMagick-7.1.1-16/coders/pattern.c diff --git a/ImageMagick-7.1.1-15/coders/pattern.h b/ImageMagick-7.1.1-16/coders/pattern.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pattern.h rename to ImageMagick-7.1.1-16/coders/pattern.h diff --git a/ImageMagick-7.1.1-15/coders/pcd.c b/ImageMagick-7.1.1-16/coders/pcd.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/pcd.c rename to ImageMagick-7.1.1-16/coders/pcd.c index b6cbd44a..e52f65b2 100644 --- a/ImageMagick-7.1.1-15/coders/pcd.c +++ b/ImageMagick-7.1.1-16/coders/pcd.c @@ -438,8 +438,8 @@ static void Upsample(const size_t width,const size_t height, assert(pixels != (unsigned char *) NULL); for (y=0; y < (ssize_t) height; y++) { - p=pixels+(height-1-y)*scaled_width+(width-1); - q=pixels+((height-1-y) << 1)*scaled_width+((width-1) << 1); + p=pixels+(height-1-(size_t) y)*scaled_width+(width-1); + q=pixels+((height-1-(size_t) y) << 1)*scaled_width+((width-1) << 1); *q=(*p); *(q+1)=(*(p)); for (x=1; x < (ssize_t) width; x++) diff --git a/ImageMagick-7.1.1-15/coders/pcd.h b/ImageMagick-7.1.1-16/coders/pcd.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pcd.h rename to ImageMagick-7.1.1-16/coders/pcd.h diff --git a/ImageMagick-7.1.1-15/coders/pcl.c b/ImageMagick-7.1.1-16/coders/pcl.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/pcl.c rename to ImageMagick-7.1.1-16/coders/pcl.c index 0dae2772..0189ab91 100644 --- a/ImageMagick-7.1.1-15/coders/pcl.c +++ b/ImageMagick-7.1.1-16/coders/pcl.c @@ -886,7 +886,7 @@ static MagickBooleanType WritePCLImage(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) < ((double) QuantumRange/2.0)) byte|=0x01; bit++; if (bit == 8) diff --git a/ImageMagick-7.1.1-15/coders/pcl.h b/ImageMagick-7.1.1-16/coders/pcl.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pcl.h rename to ImageMagick-7.1.1-16/coders/pcl.h diff --git a/ImageMagick-7.1.1-15/coders/pcx.c b/ImageMagick-7.1.1-16/coders/pcx.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/pcx.c rename to ImageMagick-7.1.1-16/coders/pcx.c index 08b296c4..b8ce7b06 100644 --- a/ImageMagick-7.1.1-15/coders/pcx.c +++ b/ImageMagick-7.1.1-16/coders/pcx.c @@ -1138,7 +1138,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) < ((double) QuantumRange/2.0)) byte|=0x01; bit++; if (bit == 8) diff --git a/ImageMagick-7.1.1-15/coders/pcx.h b/ImageMagick-7.1.1-16/coders/pcx.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pcx.h rename to ImageMagick-7.1.1-16/coders/pcx.h diff --git a/ImageMagick-7.1.1-15/coders/pdb.c b/ImageMagick-7.1.1-16/coders/pdb.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/pdb.c rename to ImageMagick-7.1.1-16/coders/pdb.c index b073a6c6..887a8704 100644 --- a/ImageMagick-7.1.1-15/coders/pdb.c +++ b/ImageMagick-7.1.1-16/coders/pdb.c @@ -88,10 +88,12 @@ typedef struct _PDBInfo attributes, version; - size_t + ssize_t create_time, modify_time, - archive_time, + archive_time; + + size_t modify_number, application_info, sort_info; @@ -913,8 +915,8 @@ static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image, for (x=0; x < (ssize_t) pdb_image.width; x++) { if (x < (ssize_t) image->columns) - buffer[literal+repeat]|=(0xff-scanline[x*packet_size]) >> - (8-bits_per_pixel) << bits*bits_per_pixel; + buffer[literal+repeat]|=(0xff-scanline[x*(ssize_t) packet_size]) >> + (8-bits_per_pixel) << bits*(ssize_t) bits_per_pixel; bits--; if (bits < 0) { diff --git a/ImageMagick-7.1.1-15/coders/pdb.h b/ImageMagick-7.1.1-16/coders/pdb.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pdb.h rename to ImageMagick-7.1.1-16/coders/pdb.h diff --git a/ImageMagick-7.1.1-15/coders/pdf.c b/ImageMagick-7.1.1-16/coders/pdf.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/pdf.c rename to ImageMagick-7.1.1-16/coders/pdf.c index 5ba15aee..de39cf3f 100644 --- a/ImageMagick-7.1.1-15/coders/pdf.c +++ b/ImageMagick-7.1.1-16/coders/pdf.c @@ -1875,7 +1875,8 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image, if (image->gravity != UndefinedGravity) { geometry.x=(-page_info.x); - geometry.y=(ssize_t) (media_info.height+page_info.y-image->rows); + geometry.y=(ssize_t) media_info.height+page_info.y-(ssize_t) + image->rows; } pointsize=12.0; if (image_info->pointsize != 0.0) @@ -1957,8 +1958,8 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image, (double) image->scene,pointsize); (void) WriteBlobString(image,buffer); (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g %.20g Td\n", - (double) geometry.x,(double) (geometry.y+geometry.height+i*pointsize+ - 12)); + (double) geometry.x,(double) (geometry.y+(ssize_t) geometry.height+ + i*pointsize+12)); (void) WriteBlobString(image,buffer); (void) FormatLocaleString(buffer,MagickPathExtent,"(%s) Tj\n", labels[i]); diff --git a/ImageMagick-7.1.1-15/coders/pdf.h b/ImageMagick-7.1.1-16/coders/pdf.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pdf.h rename to ImageMagick-7.1.1-16/coders/pdf.h diff --git a/ImageMagick-7.1.1-15/coders/pes.c b/ImageMagick-7.1.1-16/coders/pes.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/pes.c rename to ImageMagick-7.1.1-16/coders/pes.c index ac4bc2d8..5f75a71d 100644 --- a/ImageMagick-7.1.1-15/coders/pes.c +++ b/ImageMagick-7.1.1-16/coders/pes.c @@ -493,7 +493,7 @@ static Image *ReadPESImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); count=ReadBlob(image,4,version); offset=ReadBlobLSBSignedLong(image); - if (DiscardBlobBytes(image,offset+36) == MagickFalse) + if (DiscardBlobBytes(image,(MagickSizeType) (offset+36)) == MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); if (EOFBlob(image) != MagickFalse) diff --git a/ImageMagick-7.1.1-15/coders/pes.h b/ImageMagick-7.1.1-16/coders/pes.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pes.h rename to ImageMagick-7.1.1-16/coders/pes.h diff --git a/ImageMagick-7.1.1-15/coders/pgx.c b/ImageMagick-7.1.1-16/coders/pgx.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/pgx.c rename to ImageMagick-7.1.1-16/coders/pgx.c diff --git a/ImageMagick-7.1.1-15/coders/pgx.h b/ImageMagick-7.1.1-16/coders/pgx.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pgx.h rename to ImageMagick-7.1.1-16/coders/pgx.h diff --git a/ImageMagick-7.1.1-15/coders/pict.c b/ImageMagick-7.1.1-16/coders/pict.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/pict.c rename to ImageMagick-7.1.1-16/coders/pict.c index 3ed47e6d..c93e235b 100644 --- a/ImageMagick-7.1.1-15/coders/pict.c +++ b/ImageMagick-7.1.1-16/coders/pict.c @@ -474,7 +474,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image, */ for (y=0; y < (ssize_t) image->rows; y++) { - q=pixels+y*width*GetPixelChannels(image); + q=pixels+y*(ssize_t) width*(ssize_t) GetPixelChannels(image); number_pixels=bytes_per_line; count=ReadBlob(blob,(size_t) number_pixels,scanline); if (count != (ssize_t) number_pixels) @@ -500,7 +500,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image, */ for (y=0; y < (ssize_t) image->rows; y++) { - q=pixels+y*width; + q=pixels+y*(ssize_t) width; if (bytes_per_line > 200) scanline_length=ReadBlobMSBShort(blob); else @@ -523,7 +523,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image, number_pixels=length*bytes_per_pixel; p=UnpackScanline(scanline+j+1,bits_per_pixel,unpack_buffer, &number_pixels); - if ((q-pixels+number_pixels) <= *extent) + if ((size_t) (q-pixels+(ssize_t) number_pixels) <= *extent) (void) memcpy(q,p,(size_t) number_pixels); q+=number_pixels; j+=(ssize_t) (length*bytes_per_pixel+1); @@ -536,7 +536,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image, &number_pixels); for (i=0; i < (ssize_t) length; i++) { - if ((q-pixels+number_pixels) <= *extent) + if ((size_t) (q-pixels+(ssize_t) number_pixels) <= *extent) (void) memcpy(q,p,(size_t) number_pixels); q+=number_pixels; } @@ -1087,7 +1087,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, if (length > 200) scanline_length=ReadBlobMSBShort(image); else - scanline_length=ReadBlobByte(image); + scanline_length=(size_t) ReadBlobByte(image); if ((MagickSizeType) scanline_length > GetBlobSize(image)) ThrowPICTException(CorruptImageError, "InsufficientImageDataInFile"); @@ -1226,11 +1226,11 @@ static Image *ReadPICTImage(const ImageInfo *image_info, { for (i=0; i < (ssize_t) tile_image->colors; i++) { - tile_image->colormap[i].red=(Quantum) (QuantumRange- + tile_image->colormap[i].red=((double) QuantumRange- tile_image->colormap[i].red); - tile_image->colormap[i].green=(Quantum) (QuantumRange- + tile_image->colormap[i].green=((double) QuantumRange- tile_image->colormap[i].green); - tile_image->colormap[i].blue=(Quantum) (QuantumRange- + tile_image->colormap[i].blue=((double) QuantumRange- tile_image->colormap[i].blue); } } @@ -1303,7 +1303,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, SetPixelRed(tile_image,ScaleCharToQuantum( (unsigned char) ((i & 0x7c) << 1)),q); SetPixelGreen(tile_image,ScaleCharToQuantum( - (unsigned char) (((i & 0x03) << 6) | + (unsigned char) ((size_t) ((i & 0x03) << 6) | ((k & 0xe0) >> 2))),q); SetPixelBlue(tile_image,ScaleCharToQuantum( (unsigned char) ((k & 0x1f) << 3)),q); @@ -1342,7 +1342,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, if ((tile_image->storage_class == DirectClass) && (pixmap.bits_per_pixel != 16)) { - p+=(pixmap.component_count-1)*tile_image->columns; + p+=(pixmap.component_count-1)*(ssize_t) tile_image->columns; if (p < pixels) break; } @@ -1493,7 +1493,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, read_info=AcquireImageInfo(); (void) FormatLocaleString(read_info->filename,MagickPathExtent, "jpeg:%s",image_info->filename); - tile_image=BlobToImage(read_info,stream,count,exception); + tile_image=BlobToImage(read_info,stream,(size_t) count,exception); pixels=(unsigned char *) RelinquishMagickMemory(pixels); read_info=DestroyImageInfo(read_info); } diff --git a/ImageMagick-7.1.1-15/coders/pict.h b/ImageMagick-7.1.1-16/coders/pict.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pict.h rename to ImageMagick-7.1.1-16/coders/pict.h diff --git a/ImageMagick-7.1.1-15/coders/pix.c b/ImageMagick-7.1.1-16/coders/pix.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/pix.c rename to ImageMagick-7.1.1-16/coders/pix.c diff --git a/ImageMagick-7.1.1-15/coders/pix.h b/ImageMagick-7.1.1-16/coders/pix.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pix.h rename to ImageMagick-7.1.1-16/coders/pix.h diff --git a/ImageMagick-7.1.1-15/coders/plasma.c b/ImageMagick-7.1.1-16/coders/plasma.c similarity index 89% rename from ImageMagick-7.1.1-15/coders/plasma.c rename to ImageMagick-7.1.1-16/coders/plasma.c index a9fc942c..53385bfe 100644 --- a/ImageMagick-7.1.1-15/coders/plasma.c +++ b/ImageMagick-7.1.1-16/coders/plasma.c @@ -103,12 +103,12 @@ static inline MagickBooleanType PlasmaPixel(Image *image, exception); if (q == (Quantum *) NULL) return(MagickFalse); - SetPixelRed(image,(Quantum) (QuantumRange* - GetPseudoRandomValue(random_info)+0.5),q); - SetPixelGreen(image,(Quantum) (QuantumRange* - GetPseudoRandomValue(random_info)+0.5),q); - SetPixelBlue(image,(Quantum) (QuantumRange* - GetPseudoRandomValue(random_info)+0.5),q); + SetPixelRed(image,((double) QuantumRange*GetPseudoRandomValue(random_info)+ + 0.5),q); + SetPixelGreen(image,((double) QuantumRange*GetPseudoRandomValue(random_info)+ + 0.5),q); + SetPixelBlue(image,((double) QuantumRange*GetPseudoRandomValue(random_info)+ + 0.5),q); return(SyncAuthenticPixels(image,exception)); } @@ -186,22 +186,21 @@ static Image *ReadPlasmaImage(const ImageInfo *image_info, random_info=AcquireRandomInfo(); status=PlasmaPixel(image,random_info,segment_info.x1,segment_info.y1, exception); - status&=PlasmaPixel(image,random_info,segment_info.x1,(segment_info.y1+ - segment_info.y2)/2,exception); - status&=PlasmaPixel(image,random_info,segment_info.x1,segment_info.y2, - exception); - status&=PlasmaPixel(image,random_info,(segment_info.x1+segment_info.x2)/2, + status&=(MagickStatusType) PlasmaPixel(image,random_info,segment_info.x1, + (segment_info.y1+segment_info.y2)/2,exception); + status&=(MagickStatusType) PlasmaPixel(image,random_info,segment_info.x1, + segment_info.y2,exception); + status&=(MagickStatusType) PlasmaPixel(image,random_info,(segment_info.x1+ segment_info.x2)/2,segment_info.y1,exception); + status&=(MagickStatusType) PlasmaPixel(image,random_info,(segment_info.x1+ + segment_info.x2)/2,(segment_info.y1+segment_info.y2)/2,exception); + status&=(MagickStatusType) PlasmaPixel(image,random_info,(segment_info.x1+ + segment_info.x2)/2,segment_info.y2,exception); + status&=(MagickStatusType) PlasmaPixel(image,random_info,segment_info.x2, segment_info.y1,exception); - status&=PlasmaPixel(image,random_info,(segment_info.x1+segment_info.x2)/2, + status&=(MagickStatusType) PlasmaPixel(image,random_info,segment_info.x2, (segment_info.y1+segment_info.y2)/2,exception); - status&=PlasmaPixel(image,random_info,(segment_info.x1+segment_info.x2)/2, + status&=(MagickStatusType) PlasmaPixel(image,random_info,segment_info.x2, segment_info.y2,exception); - status&=PlasmaPixel(image,random_info,segment_info.x2,segment_info.y1, - exception); - status&=PlasmaPixel(image,random_info,segment_info.x2,(segment_info.y1+ - segment_info.y2)/2,exception); - status&=PlasmaPixel(image,random_info,segment_info.x2,segment_info.y2, - exception); random_info=DestroyRandomInfo(random_info); if (status == MagickFalse) return(image); diff --git a/ImageMagick-7.1.1-15/coders/plasma.h b/ImageMagick-7.1.1-16/coders/plasma.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/plasma.h rename to ImageMagick-7.1.1-16/coders/plasma.h diff --git a/ImageMagick-7.1.1-15/coders/png.c b/ImageMagick-7.1.1-16/coders/png.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/png.c rename to ImageMagick-7.1.1-16/coders/png.c index 5b7cda55..880328f1 100644 --- a/ImageMagick-7.1.1-15/coders/png.c +++ b/ImageMagick-7.1.1-16/coders/png.c @@ -747,7 +747,7 @@ LosslessReduceDepthOK(Image *image,ExceptionInfo *exception) */ #define QuantumToCharToQuantumEqQuantum(quantum) \ - ((ScaleCharToQuantum((unsigned char) ScaleQuantumToChar(quantum))) == quantum) + (((double) ScaleCharToQuantum((unsigned char) ScaleQuantumToChar(quantum))) == (double) quantum) MagickBooleanType ok_to_reduce=MagickFalse; @@ -1630,7 +1630,7 @@ Magick_png_read_raw_profile(png_struct *ping,Image *image, return(MagickFalse); } - profile=BlobToStringInfo((const void *) NULL,length); + profile=BlobToStringInfo((const void *) NULL,(size_t) length); if (profile == (StringInfo *) NULL) { @@ -1640,7 +1640,7 @@ Magick_png_read_raw_profile(png_struct *ping,Image *image, /* copy profile, skipping white space and column 1 "=" signs */ dp=GetStringInfoDatum(profile); - nibbles=length*2; + nibbles=(size_t) length*2; for (i=0; i < (ssize_t) nibbles; i++) { @@ -1765,7 +1765,8 @@ static int PNGParseiTXt(Image *image,png_byte *data,png_size_t size, } if (((MagickOffsetType) size-offset) < 1) return(0); - profile=BlobToStringInfo((const void *) (data+offset),size-offset); + profile=BlobToStringInfo((const void *) (data+offset), + size-(size_t) offset); if (profile == (StringInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), @@ -1789,7 +1790,7 @@ static int PNGParseiTXt(Image *image,png_byte *data,png_size_t size, } (void) FormatLocaleString(key,MagickPathExtent,"%s",(const char *) GetStringInfoDatum(profile)); - offset=strlen(key)+1; + offset=(ssize_t) strlen(key)+1; (void) FormatLocaleString(key,MagickPathExtent,"png:%s",(const char *) GetStringInfoDatum(profile)); if (((MagickOffsetType) size-offset) < 1) @@ -1797,13 +1798,13 @@ static int PNGParseiTXt(Image *image,png_byte *data,png_size_t size, profile=DestroyStringInfo(profile); return(0); } - compressed=data[offset++]; + compressed=(char) data[offset++]; if ((((MagickOffsetType) size-offset) < 1) || (compressed != 0)) { profile=DestroyStringInfo(profile); return(0); } - method=data[offset++]; + method=(char) data[offset++]; if ((((MagickOffsetType) size-offset) < 1) || (method != 0)) { profile=DestroyStringInfo(profile); @@ -1811,14 +1812,14 @@ static int PNGParseiTXt(Image *image,png_byte *data,png_size_t size, } (void) FormatLocaleString(language,MagickPathExtent,"%s",(const char *) GetStringInfoDatum(profile)+offset++); - offset+=strlen(language)+1; + offset+=(ssize_t) strlen(language)+1; if (((MagickOffsetType) size-offset) < 1) { profile=DestroyStringInfo(profile); return(0); } property=BlobToStringInfo((const void *) (GetStringInfoDatum(profile)+offset), - size-offset); + size-(size_t) offset); if (property == (StringInfo *) NULL) { profile=DestroyStringInfo(profile); @@ -2448,7 +2449,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info, ping_bit_depth = 8; } - image->depth=ping_bit_depth; + image->depth=(size_t) ping_bit_depth; image->depth=GetImageQuantumDepth(image,MagickFalse); image->interlace=ping_interlace_method != 0 ? PNGInterlace : NoInterlace; @@ -2652,7 +2653,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info, if (image->rendering_intent == UndefinedIntent) image->rendering_intent= Magick_RenderingIntent_from_PNG_RenderingIntent - (mng_info->global_srgb_intent); + ((int) mng_info->global_srgb_intent); } } #endif @@ -2725,7 +2726,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info, png_set_pHYs(ping,ping_info, mng_info->global_x_pixels_per_unit, mng_info->global_y_pixels_per_unit, - mng_info->global_phys_unit_type); + (int) mng_info->global_phys_unit_type); } } @@ -2981,7 +2982,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info, if (logging != MagickFalse) (void)LogMagickEvent(CoderEvent,GetMagickModule(), - " image->gamma=%f",(float) image_gamma); + " image->gamma=%g",image_gamma); if (image_gamma > 0.75) { @@ -3011,7 +3012,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info, if (logging != MagickFalse) (void)LogMagickEvent(CoderEvent,GetMagickModule(), - " image->gamma=%f",(float) image_gamma); + " image->gamma=%g",image_gamma); if (image_gamma > 0.75) { @@ -3254,7 +3255,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info, for (y=0; y < (ssize_t) image->rows; y++) { if (num_passes > 1) - row_offset=ping_rowbytes*y; + row_offset=ping_rowbytes*(size_t) y; else row_offset=0; @@ -3344,7 +3345,8 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info, if (num_passes != 1) { - status=SetImageProgress(image,LoadImageTag,pass,num_passes); + status=SetImageProgress(image,LoadImageTag,pass,(MagickSizeType) + num_passes); if (status == MagickFalse) break; } @@ -3381,7 +3383,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info, alpha; if (num_passes > 1) - row_offset=ping_rowbytes*y; + row_offset=ping_rowbytes*(size_t) y; else row_offset=0; @@ -3526,7 +3528,8 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info, break; if (num_passes != 1) { - status=SetImageProgress(image,LoadImageTag,pass,num_passes); + status=SetImageProgress(image,LoadImageTag,pass,(MagickSizeType) + num_passes); if (status == MagickFalse) break; @@ -3912,7 +3915,7 @@ static Image *ReadOnePNGImage(MngReadInfo *mng_info, /* } for navigation to beginning of SETJMP-protected block, revert to * Throwing an Exception when an error occurs. */ - image->depth=ping_file_depth; + image->depth=(size_t) ping_file_depth; return(image); /* end of reading one PNG image */ @@ -4000,22 +4003,22 @@ static Image *ReadPNGImage(const ImageInfo *image_info, if ((IssRGBColorspace(image->colorspace) != MagickFalse) && (image->gamma > .75) && - !(image->chromaticity.red_primary.x>0.6399f && - image->chromaticity.red_primary.x<0.6401f && - image->chromaticity.red_primary.y>0.3299f && - image->chromaticity.red_primary.y<0.3301f && - image->chromaticity.green_primary.x>0.2999f && - image->chromaticity.green_primary.x<0.3001f && - image->chromaticity.green_primary.y>0.5999f && - image->chromaticity.green_primary.y<0.6001f && - image->chromaticity.blue_primary.x>0.1499f && - image->chromaticity.blue_primary.x<0.1501f && - image->chromaticity.blue_primary.y>0.0599f && - image->chromaticity.blue_primary.y<0.0601f && - image->chromaticity.white_point.x>0.3126f && - image->chromaticity.white_point.x<0.3128f && - image->chromaticity.white_point.y>0.3289f && - image->chromaticity.white_point.y<0.3291f)) + !(image->chromaticity.red_primary.x>0.6399 && + image->chromaticity.red_primary.x<0.6401 && + image->chromaticity.red_primary.y>0.3299 && + image->chromaticity.red_primary.y<0.3301 && + image->chromaticity.green_primary.x>0.2999 && + image->chromaticity.green_primary.x<0.3001 && + image->chromaticity.green_primary.y>0.5999 && + image->chromaticity.green_primary.y<0.6001 && + image->chromaticity.blue_primary.x>0.1499 && + image->chromaticity.blue_primary.x<0.1501 && + image->chromaticity.blue_primary.y>0.0599 && + image->chromaticity.blue_primary.y<0.0601 && + image->chromaticity.white_point.x>0.3126 && + image->chromaticity.white_point.x<0.3128 && + image->chromaticity.white_point.y>0.3289 && + image->chromaticity.white_point.y<0.3291)) { if (logging != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -4555,7 +4558,7 @@ static Image *ReadOneJNGImage(MngReadInfo *mng_info, if (memcmp(type,mng_gAMA,4) == 0) { if (length == 4) - image->gamma=((float) mng_get_long(p))*0.00001; + image->gamma=((double) mng_get_long(p))*0.00001; chunk=(unsigned char *) RelinquishMagickMemory(chunk); continue; @@ -4628,8 +4631,8 @@ static Image *ReadOneJNGImage(MngReadInfo *mng_info, if ((int) p[8] == PNG_RESOLUTION_METER) { image->units=PixelsPerCentimeterResolution; - image->resolution.x=image->resolution.x/100.0f; - image->resolution.y=image->resolution.y/100.0f; + image->resolution.x=image->resolution.x/100.0; + image->resolution.y=image->resolution.y/100.0; } } @@ -5121,7 +5124,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info, default_frame_timeout=0; frame_delay=0; final_delay=1; - mng_info->ticks_per_second=1UL*image->ticks_per_second; + mng_info->ticks_per_second=(unsigned long) image->ticks_per_second; object_id=0; skip_to_iend=MagickFalse; term_chunk_found=MagickFalse; @@ -5241,8 +5244,8 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info, default_frame_delay=0; else - default_frame_delay=1UL*image->ticks_per_second/ - mng_info->ticks_per_second; + default_frame_delay=(size_t) image->ticks_per_second/ + (size_t) mng_info->ticks_per_second; frame_delay=default_frame_delay; simplicity=0; @@ -5343,7 +5346,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info, ThrowReaderException(CorruptImageError,"CorruptImage"); } - object_id=((unsigned int) p[0] << 8) | (unsigned int) p[1]; + object_id=(int) (((unsigned int) p[0] << 8) | (unsigned int) p[1]); if (mng_type == 2 && object_id != 0) (void) ThrowMagickException(exception,GetMagickModule(), @@ -5498,7 +5501,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info, igamma; igamma=mng_get_long(p); - mng_info->global_gamma=((float) igamma)*0.00001; + mng_info->global_gamma=((double) igamma)*0.00001; mng_info->have_global_gama=MagickTrue; } @@ -5614,8 +5617,8 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info, if (change_delay && ((p-chunk) < (ssize_t) (length-4))) { - frame_delay=1UL*image->ticks_per_second* - mng_get_long(p); + frame_delay=(size_t) image->ticks_per_second* + (size_t) mng_get_long(p); if (mng_info->ticks_per_second != 0) frame_delay/=mng_info->ticks_per_second; @@ -5635,8 +5638,8 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info, if (change_timeout && ((p-chunk) < (ssize_t) (length-4))) { - frame_timeout=1UL*image->ticks_per_second* - mng_get_long(p); + frame_timeout=(size_t) image->ticks_per_second* + (size_t) mng_get_long(p); if (mng_info->ticks_per_second != 0) frame_timeout/=mng_info->ticks_per_second; @@ -5750,8 +5753,8 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info, */ if (length > 3) { - first_object=(p[0] << 8) | p[1]; - last_object=(p[2] << 8) | p[3]; + first_object=(unsigned int) ((p[0] << 8) | p[1]); + last_object=(unsigned int) ((p[2] << 8) | p[3]); p+=4; for (i=(int) first_object; i <= (int) last_object; i++) @@ -5824,8 +5827,8 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info, if (length > 3) { - first_object=(p[0] << 8) | p[1]; - last_object=(p[2] << 8) | p[3]; + first_object=(unsigned int) ((p[0] << 8) | p[1]); + last_object=(unsigned int) ((p[2] << 8) | p[3]); p+=4; for (i=(ssize_t) first_object; i <= (ssize_t) last_object; i++) @@ -5877,12 +5880,12 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info, else { if ((MagickSizeType) loop_iters > GetMagickResourceLimit(ListLengthResource)) - loop_iters=GetMagickResourceLimit(ListLengthResource); + loop_iters=(ssize_t) GetMagickResourceLimit(ListLengthResource); if (loop_iters >= 2147483647L) loop_iters=2147483647L; if (image_info->number_scenes != 0) if (loop_iters > (ssize_t) image_info->number_scenes) - loop_iters=image_info->number_scenes; + loop_iters=(ssize_t) image_info->number_scenes; mng_info->loop_jump[loop_level]=TellBlob(image); mng_info->loop_count[loop_level]=loop_iters; } @@ -7174,7 +7177,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info, } if (mng_info->ticks_per_second) - final_delay=1UL*MagickMax(image->ticks_per_second,1L)* + final_delay=(size_t) MagickMax(image->ticks_per_second,1L)* final_delay/mng_info->ticks_per_second; else @@ -8482,7 +8485,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, (int) image->colormap[i].alpha); } - for (i=image->colors - 10; i < (ssize_t) image->colors; i++) + for (i=(ssize_t) image->colors - 10; i < (ssize_t) image->colors; i++) { if (i > 255) { @@ -8594,7 +8597,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, for (i=0; i< (ssize_t) number_semitransparent; i++) { if (IsColorEqual(image,r,semitransparent+i) - && GetPixelAlpha(image,r) == + && (double) GetPixelAlpha(image,r) == semitransparent[i].alpha) break; } @@ -8778,7 +8781,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, if (ping_have_non_bw == MagickFalse) { - if (colormap[i].red != 0 && colormap[i].red != QuantumRange) + if (colormap[i].red != 0 && colormap[i].red != (double) QuantumRange) ping_have_non_bw=MagickTrue; } } @@ -8799,9 +8802,9 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, " AcquireImageColormap"); } - image->colors = image_colors; + image->colors = (size_t) image_colors; - if (AcquireImageColormap(image,image_colors,exception) == MagickFalse) + if (AcquireImageColormap(image,(size_t) image_colors,exception) == MagickFalse) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'", @@ -8836,10 +8839,10 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, for (i=0; i< (ssize_t) image_colors; i++) { if ((((image->alpha_trait & BlendPixelTrait) == 0) || - image->colormap[i].alpha == GetPixelAlpha(image,q)) && - image->colormap[i].red == GetPixelRed(image,q) && - image->colormap[i].green == GetPixelGreen(image,q) && - image->colormap[i].blue == GetPixelBlue(image,q)) + image->colormap[i].alpha == (double) GetPixelAlpha(image,q)) && + image->colormap[i].red == (double) GetPixelRed(image,q) && + image->colormap[i].green == (double) GetPixelGreen(image,q) && + image->colormap[i].blue == (double) GetPixelBlue(image,q)) { SetPixelIndex(image,i,q); break; @@ -8968,7 +8971,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, image->colormap != NULL) for (i=0; icolormap[i].alpha = - (image->colormap[i].alpha > TransparentAlpha/2 ? + (image->colormap[i].alpha > (double) TransparentAlpha/2 ? TransparentAlpha : OpaqueAlpha); } continue; @@ -9595,7 +9598,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, } ping_have_PLTE=MagickTrue; - image_depth=ping_bit_depth; + image_depth=(size_t) ping_bit_depth; ping_num_trans=0; if (matte != MagickFalse) @@ -9665,7 +9668,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, else /* mng_info->write_pngNN not specified */ { - image_depth=ping_bit_depth; + image_depth=(size_t) ping_bit_depth; if (mng_info->colortype != 0) { @@ -9748,7 +9751,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, ping_bit_depth=8; } - old_bit_depth=ping_bit_depth; + old_bit_depth=(size_t) ping_bit_depth; if (ping_color_type == PNG_COLOR_TYPE_GRAY) { @@ -9782,16 +9785,16 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, } if (ping_bit_depth < (int) mng_info->depth) - ping_bit_depth = mng_info->depth; + ping_bit_depth = (int) mng_info->depth; } (void) old_bit_depth; - image_depth=ping_bit_depth; + image_depth=(size_t) ping_bit_depth; if (logging != MagickFalse) { (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Tentative PNG color type: %s (%.20g)", - PngColorTypeToString(ping_color_type), + PngColorTypeToString((unsigned int) ping_color_type), (double) ping_color_type); (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -10000,7 +10003,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, } } - image_depth=ping_bit_depth; + image_depth=(size_t) ping_bit_depth; } else @@ -10114,8 +10117,8 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, } } - if (ping_bit_depth < (ssize_t) mng_info->depth) - ping_bit_depth = (ssize_t) mng_info->depth; + if (ping_bit_depth < (int) mng_info->depth) + ping_bit_depth = (int) mng_info->depth; /* Adjust background and transparency samples in sub-8-bit grayscale files. @@ -10210,8 +10213,8 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, if (logging != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " PNG color type: %s (%d)", PngColorTypeToString(ping_color_type), - ping_color_type); + " PNG color type: %s (%.20g)", PngColorTypeToString((unsigned int) + ping_color_type), (double) ping_color_type); /* Initialize compression level and filtering. */ @@ -10287,7 +10290,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, level=(int) MagickMin((ssize_t) quality/10,9); - mng_info->compression_level = level+1; + mng_info->compression_level = (size_t) level+1; } if (mng_info->compression_strategy == 0) @@ -10301,7 +10304,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, } if (mng_info->compression_filter == 0) - mng_info->compression_filter=((int) quality % 10) + 1; + mng_info->compression_filter=((size_t) quality % 10) + 1; if (logging != MagickFalse) { @@ -10332,7 +10335,7 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, } if (mng_info->compression_level != 0) - png_set_compression_level(ping,mng_info->compression_level-1); + png_set_compression_level(ping,(int) mng_info->compression_level-1); if (mng_info->compression_filter == 6) { @@ -10365,11 +10368,11 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, else if (mng_info->compression_filter != 0) png_set_filter(ping,PNG_FILTER_TYPE_BASE, - mng_info->compression_filter-1); + (int) mng_info->compression_filter-1); if (mng_info->compression_strategy != 0) png_set_compression_strategy(ping, - mng_info->compression_strategy-1); + (int) mng_info->compression_strategy-1); ping_interlace_method=image_info->interlace != NoInterlace; @@ -10914,8 +10917,8 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, png_write_row(ping,ping_pixels); status=SetImageProgress(image,SaveImageTag, - (MagickOffsetType) (pass * image->rows + y), - num_passes * image->rows); + (MagickOffsetType) (pass * (ssize_t) image->rows + y), + (MagickSizeType) num_passes * image->rows); if (status == MagickFalse) break; @@ -10978,8 +10981,8 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, png_write_row(ping,ping_pixels); status=SetImageProgress(image,SaveImageTag, - (MagickOffsetType) (pass * image->rows + y), - num_passes * image->rows); + (MagickOffsetType) (pass * (ssize_t) image->rows + y), + (MagickSizeType) num_passes * image->rows); if (status == MagickFalse) break; @@ -11045,8 +11048,8 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, png_write_row(ping,ping_pixels); status=SetImageProgress(image,SaveImageTag, - (MagickOffsetType) (pass * image->rows + y), - num_passes * image->rows); + (MagickOffsetType) (pass * (ssize_t) image->rows + y), + (MagickSizeType) num_passes * image->rows); if (status == MagickFalse) break; @@ -11120,8 +11123,8 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info, png_write_row(ping,ping_pixels); status=SetImageProgress(image,SaveImageTag, - (MagickOffsetType) (pass * image->rows + y), - num_passes * image->rows); + (MagickOffsetType) pass * (ssize_t) image->rows + y, + (MagickSizeType) num_passes * image->rows); if (status == MagickFalse) break; @@ -12614,7 +12617,7 @@ static MagickBooleanType WriteOneJNGImage(MngWriteInfo *mng_info, /* Copy IDAT chunks */ len=0; p=blob+8; - for (i=8; i<(ssize_t) length; i+=len+12) + for (i=8; i<(ssize_t) length; i+=(ssize_t) len+12) { len=(((unsigned int) *(p ) & 0xff) << 24) + (((unsigned int) *(p + 1) & 0xff) << 16) + @@ -13013,11 +13016,11 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image, { if (need_geom) { - if ((next_image->columns+next_image->page.x) > mng_info->page.width) - mng_info->page.width=next_image->columns+next_image->page.x; + if ((next_image->columns+(size_t) next_image->page.x) > mng_info->page.width) + mng_info->page.width=next_image->columns+(size_t) next_image->page.x; - if ((next_image->rows+next_image->page.y) > mng_info->page.height) - mng_info->page.height=next_image->rows+next_image->page.y; + if ((next_image->rows+(size_t) next_image->page.y) > mng_info->page.height) + mng_info->page.height=next_image->rows+(size_t) next_image->page.y; } if (next_image->page.x || next_image->page.y) @@ -13038,7 +13041,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image, final_delay=next_image->delay; - if (final_delay != initial_delay || final_delay > 1UL* + if (final_delay != initial_delay || (ssize_t) final_delay > next_image->ticks_per_second) mng_info->need_fram=MagickTrue; @@ -13054,7 +13057,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image, all_images_are_gray=MagickFalse; mng_info->equal_palettes=PalettesAreEqual(image,next_image); if (use_global_plte == 0) - use_global_plte=mng_info->equal_palettes; + use_global_plte=(int) mng_info->equal_palettes; need_local_plte=!mng_info->equal_palettes; } if (GetNextImageInList(next_image) != (Image *) NULL) @@ -13142,7 +13145,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image, } if (final_delay != 0) mng_info->ticks_per_second=(png_uint_32) - (image->ticks_per_second/final_delay); + image->ticks_per_second/(png_uint_32) final_delay; if (final_delay > 50) mng_info->ticks_per_second=2; @@ -13160,7 +13163,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image, } if (mng_info->need_fram != MagickFalse) - mng_info->ticks_per_second=image->ticks_per_second; + mng_info->ticks_per_second=(unsigned long) image->ticks_per_second; /* If pseudocolor, we should also check to see if all the palettes are identical and write a global PLTE if they are. @@ -13251,7 +13254,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image, chunk[4]=3; /* repeat animation */ chunk[5]=0; /* show last frame when done */ PNGLong(chunk+6,(png_uint_32) (mng_info->ticks_per_second* - final_delay/MagickMax(image->ticks_per_second,1))); + final_delay/(size_t) MagickMax(image->ticks_per_second,1))); if (image->iterations == 0) PNGLong(chunk+10,PNG_UINT_31_MAX); @@ -13263,7 +13266,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image, { (void) LogMagickEvent(CoderEvent,GetMagickModule(), " TERM delay: %.20g",(double) (mng_info->ticks_per_second* - final_delay/MagickMax(image->ticks_per_second,1))); + final_delay/(size_t) MagickMax(image->ticks_per_second,1))); if (image->iterations == 0) (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -13397,9 +13400,9 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image, */ if ((write_mng != MagickFalse) && ((image->alpha_trait != UndefinedPixelTrait) || image->page.x > 0 || image->page.y > 0 || (image->page.width && - (image->page.width+image->page.x < mng_info->page.width)) - || (image->page.height && (image->page.height+image->page.y - < mng_info->page.height)))) + ((ssize_t) image->page.width+image->page.x < (ssize_t) mng_info->page.width)) + || (image->page.height && ((ssize_t) image->page.height+image->page.y + < (ssize_t) mng_info->page.height)))) { (void) WriteBlobMSBULong(image,6L); PNGType(chunk,mng_BACK); @@ -13579,9 +13582,8 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image, chunk[7]=0; /* flag for changing frame timeout */ chunk[8]=0; /* flag for changing frame clipping */ chunk[9]=0; /* flag for changing frame sync_id */ - PNGLong(chunk+10,(png_uint_32) - ((mng_info->ticks_per_second* - image->delay)/MagickMax(image->ticks_per_second,1))); + PNGLong(chunk+10,(png_uint_32) ((mng_info->ticks_per_second* + image->delay)/(size_t) MagickMax(image->ticks_per_second,1))); (void) WriteBlob(image,14,chunk); (void) WriteBlobMSBULong(image,crc32(0,chunk,14)); mng_info->delay=(png_uint_32) image->delay; @@ -13642,7 +13644,8 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image, if (GetNextImageInList(image) == (Image *) NULL) break; image=SyncNextImageInList(image); - status=SetImageProgress(image,SaveImagesTag,scene++,number_scenes); + status=SetImageProgress(image,SaveImagesTag,(MagickOffsetType) scene++, + number_scenes); if (status == MagickFalse) break; diff --git a/ImageMagick-7.1.1-15/coders/png.h b/ImageMagick-7.1.1-16/coders/png.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/png.h rename to ImageMagick-7.1.1-16/coders/png.h diff --git a/ImageMagick-7.1.1-15/coders/pnm.c b/ImageMagick-7.1.1-16/coders/pnm.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/pnm.c rename to ImageMagick-7.1.1-16/coders/pnm.c index 19f0e188..9404454d 100644 --- a/ImageMagick-7.1.1-15/coders/pnm.c +++ b/ImageMagick-7.1.1-16/coders/pnm.c @@ -218,7 +218,7 @@ static unsigned int PNMInteger(Image *image,CommentInfo *comment_info, { value*=10; if (value <= (unsigned int) (INT_MAX-(c-(int) '0'))) - value+=c-(int) '0'; + value+=(unsigned int) (c-(int) '0'); } c=ReadBlobByte(image); if (c == EOF) @@ -397,8 +397,11 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Comment. */ - c=PNMComment(image,&comment_info,exception); - c=ReadBlobByte(image); + while (c == '#') + { + c=PNMComment(image,&comment_info,exception); + c=ReadBlobByte(image); + } while (isspace((int) ((unsigned char) c)) != 0) c=ReadBlobByte(image); } @@ -862,7 +865,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) offset, x; - stream=ReadBlobStream(image,extent,pixels,&count); if (count != (ssize_t) extent) break; @@ -1493,7 +1495,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } offset=row++; - q=QueueAuthenticPixels(image,0,(ssize_t) (image->rows-offset-1), + q=QueueAuthenticPixels(image,0,((ssize_t) image->rows-offset-1), image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -1563,7 +1565,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } offset=row++; - q=QueueAuthenticPixels(image,0,(ssize_t) (image->rows-offset-1), + q=QueueAuthenticPixels(image,0,((ssize_t) image->rows-offset-1), image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -2025,19 +2027,19 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, break; for (x=0; x < (ssize_t) image->columns; x++) { - *q++=(unsigned char) (GetPixelLuma(image,p) >= (QuantumRange/2.0) ? - '0' : '1'); + *q++=(unsigned char) (GetPixelLuma(image,p) >= ((double) + QuantumRange/2.0) ? '0' : '1'); if ((q-pixels+2) >= (ssize_t) sizeof(pixels)) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; } *q++=' '; p+=GetPixelChannels(image); } *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; if (image->previous == (Image *) NULL) { @@ -2050,7 +2052,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, if (q != pixels) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); } break; } @@ -2095,10 +2097,10 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, count=(ssize_t) FormatLocaleString(buffer,MagickPathExtent, "%u ",ScaleQuantumToLong(index)); extent=(size_t) count; - if ((q-pixels+extent+1) >= sizeof(pixels)) + if ((size_t) (q-pixels+(ssize_t) extent+1) >= sizeof(pixels)) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; } (void) memcpy((char *) q,buffer,extent); @@ -2106,7 +2108,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, p+=GetPixelChannels(image); } *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; if (image->previous == (Image *) NULL) { @@ -2119,7 +2121,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, if (q != pixels) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); } break; } @@ -2171,10 +2173,10 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, ScaleQuantumToLong(GetPixelGreen(image,p)), ScaleQuantumToLong(GetPixelBlue(image,p))); extent=(size_t) count; - if ((q-pixels+extent+2) >= sizeof(pixels)) + if ((size_t) (q-pixels+(ssize_t) extent+2) >= sizeof(pixels)) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; } (void) memcpy((char *) q,buffer,extent); @@ -2182,7 +2184,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, p+=GetPixelChannels(image); } *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; if (image->previous == (Image *) NULL) { @@ -2195,7 +2197,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, if (q != pixels) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); } break; } diff --git a/ImageMagick-7.1.1-15/coders/pnm.h b/ImageMagick-7.1.1-16/coders/pnm.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pnm.h rename to ImageMagick-7.1.1-16/coders/pnm.h diff --git a/ImageMagick-7.1.1-15/coders/ps.c b/ImageMagick-7.1.1-16/coders/ps.c similarity index 97% rename from ImageMagick-7.1.1-15/coders/ps.c rename to ImageMagick-7.1.1-16/coders/ps.c index 47e48f1f..f1fce2a5 100644 --- a/ImageMagick-7.1.1-15/coders/ps.c +++ b/ImageMagick-7.1.1-16/coders/ps.c @@ -1535,7 +1535,8 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if (image->gravity != UndefinedGravity) { geometry.x=(-page_info.x); - geometry.y=(ssize_t) (media_info.height+page_info.y-image->rows); + geometry.y=(ssize_t) media_info.height+page_info.y-(ssize_t) + image->rows; } pointsize=12.0; if (image_info->pointsize != 0.0) @@ -1673,7 +1674,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if ((q-pixels+8) >= 80) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; (void) WriteBlobString(image,"% "); }; @@ -1688,7 +1689,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if ((q-pixels+8) >= 80) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; (void) WriteBlobString(image,"% "); }; @@ -1697,7 +1698,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if (q != pixels) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); } (void) WriteBlobString(image,"\n%%EndPreview\n"); preview_image=DestroyImage(preview_image); @@ -1741,9 +1742,9 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, bounds.x1=(double) geometry.x; if ((double) geometry.y < bounds.y1) bounds.y1=(double) geometry.y; - if ((double) (geometry.x+geometry.width-1) > bounds.x2) + if ((double) (geometry.x+(ssize_t) geometry.width-1) > bounds.x2) bounds.x2=(double) geometry.x+geometry.width-1; - if ((double) (geometry.y+(geometry.height+text_size)-1) > bounds.y2) + if ((double) (geometry.y+((ssize_t) geometry.height+(ssize_t) text_size)-1) > bounds.y2) bounds.y2=(double) geometry.y+(geometry.height+text_size)-1; value=GetImageProperty(image,"label",exception); if (value != (const char *) NULL) @@ -1807,7 +1808,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if ((q-pixels+8) >= 80) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; } p+=GetPixelChannels(image); @@ -1823,7 +1824,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if (q != pixels) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); } } else @@ -1859,7 +1860,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if ((q-pixels+2) >= 80) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; }; bit=0; @@ -1874,7 +1875,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if ((q-pixels+2) >= 80) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; } }; @@ -1889,7 +1890,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if (q != pixels) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); } } } @@ -1935,7 +1936,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if ((q-pixels+10) >= 80) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; } } @@ -1948,7 +1949,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if ((q-pixels+10) >= 80) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; } if (image->previous == (Image *) NULL) @@ -1962,7 +1963,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if (q != pixels) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); } break; } @@ -1999,7 +2000,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if ((q-pixels+6) >= 80) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; } p+=GetPixelChannels(image); @@ -2015,7 +2016,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if (q != pixels) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); } break; } @@ -2077,7 +2078,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if ((q-pixels+6) >= 80) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; } } @@ -2095,7 +2096,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if ((q-pixels+6) >= 80) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; } if (image->previous == (Image *) NULL) @@ -2109,7 +2110,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if (q != pixels) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); } break; } @@ -2131,7 +2132,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if ((q-pixels+4) >= 80) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); q=pixels; } p+=GetPixelChannels(image); @@ -2147,7 +2148,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, if (q != pixels) { *q++='\n'; - (void) WriteBlob(image,q-pixels,pixels); + (void) WriteBlob(image,(size_t) (q-pixels),pixels); } break; } diff --git a/ImageMagick-7.1.1-15/coders/ps.h b/ImageMagick-7.1.1-16/coders/ps.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/ps.h rename to ImageMagick-7.1.1-16/coders/ps.h diff --git a/ImageMagick-7.1.1-15/coders/ps2.c b/ImageMagick-7.1.1-16/coders/ps2.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/ps2.c rename to ImageMagick-7.1.1-16/coders/ps2.c index eb2d7cbd..e97c6b0a 100644 --- a/ImageMagick-7.1.1-15/coders/ps2.c +++ b/ImageMagick-7.1.1-16/coders/ps2.c @@ -463,21 +463,15 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image, compression=image->compression; if (image_info->compression != UndefinedCompression) compression=image_info->compression; - switch (compression) - { #if !defined(MAGICKCORE_JPEG_DELEGATE) - case JPEGCompression: + if (compression == JPEGCompression) { compression=RLECompression; (void) ThrowMagickException(exception,GetMagickModule(), MissingDelegateError,"DelegateLibrarySupportNotBuiltIn","`%s' (JPEG)", image->filename); - break; } #endif - default: - break; - } (void) memset(&bounds,0,sizeof(bounds)); page=1; scene=0; @@ -541,7 +535,8 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image, if (image->gravity != UndefinedGravity) { geometry.x=(-page_info.x); - geometry.y=(ssize_t) (media_info.height+page_info.y-image->rows); + geometry.y=(ssize_t) media_info.height+page_info.y-(ssize_t) + image->rows; } pointsize=12.0; if (image_info->pointsize != 0.0) @@ -682,10 +677,11 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image, bounds.x1=(double) geometry.x; if ((double) geometry.y < bounds.y1) bounds.y1=(double) geometry.y; - if ((double) (geometry.x+geometry.width-1) > bounds.x2) + if ((double) (geometry.x+(ssize_t) geometry.width-1) > bounds.x2) bounds.x2=(double) geometry.x+geometry.width-1; - if ((double) (geometry.y+(geometry.height+text_size)-1) > bounds.y2) - bounds.y2=(double) geometry.y+(geometry.height+text_size)-1; + if ((double) (geometry.y+((ssize_t) geometry.height+(ssize_t) text_size)-1) > bounds.y2) + bounds.y2=(double) geometry.y+((ssize_t) geometry.height+(ssize_t) + text_size)-1; value=GetImageProperty(image,"label",exception); if (value != (const char *) NULL) (void) WriteBlobString(image,"%%PageResources: font Helvetica\n"); diff --git a/ImageMagick-7.1.1-15/coders/ps2.h b/ImageMagick-7.1.1-16/coders/ps2.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/ps2.h rename to ImageMagick-7.1.1-16/coders/ps2.h diff --git a/ImageMagick-7.1.1-15/coders/ps3.c b/ImageMagick-7.1.1-16/coders/ps3.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/ps3.c rename to ImageMagick-7.1.1-16/coders/ps3.c index fd547fff..ae4a32da 100644 --- a/ImageMagick-7.1.1-15/coders/ps3.c +++ b/ImageMagick-7.1.1-16/coders/ps3.c @@ -361,10 +361,10 @@ static MagickBooleanType SerializeImageChannel(const ImageInfo *image_info, { bit=(unsigned char) 0x00; if (x < (ssize_t) image->columns) - bit=(unsigned char) (GetPixelLuma(image,p) == TransparentAlpha ? - 0x01 : 0x00); + bit=(unsigned char) (GetPixelLuma(image,p) == (double) + TransparentAlpha ? 0x01 : 0x00); code=(code << 1)+bit; - if (((x+1) % pack) == 0) + if (((x+1) % (ssize_t) pack) == 0) { *q++=code; code='\0'; @@ -993,7 +993,8 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image, if (image->gravity != UndefinedGravity) { geometry.x=(-page_info.x); - geometry.y=(ssize_t) (media_info.height+page_info.y-image->rows); + geometry.y=(ssize_t) media_info.height+page_info.y-(ssize_t) + image->rows; } pointsize=12.0; if (image_info->pointsize != 0.0) diff --git a/ImageMagick-7.1.1-15/coders/ps3.h b/ImageMagick-7.1.1-16/coders/ps3.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/ps3.h rename to ImageMagick-7.1.1-16/coders/ps3.h diff --git a/ImageMagick-7.1.1-15/coders/psd-private.h b/ImageMagick-7.1.1-16/coders/psd-private.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/psd-private.h rename to ImageMagick-7.1.1-16/coders/psd-private.h diff --git a/ImageMagick-7.1.1-15/coders/psd.c b/ImageMagick-7.1.1-16/coders/psd.c similarity index 96% rename from ImageMagick-7.1.1-15/coders/psd.c rename to ImageMagick-7.1.1-16/coders/psd.c index 18fea881..de46abc3 100644 --- a/ImageMagick-7.1.1-15/coders/psd.c +++ b/ImageMagick-7.1.1-16/coders/psd.c @@ -352,14 +352,15 @@ static MagickBooleanType CorrectPSDAlphaBlend(const ImageInfo *image_info, ssize_t i; - gamma=QuantumScale*GetPixelAlpha(image, q); + gamma=QuantumScale*(double) GetPixelAlpha(image, q); if (gamma != 0.0 && gamma != 1.0) { for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { PixelChannel channel = GetPixelChannelChannel(image,i); if (channel != AlphaPixelChannel) - q[i]=ClampToQuantum((q[i]-((1.0-gamma)*QuantumRange))/gamma); + q[i]=ClampToQuantum(((double) q[i]-((1.0-gamma)*(double) + QuantumRange))/gamma); } } q+=GetPixelChannels(image); @@ -426,11 +427,11 @@ static MagickBooleanType ApplyPSDLayerOpacity(Image *image,Quantum opacity, for (x=0; x < (ssize_t) image->columns; x++) { if (revert == MagickFalse) - SetPixelAlpha(image,ClampToQuantum(QuantumScale* - GetPixelAlpha(image,q)*opacity),q); + SetPixelAlpha(image,ClampToQuantum(QuantumScale*(double) + GetPixelAlpha(image,q)*(double) opacity),q); else if (opacity > 0) - SetPixelAlpha(image,ClampToQuantum((double) QuantumRange* - GetPixelAlpha(image,q)/(MagickRealType) opacity),q); + SetPixelAlpha(image,ClampToQuantum((double) QuantumRange*(double) + GetPixelAlpha(image,q)/(double) opacity),q); q+=GetPixelChannels(image); } if (SyncAuthenticPixels(image,exception) == MagickFalse) @@ -509,8 +510,10 @@ static MagickBooleanType ApplyPSDOpacityMask(Image *image,const Image *mask, intensity=GetPixelIntensity(complete_mask,p); if (revert == MagickFalse) SetPixelAlpha(image,ClampToQuantum(intensity*(QuantumScale*alpha)),q); - else if (intensity > 0) - SetPixelAlpha(image,ClampToQuantum((alpha/intensity)*QuantumRange),q); + else + if (intensity > 0) + SetPixelAlpha(image,ClampToQuantum((alpha/intensity)*(double) + QuantumRange),q); q+=GetPixelChannels(image); p+=GetPixelChannels(complete_mask); } @@ -1004,7 +1007,7 @@ static MagickBooleanType ReadPSDChannelPixels(Image *image,const ssize_t row, nibble; p=PushFloatPixel(MSBEndian,p,&nibble); - pixel=ClampToQuantum(((MagickRealType) QuantumRange)*nibble); + pixel=ClampToQuantum((double) QuantumRange*(double) nibble); } if (image->depth > 1) { @@ -1022,9 +1025,9 @@ static MagickBooleanType ReadPSDChannelPixels(Image *image,const ssize_t row, number_bits=8; for (bit = 0; bit < (ssize_t) number_bits; bit++) { - SetPSDPixel(image,channel,packet_size, - (((unsigned char)((ssize_t) pixel)) & (0x01 << (7-bit))) != 0 ? 0 : - QuantumRange,q,exception); + SetPSDPixel(image,channel,packet_size,(((unsigned char) + ((ssize_t) pixel)) & (0x01 << (7-bit))) != 0 ? 0 : + (double) QuantumRange,q,exception); q+=GetPixelChannels(image); x++; } @@ -2213,7 +2216,7 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image, for (i=0; i < number_layers; i++) { if ((layer_info[i].image == (Image *) NULL) || - (PSDSkipImage(psd_info, image_info,++index) != MagickFalse)) + (PSDSkipImage(psd_info, image_info,(size_t) ++index) != MagickFalse)) { for (j=0; j < (ssize_t) layer_info[i].channels; j++) { @@ -2316,7 +2319,8 @@ static MagickBooleanType ReadPSDMergedImage(const ImageInfo *image_info, } if (compression == RLE) - status=ReadPSDChannelRLE(image,channel,sizes+(i*image->rows),exception); + status=ReadPSDChannelRLE(image,channel,sizes+(i*(ssize_t) image->rows), + exception); else status=ReadPSDChannelRaw(image,channel,exception); @@ -2601,7 +2605,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Skip the rest of the layer and mask information. */ - (void) SeekBlob(image,offset+length,SEEK_SET); + (void) SeekBlob(image,offset+(MagickOffsetType) length,SEEK_SET); } /* If we are only "pinging" the image, then we're done - so return. @@ -2685,7 +2689,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) next=image; while (next != (Image *) NULL) { - if (PSDSkipImage(&psd_info,image_info,i++) == MagickFalse) + if (PSDSkipImage(&psd_info,image_info,(size_t) i++) == MagickFalse) { (void) SetImageProfile(next,GetStringInfoName(profile),profile, exception); @@ -2976,7 +2980,7 @@ static size_t WriteCompressionStart(const PSDInfo *psd_info,Image *image, length=(size_t) WriteBlobShort(image,RLE); for (i=0; i < channels; i++) for (y=0; y < (ssize_t) next_image->rows; y++) - length+=SetPSDOffset(psd_info,image,0); + length=(size_t) ((ssize_t) length+SetPSDOffset(psd_info,image,0)); } #ifdef MAGICKCORE_ZLIB_DELEGATE else if (compression == ZipCompression) @@ -2993,23 +2997,21 @@ static size_t WritePSDChannel(const PSDInfo *psd_info, MagickOffsetType size_offset,const MagickBooleanType separate, const CompressionType compression,ExceptionInfo *exception) { + const Quantum + *p; + MagickBooleanType monochrome; QuantumInfo *quantum_info; - const Quantum - *p; - - ssize_t - i; - size_t - count, length; ssize_t + count, + i, y; unsigned char @@ -3034,7 +3036,8 @@ static size_t WritePSDChannel(const PSDInfo *psd_info, if (separate != MagickFalse) { size_offset=TellBlob(image)+2; - count+=WriteCompressionStart(psd_info,image,next_image,compression,1); + count+=(ssize_t) WriteCompressionStart(psd_info,image,next_image, + compression,1); } if (next_image->depth > 8) next_image->depth=16; @@ -3115,7 +3118,7 @@ static size_t WritePSDChannel(const PSDInfo *psd_info, } #endif quantum_info=DestroyQuantumInfo(quantum_info); - return(count); + return((size_t) count); } static unsigned char *AcquireCompactPixels(const Image *image, @@ -3201,7 +3204,7 @@ static size_t WritePSDChannels(const PSDInfo *psd_info, if (separate != MagickFalse) size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2; else - rows_offset+=offset_length; + rows_offset+=(MagickOffsetType) offset_length; count+=length; } else @@ -3214,7 +3217,7 @@ static size_t WritePSDChannels(const PSDInfo *psd_info, if (separate != MagickFalse) size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2; else - rows_offset+=offset_length; + rows_offset+=(MagickOffsetType) offset_length; count+=length; } else @@ -3228,7 +3231,7 @@ static size_t WritePSDChannels(const PSDInfo *psd_info, if (separate != MagickFalse) size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2; else - rows_offset+=offset_length; + rows_offset+=(MagickOffsetType) offset_length; count+=length; length=WritePSDChannel(psd_info,image_info,image,next_image, @@ -3237,7 +3240,7 @@ static size_t WritePSDChannels(const PSDInfo *psd_info, if (separate != MagickFalse) size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2; else - rows_offset+=offset_length; + rows_offset+=(MagickOffsetType) offset_length; count+=length; length=WritePSDChannel(psd_info,image_info,image,next_image, @@ -3246,7 +3249,7 @@ static size_t WritePSDChannels(const PSDInfo *psd_info, if (separate != MagickFalse) size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2; else - rows_offset+=offset_length; + rows_offset+=(MagickOffsetType) offset_length; count+=length; if (next_image->colorspace == CMYKColorspace) @@ -3257,7 +3260,7 @@ static size_t WritePSDChannels(const PSDInfo *psd_info, if (separate != MagickFalse) size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2; else - rows_offset+=offset_length; + rows_offset+=(MagickOffsetType) offset_length; count+=length; } } @@ -3269,7 +3272,7 @@ static size_t WritePSDChannels(const PSDInfo *psd_info, if (separate != MagickFalse) size_offset+=WritePSDSize(psd_info,image,length,size_offset)+2; else - rows_offset+=offset_length; + rows_offset+=(MagickOffsetType) offset_length; count+=length; } } @@ -3310,10 +3313,10 @@ static size_t WritePSDChannels(const PSDInfo *psd_info, static size_t WritePascalString(Image *image,const char *value,size_t padding) { size_t - count, length; ssize_t + count, i; /* @@ -3330,10 +3333,10 @@ static size_t WritePascalString(Image *image,const char *value,size_t padding) } length++; if ((length % padding) == 0) - return(count); + return((size_t) count); for (i=0; i < (ssize_t) (padding-(length % padding)); i++) count+=WriteBlobByte(image,0); - return(count); + return((size_t) count); } static void WriteResolutionResourceBlock(Image *image) @@ -3372,12 +3375,12 @@ static void WriteResolutionResourceBlock(Image *image) static inline size_t WriteChannelSize(const PSDInfo *psd_info,Image *image, const signed short channel) { - size_t + ssize_t count; - count=(size_t) WriteBlobShort(image,(unsigned short) channel); + count=WriteBlobShort(image,(unsigned short) channel); count+=SetPSDSize(psd_info,image,0); - return(count); + return((size_t) count); } static void RemoveICCProfileFromResourceBlock(StringInfo *bim_profile) @@ -3424,8 +3427,10 @@ static void RemoveICCProfileFromResourceBlock(StringInfo *bim_profile) if ((quantum >= 12) && (quantum < (ssize_t) length)) { if ((q+quantum < (datum+length-16))) - (void) memmove(q,q+quantum,length-quantum-(q-datum)); - SetStringInfoLength(bim_profile,length-quantum); + (void) memmove(q,q+quantum,(size_t) ((ssize_t) length-quantum- + (q-datum))); + SetStringInfoLength(bim_profile,(size_t) ((ssize_t) length- + quantum)); } break; } @@ -3479,8 +3484,9 @@ static void RemoveResolutionFromResourceBlock(StringInfo *bim_profile) if ((id == 0x000003ed) && (cnt < (ssize_t) (length-12)) && ((ssize_t) length-(cnt+12)-(q-datum)) > 0) { - (void) memmove(q,q+cnt+12,length-(cnt+12)-(q-datum)); - SetStringInfoLength(bim_profile,length-(cnt+12)); + (void) memmove(q,q+cnt+12,(size_t) ((ssize_t) length-(cnt+12)- + (q-datum))); + SetStringInfoLength(bim_profile,(size_t) ((ssize_t) length-(cnt+12))); break; } p+=count; @@ -3639,9 +3645,9 @@ static MagickBooleanType WritePSDLayersInternal(Image *image, next_image=GetNextImageInList(next_image); } if (image->alpha_trait != UndefinedPixelTrait) - size+=WriteBlobShort(image,-(unsigned short) layer_count); + size+=(size_t) WriteBlobShort(image,-(unsigned short) layer_count); else - size+=WriteBlobShort(image,(unsigned short) layer_count); + size+=(size_t) WriteBlobShort(image,(unsigned short) layer_count); layer_size_offsets=(MagickOffsetType *) AcquireQuantumMemory( (size_t) layer_count,sizeof(MagickOffsetType)); if (layer_size_offsets == (MagickOffsetType *) NULL) @@ -3667,12 +3673,12 @@ static MagickBooleanType WritePSDLayersInternal(Image *image, mask=(Image *) GetImageRegistry(ImageRegistryType,property,exception); default_color=(unsigned char) (strlen(property) == 9 ? 255 : 0); } - size+=WriteBlobSignedLong(image,(signed int) next_image->page.y); - size+=WriteBlobSignedLong(image,(signed int) next_image->page.x); - size+=WriteBlobSignedLong(image,(signed int) (next_image->page.y+ - next_image->rows)); - size+=WriteBlobSignedLong(image,(signed int) (next_image->page.x+ - next_image->columns)); + size+=(size_t) WriteBlobSignedLong(image,(signed int) next_image->page.y); + size+=(size_t) WriteBlobSignedLong(image,(signed int) next_image->page.x); + size+=(size_t) WriteBlobSignedLong(image,(signed int) ((ssize_t) + next_image->page.y+(ssize_t) next_image->rows)); + size+=(size_t) WriteBlobSignedLong(image,(signed int) ((ssize_t) + next_image->page.x+(ssize_t) next_image->columns)); channels=1; if ((next_image->storage_class != PseudoClass) && (IsImageGray(next_image) == MagickFalse)) @@ -3683,16 +3689,18 @@ static MagickBooleanType WritePSDLayersInternal(Image *image, total_channels++; if (mask != (Image *) NULL) total_channels++; - size+=WriteBlobShort(image,total_channels); + size+=(size_t) WriteBlobShort(image,total_channels); layer_size_offsets[layer_index++]=TellBlob(image); for (i=0; i < (ssize_t) channels; i++) - size+=WriteChannelSize(psd_info,image,(signed short) i); + size+=(size_t) WriteChannelSize(psd_info,image,(signed short) i); if (next_image->alpha_trait != UndefinedPixelTrait) - size+=WriteChannelSize(psd_info,image,-1); + size+=(size_t) WriteChannelSize(psd_info,image,-1); if (mask != (Image *) NULL) - size+=WriteChannelSize(psd_info,image,-2); - size+=WriteBlobString(image,image->endian == LSBEndian ? "MIB8" :"8BIM"); - size+=WriteBlobString(image,CompositeOperatorToPSDBlendMode(next_image)); + size+=(size_t) WriteChannelSize(psd_info,image,-2); + size+=(size_t) WriteBlobString(image,image->endian == LSBEndian ? "MIB8" : + "8BIM"); + size+=(size_t) WriteBlobString(image, + CompositeOperatorToPSDBlendMode(next_image)); property=GetImageArtifact(next_image,"psd:layer.opacity"); if (property != (const char *) NULL) { @@ -3700,15 +3708,15 @@ static MagickBooleanType WritePSDLayersInternal(Image *image, opacity; opacity=(Quantum) StringToInteger(property); - size+=WriteBlobByte(image,ScaleQuantumToChar(opacity)); + size+=(size_t) WriteBlobByte(image,ScaleQuantumToChar(opacity)); (void) ApplyPSDLayerOpacity(next_image,opacity,MagickTrue,exception); } else - size+=WriteBlobByte(image,255); - size+=WriteBlobByte(image,0); - size+=WriteBlobByte(image,(unsigned char) (next_image->compose == + size+=(size_t) WriteBlobByte(image,255); + size+=(size_t) WriteBlobByte(image,0); + size+=(size_t) WriteBlobByte(image,(unsigned char) (next_image->compose == NoCompositeOp ? 1 << 0x02 : 1)); /* layer properties - visible, etc. */ - size+=WriteBlobByte(image,0); + size+=(size_t) WriteBlobByte(image,0); info=GetAdditionalInformation(image_info,next_image,exception); property=(const char *) GetImageProperty(next_image,"label",exception); if (property == (const char *) NULL) @@ -3725,9 +3733,9 @@ static MagickBooleanType WritePSDLayersInternal(Image *image, name_length+=8; if (mask != (Image *) NULL) name_length+=20; - size+=WriteBlobLong(image,(unsigned int) name_length); + size+=(size_t) WriteBlobLong(image,(unsigned int) name_length); if (mask == (Image *) NULL) - size+=WriteBlobLong(image,0); + size+=(size_t) WriteBlobLong(image,0); else { if (mask->compose != NoCompositeOp) @@ -3735,21 +3743,22 @@ static MagickBooleanType WritePSDLayersInternal(Image *image, default_color),MagickTrue,exception); mask->page.y+=image->page.y; mask->page.x+=image->page.x; - size+=WriteBlobLong(image,20); - size+=WriteBlobSignedLong(image,(signed int) mask->page.y); - size+=WriteBlobSignedLong(image,(signed int) mask->page.x); - size+=WriteBlobSignedLong(image,(signed int) (mask->rows+mask->page.y)); - size+=WriteBlobSignedLong(image,(signed int) (mask->columns+ - mask->page.x)); - size+=WriteBlobByte(image,default_color); - size+=WriteBlobByte(image,(unsigned char) (mask->compose == + size+=(size_t) WriteBlobLong(image,20); + size+=(size_t) WriteBlobSignedLong(image,(signed int) mask->page.y); + size+=(size_t) WriteBlobSignedLong(image,(signed int) mask->page.x); + size+=(size_t) WriteBlobSignedLong(image,(signed int) ((ssize_t) + mask->rows+mask->page.y)); + size+=(size_t) WriteBlobSignedLong(image,(signed int) ((ssize_t) + mask->columns+mask->page.x)); + size+=(size_t) WriteBlobByte(image,default_color); + size+=(size_t) WriteBlobByte(image,(unsigned char) (mask->compose == NoCompositeOp ? 2 : 0)); - size+=WriteBlobMSBShort(image,0); + size+=(size_t) WriteBlobMSBShort(image,0); } - size+=WriteBlobLong(image,0); + size+=(size_t) WriteBlobLong(image,0); size+=WritePascalString(image,property,4); if (info != (const StringInfo *) NULL) - size+=WriteBlob(image,GetStringInfoLength(info), + size+=(size_t) WriteBlob(image,GetStringInfoLength(info), GetStringInfoDatum(info)); next_image=GetNextImageInList(next_image); } @@ -3945,10 +3954,10 @@ static MagickBooleanType WritePSDImage(const ImageInfo *image_info, if (icc_profile != (StringInfo *) NULL) RemoveICCProfileFromResourceBlock(bim_profile); RemoveResolutionFromResourceBlock(bim_profile); - length+=PSDQuantum(GetStringInfoLength(bim_profile)); + length+=(size_t) PSDQuantum(GetStringInfoLength(bim_profile)); } if (icc_profile != (const StringInfo *) NULL) - length+=PSDQuantum(GetStringInfoLength(icc_profile))+12; + length+=(size_t) PSDQuantum(GetStringInfoLength(icc_profile))+12; if ((image->resolution.x > 0.0) && (image->resolution.y > 0.0)) length+=28; /* size of WriteResolutionResourceBlock */ (void) WriteBlobMSBLong(image,(unsigned int) length); diff --git a/ImageMagick-7.1.1-15/coders/psd.h b/ImageMagick-7.1.1-16/coders/psd.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/psd.h rename to ImageMagick-7.1.1-16/coders/psd.h diff --git a/ImageMagick-7.1.1-15/coders/pwp.c b/ImageMagick-7.1.1-16/coders/pwp.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/pwp.c rename to ImageMagick-7.1.1-16/coders/pwp.c diff --git a/ImageMagick-7.1.1-15/coders/pwp.h b/ImageMagick-7.1.1-16/coders/pwp.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/pwp.h rename to ImageMagick-7.1.1-16/coders/pwp.h diff --git a/ImageMagick-7.1.1-15/coders/qoi.c b/ImageMagick-7.1.1-16/coders/qoi.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/qoi.c rename to ImageMagick-7.1.1-16/coders/qoi.c index df47197c..a77d5494 100644 --- a/ImageMagick-7.1.1-15/coders/qoi.c +++ b/ImageMagick-7.1.1-16/coders/qoi.c @@ -17,7 +17,7 @@ % December 2021 % % % % % -% Copyright @ 2021 ImageMagick Studio LLC, a non-profit organization % +% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % @@ -431,28 +431,30 @@ ModuleExport void UnregisterQOIImage(void) static MagickBooleanType WriteQOIImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { - QuantumType - quantum_type; + const Quantum + *p; MagickBooleanType status; - const Quantum - *p; + qoi_rgba_t + px, + pp, + lut[64]; + + QuantumType + quantum_type; size_t channels, colorspace, end, - run, + run; + + ssize_t idx, i; - qoi_rgba_t - px, - pp, - lut[64]; - /* Open output image file. */ @@ -509,7 +511,7 @@ static MagickBooleanType WriteQOIImage(const ImageInfo *image_info,Image *image, Do the actual encoding. */ end=image->rows * image->columns; - for (i=0; i < end; i++) { + for (i=0; i < (ssize_t) end; i++) { pp=px; px.rgba.r=ScaleQuantumToChar(GetPixelRed(image,p)); px.rgba.g=ScaleQuantumToChar(GetPixelGreen(image,p)); diff --git a/ImageMagick-7.1.1-15/coders/qoi.h b/ImageMagick-7.1.1-16/coders/qoi.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/qoi.h rename to ImageMagick-7.1.1-16/coders/qoi.h diff --git a/ImageMagick-7.1.1-15/coders/raw.c b/ImageMagick-7.1.1-16/coders/raw.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/raw.c rename to ImageMagick-7.1.1-16/coders/raw.c diff --git a/ImageMagick-7.1.1-15/coders/raw.h b/ImageMagick-7.1.1-16/coders/raw.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/raw.h rename to ImageMagick-7.1.1-16/coders/raw.h diff --git a/ImageMagick-7.1.1-15/coders/rgb.c b/ImageMagick-7.1.1-16/coders/rgb.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/rgb.c rename to ImageMagick-7.1.1-16/coders/rgb.c diff --git a/ImageMagick-7.1.1-15/coders/rgb.h b/ImageMagick-7.1.1-16/coders/rgb.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/rgb.h rename to ImageMagick-7.1.1-16/coders/rgb.h diff --git a/ImageMagick-7.1.1-15/coders/rgf.c b/ImageMagick-7.1.1-16/coders/rgf.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/rgf.c rename to ImageMagick-7.1.1-16/coders/rgf.c index 592c3af9..1cda08b0 100644 --- a/ImageMagick-7.1.1-15/coders/rgf.c +++ b/ImageMagick-7.1.1-16/coders/rgf.c @@ -366,7 +366,7 @@ static MagickBooleanType WriteRGFImage(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) < ((double) QuantumRange/2.0)) byte|=0x80; bit++; if (bit == 8) diff --git a/ImageMagick-7.1.1-15/coders/rgf.h b/ImageMagick-7.1.1-16/coders/rgf.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/rgf.h rename to ImageMagick-7.1.1-16/coders/rgf.h diff --git a/ImageMagick-7.1.1-15/coders/rla.c b/ImageMagick-7.1.1-16/coders/rla.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/rla.c rename to ImageMagick-7.1.1-16/coders/rla.c index cf5ad423..82e21db0 100644 --- a/ImageMagick-7.1.1-15/coders/rla.c +++ b/ImageMagick-7.1.1-16/coders/rla.c @@ -295,7 +295,7 @@ static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception) */ for (y=0; y < (ssize_t) image->rows; y++) { - offset=SeekBlob(image,scanlines[image->rows-y-1],SEEK_SET); + offset=SeekBlob(image,scanlines[(ssize_t) image->rows-y-1],SEEK_SET); if (offset < 0) { scanlines=(MagickOffsetType *) RelinquishMagickMemory(scanlines); @@ -318,7 +318,7 @@ static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception) { while (runlength < 0) { - q=GetAuthenticPixels(image,(ssize_t) (x % image->columns),y,1,1, + q=GetAuthenticPixels(image,x % (ssize_t) image->columns,y,1,1, exception); if (q == (Quantum *) NULL) break; @@ -360,7 +360,7 @@ static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception) runlength++; do { - q=GetAuthenticPixels(image,(ssize_t) (x % image->columns),y,1,1, + q=GetAuthenticPixels(image,x % (ssize_t) image->columns,y,1,1, exception); if (q == (Quantum *) NULL) break; diff --git a/ImageMagick-7.1.1-15/coders/rla.h b/ImageMagick-7.1.1-16/coders/rla.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/rla.h rename to ImageMagick-7.1.1-16/coders/rla.h diff --git a/ImageMagick-7.1.1-15/coders/rle.c b/ImageMagick-7.1.1-16/coders/rle.c similarity index 97% rename from ImageMagick-7.1.1-15/coders/rle.c rename to ImageMagick-7.1.1-16/coders/rle.c index bb896516..1866088d 100644 --- a/ImageMagick-7.1.1-15/coders/rle.c +++ b/ImageMagick-7.1.1-16/coders/rle.c @@ -149,11 +149,11 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) int opcode, - operand, - status; + operand; MagickStatusType - flags; + flags, + status; MagickSizeType number_pixels; @@ -162,20 +162,9 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) *pixel_info; Quantum - index; - - ssize_t - x; - - Quantum + index, *q; - ssize_t - i; - - unsigned char - *p; - size_t bits_per_pixel, map_length, @@ -187,12 +176,15 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) ssize_t count, + i, offset, + x, y; unsigned char background_color[256] = { 0 }, *colormap, + *p, pixel, plane, *pixels; @@ -449,11 +441,12 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) if (operand == EOF) ThrowRLEException(CorruptImageError,"UnexpectedEndOfFile"); } - offset=(ssize_t) (((image->rows-y-1)*image->columns*number_planes)+x* + offset=(ssize_t) ((((ssize_t) image->rows-y-1)*(ssize_t) + image->columns*(ssize_t) number_planes)+x*(ssize_t) number_planes+plane); operand++; if ((offset < 0) || - ((size_t) (offset+operand*number_planes) > pixel_info_length)) + ((size_t) (offset+operand*(ssize_t) number_planes) > pixel_info_length)) ThrowRLEException(CorruptImageError,"UnableToReadImageData"); p=pixels+offset; for (i=0; i < (ssize_t) operand; i++) @@ -482,11 +475,11 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) } pixel=(unsigned char) ReadBlobByte(image); (void) ReadBlobByte(image); - offset=(ssize_t) (((image->rows-y-1)*image->columns*number_planes)+x* - number_planes+plane); + offset=(((ssize_t) image->rows-y-1)*(ssize_t) image->columns* + (ssize_t) number_planes)+x*(ssize_t) number_planes+plane; operand++; if ((offset < 0) || - ((size_t) (offset+operand*number_planes) > pixel_info_length)) + ((size_t) (offset+operand*(ssize_t) number_planes) > pixel_info_length)) ThrowRLEException(CorruptImageError,"UnableToReadImageData"); p=pixels+offset; for (i=0; i < (ssize_t) operand; i++) @@ -529,8 +522,8 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) for (i=0; i < (ssize_t) number_pixels; i++) for (x=0; x < (ssize_t) number_planes; x++) { - ValidateColormapValue(image,(ssize_t) (x*map_length+ - (*p & mask)),&index,exception); + ValidateColormapValue(image,x*(ssize_t) map_length+ + (*p & mask),&index,exception); *p=colormap[(ssize_t) index]; p++; } diff --git a/ImageMagick-7.1.1-15/coders/rle.h b/ImageMagick-7.1.1-16/coders/rle.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/rle.h rename to ImageMagick-7.1.1-16/coders/rle.h diff --git a/ImageMagick-7.1.1-15/coders/scr.c b/ImageMagick-7.1.1-16/coders/scr.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/scr.c rename to ImageMagick-7.1.1-16/coders/scr.c diff --git a/ImageMagick-7.1.1-15/coders/scr.h b/ImageMagick-7.1.1-16/coders/scr.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/scr.h rename to ImageMagick-7.1.1-16/coders/scr.h diff --git a/ImageMagick-7.1.1-15/coders/screenshot.c b/ImageMagick-7.1.1-16/coders/screenshot.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/screenshot.c rename to ImageMagick-7.1.1-16/coders/screenshot.c diff --git a/ImageMagick-7.1.1-15/coders/screenshot.h b/ImageMagick-7.1.1-16/coders/screenshot.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/screenshot.h rename to ImageMagick-7.1.1-16/coders/screenshot.h diff --git a/ImageMagick-7.1.1-15/coders/sct.c b/ImageMagick-7.1.1-16/coders/sct.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/sct.c rename to ImageMagick-7.1.1-16/coders/sct.c index c3c94188..e447a1b2 100644 --- a/ImageMagick-7.1.1-15/coders/sct.c +++ b/ImageMagick-7.1.1-16/coders/sct.c @@ -124,41 +124,37 @@ static Image *ReadSCTImage(const ImageInfo *image_info,ExceptionInfo *exception) char magick[2]; - Image - *image; - - MagickBooleanType - status; - double height, width; + Image + *image; + int c; - Quantum - pixel; - - ssize_t - i, - x; + MagickBooleanType + status; Quantum + pixel, *q; + size_t + separations, + separations_mask, + units; + ssize_t count, + i, + x, y; unsigned char buffer[768]; - size_t - separations, - separations_mask, - units; - /* Open image file. */ @@ -200,10 +196,10 @@ static Image *ReadSCTImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Read parameter block. */ - units=1UL*ReadBlobByte(image); + units=(size_t) ReadBlobByte(image); if (units == 0) image->units=PixelsPerCentimeterResolution; - separations=1UL*ReadBlobByte(image); + separations=(size_t) ReadBlobByte(image); separations_mask=ReadBlobMSBShort(image); count=ReadBlob(image,14,buffer); buffer[14]='\0'; diff --git a/ImageMagick-7.1.1-15/coders/sct.h b/ImageMagick-7.1.1-16/coders/sct.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/sct.h rename to ImageMagick-7.1.1-16/coders/sct.h diff --git a/ImageMagick-7.1.1-15/coders/sfw.c b/ImageMagick-7.1.1-16/coders/sfw.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/sfw.c rename to ImageMagick-7.1.1-16/coders/sfw.c diff --git a/ImageMagick-7.1.1-15/coders/sfw.h b/ImageMagick-7.1.1-16/coders/sfw.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/sfw.h rename to ImageMagick-7.1.1-16/coders/sfw.h diff --git a/ImageMagick-7.1.1-15/coders/sgi.c b/ImageMagick-7.1.1-16/coders/sgi.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/sgi.c rename to ImageMagick-7.1.1-16/coders/sgi.c index f61af429..226034ef 100644 --- a/ImageMagick-7.1.1-15/coders/sgi.c +++ b/ImageMagick-7.1.1-16/coders/sgi.c @@ -413,7 +413,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) } for (z=0; z < (ssize_t) iris_info.depth; z++) { - p=pixels+bytes_per_pixel*z; + p=pixels+(ssize_t) bytes_per_pixel*z; for (y=0; y < (ssize_t) iris_info.rows; y++) { count=ReadBlob(image,bytes_per_pixel*iris_info.columns,scanline); @@ -523,7 +523,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) offset+=(ssize_t) runlength[y+z*iris_info.rows]; status=SGIDecode(bytes_per_pixel,(ssize_t) (runlength[y+z*iris_info.rows]/bytes_per_pixel),packets, - (ssize_t) iris_info.columns,p+bytes_per_pixel*z); + (ssize_t) iris_info.columns,p+(ssize_t) bytes_per_pixel*z); if (status == MagickFalse) { packet_info=RelinquishVirtualMemory(packet_info); @@ -563,7 +563,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) offset+=(ssize_t) runlength[y+z*iris_info.rows]; status=SGIDecode(bytes_per_pixel,(ssize_t) (runlength[y+z*iris_info.rows]/bytes_per_pixel),packets, - (ssize_t) iris_info.columns,p+bytes_per_pixel*z); + (ssize_t) iris_info.columns,p+(ssize_t) bytes_per_pixel*z); if (status == MagickFalse) { packet_info=RelinquishVirtualMemory(packet_info); @@ -596,7 +596,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) { for (y=0; y < (ssize_t) image->rows; y++) { - p=pixels+(image->rows-y-1)*8*image->columns; + p=pixels+((ssize_t) image->rows-y-1)*8*(ssize_t) image->columns; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -629,7 +629,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) else for (y=0; y < (ssize_t) image->rows; y++) { - p=pixels+(image->rows-y-1)*4*image->columns; + p=pixels+((ssize_t) image->rows-y-1)*4*(ssize_t) image->columns; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -672,13 +672,13 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) { for (y=0; y < (ssize_t) image->rows; y++) { - p=pixels+(image->rows-y-1)*8*image->columns; + p=pixels+((ssize_t) image->rows-y-1)*8*(ssize_t) image->columns; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { - quantum=(*p << 8); + quantum=(size_t) (*p << 8); quantum|=(*(p+1)); SetPixelIndex(image,(Quantum) quantum,q); p+=8; @@ -698,7 +698,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) else for (y=0; y < (ssize_t) image->rows; y++) { - p=pixels+(image->rows-y-1)*4*image->columns; + p=pixels+((ssize_t) image->rows-y-1)*4*(ssize_t) image->columns; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -875,7 +875,7 @@ static size_t SGIEncode(unsigned char *pixels,size_t length, while (length != 0) { runlength=(short) (length > 126 ? 126 : length); - length-=runlength; + length-=(size_t) runlength; *q++=(unsigned char) (0x80 | runlength); for ( ; runlength > 0; runlength--) { @@ -891,7 +891,7 @@ static size_t SGIEncode(unsigned char *pixels,size_t length, while (length != 0) { runlength=(short) (length > 126 ? 126 : length); - length-=runlength; + length-=(size_t) runlength; *q++=(unsigned char) runlength; *q++=(*mark); } diff --git a/ImageMagick-7.1.1-15/coders/sgi.h b/ImageMagick-7.1.1-16/coders/sgi.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/sgi.h rename to ImageMagick-7.1.1-16/coders/sgi.h diff --git a/ImageMagick-7.1.1-15/coders/sixel.c b/ImageMagick-7.1.1-16/coders/sixel.c similarity index 94% rename from ImageMagick-7.1.1-15/coders/sixel.c rename to ImageMagick-7.1.1-16/coders/sixel.c index eefae05d..5551af62 100644 --- a/ImageMagick-7.1.1-15/coders/sixel.c +++ b/ImageMagick-7.1.1-16/coders/sixel.c @@ -18,7 +18,7 @@ % Based on kmiya's sixel (2014-03-28) % % % % % -% Copyright @ 2014 ImageMagick Studio LLC, a non-profit organization % +% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % @@ -290,9 +290,9 @@ static MagickBooleanType sixel_decode(Image *image,unsigned char *p, memset(param,0,sizeof(param)); imsx=2048; imsy=2048; - if (SetImageExtent(image,imsx,imsy,exception) == MagickFalse) + if (SetImageExtent(image,(size_t) imsx,(size_t) imsy,exception) == MagickFalse) return(MagickFalse); - imbuf=(sixel_pixel_t *) AcquireQuantumMemory(imsx,imsy*sizeof(sixel_pixel_t)); + imbuf=(sixel_pixel_t *) AcquireQuantumMemory((size_t) imsx,(size_t) imsy*sizeof(sixel_pixel_t)); if (imbuf == (sixel_pixel_t *) NULL) return(MagickFalse); for (n = 0; n < 16; n++) @@ -396,19 +396,19 @@ static MagickBooleanType sixel_decode(Image *image,unsigned char *p, { dmsx=imsx > attributed_ph ? imsx : attributed_ph; dmsy=imsy > attributed_pv ? imsy : attributed_pv; - if (SetImageExtent(image,dmsx,dmsy,exception) == MagickFalse) + if (SetImageExtent(image,(size_t) dmsx,(size_t) dmsy,exception) == MagickFalse) break; - dmbuf=(sixel_pixel_t *) AcquireQuantumMemory(dmsx,dmsy* - sizeof(sixel_pixel_t)); + dmbuf=(sixel_pixel_t *) AcquireQuantumMemory((size_t) dmsx,(size_t) + dmsy*sizeof(sixel_pixel_t)); if (dmbuf == (sixel_pixel_t *) NULL) { imbuf=(sixel_pixel_t *) RelinquishMagickMemory(imbuf); return(MagickFalse); } - (void) memset(dmbuf,background_color_index,(size_t) dmsx*dmsy* - sizeof(sixel_pixel_t)); + (void) memset(dmbuf,background_color_index,(size_t) dmsx*(size_t) + dmsy*sizeof(sixel_pixel_t)); for (y = 0; y < imsy; ++y) - (void) memcpy(dmbuf+dmsx*y,imbuf+imsx*y,imsx* + (void) memcpy(dmbuf+dmsx*y,imbuf+imsx*y,(size_t) imsx* sizeof(sixel_pixel_t)); imbuf=(sixel_pixel_t *) RelinquishMagickMemory(imbuf); imsx=dmsx; @@ -501,19 +501,19 @@ static MagickBooleanType sixel_decode(Image *image,unsigned char *p, dmsx=nx; dmsy=ny; - if (SetImageExtent(image,dmsx,dmsy,exception) == MagickFalse) + if (SetImageExtent(image,(size_t) dmsx,(size_t) dmsy,exception) == MagickFalse) break; - dmbuf=(sixel_pixel_t *) AcquireQuantumMemory(dmsx,dmsy* - sizeof(sixel_pixel_t)); + dmbuf=(sixel_pixel_t *) AcquireQuantumMemory((size_t) dmsx,(size_t) + dmsy*sizeof(sixel_pixel_t)); if (dmbuf == (sixel_pixel_t *) NULL) { imbuf=(sixel_pixel_t *) RelinquishMagickMemory(imbuf); return(MagickFalse); } - (void) memset(dmbuf,background_color_index,(size_t) dmsx*dmsy* - sizeof(sixel_pixel_t)); + (void) memset(dmbuf,background_color_index,(size_t) dmsx*(size_t) + dmsy*sizeof(sixel_pixel_t)); for (y = 0; y < imsy; ++y) - (void) memcpy(dmbuf+dmsx*y,imbuf+imsx*y,imsx* + (void) memcpy(dmbuf+dmsx*y,imbuf+imsx*y,(size_t) imsx* sizeof(sixel_pixel_t)); imbuf = (sixel_pixel_t *) RelinquishMagickMemory(imbuf); imsx=dmsx; @@ -533,8 +533,9 @@ static MagickBooleanType sixel_decode(Image *image,unsigned char *p, { if ((b & sixel_vertical_mask) != 0) { - offset=(size_t) imsx*(position_y+i)+position_x; - if (offset >= (size_t) imsx * imsy) + offset=(size_t) (imsx*((ssize_t) position_y+i)+ + (ssize_t) position_x); + if (offset >= (size_t) (imsx*imsy)) { imbuf=(sixel_pixel_t *) RelinquishMagickMemory(imbuf); return(MagickFalse); @@ -564,14 +565,14 @@ static MagickBooleanType sixel_decode(Image *image,unsigned char *p, } for (y = position_y + i; y < position_y + i + n; ++y) { - offset=(size_t) imsx*y+position_x; - if (offset+repeat_count >= (size_t) imsx*imsy) + offset=(size_t) ((ssize_t) imsx*y+(ssize_t) position_x); + if ((offset+(size_t) repeat_count) >= (size_t) (imsx*imsy)) { imbuf=(sixel_pixel_t *) RelinquishMagickMemory(imbuf); return(MagickFalse); } for (x = 0; x < repeat_count; x++) - imbuf[offset+x] = color_index; + imbuf[(int) offset+x] = color_index; } if (max_x < (position_x+repeat_count-1)) max_x = position_x+repeat_count-1; @@ -598,12 +599,12 @@ static MagickBooleanType sixel_decode(Image *image,unsigned char *p, { dmsx=max_x; dmsy=max_y; - if (SetImageExtent(image,dmsx,dmsy,exception) == MagickFalse) + if (SetImageExtent(image,(size_t) dmsx,(size_t) dmsy,exception) == MagickFalse) { imbuf=(sixel_pixel_t *) RelinquishMagickMemory(imbuf); return(MagickFalse); } - dmbuf=(sixel_pixel_t *) AcquireQuantumMemory(dmsx,dmsy* + dmbuf=(sixel_pixel_t *) AcquireQuantumMemory((size_t) dmsx,(size_t) dmsy* sizeof(sixel_pixel_t)); if (dmbuf == (sixel_pixel_t *) NULL) { @@ -611,7 +612,8 @@ static MagickBooleanType sixel_decode(Image *image,unsigned char *p, return(MagickFalse); } for (y=0; y < dmsy; ++y) - (void) memcpy(dmbuf+dmsx*y,imbuf+imsx*y,dmsx*sizeof(sixel_pixel_t)); + (void) memcpy(dmbuf+dmsx*y,imbuf+imsx*y,(size_t) dmsx* + sizeof(sixel_pixel_t)); imbuf=(sixel_pixel_t *) RelinquishMagickMemory(imbuf); imsx=dmsx; imsy=dmsy; @@ -619,8 +621,8 @@ static MagickBooleanType sixel_decode(Image *image,unsigned char *p, } *pixels=imbuf; - *pwidth=imsx; - *pheight=imsy; + *pwidth=(size_t) imsx; + *pheight=(size_t) imsy; *ncolors=(size_t) max_color_index+1; *palette=(unsigned char *) AcquireQuantumMemory(*ncolors,4); if (*palette == (unsigned char *) NULL) @@ -660,7 +662,7 @@ static void sixel_advance(sixel_output_t *context, int nwrite) { WriteBlob(context->image,SIXEL_OUTPUT_PACKET_SIZE,context->buffer); memmove(context->buffer, - context->buffer + SIXEL_OUTPUT_PACKET_SIZE, + context->buffer + SIXEL_OUTPUT_PACKET_SIZE,(size_t) (context->pos -= SIXEL_OUTPUT_PACKET_SIZE)); } } @@ -685,7 +687,7 @@ static int sixel_put_flash(sixel_output_t *const context) { for (n = 0; n < context->save_count; n++) { - context->buffer[context->pos]=(char)context->save_pixel; + context->buffer[context->pos]=(unsigned char)context->save_pixel; sixel_advance(context,1); } } @@ -840,9 +842,9 @@ static MagickBooleanType sixel_encode_impl(sixel_pixel_t *pixels,size_t width, { for (x=0; x < (int) width; x++) { - pix=pixels[y*width+x]; + pix=pixels[y*(ssize_t) width+x]; if ((pix >= 0) && (pix < (int) ncolors) && (pix != keycolor)) - map[pix*width+x]|=(1 << i); + map[pix*(ssize_t) width+x]|=(1 << i); } if (++i < 6 && (y + 1) < (int) height) continue; @@ -850,15 +852,15 @@ static MagickBooleanType sixel_encode_impl(sixel_pixel_t *pixels,size_t width, { for (left=0; left < (int) width; left++) { - if (*(map+c*width+left) == 0) + if (*(map+c*(ssize_t) width+left) == 0) continue; for (right=left+1; right < (int) width; right++) { - if (*(map+c*width+right) != 0) + if (*(map+c*(ssize_t) width+right) != 0) continue; for (n = 1; (right+n) < (int) width; n++) { - if (*(map+c*width+right+n) != 0) + if (*(map+c*(ssize_t) width+right+n) != 0) break; } if ((n >= 10) || (right+n >= (int) width)) @@ -878,7 +880,7 @@ static MagickBooleanType sixel_encode_impl(sixel_pixel_t *pixels,size_t width, np->color=c; np->left=left; np->right=right; - np->map=map+c*width; + np->map=map+c*(ssize_t) width; top.next=context->node_top; tp=⊤ while (tp->next != (struct sixel_node *) NULL) @@ -948,7 +950,7 @@ static MagickBooleanType sixel_encode_impl(sixel_pixel_t *pixels,size_t width, } /* flush buffer */ if (context->pos > 0) - WriteBlob(context->image,context->pos,context->buffer); + WriteBlob(context->image,(size_t) context->pos,context->buffer); RelinquishNodesAndMap; return(MagickTrue); } @@ -1157,7 +1159,7 @@ static Image *ReadSIXELImage(const ImageInfo *image_info, break; for (x=0; x < (ssize_t) image->columns; x++) { - j=(ssize_t) sixel_pixels[y*image->columns+x]; + j=(ssize_t) sixel_pixels[y*(ssize_t) image->columns+x]; j=ConstrainColormapIndex(image,j,exception); SetPixelIndex(image,j,q); SetPixelRed(image,image->colormap[j].red,q); @@ -1338,7 +1340,7 @@ static MagickBooleanType WriteSIXELImage(const ImageInfo *image_info, (image->colors > SIXEL_PALETTE_MAX)) (void) SetImageType(image,PaletteBilevelAlphaType,exception); for (i=0; i < (ssize_t) image->colors; i++) - if (image->colormap[i].alpha != OpaqueAlpha) + if (image->colormap[i].alpha != (double) OpaqueAlpha) { if (opacity < 0) { @@ -1354,7 +1356,7 @@ static MagickBooleanType WriteSIXELImage(const ImageInfo *image_info, { (void) SetImageType(image,PaletteBilevelAlphaType,exception); for (i=0; i < (ssize_t) image->colors; i++) - if (image->colormap[i].alpha != OpaqueAlpha) + if (image->colormap[i].alpha != (double) OpaqueAlpha) { if (opacity < 0) { @@ -1403,7 +1405,8 @@ static MagickBooleanType WriteSIXELImage(const ImageInfo *image_info, break; for (x=0; x < (ssize_t) image->columns; x++) { - sixel_pixels[y*image->columns+x]=((ssize_t) GetPixelIndex(image,q)); + sixel_pixels[y*(ssize_t) image->columns+x]=((ssize_t) + GetPixelIndex(image,q)); q+=GetPixelChannels(image); } } diff --git a/ImageMagick-7.1.1-15/coders/sixel.h b/ImageMagick-7.1.1-16/coders/sixel.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/sixel.h rename to ImageMagick-7.1.1-16/coders/sixel.h diff --git a/ImageMagick-7.1.1-15/coders/stegano.c b/ImageMagick-7.1.1-16/coders/stegano.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/stegano.c rename to ImageMagick-7.1.1-16/coders/stegano.c diff --git a/ImageMagick-7.1.1-15/coders/stegano.h b/ImageMagick-7.1.1-16/coders/stegano.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/stegano.h rename to ImageMagick-7.1.1-16/coders/stegano.h diff --git a/ImageMagick-7.1.1-15/coders/strimg.c b/ImageMagick-7.1.1-16/coders/strimg.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/strimg.c rename to ImageMagick-7.1.1-16/coders/strimg.c diff --git a/ImageMagick-7.1.1-15/coders/strimg.h b/ImageMagick-7.1.1-16/coders/strimg.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/strimg.h rename to ImageMagick-7.1.1-16/coders/strimg.h diff --git a/ImageMagick-7.1.1-15/coders/sun.c b/ImageMagick-7.1.1-16/coders/sun.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/sun.c rename to ImageMagick-7.1.1-16/coders/sun.c index c44d92a7..c44dee3e 100644 --- a/ImageMagick-7.1.1-15/coders/sun.c +++ b/ImageMagick-7.1.1-16/coders/sun.c @@ -964,7 +964,7 @@ static MagickBooleanType WriteSUNImage(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) < ((double) QuantumRange/2.0)) byte|=0x01; bit++; if (bit == 8) diff --git a/ImageMagick-7.1.1-15/coders/sun.h b/ImageMagick-7.1.1-16/coders/sun.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/sun.h rename to ImageMagick-7.1.1-16/coders/sun.h diff --git a/ImageMagick-7.1.1-15/coders/svg.c b/ImageMagick-7.1.1-16/coders/svg.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/svg.c rename to ImageMagick-7.1.1-16/coders/svg.c index abbe9b99..6b581f75 100644 --- a/ImageMagick-7.1.1-15/coders/svg.c +++ b/ImageMagick-7.1.1-16/coders/svg.c @@ -299,7 +299,8 @@ static Image *RenderSVGImage(const ImageInfo *image_info,Image *image, delegate_info=GetDelegateInfo("svg:decode",(char *) NULL,exception); if (delegate_info == (const DelegateInfo *) NULL) return((Image *) NULL); - status=AcquireUniqueSymbolicLink(image->filename,input_filename); + status=AcquireUniqueSymbolicLink(image->filename,input_filename) == + MagickFalse ? 0 : 1; (void) AcquireUniqueFilename(unique); (void) FormatLocaleString(output_filename,MagickPathExtent,"%s.png",unique); (void) AcquireUniqueFilename(unique); @@ -440,7 +441,7 @@ static Image *RenderRSVGImage(const ImageInfo *image_info,Image *image, { buffer[n]='\0'; error=(GError *) NULL; - (void) rsvg_handle_write(svg_handle,buffer,n,&error); + (void) rsvg_handle_write(svg_handle,buffer,(gsize) n,&error); if (error != (GError *) NULL) g_error_free(error); } @@ -500,8 +501,8 @@ static Image *RenderRSVGImage(const ImageInfo *image_info,Image *image, } else { - image->columns=dimension_info.width; - image->rows=dimension_info.height; + image->columns=(size_t) dimension_info.width; + image->rows=(size_t) dimension_info.height; } pixel_info=(MemoryInfo *) NULL; #else @@ -1574,8 +1575,8 @@ static void SVGStartElement(void *context,const xmlChar *name, name); svg_info=(SVGInfo *) context; svg_info->n++; - svg_info->scale=(double *) ResizeQuantumMemory(svg_info->scale, - svg_info->n+1UL,sizeof(*svg_info->scale)); + svg_info->scale=(double *) ResizeQuantumMemory(svg_info->scale,(size_t) + svg_info->n+1,sizeof(*svg_info->scale)); if (svg_info->scale == (double *) NULL) { (void) ThrowMagickException(svg_info->exception,GetMagickModule(), @@ -3218,12 +3219,12 @@ static void SVGCharacters(void *context,const xmlChar *c,int length) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " SAX.characters(%s,%.20g)",c,(double) length); svg_info=(SVGInfo *) context; - text=(char *) AcquireQuantumMemory(length+1,sizeof(*text)); + text=(char *) AcquireQuantumMemory((size_t) length+1,sizeof(*text)); if (text == (char *) NULL) return; p=text; for (i=0; i < (ssize_t) length; i++) - *p++=c[i]; + *p++=(char) c[i]; *p='\0'; SVGStripString(MagickFalse,text); if (svg_info->text == (char *) NULL) @@ -5183,9 +5184,9 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image, for (p=token; *p != '\0'; p++) if (isalpha((int) ((unsigned char) *p)) != 0) number_attributes++; - if (i > (ssize_t) (number_points-6*BezierQuantum*number_attributes-1)) + if (i > ((ssize_t) number_points-6*BezierQuantum*number_attributes-1)) { - number_points+=6*BezierQuantum*number_attributes; + number_points+=(size_t) (6*BezierQuantum*number_attributes); primitive_info=(PrimitiveInfo *) ResizeQuantumMemory(primitive_info, number_points,sizeof(*primitive_info)); if (primitive_info == (PrimitiveInfo *) NULL) diff --git a/ImageMagick-7.1.1-15/coders/svg.h b/ImageMagick-7.1.1-16/coders/svg.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/svg.h rename to ImageMagick-7.1.1-16/coders/svg.h diff --git a/ImageMagick-7.1.1-15/coders/tga.c b/ImageMagick-7.1.1-16/coders/tga.c similarity index 91% rename from ImageMagick-7.1.1-15/coders/tga.c rename to ImageMagick-7.1.1-16/coders/tga.c index 0884729c..57e58dc9 100644 --- a/ImageMagick-7.1.1-15/coders/tga.c +++ b/ImageMagick-7.1.1-16/coders/tga.c @@ -109,24 +109,6 @@ typedef struct _TGAInfo unsigned char bits_per_pixel, attributes; - - unsigned long - extension, - developer; - - char - signature[18]; - - unsigned short - size; - - char - author[42], - comment[325], - software[42]; - - unsigned char - attributes_type; } TGAInfo; /* @@ -461,9 +443,9 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception) offset_stepsize=2; for (y=0; y < (ssize_t) image->rows; y++) { - size_t - y_offset = (size_t) (flip_y == MagickFalse) ? (size_t) offset : - image->rows-1-offset; + ssize_t + y_offset=(flip_y == MagickFalse) ? offset : (ssize_t) image->rows- + 1-offset; q=QueueAuthenticPixels(image,0,y_offset,image->columns,1,exception); if (q == (Quantum *) NULL) @@ -610,7 +592,7 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception) if (offset >= (ssize_t) image->rows) { base++; - offset=base; + offset=(ssize_t) base; } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; @@ -630,39 +612,40 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Optional header. */ - tga_info.extension=(unsigned long) ReadBlobLSBLong(image); - tga_info.developer=(unsigned long) ReadBlobLSBLong(image); - count=ReadBlob(image,18,&tga_info.signature); - if ((count == 18) && - (LocaleCompare(tga_info.signature,"TRUEVISION-XFILE.") == 0) && - (tga_info.extension > 3) && - (SeekBlob(image,tga_info.extension,SEEK_SET) == (MagickOffsetType) tga_info.extension)) + char + signature[18]; + + unsigned long + extension; + + extension=(unsigned long) ReadBlobLSBLong(image); + (void) ReadBlobLSBLong(image); + count=ReadBlob(image,18,signature); + if ((count == 18) && (extension > 3) && + (LocaleCompare(signature,"TRUEVISION-XFILE.") == 0) && + (SeekBlob(image,(MagickOffsetType) extension,SEEK_SET) == (MagickOffsetType) extension) && + (ReadBlobLSBShort(image) == 495)) { - tga_info.size=(unsigned long) ReadBlobLSBShort(image); - if (tga_info.size == 495) - { - /* - Optional extension. - */ - count=ReadBlob(image,41,&tga_info.author); - tga_info.author[41]='\0'; - (void) SetImageProperty(image,"tga:author",tga_info.author, - exception); - count=ReadBlob(image,324,&tga_info.comment); - tga_info.comment[324]='\0'; - (void) SetImageProperty(image,"tga:comment",tga_info.comment, - exception); - (void) DiscardBlobBytes(image,59); - count=ReadBlob(image,41,&tga_info.software); - tga_info.comment[41]='\0'; - (void) SetImageProperty(image,"tga:software",tga_info.software, - exception); - (void) DiscardBlobBytes(image,27); - tga_info.attributes_type=(unsigned char) ReadBlobByte(image); - if (((image->alpha_trait & BlendPixelTrait) != 0) && - (tga_info.attributes_type != 3)) - image->alpha_trait=UndefinedPixelTrait; - } + /* + Optional extension. + */ + char + buffer[325]; + + (void) ReadBlob(image,41,buffer); + buffer[41]='\0'; + (void) SetImageProperty(image,"tga:author",buffer,exception); + (void) ReadBlob(image,324,buffer); + buffer[324]='\0'; + (void) SetImageProperty(image,"tga:comment",buffer,exception); + (void) DiscardBlobBytes(image,59); + (void) ReadBlob(image,41,buffer); + buffer[41]='\0'; + (void) SetImageProperty(image,"tga:software",buffer,exception); + (void) DiscardBlobBytes(image,27); + if (((image->alpha_trait & BlendPixelTrait) != 0) && + (ReadBlobByte(image) != 3)) + image->alpha_trait=UndefinedPixelTrait; } } (void) CloseBlob(image); @@ -781,7 +764,8 @@ static inline void WriteTGAPixel(Image *image,TGAImageType image_type, const Quantum *p,const QuantumAny range,const double midpoint) { if (image_type == TGAColormap || image_type == TGARLEColormap) - (void) WriteBlobByte(image,(unsigned char) ((ssize_t) GetPixelIndex(image,p))); + (void) WriteBlobByte(image,(unsigned char) ((ssize_t) + GetPixelIndex(image,p))); else { if (image_type == TGAMonochrome || image_type == TGARLEMonochrome) @@ -827,10 +811,11 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image, compression; const char - *comment; + *comment, + *option; const double - midpoint = QuantumRange/2.0; + midpoint = (double) QuantumRange/2.0; const Quantum *p; @@ -938,6 +923,8 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image, tga_info.colormap_length=(unsigned short) image->colors; if (image_info->depth == 5) tga_info.colormap_size=16; + else if (image->alpha_trait != UndefinedPixelTrait) + tga_info.colormap_size=32; else tga_info.colormap_size=24; } @@ -1000,6 +987,8 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image, *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].blue)); *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].green)); *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].red)); + if (image->alpha_trait != UndefinedPixelTrait) + *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].alpha)); } } (void) WriteBlob(image,(size_t) ((tga_info.colormap_size/8)* @@ -1029,29 +1018,29 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image, { if (tga_info.image_type == TGARLEColormap) { - if (GetPixelIndex(image,p+(i*channels)) != - GetPixelIndex(image,p+((i-1)*channels))) + if (GetPixelIndex(image,p+(i*(ssize_t) channels)) != + GetPixelIndex(image,p+((i-1)*(ssize_t) channels))) break; } else if (tga_info.image_type == TGARLEMonochrome) { - if (GetPixelLuma(image,p+(i*channels)) != - GetPixelLuma(image,p+((i-1)*channels))) + if (GetPixelLuma(image,p+(i*(ssize_t) channels)) != + GetPixelLuma(image,p+((i-1)*(ssize_t) 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)))) + if ((GetPixelBlue(image,p+(i*(ssize_t) channels)) != + GetPixelBlue(image,p+((i-1)*(ssize_t) channels))) || + (GetPixelGreen(image,p+(i*(ssize_t) channels)) != + GetPixelGreen(image,p+((i-1)*(ssize_t) channels))) || + (GetPixelRed(image,p+(i*(ssize_t) channels)) != + GetPixelRed(image,p+((i-1)*(ssize_t) channels)))) break; if ((image->alpha_trait != UndefinedPixelTrait) && - (GetPixelAlpha(image,p+(i*channels)) != - GetPixelAlpha(image,p+(i-1)*channels))) + (GetPixelAlpha(image,p+(i*(ssize_t) channels)) != + GetPixelAlpha(image,p+(i-1)*(ssize_t) channels))) break; } i++; @@ -1059,7 +1048,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image, if (i < 3) { count+=i; - p+=(i*channels); + p+=(i*(ssize_t) channels); } if ((i >= 3) || (count == 128) || ((x + i) == (ssize_t) image->columns)) @@ -1069,8 +1058,8 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image, (void) WriteBlobByte(image,(unsigned char) (--count)); while (count >= 0) { - WriteTGAPixel(image,tga_info.image_type,p-((count+1)* - channels),range,midpoint); + WriteTGAPixel(image,tga_info.image_type,p- + ((count+1)*(ssize_t) channels),range,midpoint); count--; } count=0; @@ -1080,7 +1069,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image, { (void) WriteBlobByte(image,(unsigned char) ((i-1) | 0x80)); WriteTGAPixel(image,tga_info.image_type,p,range,midpoint); - p+=(i*channels); + p+=(i*(ssize_t) channels); } x+=i; } @@ -1108,6 +1097,17 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image, break; } } + /* + Optional footer. + */ + option=GetImageOption(image_info,"tga:write-footer"); + if (IsStringTrue(option) != MagickFalse) + { + WriteBlobLong(image,0); + WriteBlobLong(image,0); + WriteBlobString(image,"TRUEVISION-XFILE."); + WriteBlobByte(image,0); + } (void) CloseBlob(image); return(MagickTrue); } diff --git a/ImageMagick-7.1.1-15/coders/tga.h b/ImageMagick-7.1.1-16/coders/tga.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/tga.h rename to ImageMagick-7.1.1-16/coders/tga.h diff --git a/ImageMagick-7.1.1-15/coders/thumbnail.c b/ImageMagick-7.1.1-16/coders/thumbnail.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/thumbnail.c rename to ImageMagick-7.1.1-16/coders/thumbnail.c diff --git a/ImageMagick-7.1.1-15/coders/thumbnail.h b/ImageMagick-7.1.1-16/coders/thumbnail.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/thumbnail.h rename to ImageMagick-7.1.1-16/coders/thumbnail.h diff --git a/ImageMagick-7.1.1-15/coders/tiff.c b/ImageMagick-7.1.1-16/coders/tiff.c similarity index 97% rename from ImageMagick-7.1.1-15/coders/tiff.c rename to ImageMagick-7.1.1-16/coders/tiff.c index bd330989..0f05daa9 100644 --- a/ImageMagick-7.1.1-15/coders/tiff.c +++ b/ImageMagick-7.1.1-16/coders/tiff.c @@ -206,7 +206,7 @@ static MagickOffsetType TIFFSeekCustomStream(const MagickOffsetType offset, { if (((MagickOffsetType) profile->length+offset) < 0) return(-1); - profile->offset=profile->length+offset; + profile->offset=(MagickOffsetType) profile->length+offset; break; } } @@ -526,14 +526,14 @@ static MagickBooleanType DecodeLabImage(Image *image,ExceptionInfo *exception) a, b; - a=QuantumScale*GetPixela(image,q)+0.5; + a=QuantumScale*(double) GetPixela(image,q)+0.5; if (a > 1.0) a-=1.0; - b=QuantumScale*GetPixelb(image,q)+0.5; + b=QuantumScale*(double) GetPixelb(image,q)+0.5; if (b > 1.0) b-=1.0; - SetPixela(image,QuantumRange*a,q); - SetPixelb(image,QuantumRange*b,q); + SetPixela(image,(double) QuantumRange*a,q); + SetPixelb(image,(double) QuantumRange*b,q); q+=GetPixelChannels(image); } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) @@ -640,7 +640,7 @@ static MagickBooleanType TIFFGetProfiles(TIFF *tiff,Image *image, (TIFFFieldDataType(field) == TIFF_LONG)) { if (TIFFIsByteSwapped(tiff) != 0) - TIFFSwabArrayOfLong((uint32 *) profile,(size_t) length); + TIFFSwabArrayOfLong((uint32 *) profile,(tmsize_t) length); status=ReadProfile(image,"iptc",profile,4L*length,exception); } else @@ -1070,8 +1070,8 @@ static ssize_t TIFFReadCustomStream(unsigned char *data,const size_t count, return(-1); total=MagickMin(count, (size_t) remaining); (void) memcpy(data,profile->data->datum+profile->offset,total); - profile->offset+=total; - return(total); + profile->offset+=(MagickOffsetType) total; + return((ssize_t) total); } static CustomStreamInfo *TIFFAcquireCustomStreamForReading( @@ -1363,7 +1363,7 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, } tiff_status=TIFFGetFieldDefaulted(tiff,TIFFTAG_EXTRASAMPLES,&extra_samples, &sample_info,sans); - if ((samples_per_pixel+extra_samples) > MaxPixelChannels) + if (samples_per_pixel > MaxPixelChannels) { TIFFClose(tiff); ThrowReaderException(CorruptImageError,"MaximumChannelsExceeded"); @@ -1510,16 +1510,16 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, if ((TIFFGetFieldDefaulted(tiff,TIFFTAG_XPOSITION,&x_position,sans) == 1) && (TIFFGetFieldDefaulted(tiff,TIFFTAG_YPOSITION,&y_position,sans) == 1)) { - image->page.x=CastDoubleToLong(ceil(x_position* + image->page.x=CastDoubleToLong(ceil((double) x_position* image->resolution.x-0.5)); - image->page.y=CastDoubleToLong(ceil(y_position* + image->page.y=CastDoubleToLong(ceil((double) y_position* image->resolution.y-0.5)); } if (TIFFGetFieldDefaulted(tiff,TIFFTAG_ORIENTATION,&orientation,sans) == 1) image->orientation=(OrientationType) orientation; if (TIFFGetField(tiff,TIFFTAG_WHITEPOINT,&chromaticity) == 1) { - if ((chromaticity != (float *) NULL) && (*chromaticity != 0.0)) + if ((chromaticity != (float *) NULL) && (*chromaticity != 0.0f)) { image->chromaticity.white_point.x=chromaticity[0]; image->chromaticity.white_point.y=chromaticity[1]; @@ -1527,7 +1527,7 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, } if (TIFFGetField(tiff,TIFFTAG_PRIMARYCHROMATICITIES,&chromaticity) == 1) { - if ((chromaticity != (float *) NULL) && (*chromaticity != 0.0)) + if ((chromaticity != (float *) NULL) && (*chromaticity != 0.0f)) { image->chromaticity.red_primary.x=chromaticity[0]; image->chromaticity.red_primary.y=chromaticity[1]; @@ -1576,6 +1576,9 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, break; } case COMPRESSION_OJPEG: image->compression=JPEGCompression; break; +#if defined(COMPRESSION_LERC) + case COMPRESSION_LERC: image->compression=LERCCompression; break; +#endif #if defined(COMPRESSION_LZMA) case COMPRESSION_LZMA: image->compression=LZMACompression; break; #endif @@ -1662,7 +1665,7 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, return(DestroyImageList(image)); } status=SetImageColorspace(image,image->colorspace,exception); - status&=ResetImagePixels(image,exception); + status&=(MagickStatusType) ResetImagePixels(image,exception); if (status == MagickFalse) { TIFFClose(tiff); @@ -1710,7 +1713,6 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, } else { - (void) SetPixelMetaChannels(image,extra_samples,exception); for (i=0; i < extra_samples; i++) { if (sample_info[i] == EXTRASAMPLE_ASSOCALPHA) @@ -1719,6 +1721,7 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, SetQuantumAlphaType(quantum_info,AssociatedQuantumAlpha); (void) SetImageProperty(image,"tiff:alpha","associated", exception); + break; } else if (sample_info[i] == EXTRASAMPLE_UNASSALPHA) @@ -1727,11 +1730,13 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, SetQuantumAlphaType(quantum_info,DisassociatedQuantumAlpha); (void) SetImageProperty(image,"tiff:alpha","unassociated", exception); + break; } } if (image->alpha_trait != UndefinedPixelTrait) extra_samples--; - (void) SetPixelMetaChannels(image,extra_samples,exception); + if (extra_samples > 0) + (void) SetPixelMetaChannels(image,extra_samples,exception); } } if (image->alpha_trait != UndefinedPixelTrait) @@ -1830,8 +1835,8 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, pad=(size_t) MagickMax((ssize_t) samples_per_pixel+ extra_samples-3,0); } - status=SetQuantumPad(image,quantum_info,pad*((bits_per_sample+7) >> - 3)); + status=SetQuantumPad(image,quantum_info,pad* + (size_t) ((bits_per_sample+7) >> 3)); if (status == MagickFalse) ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); } @@ -2056,7 +2061,7 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, size_t rows_remaining; - rows_remaining=image->rows-y; + rows_remaining=image->rows-(size_t) y; if ((ssize_t) (y+rows) < (ssize_t) image->rows) rows_remaining=rows; for (x=0; x < (ssize_t) image->columns; x+=columns) @@ -2065,8 +2070,8 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, columns_remaining, row; - columns_remaining=image->columns-x; - if ((ssize_t) (x+columns) < (ssize_t) image->columns) + columns_remaining=image->columns-(size_t) x; + if ((x+(ssize_t) columns) < (ssize_t) image->columns) columns_remaining=columns; size=TIFFReadTile(tiff,tile_pixels,(uint32) x,(uint32) y, 0,i); @@ -2078,8 +2083,8 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, Quantum *magick_restrict q; - q=GetAuthenticPixels(image,x,y+row,columns_remaining,1, - exception); + q=GetAuthenticPixels(image,x,y+(ssize_t) row,columns_remaining, + 1,exception); if (q == (Quantum *) NULL) break; (void) ImportQuantumPixels(image,(CacheView *) NULL, @@ -2212,8 +2217,8 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, break; } image=SyncNextImageInList(image); - status=SetImageProgress(image,LoadImagesTag,image->scene-1, - image->scene); + status=SetImageProgress(image,LoadImagesTag,(MagickOffsetType) + image->scene-1,image->scene); if (status == MagickFalse) break; } @@ -2381,6 +2386,9 @@ ModuleExport size_t RegisterTIFFImage(void) #if defined(COMPRESSION_JPEG) ", JPEG" #endif +#if defined(COMPRESSION_LERC) + ", LERC" +#endif #if defined(COMPRESSION_LZW) ", LZW" #endif @@ -2712,7 +2720,8 @@ static MagickBooleanType WriteGROUP4Image(const ImageInfo *image_info, */ for (i=0; i < (ssize_t) TIFFNumberOfStrips(tiff); i++) { - count=(ssize_t) TIFFReadRawStrip(tiff,(uint32) i,buffer,strip_size); + count=(ssize_t) TIFFReadRawStrip(tiff,(uint32) i,buffer,(tmsize_t) + strip_size); if (WriteBlob(image,(size_t) count,buffer) != count) status=MagickFalse; } @@ -2791,7 +2800,7 @@ static MagickBooleanType WritePTIFImage(const ImageInfo *image_info, Property ptif:min-base[x][max-levels]. */ RectangleInfo - pyramid_geometry = { 0.0, 0.0, 0.0, 0.0 }; + pyramid_geometry = { 0, 0, 0, 0 }; MagickStatusType flags = ParseAbsoluteGeometry(option,&pyramid_geometry); @@ -2941,14 +2950,14 @@ static MagickBooleanType EncodeLabImage(Image *image,ExceptionInfo *exception) a, b; - a=QuantumScale*GetPixela(image,q)-0.5; + a=QuantumScale*(double) GetPixela(image,q)-0.5; if (a < 0.0) a+=1.0; - b=QuantumScale*GetPixelb(image,q)-0.5; + b=QuantumScale*(double) GetPixelb(image,q)-0.5; if (b < 0.0) b+=1.0; - SetPixela(image,QuantumRange*a,q); - SetPixelb(image,QuantumRange*b,q); + SetPixela(image,(double) QuantumRange*a,q); + SetPixelb(image,(double) QuantumRange*b,q); q+=GetPixelChannels(image); } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) @@ -2988,7 +2997,7 @@ static MagickBooleanType GetTIFFInfo(const ImageInfo *image_info, rows, rows_per_strip; - extent=TIFFScanlineSize(tiff); + extent=(size_t) TIFFScanlineSize(tiff); rows_per_strip=TIFFStripSizeDefault/(extent == 0 ? 1 : (uint32) extent); rows_per_strip=16*(((rows_per_strip < 16 ? 16 : rows_per_strip)+1)/16); if ((TIFFGetField(tiff,TIFFTAG_IMAGELENGTH,&rows) == 1) && @@ -3020,9 +3029,9 @@ static MagickBooleanType GetTIFFInfo(const ImageInfo *image_info, return(MagickFalse); } tiff_info->scanlines=(unsigned char *) AcquireQuantumMemory((size_t) - tile_rows*TIFFScanlineSize(tiff),sizeof(*tiff_info->scanlines)); + tile_rows*(size_t) TIFFScanlineSize(tiff),sizeof(*tiff_info->scanlines)); tiff_info->pixels=(unsigned char *) AcquireQuantumMemory((size_t) - tile_rows*TIFFTileSize(tiff),sizeof(*tiff_info->scanlines)); + tile_rows*(size_t) TIFFTileSize(tiff),sizeof(*tiff_info->scanlines)); if ((tiff_info->scanlines == (unsigned char *) NULL) || (tiff_info->pixels == (unsigned char *) NULL)) { @@ -3060,11 +3069,11 @@ static tmsize_t TIFFWritePixels(TIFF *tiff,TIFFInfo *tiff_info,ssize_t row, /* Fill scanlines to tile height. */ - i=(ssize_t) (row % tiff_info->tile_geometry.height)* + i=(ssize_t) (row % (ssize_t) tiff_info->tile_geometry.height)* TIFFScanlineSize(tiff); (void) memcpy(tiff_info->scanlines+i,(char *) tiff_info->scanline, (size_t) TIFFScanlineSize(tiff)); - if (((size_t) (row % tiff_info->tile_geometry.height) != (tiff_info->tile_geometry.height-1)) && + if ((((size_t) row % tiff_info->tile_geometry.height) != (tiff_info->tile_geometry.height-1)) && (row != (ssize_t) (image->rows-1))) return(0); } @@ -3078,28 +3087,29 @@ static tmsize_t TIFFWritePixels(TIFF *tiff,TIFFInfo *tiff_info,ssize_t row, tiff_info->tile_geometry.width; for (i=0; i < (ssize_t) number_tiles; i++) { - tile_width=(i == (ssize_t) (number_tiles-1)) ? image->columns-(i* - tiff_info->tile_geometry.width) : tiff_info->tile_geometry.width; - for (j=0; j < (ssize_t) ((row % tiff_info->tile_geometry.height)+1); j++) + tile_width=(size_t) ((i == (ssize_t) (number_tiles-1)) ? (ssize_t) + image->columns-(i*(ssize_t) tiff_info->tile_geometry.width) : + (ssize_t) tiff_info->tile_geometry.width); + for (j=0; j < ((row % (ssize_t) tiff_info->tile_geometry.height)+1); j++) for (k=0; k < (ssize_t) tile_width; k++) { if (bytes_per_pixel == 0) { p=tiff_info->scanlines+(j*TIFFScanlineSize(tiff)+(i* - tiff_info->tile_geometry.width+k)/8); + (ssize_t) tiff_info->tile_geometry.width+k)/8); q=tiff_info->pixels+(j*TIFFTileRowSize(tiff)+k/8); *q++=(*p++); continue; } p=tiff_info->scanlines+(j*TIFFScanlineSize(tiff)+(i* - tiff_info->tile_geometry.width+k)*bytes_per_pixel); + (ssize_t) tiff_info->tile_geometry.width+k)*bytes_per_pixel); q=tiff_info->pixels+(j*TIFFTileRowSize(tiff)+k*bytes_per_pixel); for (l=0; l < bytes_per_pixel; l++) *q++=(*p++); } - if ((i*tiff_info->tile_geometry.width) != image->columns) - status=TIFFWriteTile(tiff,tiff_info->pixels,(uint32) (i* - tiff_info->tile_geometry.width),(uint32) ((row/ + if (((size_t) i*tiff_info->tile_geometry.width) != image->columns) + status=TIFFWriteTile(tiff,tiff_info->pixels,(uint32) ((size_t) i* + tiff_info->tile_geometry.width),(uint32) (((size_t) row/ tiff_info->tile_geometry.height)*tiff_info->tile_geometry.height),0, sample); if (status < 0) @@ -3125,8 +3135,8 @@ static ssize_t TIFFWriteCustomStream(unsigned char *data,const size_t count, SetStringInfoLength(profile->data,profile->extent); } (void) memcpy(profile->data->datum+profile->offset,data,count); - profile->offset+=count; - return(count); + profile->offset+=(MagickOffsetType) count; + return((ssize_t) count); } static CustomStreamInfo *TIFFAcquireCustomStreamForWriting( @@ -3291,7 +3301,7 @@ static void TIFFSetProfiles(TIFF *tiff,Image *image) { if (TIFFIsByteSwapped(tiff)) TIFFSwabArrayOfLong((uint32 *) GetStringInfoDatum(iptc_profile), - (unsigned long) (length/4)); + (tmsize_t) (length/4)); (void) TIFFSetField(tiff,TIFFTAG_RICHTIFFIPTC,(uint32) GetStringInfoLength(iptc_profile)/4,GetStringInfoDatum( iptc_profile)); @@ -3583,6 +3593,13 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, compress_tag=COMPRESSION_JPEG; break; } +#if defined(COMPRESSION_LERC) + case LERCCompression: + { + compress_tag=COMPRESSION_LERC; + break; + } +#endif #if defined(COMPRESSION_LZMA) case LZMACompression: { @@ -3861,6 +3878,10 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, } case COMPRESSION_CCITTFAX4: break; +#if defined(LERC_SUPPORT) && defined(COMPRESSION_LERC) + case COMPRESSION_LERC: + break; +#endif #if defined(LZMA_SUPPORT) && defined(COMPRESSION_LZMA) case COMPRESSION_LZMA: { @@ -3959,9 +3980,9 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, CoderWarning,"TIFF: negative image positions unsupported","%s", image->filename); } - (void) TIFFSetField(tiff,TIFFTAG_XPOSITION,(float) x_position/ + (void) TIFFSetField(tiff,TIFFTAG_XPOSITION,(double) x_position/ image->resolution.x); - (void) TIFFSetField(tiff,TIFFTAG_YPOSITION,(float) y_position/ + (void) TIFFSetField(tiff,TIFFTAG_YPOSITION,(double) y_position/ image->resolution.y); } if (image->chromaticity.white_point.x != 0.0) diff --git a/ImageMagick-7.1.1-15/coders/tiff.h b/ImageMagick-7.1.1-16/coders/tiff.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/tiff.h rename to ImageMagick-7.1.1-16/coders/tiff.h diff --git a/ImageMagick-7.1.1-15/coders/tile.c b/ImageMagick-7.1.1-16/coders/tile.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/tile.c rename to ImageMagick-7.1.1-16/coders/tile.c diff --git a/ImageMagick-7.1.1-15/coders/tile.h b/ImageMagick-7.1.1-16/coders/tile.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/tile.h rename to ImageMagick-7.1.1-16/coders/tile.h diff --git a/ImageMagick-7.1.1-15/coders/tim.c b/ImageMagick-7.1.1-16/coders/tim.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/tim.c rename to ImageMagick-7.1.1-16/coders/tim.c index 4d79a4d4..7eead9db 100644 --- a/ImageMagick-7.1.1-15/coders/tim.c +++ b/ImageMagick-7.1.1-16/coders/tim.c @@ -235,7 +235,7 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image_size > GetBlobSize(image)) ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); bytes_per_line=width*2; - width=(width*16)/bits_per_pixel; + width=(size_t) (((ssize_t) width*16)/bits_per_pixel); image->columns=width; image->rows=height; status=SetImageExtent(image,image->columns,image->rows,exception); @@ -269,7 +269,7 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; - p=tim_pixels+y*bytes_per_line; + p=tim_pixels+y*(ssize_t) bytes_per_line; for (x=0; x < ((ssize_t) image->columns-1); x+=2) { SetPixelIndex(image,(*p) & 0x0f,q); @@ -306,7 +306,7 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; - p=tim_pixels+y*bytes_per_line; + p=tim_pixels+y*(ssize_t) bytes_per_line; for (x=0; x < (ssize_t) image->columns; x++) { SetPixelIndex(image,*p++,q); @@ -331,7 +331,7 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) */ for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=tim_pixels+y*bytes_per_line; + p=tim_pixels+y*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; @@ -366,7 +366,7 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) */ for (y=(ssize_t) image->rows-1; y >= 0; y--) { - p=tim_pixels+y*bytes_per_line; + p=tim_pixels+y*(ssize_t) bytes_per_line; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; diff --git a/ImageMagick-7.1.1-15/coders/tim.h b/ImageMagick-7.1.1-16/coders/tim.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/tim.h rename to ImageMagick-7.1.1-16/coders/tim.h diff --git a/ImageMagick-7.1.1-15/coders/tim2.c b/ImageMagick-7.1.1-16/coders/tim2.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/tim2.c rename to ImageMagick-7.1.1-16/coders/tim2.c index b1a2c548..3486df83 100644 --- a/ImageMagick-7.1.1-15/coders/tim2.c +++ b/ImageMagick-7.1.1-16/coders/tim2.c @@ -242,9 +242,6 @@ static MagickBooleanType ReadTIM2ImageData(const ImageInfo *image_info, Quantum *q; - unsigned char - *p; - size_t bits_per_line, bytes_per_line; @@ -254,6 +251,7 @@ static MagickBooleanType ReadTIM2ImageData(const ImageInfo *image_info, y; unsigned char + *p, *row_data; unsigned int @@ -271,7 +269,7 @@ static MagickBooleanType ReadTIM2ImageData(const ImageInfo *image_info, /* * Image data */ - bits_per_line=image->columns*bits_per_pixel; + bits_per_line=image->columns*(size_t) bits_per_pixel; bytes_per_line=bits_per_line/8 + ((bits_per_line%8==0) ? 0 : 1); row_data=(unsigned char*) AcquireQuantumMemory(1,bytes_per_line); if (row_data == (unsigned char *) NULL) @@ -520,7 +518,8 @@ static MagickBooleanType ReadTIM2ImageData(const ImageInfo *image_info, /* * ### Read CLUT Data ### */ - clut_size=MagickMax(header->clut_size,(clut_depth/8)*image->colors); + clut_size=MagickMax(header->clut_size,(size_t) (clut_depth/8)* + image->colors); clut_data=(unsigned char *) AcquireQuantumMemory(clut_size, sizeof(*clut_data)); if (clut_data == (unsigned char *) NULL) @@ -544,8 +543,8 @@ static MagickBooleanType ReadTIM2ImageData(const ImageInfo *image_info, { for (i=0; i < (ssize_t) image->colors; i++) { - word = ((unsigned short)* p )<<0*8 | - ((unsigned short)*(p+1))<<1*8; + word = (unsigned int) (((unsigned short)* p )<<0*8 | + ((unsigned short)*(p+1))<<1*8); image->colormap[i].red=GetChannelValue(word,0,RGBA16); image->colormap[i].green=GetChannelValue(word,1,RGBA16); @@ -697,7 +696,8 @@ static Image *ReadTIM2Image(const ImageInfo *image_info, break; } image=SyncNextImageInList(image); - status=SetImageProgress(image,LoadImagesTag,image->scene-1,image->scene); + status=SetImageProgress(image,LoadImagesTag,(MagickOffsetType) + image->scene-1,image->scene); if (status == MagickFalse) break; } @@ -752,7 +752,7 @@ static Image *ReadTIM2Image(const ImageInfo *image_info, ThrowReaderException(CorruptImageError,"ImproperImageHeader"); break; } - image->depth=(clut_depth != 0) ? clut_depth : bits_per_pixel; + image->depth=(size_t) ((clut_depth != 0) ? clut_depth : bits_per_pixel); if ((image->depth == 16) || (image->depth == 32)) image->alpha_trait=BlendPixelTrait; if (image->ping == MagickFalse) diff --git a/ImageMagick-7.1.1-15/coders/tim2.h b/ImageMagick-7.1.1-16/coders/tim2.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/tim2.h rename to ImageMagick-7.1.1-16/coders/tim2.h diff --git a/ImageMagick-7.1.1-15/coders/ttf.c b/ImageMagick-7.1.1-16/coders/ttf.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/ttf.c rename to ImageMagick-7.1.1-16/coders/ttf.c diff --git a/ImageMagick-7.1.1-15/coders/ttf.h b/ImageMagick-7.1.1-16/coders/ttf.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/ttf.h rename to ImageMagick-7.1.1-16/coders/ttf.h diff --git a/ImageMagick-7.1.1-15/coders/txt.c b/ImageMagick-7.1.1-16/coders/txt.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/txt.c rename to ImageMagick-7.1.1-16/coders/txt.c diff --git a/ImageMagick-7.1.1-15/coders/txt.h b/ImageMagick-7.1.1-16/coders/txt.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/txt.h rename to ImageMagick-7.1.1-16/coders/txt.h diff --git a/ImageMagick-7.1.1-15/coders/uil.c b/ImageMagick-7.1.1-16/coders/uil.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/uil.c rename to ImageMagick-7.1.1-16/coders/uil.c index b77849d1..fe6a0dad 100644 --- a/ImageMagick-7.1.1-15/coders/uil.c +++ b/ImageMagick-7.1.1-16/coders/uil.c @@ -330,7 +330,7 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image, (void) FormatLocaleString(buffer,MagickPathExtent, " color('%s',%s) = '%s'",name, GetPixelInfoIntensity(image,image->colormap+i) < - (QuantumRange/2.0) ? "background" : "foreground",symbol); + ((double) QuantumRange/2.0) ? "background" : "foreground",symbol); (void) WriteBlobString(image,buffer); (void) FormatLocaleString(buffer,MagickPathExtent,"%s", (i == (ssize_t) (colors-1) ? ");\n" : ",\n")); diff --git a/ImageMagick-7.1.1-15/coders/uil.h b/ImageMagick-7.1.1-16/coders/uil.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/uil.h rename to ImageMagick-7.1.1-16/coders/uil.h diff --git a/ImageMagick-7.1.1-15/coders/url.c b/ImageMagick-7.1.1-16/coders/url.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/url.c rename to ImageMagick-7.1.1-16/coders/url.c index 1b29927d..b9189d14 100644 --- a/ImageMagick-7.1.1-15/coders/url.c +++ b/ImageMagick-7.1.1-16/coders/url.c @@ -117,7 +117,7 @@ static void GetFTPData(void *userdata,const char *data,int size) return; if (size <= 0) return; - length=fwrite(data,size,1,file); + length=fwrite(data,(size_t) size,1,file); (void) length; } #endif @@ -255,7 +255,7 @@ static Image *ReadURLImage(const ImageInfo *image_info,ExceptionInfo *exception) count; while ((bytes=xmlNanoHTTPRead(context,buffer,sizeof(buffer))) > 0) - count=(ssize_t) fwrite(buffer,bytes,1,file); + count=(ssize_t) fwrite(buffer,(size_t) bytes,1,file); (void) count; xmlNanoHTTPClose(context); xmlFree(type); diff --git a/ImageMagick-7.1.1-15/coders/url.h b/ImageMagick-7.1.1-16/coders/url.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/url.h rename to ImageMagick-7.1.1-16/coders/url.h diff --git a/ImageMagick-7.1.1-15/coders/uyvy.c b/ImageMagick-7.1.1-16/coders/uyvy.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/uyvy.c rename to ImageMagick-7.1.1-16/coders/uyvy.c index 9fbda1ad..92b7f80e 100644 --- a/ImageMagick-7.1.1-15/coders/uyvy.c +++ b/ImageMagick-7.1.1-16/coders/uyvy.c @@ -137,7 +137,7 @@ static Image *ReadUYVYImage(const ImageInfo *image_info, status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) return(DestroyImage(image)); - if (DiscardBlobBytes(image,image->offset) == MagickFalse) + if (DiscardBlobBytes(image,(MagickSizeType) image->offset) == MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); image->depth=8; @@ -342,8 +342,8 @@ static MagickBooleanType WriteUYVYImage(const ImageInfo *image_info, { if (full != MagickFalse) { - pixel.green=(pixel.green+GetPixelGreen(uyvy_image,p))/2; - pixel.blue=(pixel.blue+GetPixelBlue(uyvy_image,p))/2; + pixel.green=(pixel.green+(double) GetPixelGreen(uyvy_image,p))/2; + pixel.blue=(pixel.blue+(double) GetPixelBlue(uyvy_image,p))/2; (void) WriteBlobByte(image,ScaleQuantumToChar((Quantum) pixel.green)); (void) WriteBlobByte(image,ScaleQuantumToChar((Quantum) pixel.red)); (void) WriteBlobByte(image,ScaleQuantumToChar((Quantum) pixel.blue)); diff --git a/ImageMagick-7.1.1-15/coders/uyvy.h b/ImageMagick-7.1.1-16/coders/uyvy.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/uyvy.h rename to ImageMagick-7.1.1-16/coders/uyvy.h diff --git a/ImageMagick-7.1.1-15/coders/vicar.c b/ImageMagick-7.1.1-16/coders/vicar.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/vicar.c rename to ImageMagick-7.1.1-16/coders/vicar.c index 399558e1..66a64f98 100644 --- a/ImageMagick-7.1.1-15/coders/vicar.c +++ b/ImageMagick-7.1.1-16/coders/vicar.c @@ -329,9 +329,9 @@ static Image *ReadVICARImage(const ImageInfo *image_info, if (LocaleCompare(keyword,"FORMAT") == 0) (void) CopyMagickString(format,value,MagickPathExtent); if (LocaleCompare(keyword,"LABEL_RECORDS") == 0) - length*=(ssize_t) StringToLong(value); + length*=(size_t) StringToLong(value); if (LocaleCompare(keyword,"LBLSIZE") == 0) - length=(ssize_t) StringToLong(value)+offset; + length=(size_t) (StringToLong(value)+offset); if (LocaleCompare(keyword,"LINES") == 0) image->rows=StringToUnsignedLong(value); if (LocaleCompare(keyword,"NL") == 0) diff --git a/ImageMagick-7.1.1-15/coders/vicar.h b/ImageMagick-7.1.1-16/coders/vicar.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/vicar.h rename to ImageMagick-7.1.1-16/coders/vicar.h diff --git a/ImageMagick-7.1.1-15/coders/vid.c b/ImageMagick-7.1.1-16/coders/vid.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/vid.c rename to ImageMagick-7.1.1-16/coders/vid.c index a5c949ed..eb8d15a8 100644 --- a/ImageMagick-7.1.1-15/coders/vid.c +++ b/ImageMagick-7.1.1-16/coders/vid.c @@ -207,7 +207,8 @@ static Image *ReadVIDImage(const ImageInfo *image_info,ExceptionInfo *exception) "thumbnail geometry: %.20gx%.20g",(double) next_image->columns,(double) next_image->rows); AppendImageToList(&images,next_image); - status=SetImageProgress(images,LoadImagesTag,i,number_files); + status=SetImageProgress(images,LoadImagesTag,i,(MagickSizeType) + number_files); if (status == MagickFalse) break; } diff --git a/ImageMagick-7.1.1-15/coders/vid.h b/ImageMagick-7.1.1-16/coders/vid.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/vid.h rename to ImageMagick-7.1.1-16/coders/vid.h diff --git a/ImageMagick-7.1.1-15/coders/video.c b/ImageMagick-7.1.1-16/coders/video.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/video.c rename to ImageMagick-7.1.1-16/coders/video.c index babf7c9e..625f125b 100644 --- a/ImageMagick-7.1.1-15/coders/video.c +++ b/ImageMagick-7.1.1-16/coders/video.c @@ -247,8 +247,8 @@ static Image *ReadVIDEOImage(const ImageInfo *image_info, (void) ConcatenateMagickString(options," -pix_fmt rgba", MagickPathExtent); intermediate_format=GetIntermediateFormat(image_info); - (void) FormatLocaleString(command,MagickPathExtent," -vcodec %s", - intermediate_format); + (void) FormatLocaleString(command,MagickPathExtent, + " -vcodec %s -lossless 1",intermediate_format); (void) ConcatenateMagickString(options,command,MagickPathExtent); AcquireUniqueFilename(read_info->unique); (void) AcquireUniqueSymbolicLink(image_info->filename, @@ -510,7 +510,7 @@ static MagickBooleanType CopyDelegateFile(const char *source, return(MagickFalse); } length=0; - for (i=0; ; i+=count) + for (i=0; ; i+=(size_t) count) { count=(ssize_t) read(source_file,buffer,quantum); if (count <= 0) diff --git a/ImageMagick-7.1.1-15/coders/video.h b/ImageMagick-7.1.1-16/coders/video.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/video.h rename to ImageMagick-7.1.1-16/coders/video.h diff --git a/ImageMagick-7.1.1-15/coders/viff.c b/ImageMagick-7.1.1-16/coders/viff.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/viff.c rename to ImageMagick-7.1.1-16/coders/viff.c index dfb3a6c2..d4174921 100644 --- a/ImageMagick-7.1.1-15/coders/viff.c +++ b/ImageMagick-7.1.1-16/coders/viff.c @@ -224,18 +224,9 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, MagickSizeType number_pixels; - ssize_t - x; - Quantum *q; - ssize_t - i; - - unsigned char - *p; - size_t bytes_per_pixel, max_packets, @@ -243,9 +234,12 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, ssize_t count, + i, + x, y; unsigned char + *p, *pixels; unsigned long @@ -416,7 +410,7 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, default: bytes_per_pixel=1; break; } image->colors=viff_info.map_columns; - count=(size_t) bytes_per_pixel*image->colors*viff_info.map_rows; + count=(ssize_t) (bytes_per_pixel*image->colors*viff_info.map_rows); if ((MagickSizeType) count > GetBlobSize(image)) ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); if ((MagickSizeType) viff_info.map_rows > @@ -431,7 +425,7 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, /* Read VIFF raster colormap. */ - if (ReadBlob(image,count,viff_colormap) != count) + if (ReadBlob(image,(size_t) count,viff_colormap) != count) { viff_colormap=(unsigned char *) RelinquishMagickMemory( viff_colormap); @@ -480,12 +474,12 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, } else if (i < (ssize_t) (2*image->colors)) - image->colormap[i % image->colors].green=(MagickRealType) - ScaleCharToQuantum((unsigned char) value); + image->colormap[i % (ssize_t) image->colors].green= + (MagickRealType) ScaleCharToQuantum((unsigned char) value); else if (i < (ssize_t) (3*image->colors)) - image->colormap[i % image->colors].blue=(MagickRealType) - ScaleCharToQuantum((unsigned char) value); + image->colormap[i % (ssize_t) image->colors].blue= + (MagickRealType) ScaleCharToQuantum((unsigned char) value); } viff_colormap=(unsigned char *) RelinquishMagickMemory(viff_colormap); break; @@ -527,7 +521,7 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, if (HeapOverflowSanityCheckGetSize((size_t) number_pixels,viff_info.number_data_bands,&max_packets) != MagickFalse) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } - count=bytes_per_pixel*max_packets; + count=(ssize_t) (bytes_per_pixel*max_packets); if ((MagickSizeType) count > GetBlobSize(image)) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); pixels=(unsigned char *) AcquireQuantumMemory((size_t) MagickMax( @@ -536,7 +530,7 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); (void) memset(pixels,0,MagickMax(number_pixels,max_packets)* bytes_per_pixel*sizeof(*pixels)); - if (ReadBlob(image,count,pixels) != count) + if (ReadBlob(image,(size_t) count,pixels) != count) { pixels=(unsigned char *) RelinquishMagickMemory(pixels); ThrowReaderException(CorruptImageError,"ImproperImageHeader"); @@ -1204,7 +1198,7 @@ static MagickBooleanType WriteVIFFImage(const ImageInfo *image_info, for (x=0; x < (ssize_t) image->columns; x++) { byte>>=1; - if (GetPixelLuma(image,p) < (QuantumRange/2.0)) + if (GetPixelLuma(image,p) < ((double) QuantumRange/2.0)) byte|=0x80; bit++; if (bit == 8) diff --git a/ImageMagick-7.1.1-15/coders/viff.h b/ImageMagick-7.1.1-16/coders/viff.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/viff.h rename to ImageMagick-7.1.1-16/coders/viff.h diff --git a/ImageMagick-7.1.1-15/coders/vips.c b/ImageMagick-7.1.1-16/coders/vips.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/vips.c rename to ImageMagick-7.1.1-16/coders/vips.c index 1c68fff1..f48f68d8 100644 --- a/ImageMagick-7.1.1-15/coders/vips.c +++ b/ImageMagick-7.1.1-16/coders/vips.c @@ -291,7 +291,8 @@ static inline Quantum ReadVIPSPixelNONE(Image *image, case VIPSBandFormatINT: return(ScaleLongToQuantum(ReadBlobLong(image))); case VIPSBandFormatFLOAT: - return((Quantum) ((float) QuantumRange*(ReadBlobFloat(image)/1.0))); + return((Quantum) ((double) QuantumRange*((double) + ReadBlobFloat(image)/1.0))); case VIPSBandFormatDOUBLE: return((Quantum) ((double) QuantumRange*(ReadBlobDouble( image)/1.0))); diff --git a/ImageMagick-7.1.1-15/coders/vips.h b/ImageMagick-7.1.1-16/coders/vips.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/vips.h rename to ImageMagick-7.1.1-16/coders/vips.h diff --git a/ImageMagick-7.1.1-15/coders/wbmp.c b/ImageMagick-7.1.1-16/coders/wbmp.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/wbmp.c rename to ImageMagick-7.1.1-16/coders/wbmp.c index 951bc7f4..4e192689 100644 --- a/ImageMagick-7.1.1-15/coders/wbmp.c +++ b/ImageMagick-7.1.1-16/coders/wbmp.c @@ -17,7 +17,7 @@ % January 2000 % % % % % -% Copyright @ 2000 ImageMagick Studio LLC, a non-profit organization % +% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % @@ -173,7 +173,7 @@ static Image *ReadWBMPImage(const ImageInfo *image_info, ThrowReaderException(CorruptImageError,"CorruptWBMPimage"); if ((image->columns == 0) || (image->rows == 0)) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); - if (DiscardBlobBytes(image,image->offset) == MagickFalse) + if (DiscardBlobBytes(image,(MagickSizeType) image->offset) == MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); if (image_info->ping != MagickFalse) @@ -400,7 +400,7 @@ static MagickBooleanType WriteWBMPImage(const ImageInfo *image_info, byte=0; for (x=0; x < (ssize_t) image->columns; x++) { - if (GetPixelLuma(image,p) >= (QuantumRange/2.0)) + if (GetPixelLuma(image,p) >= ((double) QuantumRange/2.0)) byte|=0x1 << (7-bit); bit++; if (bit == 8) diff --git a/ImageMagick-7.1.1-15/coders/wbmp.h b/ImageMagick-7.1.1-16/coders/wbmp.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/wbmp.h rename to ImageMagick-7.1.1-16/coders/wbmp.h diff --git a/ImageMagick-7.1.1-15/coders/webp.c b/ImageMagick-7.1.1-16/coders/webp.c similarity index 97% rename from ImageMagick-7.1.1-15/coders/webp.c rename to ImageMagick-7.1.1-16/coders/webp.c index b8dec3d9..f79800ad 100644 --- a/ImageMagick-7.1.1-15/coders/webp.c +++ b/ImageMagick-7.1.1-16/coders/webp.c @@ -201,7 +201,7 @@ static MagickBooleanType IsWEBPImageLossless(const unsigned char *stream, chunk_size=ReadWebPLSBWord(stream+offset+TAG_SIZE); if (chunk_size > MAX_CHUNK_PAYLOAD) break; - chunk_size_pad=(CHUNK_HEADER_SIZE+chunk_size+1) & ~1; + chunk_size_pad=(CHUNK_HEADER_SIZE+chunk_size+1) & (unsigned int) ~1; if (memcmp(stream+offset,VP8_CHUNK_HEADER,VP8_CHUNK_HEADER_SIZE) == 0) return(*(stream+offset+VP8_CHUNK_HEADER_SIZE) == LOSSLESS_FLAG ? MagickTrue : MagickFalse); @@ -219,7 +219,7 @@ static int FillBasicWEBPInfo(Image *image,const uint8_t *stream,size_t length, int webp_status; - webp_status=WebPGetFeatures(stream,length,features); + webp_status=(int) WebPGetFeatures(stream,length,features); if (webp_status != VP8_STATUS_OK) return(webp_status); @@ -233,15 +233,15 @@ static int FillBasicWEBPInfo(Image *image,const uint8_t *stream,size_t length, return(webp_status); } -static int ReadSingleWEBPImage(Image *image,const uint8_t *stream, - size_t length,WebPDecoderConfig *configure,ExceptionInfo *exception, - MagickBooleanType is_first) +static int ReadSingleWEBPImage(const ImageInfo *image_info,Image *image, + const uint8_t *stream,size_t length,WebPDecoderConfig *configure, + ExceptionInfo *exception,MagickBooleanType is_first) { int webp_status; - unsigned char - *p; + MagickBooleanType + status; size_t canvas_width, @@ -254,12 +254,12 @@ static int ReadSingleWEBPImage(Image *image,const uint8_t *stream, y_offset, y; + unsigned char + *p; + WebPDecBuffer *magick_restrict webp_image; - MagickBooleanType - status; - webp_image=&configure->output; if (is_first != MagickFalse) { @@ -292,7 +292,10 @@ static int ReadSingleWEBPImage(Image *image,const uint8_t *stream, if (IsWEBPImageLossless((unsigned char *) stream,length) != MagickFalse) image->quality=100; - webp_status=WebPDecode(stream,length,configure); + if (image_info->ping != MagickFalse) + return(webp_status); + + webp_status=(int) WebPDecode(stream,length,configure); if (webp_status != VP8_STATUS_OK) return(webp_status); @@ -310,8 +313,8 @@ static int ReadSingleWEBPImage(Image *image,const uint8_t *stream, break; for (x=0; x < (ssize_t) image->columns; x++) { - if ((x >= x_offset && x < (ssize_t) (x_offset+image_width)) && - (y >= y_offset && y < (ssize_t) (y_offset+image_height))) + if (((x >= x_offset) && (x < (x_offset+(ssize_t) image_width))) && + ((y >= y_offset) && (y < (y_offset+(ssize_t) image_height)))) { SetPixelRed(image,ScaleCharToQuantum(*p++),q); SetPixelGreen(image,ScaleCharToQuantum(*p++),q); @@ -445,7 +448,7 @@ static int ReadAnimatedWEBPImage(const ImageInfo *image_info,Image *image, mux=WebPMuxCreate(&data,0); status=WebPMuxGetAnimationParams(mux,¶ms); if (status >= 0) - image->iterations=(ssize_t) params.loop_count; + image->iterations=(size_t) params.loop_count; WebPMuxDelete(mux); } demux=WebPDemux(&data); @@ -462,15 +465,17 @@ static int ReadAnimatedWEBPImage(const ImageInfo *image_info,Image *image, CloneImageProperties(image,original_image); image->page.x=(ssize_t) iter.x_offset; image->page.y=(ssize_t) iter.y_offset; - webp_status=ReadSingleWEBPImage(image,iter.fragment.bytes, - iter.fragment.size,configure,exception,MagickFalse); + webp_status=ReadSingleWEBPImage(image_info,image, + iter.fragment.bytes,iter.fragment.size,configure,exception, + MagickFalse); } else { image->page.x=(ssize_t) iter.x_offset; image->page.y=(ssize_t) iter.y_offset; - webp_status=ReadSingleWEBPImage(image,iter.fragment.bytes, - iter.fragment.size,configure,exception,MagickTrue); + webp_status=ReadSingleWEBPImage(image_info,image, + iter.fragment.bytes,iter.fragment.size,configure,exception, + MagickTrue); } if (webp_status != VP8_STATUS_OK) break; @@ -556,7 +561,7 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, count=ReadBlob(image,12,header); if (count != 12) ThrowWEBPException(CorruptImageError,"InsufficientImageDataInFile"); - status=IsWEBP(header,(ssize_t) count); + status=IsWEBP(header,(size_t) count); if (status == MagickFalse) ThrowWEBPException(CorruptImageError,"CorruptImage"); length=(size_t) (ReadWebPLSBWord(header+4)+8); @@ -582,7 +587,8 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, webp_status=VP8_STATUS_UNSUPPORTED_FEATURE; #endif } else { - webp_status=ReadSingleWEBPImage(image,stream,length,&configure,exception,MagickFalse); + webp_status=ReadSingleWEBPImage(image_info,image,stream,length, + &configure,exception,MagickFalse); } } diff --git a/ImageMagick-7.1.1-15/coders/webp.h b/ImageMagick-7.1.1-16/coders/webp.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/webp.h rename to ImageMagick-7.1.1-16/coders/webp.h diff --git a/ImageMagick-7.1.1-15/coders/wmf.c b/ImageMagick-7.1.1-16/coders/wmf.c similarity index 84% rename from ImageMagick-7.1.1-15/coders/wmf.c rename to ImageMagick-7.1.1-16/coders/wmf.c index 82777f6f..5610bcf5 100644 --- a/ImageMagick-7.1.1-15/coders/wmf.c +++ b/ImageMagick-7.1.1-16/coders/wmf.c @@ -17,7 +17,7 @@ % December 2000 % % % % % -% Copyright @ 2000 ImageMagick Studio LLC, a non-profit organization % +% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % @@ -240,8 +240,8 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) #elif defined(MAGICKCORE_WMF_DELEGATE) #define ERR(API) ((API)->err != wmf_E_None) -#define XC(x) ((double) x) -#define YC(y) ((double) y) +#define XC(x) ((double) (x)) +#define YC(y) ((double) (y)) #if !defined(M_PI) # define M_PI MagickPI @@ -408,42 +408,42 @@ static void draw_pattern_push(wmfAPI* API, unsigned long id, unsigned lo static int ipa_blob_read(void* wand); static int ipa_blob_seek(void* wand,long position); static long ipa_blob_tell(void* wand); -static void ipa_bmp_draw(wmfAPI * API, wmfBMP_Draw_t * bmp_draw); -static void ipa_bmp_free(wmfAPI * API, wmfBMP * bmp); -static void ipa_bmp_read(wmfAPI * API, wmfBMP_Read_t * bmp_read); -static void ipa_device_begin(wmfAPI * API); -static void ipa_device_close(wmfAPI * API); -static void ipa_device_end(wmfAPI * API); -static void ipa_device_open(wmfAPI * API); -static void ipa_draw_arc(wmfAPI * API, wmfDrawArc_t * draw_arc); -static void ipa_draw_chord(wmfAPI * API, wmfDrawArc_t * draw_arc); -static void ipa_draw_ellipse(wmfAPI * API, wmfDrawArc_t * draw_arc); -static void ipa_draw_line(wmfAPI * API, wmfDrawLine_t * draw_line); -static void ipa_draw_pie(wmfAPI * API, wmfDrawArc_t * draw_arc); -static void ipa_draw_pixel(wmfAPI * API, wmfDrawPixel_t * draw_pixel); -static void ipa_draw_polygon(wmfAPI * API, wmfPolyLine_t * poly_line); +static void ipa_bmp_draw(wmfAPI *API, wmfBMP_Draw_t *bmp_draw); +static void ipa_bmp_free(wmfAPI *API, wmfBMP *bmp); +static void ipa_bmp_read(wmfAPI *API, wmfBMP_Read_t *bmp_read); +static void ipa_device_begin(wmfAPI *API); +static void ipa_device_close(wmfAPI *API); +static void ipa_device_end(wmfAPI *API); +static void ipa_device_open(wmfAPI *API); +static void ipa_draw_arc(wmfAPI *API, wmfDrawArc_t *draw_arc); +static void ipa_draw_chord(wmfAPI *API, wmfDrawArc_t *draw_arc); +static void ipa_draw_ellipse(wmfAPI *API, wmfDrawArc_t *draw_arc); +static void ipa_draw_line(wmfAPI *API, wmfDrawLine_t *draw_line); +static void ipa_draw_pie(wmfAPI *API, wmfDrawArc_t *draw_arc); +static void ipa_draw_pixel(wmfAPI *API, wmfDrawPixel_t *draw_pixel); +static void ipa_draw_polygon(wmfAPI *API, wmfPolyLine_t *poly_line); #if defined(MAGICKCORE_WMF_DELEGATE) -static void ipa_draw_polypolygon(wmfAPI * API, wmfPolyPoly_t* polypolygon); +static void ipa_draw_polypolygon(wmfAPI *API, wmfPolyPoly_t* polypolygon); #endif -static void ipa_draw_rectangle(wmfAPI * API, wmfDrawRectangle_t * draw_rect); -static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text); -static void ipa_flood_exterior(wmfAPI * API, wmfFlood_t * flood); -static void ipa_flood_interior(wmfAPI * API, wmfFlood_t * flood); -static void ipa_functions(wmfAPI * API); -static void ipa_poly_line(wmfAPI * API, wmfPolyLine_t * poly_line); -static void ipa_region_clip(wmfAPI * API, wmfPolyRectangle_t * poly_rect); -static void ipa_region_frame(wmfAPI * API, wmfPolyRectangle_t * poly_rect); -static void ipa_region_paint(wmfAPI * API, wmfPolyRectangle_t * poly_rect); -static void ipa_rop_draw(wmfAPI * API, wmfROP_Draw_t * rop_draw); -static void ipa_udata_copy(wmfAPI * API, wmfUserData_t * userdata); -static void ipa_udata_free(wmfAPI * API, wmfUserData_t * userdata); -static void ipa_udata_init(wmfAPI * API, wmfUserData_t * userdata); -static void ipa_udata_set(wmfAPI * API, wmfUserData_t * userdata); +static void ipa_draw_rectangle(wmfAPI *API, wmfDrawRectangle_t *draw_rect); +static void ipa_draw_text(wmfAPI *API, wmfDrawText_t *draw_text); +static void ipa_flood_exterior(wmfAPI *API, wmfFlood_t *flood); +static void ipa_flood_interior(wmfAPI *API, wmfFlood_t *flood); +static void ipa_functions(wmfAPI *API); +static void ipa_poly_line(wmfAPI *API, wmfPolyLine_t *poly_line); +static void ipa_region_clip(wmfAPI *API, wmfPolyRectangle_t *poly_rect); +static void ipa_region_frame(wmfAPI *API, wmfPolyRectangle_t *poly_rect); +static void ipa_region_paint(wmfAPI *API, wmfPolyRectangle_t *poly_rect); +static void ipa_rop_draw(wmfAPI *API, wmfROP_Draw_t *rop_draw); +static void ipa_udata_copy(wmfAPI *API, wmfUserData_t *userdata); +static void ipa_udata_free(wmfAPI *API, wmfUserData_t *userdata); +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); -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); +static void util_draw_arc(wmfAPI *API, wmfDrawArc_t *draw_arc,magick_arc_t finish); +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); /* Progress callback */ int magick_progress_callback(void *context,float quantum) @@ -473,7 +473,7 @@ static void draw_fill_color_string(DrawingWand *drawing_wand,const char *color) DrawSetFillColor(drawing_wand,fill_color); fill_color=DestroyPixelWand(fill_color); } -static void draw_fill_color_rgb( wmfAPI* API, const wmfRGB* rgb ) +static void draw_fill_color_rgb(wmfAPI* API, const wmfRGB* rgb) { PixelWand *fill_color; @@ -499,7 +499,7 @@ static void draw_stroke_color_string(DrawingWand *drawing_wand,const char *color stroke_color=DestroyPixelWand(stroke_color); } -static void draw_stroke_color_rgb( wmfAPI* API, const wmfRGB* rgb ) +static void draw_stroke_color_rgb(wmfAPI* API, const wmfRGB* rgb) { PixelWand *stroke_color; @@ -525,10 +525,10 @@ static void draw_under_color_string(DrawingWand *drawing_wand,const char *color) under_color=DestroyPixelWand(under_color); } -static void draw_pattern_push( wmfAPI* API, +static void draw_pattern_push(wmfAPI* API, unsigned long id, unsigned long columns, - unsigned long rows ) + unsigned long rows) { char pattern_id[MagickPathExtent]; @@ -545,7 +545,7 @@ static void draw_pattern_push( wmfAPI* API, device wand called the 'source', to a rectangular area of the same size in another device wand, called the 'destination'. */ -static void ipa_rop_draw(wmfAPI * API, wmfROP_Draw_t * rop_draw) +static void ipa_rop_draw(wmfAPI *API, wmfROP_Draw_t *rop_draw) { /* wmfBrush */ /* *brush = WMF_DC_BRUSH(rop_draw->dc); */ @@ -581,43 +581,43 @@ static void ipa_rop_draw(wmfAPI * API, wmfROP_Draw_t * rop_draw) switch (rop_draw->ROP) /* Ternary raster operations */ { case SRCCOPY: /* dest = source */ - printf("ipa_rop_draw SRCCOPY ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw SRCCOPY ROP mode not implemented\n"); break; case SRCPAINT: /* dest = source OR dest */ - printf("ipa_rop_draw SRCPAINT ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw SRCPAINT ROP mode not implemented\n"); break; case SRCAND: /* dest = source AND dest */ - printf("ipa_rop_draw SRCAND ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw SRCAND ROP mode not implemented\n"); break; case SRCINVERT: /* dest = source XOR dest */ - printf("ipa_rop_draw SRCINVERT ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw SRCINVERT ROP mode not implemented\n"); break; case SRCERASE: /* dest = source AND (NOT dest) */ - printf("ipa_rop_draw SRCERASE ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw SRCERASE ROP mode not implemented\n"); break; case NOTSRCCOPY: /* dest = (NOT source) */ - printf("ipa_rop_draw NOTSRCCOPY ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw NOTSRCCOPY ROP mode not implemented\n"); break; case NOTSRCERASE: /* dest = (NOT src) AND (NOT dest) */ - printf("ipa_rop_draw NOTSRCERASE ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw NOTSRCERASE ROP mode not implemented\n"); break; case MERGECOPY: /* dest = (source AND pattern) */ - printf("ipa_rop_draw MERGECOPY ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw MERGECOPY ROP mode not implemented\n"); break; case MERGEPAINT: /* dest = (NOT source) OR dest */ - printf("ipa_rop_draw MERGEPAINT ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw MERGEPAINT ROP mode not implemented\n"); break; case PATCOPY: /* dest = pattern */ util_set_brush(API, rop_draw->dc, BrushApplyFill); break; case PATPAINT: /* dest = DPSnoo */ - printf("ipa_rop_draw PATPAINT ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw PATPAINT ROP mode not implemented\n"); break; case PATINVERT: /* dest = pattern XOR dest */ - printf("ipa_rop_draw PATINVERT ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw PATINVERT ROP mode not implemented\n"); break; case DSTINVERT: /* dest = (NOT dest) */ - printf("ipa_rop_draw DSTINVERT ROP mode not implemented\n"); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw DSTINVERT ROP mode not implemented\n"); break; case BLACKNESS: /* dest = BLACK */ draw_fill_color_string(WmfDrawingWand,"black"); @@ -626,7 +626,7 @@ static void ipa_rop_draw(wmfAPI * API, wmfROP_Draw_t * rop_draw) draw_fill_color_string(WmfDrawingWand,"white"); break; default: - printf("ipa_rop_draw 0x%x ROP mode not implemented\n", rop_draw->ROP); + (void) LogMagickEvent(CoderEvent,GetMagickModule(),"ipa_rop_draw 0x%x ROP mode not implemented\n", rop_draw->ROP); break; } @@ -683,7 +683,7 @@ static void ipa_bmp_draw(wmfAPI *API, wmfBMP_Draw_t *bmp_draw) crop_info.width = bmp_draw->crop.w; crop_info.height = bmp_draw->crop.h; - crop_image = CropImage( image, &crop_info, exception ); + crop_image = CropImage(image, &crop_info, exception); if (crop_image) { image=DestroyImageList(image); @@ -692,26 +692,26 @@ static void ipa_bmp_draw(wmfAPI *API, wmfBMP_Draw_t *bmp_draw) } } - QueryColorCompliance( "white", AllCompliance, &white, exception ); + QueryColorCompliance("white", AllCompliance, &white, exception); - if ( ddata->image_info->texture || + if (ddata->image_info->texture || !(IsPixelInfoEquivalent(&ddata->image_info->background_color,&white)) || - ddata->image_info->background_color.alpha != OpaqueAlpha ) + ddata->image_info->background_color.alpha != (double) OpaqueAlpha) { /* Set image white background to transparent so that it may be overlaid over non-white backgrounds. */ - QueryColorCompliance( "white", AllCompliance, &white, exception ); - TransparentPaintImage( image, &white, QuantumRange, MagickFalse, exception ); + QueryColorCompliance("white", AllCompliance, &white, exception); + TransparentPaintImage(image, &white, QuantumRange, MagickFalse, exception); } - width = fabs(bmp_draw->pixel_width * (double) bmp_draw->crop.w); - height = fabs(bmp_draw->pixel_height * (double) bmp_draw->crop.h); + width = fabs(bmp_draw->pixel_width *(double) bmp_draw->crop.w); + height = fabs(bmp_draw->pixel_height *(double) bmp_draw->crop.h); magick_wand=NewMagickWandFromImage(image); (void) DrawComposite(WmfDrawingWand, CopyCompositeOp, - XC(bmp_draw->pt.x) * ddata->scale_x, YC(bmp_draw->pt.y) * ddata->scale_y, - width * ddata->scale_x, height * ddata->scale_y, magick_wand); + XC(bmp_draw->pt.x) *ddata->scale_x, YC(bmp_draw->pt.y) *ddata->scale_y, + width *ddata->scale_x, height *ddata->scale_y, magick_wand); magick_wand=DestroyMagickWand(magick_wand); #if 0 @@ -726,7 +726,7 @@ static void ipa_bmp_draw(wmfAPI *API, wmfBMP_Draw_t *bmp_draw) #endif } -static void ipa_bmp_read(wmfAPI * API, wmfBMP_Read_t * bmp_read) { +static void ipa_bmp_read(wmfAPI *API, wmfBMP_Read_t *bmp_read) { wmf_magick_t *ddata = WMF_MAGICK_GetData(API); @@ -759,7 +759,7 @@ static void ipa_bmp_read(wmfAPI * API, wmfBMP_Read_t * bmp_read) { bmp_read->width, bmp_read->height); #endif image=BlobToImage(image_info, (const void *) bmp_read->buffer, - bmp_read->length, exception); + (size_t) bmp_read->length, exception); image_info=DestroyImageInfo(image_info); if (image != (Image *) NULL) { @@ -773,7 +773,7 @@ static void ipa_bmp_read(wmfAPI * API, wmfBMP_Read_t * bmp_read) { } } -static void ipa_bmp_free(wmfAPI * API, wmfBMP * bmp) +static void ipa_bmp_free(wmfAPI *API, wmfBMP *bmp) { (void) API; DestroyImageList((Image*)bmp->data); @@ -785,7 +785,7 @@ static void ipa_bmp_free(wmfAPI * API, wmfBMP * bmp) /* This called by wmf_play() the *first* time the meta file is played */ -static void ipa_device_open(wmfAPI * API) +static void ipa_device_open(wmfAPI *API) { wmf_magick_t *ddata = WMF_MAGICK_GetData (API); @@ -802,7 +802,7 @@ static void ipa_device_open(wmfAPI * API) /* This called by wmf_api_destroy() */ -static void ipa_device_close(wmfAPI * API) +static void ipa_device_close(wmfAPI *API) { wmf_magick_t *ddata = WMF_MAGICK_GetData(API); @@ -825,7 +825,7 @@ static void ipa_device_close(wmfAPI * API) /* This called from the beginning of each play for initial page setup */ -static void ipa_device_begin(wmfAPI * API) +static void ipa_device_begin(wmfAPI *API) { char comment[MagickPathExtent]; @@ -882,7 +882,7 @@ static void ipa_device_begin(wmfAPI * API) image_info = CloneImageInfo((ImageInfo *) 0); (void) CopyMagickString(image_info->filename,ddata->image_info->texture, MagickPathExtent); - if ( ddata->image_info->size ) + if (ddata->image_info->size) CloneString(&image_info->size,ddata->image_info->size); image = ReadImage(image_info,exception); @@ -932,7 +932,7 @@ static void ipa_device_begin(wmfAPI * API) /* This called from the end of each play for page termination */ -static void ipa_device_end(wmfAPI * API) +static void ipa_device_end(wmfAPI *API) { wmf_magick_t *ddata = WMF_MAGICK_GetData(API); @@ -946,7 +946,7 @@ static void ipa_device_end(wmfAPI * API) (void) PopDrawingWand(WmfDrawingWand); } -static void ipa_flood_interior(wmfAPI * API, wmfFlood_t * flood) +static void ipa_flood_interior(wmfAPI *API, wmfFlood_t *flood) { /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); @@ -960,7 +960,7 @@ static void ipa_flood_interior(wmfAPI * API, wmfFlood_t * flood) (void) PopDrawingWand(WmfDrawingWand); } -static void ipa_flood_exterior(wmfAPI * API, wmfFlood_t * flood) +static void ipa_flood_exterior(wmfAPI *API, wmfFlood_t *flood) { /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); @@ -978,7 +978,7 @@ static void ipa_flood_exterior(wmfAPI * API, wmfFlood_t * flood) (void) PopDrawingWand(WmfDrawingWand); } -static void ipa_draw_pixel(wmfAPI * API, wmfDrawPixel_t * draw_pixel) +static void ipa_draw_pixel(wmfAPI *API, wmfDrawPixel_t *draw_pixel) { /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); @@ -990,35 +990,35 @@ static void ipa_draw_pixel(wmfAPI * API, wmfDrawPixel_t * draw_pixel) DrawRectangle(WmfDrawingWand, XC(draw_pixel->pt.x), YC(draw_pixel->pt.y), - XC(draw_pixel->pt.x + draw_pixel->pixel_width), - YC(draw_pixel->pt.y + draw_pixel->pixel_height)); + XC((double) draw_pixel->pt.x + draw_pixel->pixel_width), + YC((double) draw_pixel->pt.y + draw_pixel->pixel_height)); /* Restore graphic wand */ (void) PopDrawingWand(WmfDrawingWand); } -static void ipa_draw_pie(wmfAPI * API, wmfDrawArc_t * draw_arc) +static void ipa_draw_pie(wmfAPI *API, wmfDrawArc_t *draw_arc) { util_draw_arc(API, draw_arc, magick_arc_pie); } -static void ipa_draw_chord(wmfAPI * API, wmfDrawArc_t * draw_arc) +static void ipa_draw_chord(wmfAPI *API, wmfDrawArc_t *draw_arc) { util_draw_arc(API, draw_arc, magick_arc_chord); } -static void ipa_draw_arc(wmfAPI * API, wmfDrawArc_t * draw_arc) +static void ipa_draw_arc(wmfAPI *API, wmfDrawArc_t *draw_arc) { util_draw_arc(API, draw_arc, magick_arc_open); } -static void ipa_draw_ellipse(wmfAPI * API, wmfDrawArc_t * draw_arc) +static void ipa_draw_ellipse(wmfAPI *API, wmfDrawArc_t *draw_arc) { util_draw_arc(API, draw_arc, magick_arc_ellipse); } -static void util_draw_arc(wmfAPI * API, - wmfDrawArc_t * draw_arc, magick_arc_t finish) +static void util_draw_arc(wmfAPI *API, + wmfDrawArc_t *draw_arc, magick_arc_t finish) { wmfD_Coord BR, @@ -1077,8 +1077,8 @@ static void util_draw_arc(wmfAPI * API, end.x -= O.x; end.y -= O.y; - phi_s = atan2((double) start.y, (double) start.x) * 180 / MagickPI; - phi_e = atan2((double) end.y, (double) end.x) * 180 / MagickPI; + phi_s = atan2((double) start.y, (double) start.x) *180 / MagickPI; + phi_e = atan2((double) end.y, (double) end.x) *180 / MagickPI; if (phi_e <= phi_s) phi_e += 360; @@ -1120,7 +1120,7 @@ static void util_draw_arc(wmfAPI * API, (void) PopDrawingWand(WmfDrawingWand); } -static void ipa_draw_line(wmfAPI * API, wmfDrawLine_t * draw_line) +static void ipa_draw_line(wmfAPI *API, wmfDrawLine_t *draw_line) { /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); @@ -1137,7 +1137,7 @@ static void ipa_draw_line(wmfAPI * API, wmfDrawLine_t * draw_line) (void) PopDrawingWand(WmfDrawingWand); } -static void ipa_poly_line(wmfAPI * API, wmfPolyLine_t * polyline) +static void ipa_poly_line(wmfAPI *API, wmfPolyLine_t *polyline) { if (polyline->count <= 2) return; @@ -1169,7 +1169,7 @@ static void ipa_poly_line(wmfAPI * API, wmfPolyLine_t * polyline) } } -static void ipa_draw_polygon(wmfAPI * API, wmfPolyLine_t * polyline) +static void ipa_draw_polygon(wmfAPI *API, wmfPolyLine_t *polyline) { if (polyline->count <= 2) return; @@ -1205,7 +1205,7 @@ static void ipa_draw_polygon(wmfAPI * API, wmfPolyLine_t * polyline) /* Draw a polypolygon. A polypolygon is a list of polygons */ #if defined(MAGICKCORE_WMF_DELEGATE) -static void ipa_draw_polypolygon(wmfAPI * API, wmfPolyPoly_t* polypolygon) +static void ipa_draw_polypolygon(wmfAPI *API, wmfPolyPoly_t* polypolygon) { if (TO_FILL(polypolygon) || TO_DRAW(polypolygon)) { @@ -1253,7 +1253,7 @@ static void ipa_draw_polypolygon(wmfAPI * API, wmfPolyPoly_t* polypolygon) } #endif -static void ipa_draw_rectangle(wmfAPI * API, wmfDrawRectangle_t * draw_rect) +static void ipa_draw_rectangle(wmfAPI *API, wmfDrawRectangle_t *draw_rect) { /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); @@ -1279,7 +1279,7 @@ static void ipa_draw_rectangle(wmfAPI * API, wmfDrawRectangle_t * draw_rect) } /* Draw an un-filled rectangle using the current brush */ -static void ipa_region_frame(wmfAPI * API, wmfPolyRectangle_t * poly_rect) +static void ipa_region_frame(wmfAPI *API, wmfPolyRectangle_t *poly_rect) { /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); @@ -1304,7 +1304,7 @@ static void ipa_region_frame(wmfAPI * API, wmfPolyRectangle_t * poly_rect) (void) PopDrawingWand(WmfDrawingWand); } -static void ipa_region_paint(wmfAPI * API, wmfPolyRectangle_t * poly_rect) +static void ipa_region_paint(wmfAPI *API, wmfPolyRectangle_t *poly_rect) { if (poly_rect->count == 0) @@ -1433,11 +1433,11 @@ static void ipa_functions(wmfAPI *API) ddata->image = 0; } -static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text) +static void ipa_draw_text(wmfAPI *API, wmfDrawText_t *draw_text) { double - angle = 0, /* text rotation angle */ - pointsize = 0; /* pointsize to output font with desired height */ + angle = 0.0, /* text rotation angle */ + pointsize = 0.0; /* pointsize to output font with desired height */ ExceptionInfo *exception; @@ -1464,17 +1464,18 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text) *font; wmf_magick_t - * ddata = WMF_MAGICK_GetData(API); + *ddata = WMF_MAGICK_GetData(API); point = draw_text->pt; /* Choose bounding box and calculate its width and height */ #if !defined(MAGICKCORE_WMF_DELEGATE) { - double dx, + double + dx, dy; - if ( draw_text->flags) + if (draw_text->flags) { TL = draw_text->TL; BR = draw_text->BR; @@ -1501,9 +1502,15 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text) font = WMF_DC_FONT(draw_text->dc); + if (!draw_text->str) + return; + /* Convert font_height to equivalent pointsize */ exception=ddata->exception; - pointsize = util_pointsize( API, font, draw_text->str, draw_text->font_height, exception); + pointsize = util_pointsize(API, font, draw_text->str, draw_text->font_height, exception); + + if (pointsize <= 0.0) + return; /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); @@ -1514,7 +1521,7 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text) /* printf("WMF_FONT_NAME: = \"%s\"\n", WMF_FONT_NAME(font)); */ printf("WMF_FONT_PSNAME: = \"%s\"\n", WMF_FONT_PSNAME(font)); printf("Bounding box TL=%g,%g BR=%g,%g\n", - TL.x, TL.y, BR.x, BR.y ); + TL.x, TL.y, BR.x, BR.y); /* printf("Text box = %gx%g\n", bbox_width, bbox_height); */ /* printf("WMF_FONT_HEIGHT = %i\n", (int)WMF_FONT_HEIGHT(font)); */ printf("Pointsize = %g\n", pointsize); @@ -1522,7 +1529,7 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text) #endif /* - * Obtain font metrics if required + *Obtain font metrics if required * */ if ((WMF_DC_TEXTALIGN(draw_text->dc) & TA_CENTER) || @@ -1545,12 +1552,12 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text) if ((WMF_DC_TEXTALIGN(draw_text->dc) & TA_CENTER)) { double - text_width = metrics.width * (ddata->scale_y / ddata->scale_x); + text_width = metrics.width *(ddata->scale_y / ddata->scale_x); #if defined(MAGICKCORE_WMF_DELEGATE) - point.x -= text_width / 2; + point.x -= (float) (text_width / 2.0); #else - point.x += bbox_width / 2 - text_width / 2; + point.x += (float) (bbox_width / 2.0 - text_width / 2.0); #endif } } @@ -1593,7 +1600,7 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text) } /* Set text clipping (META_EXTTEXTOUT mode) */ - if ( draw_text->flags & ETO_CLIPPED) + if (draw_text->flags & ETO_CLIPPED) { } @@ -1625,7 +1632,7 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text) DrawRotate(WmfDrawingWand, angle); /* - * Render text + *Render text * */ @@ -1646,9 +1653,9 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text) if (metrics.underline_thickness < 1.5) line_height *= 0.55; ulTL.x = 0; - ulTL.y = fabs(metrics.descent) - line_height; - ulBR.x = metrics.width; - ulBR.y = fabs(metrics.descent); + ulTL.y = (float) fabs(metrics.descent) - line_height; + ulBR.x = (float) metrics.width; + ulBR.y = (float) fabs(metrics.descent); DrawRectangle(WmfDrawingWand, XC(ulTL.x), YC(ulTL.y), XC(ulBR.x), YC(ulBR.y)); @@ -1693,7 +1700,7 @@ static void ipa_draw_text(wmfAPI * API, wmfDrawText_t * draw_text) } -static void ipa_udata_init(wmfAPI * API, wmfUserData_t * userdata) +static void ipa_udata_init(wmfAPI *API, wmfUserData_t *userdata) { (void) API; (void) userdata; @@ -1701,7 +1708,7 @@ static void ipa_udata_init(wmfAPI * API, wmfUserData_t * userdata) } -static void ipa_udata_copy(wmfAPI * API, wmfUserData_t * userdata) +static void ipa_udata_copy(wmfAPI *API, wmfUserData_t *userdata) { (void) API; (void) userdata; @@ -1709,7 +1716,7 @@ static void ipa_udata_copy(wmfAPI * API, wmfUserData_t * userdata) } -static void ipa_udata_set(wmfAPI * API, wmfUserData_t * userdata) +static void ipa_udata_set(wmfAPI *API, wmfUserData_t *userdata) { (void) API; (void) userdata; @@ -1752,7 +1759,7 @@ static void util_set_brush(wmfAPI *API, wmfDC *dc,const BrushApply brush_apply) /* WMF_BRUSH_COLOR specifies brush color, WMF_BRUSH_HATCH ignored */ { - if ( brush_apply == BrushApplyStroke ) + if (brush_apply == BrushApplyStroke) draw_stroke_color_rgb(API,WMF_BRUSH_COLOR(brush)); else draw_fill_color_rgb(API,WMF_BRUSH_COLOR(brush)); @@ -1761,7 +1768,7 @@ static void util_set_brush(wmfAPI *API, wmfDC *dc,const BrushApply brush_apply) case BS_HOLLOW /* 1 */: /* BS_HOLLOW & BS_NULL share enum */ /* WMF_BRUSH_COLOR and WMF_BRUSH_HATCH ignored */ { - if ( brush_apply == BrushApplyStroke ) + if (brush_apply == BrushApplyStroke) draw_stroke_color_string(WmfDrawingWand,"none"); else draw_fill_color_string(WmfDrawingWand,"none"); @@ -1778,12 +1785,12 @@ static void util_set_brush(wmfAPI *API, wmfDC *dc,const BrushApply brush_apply) if (WMF_DC_OPAQUE(dc)) { - if ( brush_apply == BrushApplyStroke ) + if (brush_apply == BrushApplyStroke) draw_stroke_color_rgb(API,WMF_DC_BACKGROUND(dc)); else draw_fill_color_rgb(API,WMF_DC_BACKGROUND(dc)); - DrawRectangle(WmfDrawingWand, 0, 0, 7, 7 ); + DrawRectangle(WmfDrawingWand, 0, 0, 7, 7); } DrawSetStrokeAntialias(WmfDrawingWand, MagickFalse); @@ -1811,24 +1818,24 @@ static void util_set_brush(wmfAPI *API, wmfDC *dc,const BrushApply brush_apply) } case HS_BDIAGONAL: /* / */ { - DrawLine(WmfDrawingWand, 0, 7, 7, 0 ); + DrawLine(WmfDrawingWand, 0, 7, 7, 0); break; } case HS_CROSS: /* +++++ */ { - DrawLine(WmfDrawingWand, 0, 3, 7, 3 ); - DrawLine(WmfDrawingWand, 3, 0, 3, 7 ); + DrawLine(WmfDrawingWand, 0, 3, 7, 3); + DrawLine(WmfDrawingWand, 3, 0, 3, 7); break; } case HS_DIAGCROSS: /* xxxxx */ { - DrawLine(WmfDrawingWand, 0, 0, 7, 7 ); - DrawLine(WmfDrawingWand, 0, 7, 7, 0 ); + DrawLine(WmfDrawingWand, 0, 0, 7, 7); + DrawLine(WmfDrawingWand, 0, 7, 7, 0); break; } default: { - printf("util_set_brush: unexpected brush hatch enumeration %u\n", + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: unexpected brush hatch enumeration %u\n", (unsigned int)WMF_BRUSH_HATCH(brush)); } } @@ -1841,7 +1848,7 @@ static void util_set_brush(wmfAPI *API, wmfDC *dc,const BrushApply brush_apply) (void) FormatLocaleString(pattern_id,MagickPathExtent,"#brush_%lu", ddata->pattern_id); - if (brush_apply == BrushApplyStroke ) + if (brush_apply == BrushApplyStroke) (void) DrawSetStrokePatternURL(WmfDrawingWand,pattern_id); else (void) DrawSetFillPatternURL(WmfDrawingWand,pattern_id); @@ -1853,12 +1860,12 @@ static void util_set_brush(wmfAPI *API, wmfDC *dc,const BrushApply brush_apply) /* WMF_BRUSH_COLOR ignored, WMF_BRUSH_HATCH provides handle to bitmap */ { - printf("util_set_brush: BS_PATTERN not supported\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: BS_PATTERN not supported\n"); break; } case BS_INDEXED /* 4 */: { - printf("util_set_brush: BS_INDEXED not supported\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: BS_INDEXED not supported\n"); break; } case BS_DIBPATTERN /* 5 */: @@ -1884,56 +1891,56 @@ static void util_set_brush(wmfAPI *API, wmfDC *dc,const BrushApply brush_apply) { /* Binary raster ops */ case R2_BLACK: - printf("util_set_brush: R2_BLACK ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_BLACK ROP2 mode not supported!\n"); break; case R2_NOTMERGEPEN: - printf("util_set_brush: R2_NOTMERGEPEN ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_NOTMERGEPEN ROP2 mode not supported!\n"); break; case R2_MASKNOTPEN: - printf("util_set_brush R2_MASKNOTPEN ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush R2_MASKNOTPEN ROP2 mode not supported!\n"); break; case R2_NOTCOPYPEN: - printf("util_set_brush: R2_NOTCOPYPEN ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_NOTCOPYPEN ROP2 mode not supported!\n"); break; case R2_MASKPENNOT: - printf("util_set_brush: R2_MASKPENNOT ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_MASKPENNOT ROP2 mode not supported!\n"); break; case R2_NOT: - printf("util_set_brush: R2_NOT ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_NOT ROP2 mode not supported!\n"); break; case R2_XORPEN: - printf("util_set_brush: R2_XORPEN ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_XORPEN ROP2 mode not supported!\n"); break; case R2_NOTMASKPEN: - printf("util_set_brush: R2_NOTMASKPEN ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_NOTMASKPEN ROP2 mode not supported!\n"); break; case R2_MASKPEN: - printf("util_set_brush: R2_MASKPEN ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_MASKPEN ROP2 mode not supported!\n"); break; case R2_NOTXORPEN: - printf("util_set_brush: R2_NOTXORPEN ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_NOTXORPEN ROP2 mode not supported!\n"); break; case R2_NOP: - printf("util_set_brush: R2_NOP ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_NOP ROP2 mode not supported!\n"); break; case R2_MERGENOTPEN: - printf("util_set_brush: R2_MERGENOTPEN ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_MERGENOTPEN ROP2 mode not supported!\n"); break; case R2_COPYPEN: mode = CopyCompositeOp; break; case R2_MERGEPENNOT: - printf("util_set_brush: R2_MERGEPENNOT ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_MERGEPENNOT ROP2 mode not supported!\n"); break; case R2_MERGEPEN: - printf("util_set_brush: R2_MERGEPEN ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_MERGEPEN ROP2 mode not supported!\n"); break; case R2_WHITE: - printf("util_set_brush: R2_WHITE ROP2 mode not supported!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: R2_WHITE ROP2 mode not supported!\n"); break; default: { - printf("util_set_brush: unexpected ROP2 enumeration %u!\n", + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: unexpected ROP2 enumeration %u!\n", (unsigned int)WMF_DC_ROP(dc)); } } @@ -1954,7 +1961,7 @@ static void util_set_brush(wmfAPI *API, wmfDC *dc,const BrushApply brush_apply) (void) FormatLocaleString(pattern_id,MagickPathExtent,"#brush_%lu", ddata->pattern_id); - if ( brush_apply == BrushApplyStroke ) + if (brush_apply == BrushApplyStroke) (void) DrawSetStrokePatternURL(WmfDrawingWand,pattern_id); else (void) DrawSetFillPatternURL(WmfDrawingWand,pattern_id); @@ -1962,7 +1969,7 @@ static void util_set_brush(wmfAPI *API, wmfDC *dc,const BrushApply brush_apply) } } else - printf("util_set_brush: no BMP image data!\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: no BMP image data!\n"); break; } @@ -1970,17 +1977,17 @@ static void util_set_brush(wmfAPI *API, wmfDC *dc,const BrushApply brush_apply) /* WMF_BRUSH_COLOR ignored, WMF_BRUSH_HATCH provides pointer to DIB */ { - printf("util_set_brush: BS_DIBPATTERNPT not supported\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: BS_DIBPATTERNPT not supported\n"); break; } case BS_PATTERN8X8 /* 7 */: { - printf("util_set_brush: BS_PATTERN8X8 not supported\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: BS_PATTERN8X8 not supported\n"); break; } case BS_DIBPATTERN8X8 /* 8 */: { - printf("util_set_brush: BS_DIBPATTERN8X8 not supported\n"); + LogMagickEvent(CoderEvent,GetMagickModule(),"util_set_brush: BS_DIBPATTERN8X8 not supported\n"); break; } default: @@ -1989,7 +1996,7 @@ static void util_set_brush(wmfAPI *API, wmfDC *dc,const BrushApply brush_apply) } } -static void util_set_pen(wmfAPI * API, wmfDC * dc) +static void util_set_pen(wmfAPI *API, wmfDC *dc) { wmf_magick_t *ddata = WMF_MAGICK_GetData(API); @@ -2025,7 +2032,7 @@ static void util_set_pen(wmfAPI * API, wmfDC * dc) return; } - DrawSetStrokeAntialias(WmfDrawingWand, MagickTrue ); + DrawSetStrokeAntialias(WmfDrawingWand, MagickTrue); DrawSetStrokeWidth(WmfDrawingWand,MagickMax(0.0, pen_width)); { @@ -2077,8 +2084,8 @@ static void util_set_pen(wmfAPI * API, wmfDC * dc) case PS_DASH: /* ------- */ { /* Pattern 18,7 */ - dasharray[0] = pixel_width * 18; - dasharray[1] = pixel_width * 7; + dasharray[0] = pixel_width *18; + dasharray[1] = pixel_width *7; dasharray[2] = 0; DrawSetStrokeAntialias(WmfDrawingWand,MagickFalse); @@ -2089,8 +2096,8 @@ static void util_set_pen(wmfAPI * API, wmfDC * dc) case PS_DOT: /* ....... */ { /* Pattern 3,3 */ - dasharray[0] = pixel_width * 3; - dasharray[1] = pixel_width * 3; + dasharray[0] = pixel_width *3; + dasharray[1] = pixel_width *3; dasharray[2] = 0; DrawSetStrokeAntialias(WmfDrawingWand,MagickFalse); @@ -2100,10 +2107,10 @@ static void util_set_pen(wmfAPI * API, wmfDC * dc) case PS_DASHDOT: /* _._._._ */ { /* Pattern 9,6,3,6 */ - dasharray[0] = pixel_width * 9; - dasharray[1] = pixel_width * 6; - dasharray[2] = pixel_width * 3; - dasharray[3] = pixel_width * 6; + dasharray[0] = pixel_width *9; + dasharray[1] = pixel_width *6; + dasharray[2] = pixel_width *3; + dasharray[3] = pixel_width *6; dasharray[4] = 0; DrawSetStrokeAntialias(WmfDrawingWand,MagickFalse); @@ -2113,12 +2120,12 @@ static void util_set_pen(wmfAPI * API, wmfDC * dc) case PS_DASHDOTDOT: /* _.._.._ */ { /* Pattern 9,3,3,3,3,3 */ - dasharray[0] = pixel_width * 9; - dasharray[1] = pixel_width * 3; - dasharray[2] = pixel_width * 3; - dasharray[3] = pixel_width * 3; - dasharray[4] = pixel_width * 3; - dasharray[5] = pixel_width * 3; + dasharray[0] = pixel_width *9; + dasharray[1] = pixel_width *3; + dasharray[2] = pixel_width *3; + dasharray[3] = pixel_width *3; + dasharray[4] = pixel_width *3; + dasharray[5] = pixel_width *3; dasharray[6] = 0; DrawSetStrokeAntialias(WmfDrawingWand,MagickFalse); @@ -2139,7 +2146,7 @@ static void util_set_pen(wmfAPI * API, wmfDC * dc) } /* Estimate font pointsize based on Windows font parameters */ -static double util_pointsize( wmfAPI* API, wmfFont* font, char* str, double font_height, ExceptionInfo *exception) +static double util_pointsize(wmfAPI* API, wmfFont* font, char* str, double font_height, ExceptionInfo *exception) { wmf_magick_t *ddata = WMF_MAGICK_GetData(API); @@ -2170,17 +2177,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 *PerceptibleReciprocal(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 *PerceptibleReciprocal(metrics.ascent + fabs(metrics.descent))); } else { - pointsize = (font_height * (font_height * PerceptibleReciprocal(metrics.height))); + pointsize = (font_height *(font_height *PerceptibleReciprocal(metrics.height))); draw_info->pointsize = pointsize; if (GetTypeMetrics(image, draw_info, &metrics, exception) != MagickFalse) - pointsize *= (font_height * PerceptibleReciprocal((double) metrics.height)); + pointsize *= (font_height *PerceptibleReciprocal((double) metrics.height)); } #if 0 @@ -2210,14 +2217,14 @@ static double util_pointsize( wmfAPI* API, wmfFont* font, char* str, double font #if defined(MAGICKCORE_WMF_DELEGATE) /* - * Returns width of string in points, assuming (unstretched) font size of 1pt - * (similar to wmf_ipa_font_stringwidth) + *Returns width of string in points, assuming (unstretched) font size of 1pt + *(similar to wmf_ipa_font_stringwidth) * - * This extremely odd at best, particularly since player/meta.h has access - * to the corrected font_height (as drawtext.font_height) when it invokes the - * stringwidth callback. It should be possible to compute the real stringwidth! + *This extremely odd at best, particularly since player/meta.h has access + *to the corrected font_height (as drawtext.font_height) when it invokes the + *stringwidth callback. It should be possible to compute the real stringwidth! */ -static float lite_font_stringwidth( wmfAPI* API, wmfFont* font, char* str) +static float lite_font_stringwidth(wmfAPI* API, wmfFont* font, char* str) { #if 0 wmf_magick_t @@ -2263,7 +2270,7 @@ static float lite_font_stringwidth( wmfAPI* API, wmfFont* font, char* str) exception=ddata->exception; if (GetTypeMetrics(image, draw_info, &metrics, exception) != MagickFalse) - stringwidth = ((metrics.width * 72)/(image->resolution.x * draw_info->pointsize)); /* *0.916348; */ + stringwidth = ((metrics.width *72)/(image->resolution.x *draw_info->pointsize)); /* *0.916348; */ draw_info->font=NULL; draw_info->text=NULL; @@ -2342,7 +2349,7 @@ static wmfMapping SubFontMap[] = { (char *) NULL, (char *) NULL, FT_ENCODING_NONE } }; -static void lite_font_map( wmfAPI* API, wmfFont* font) +static void lite_font_map(wmfAPI* API, wmfFont* font) { wmfFontData *font_data; @@ -2402,7 +2409,7 @@ static void lite_font_map( wmfAPI* API, wmfFont* font) if (WMF_FONT_ITALIC(font)) style=ItalicStyle; type_info=GetTypeInfoByFamily(wmf_font_name,style,AnyStretch, - target_weight,exception); + (size_t) target_weight,exception); if (type_info == (const TypeInfo *) NULL) type_info=GetTypeInfoByFamily(wmf_font_name,AnyStyle,AnyStretch,0, exception); @@ -2411,7 +2418,7 @@ static void lite_font_map( wmfAPI* API, wmfFont* font) } /* Look for exact full match */ - if(!magick_font->ps_name) + if (!magick_font->ps_name) { type_info=GetTypeInfo(wmf_font_name,exception); if (type_info != (const TypeInfo *) NULL) @@ -2430,20 +2437,20 @@ static void lite_font_map( wmfAPI* API, wmfFont* font) want_bold = MagickFalse, i; - if ( WMF_FONT_WEIGHT(font) != 0 ) + if (WMF_FONT_WEIGHT(font) != 0) target_weight = WMF_FONT_WEIGHT(font); - if ( (target_weight > 550) || ((strstr(wmf_font_name,"Bold") || + if ((target_weight > 550) || ((strstr(wmf_font_name,"Bold") || strstr(wmf_font_name,"Heavy") || - strstr(wmf_font_name,"Black"))) ) + strstr(wmf_font_name,"Black")))) want_bold = MagickTrue; - if ( (WMF_FONT_ITALIC(font)) || ((strstr(wmf_font_name,"Italic") || - strstr(wmf_font_name,"Oblique"))) ) + if ((WMF_FONT_ITALIC(font)) || ((strstr(wmf_font_name,"Italic") || + strstr(wmf_font_name,"Oblique")))) want_italic = MagickTrue; (void) CopyMagickString(target,"Times",MagickPathExtent); - for( i=0; SubFontMap[i].name != NULL; i++ ) + for(i=0; SubFontMap[i].name != NULL; i++) { if (LocaleCompare(wmf_font_name, SubFontMap[i].name) == 0) { @@ -2453,7 +2460,7 @@ static void lite_font_map( wmfAPI* API, wmfFont* font) } } - for( i=0; WMFFontMap[i].name != NULL; i++ ) + for(i=0; WMFFontMap[i].name != NULL; i++) { if (LocaleNCompare(WMFFontMap[i].name,target,strlen(WMFFontMap[i].name)) == 0) { @@ -2480,7 +2487,7 @@ static void lite_font_map( wmfAPI* API, wmfFont* font) } /* Initialize API font structures */ -static void lite_font_init( wmfAPI* API, wmfAPI_Options* options) +static void lite_font_init(wmfAPI* API, wmfAPI_Options* options) { wmfFontData *font_data; @@ -2585,7 +2592,7 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) } /* - * Create WMF API + *Create WMF API * */ @@ -2633,7 +2640,7 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) #endif /* - * Open BLOB input via libwmf API + *Open BLOB input via libwmf API * */ wmf_error = wmf_bbuf_input(API,ipa_blob_read,ipa_blob_seek, @@ -2655,7 +2662,7 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) } /* - * Scan WMF file + *Scan WMF file * */ if (image->debug != MagickFalse) @@ -2677,7 +2684,7 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) } /* - * Compute dimensions and scale factors + *Compute dimensions and scale factors * */ @@ -2718,7 +2725,7 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Obtain (or guess) metafile units */ if ((API)->File->placeable && (API)->File->pmh->Inch) units_per_inch=(API)->File->pmh->Inch; - else if ( (wmf_width*wmf_height) < 1024*1024) + else if ((wmf_width*wmf_height) < 1024*1024) units_per_inch=POINTS_PER_INCH; /* MM_TEXT */ else units_per_inch=TWIPS_PER_INCH; /* MM_TWIPS */ @@ -2727,15 +2734,15 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) resolution */ image_width_inch = (double) wmf_width / units_per_inch; image_height_inch = (double) wmf_height / units_per_inch; - image_width = image_width_inch * resolution_x; - image_height = image_height_inch * resolution_y; + image_width = image_width_inch *resolution_x; + image_height = image_height_inch *resolution_y; /* Compute bounding box scale factors and origin translations * - * This all just a hack since libwmf does not currently seem to - * provide the mapping between LOGICAL coordinates and DEVICE - * coordinates. This mapping is necessary in order to know - * where to place the logical bounding box within the image. + *This all just a hack since libwmf does not currently seem to + *provide the mapping between LOGICAL coordinates and DEVICE + *coordinates. This mapping is necessary in order to know + *where to place the logical bounding box within the image. * */ @@ -2753,7 +2760,7 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Heuristic: guess that if the vertical coordinates mostly span negative values, then the image must be inverted. */ - if ( fabs(bbox.BR.y) > fabs(bbox.TL.y) ) + if (fabs(bbox.BR.y) > fabs(bbox.TL.y)) { /* Normal (Origin at top left of image) */ ddata->scale_y = (image_height/bounding_height); @@ -2773,15 +2780,16 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) (API)->File->placeable ? "Yes" : "No"); (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " Size in metafile units: %gx%g",wmf_width,wmf_height); + " Size in metafile units: %gx%g",(double) wmf_width,(double) + wmf_height); (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Metafile units/inch: %g",units_per_inch); (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Size in inches: %gx%g", image_width_inch,image_height_inch); (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " Bounding Box: %g,%g %g,%g", - bbox.TL.x, bbox.TL.y, bbox.BR.x, bbox.BR.y); + " Bounding Box: %g,%g %g,%g",(double) bbox.TL.x, + (double) bbox.TL.y, (double) bbox.BR.x, (double) bbox.BR.y); (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Bounding width x height: %gx%g",bounding_width, bounding_height); @@ -2836,7 +2844,7 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) #endif /* - * Create canvas image + *Create canvas image * */ image->rows=(unsigned long) ceil(image_height); @@ -2861,16 +2869,16 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) (unsigned long) image->columns); /* - * Set solid background color + *Set solid background color */ { image->background_color = image_info->background_color; - if (image->background_color.alpha != OpaqueAlpha) + if (image->background_color.alpha != (double) OpaqueAlpha) image->alpha_trait=BlendPixelTrait; (void) SetImageBackgroundColor(image,exception); } /* - * Play file to generate Vector drawing commands + *Play file to generate Vector drawing commands * */ @@ -2894,7 +2902,7 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) } /* - * Scribble on canvas image + *Scribble on canvas image * */ diff --git a/ImageMagick-7.1.1-15/coders/wmf.h b/ImageMagick-7.1.1-16/coders/wmf.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/wmf.h rename to ImageMagick-7.1.1-16/coders/wmf.h diff --git a/ImageMagick-7.1.1-15/coders/wpg.c b/ImageMagick-7.1.1-16/coders/wpg.c similarity index 97% rename from ImageMagick-7.1.1-15/coders/wpg.c rename to ImageMagick-7.1.1-16/coders/wpg.c index 9b33b85d..74198522 100644 --- a/ImageMagick-7.1.1-15/coders/wpg.c +++ b/ImageMagick-7.1.1-16/coders/wpg.c @@ -465,7 +465,7 @@ static int UnpackWPGRaster(Image *image,int bpp,ExceptionInfo *exception) x=0; y=0; - ldblk=(ssize_t) ((bpp*image->columns+7)/8); + ldblk=(ssize_t) ((bpp*(ssize_t) image->columns+7)/8); BImgBuff=(unsigned char *) AcquireQuantumMemory((size_t) ldblk, 8*sizeof(*BImgBuff)); if(BImgBuff==NULL) return(-2); @@ -587,12 +587,12 @@ static int UnpackWPG2Raster(Image *image,int bpp,ExceptionInfo *exception) x=0; y=0; - ldblk=(ssize_t) ((bpp*image->columns+7)/8); + ldblk=(ssize_t) ((bpp*(ssize_t) image->columns+7)/8); BImgBuff=(unsigned char *) AcquireQuantumMemory((size_t) ldblk, 8*sizeof(*BImgBuff)); if(BImgBuff==NULL) return(-2); - (void) memset(BImgBuff,0,ldblk*8*sizeof(*BImgBuff)); + (void) memset(BImgBuff,0,((size_t) ldblk*8*sizeof(*BImgBuff))); while( y< (ssize_t) image->rows) { @@ -601,7 +601,7 @@ static int UnpackWPG2Raster(Image *image,int bpp,ExceptionInfo *exception) switch(bbuf) { case 0x7D: - SampleSize=ReadBlobByte(image); /* DSZ */ + SampleSize=(unsigned int) ReadBlobByte(image); /* DSZ */ if(SampleSize>8) { BImgBuff=(unsigned char *) RelinquishMagickMemory(BImgBuff); @@ -682,7 +682,7 @@ static int UnpackWPG2Raster(Image *image,int bpp,ExceptionInfo *exception) InsertByte6(SampleBuffer[bbuf]); } else { /* NRP */ - for(i=0; i < (ssize_t) (SampleSize*(RunCount+1)); i++) + for(i=0; i < (ssize_t) ((int) SampleSize*((int) RunCount+1)); i++) { bbuf=ReadBlobByte(image); InsertByte6(bbuf); @@ -849,7 +849,7 @@ static Image *ExtractPostscript(Image *image,const ImageInfo *image_info, (void) fclose(ps_file); /* Detect file format - Check magic.mgk configuration file. */ - magic_info=GetMagicInfo(magick,count,exception); + magic_info=GetMagicInfo(magick,(size_t) count,exception); if(magic_info == (const MagicInfo *) NULL) goto FINISH_UNL; if(exception->severity != UndefinedException) goto FINISH_UNL; (void) CopyMagickString(clone_info->magick,GetMagicName(magic_info), @@ -1137,7 +1137,8 @@ static Image *ReadWPGImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); if (EOFBlob(image)) break; - Header.DataOffset=TellBlob(image)+Rec.RecordLength; + Header.DataOffset=(MagickOffsetType) TellBlob(image)+(ssize_t) + Rec.RecordLength; if (Header.DataOffset > (MagickOffsetType) GetBlobSize(image)) ThrowReaderException(CorruptImageError, "InsufficientImageDataInFile"); @@ -1160,7 +1161,7 @@ static Image *ReadWPGImage(const ImageInfo *image_info,ExceptionInfo *exception) } image->columns=BitmapHeader1.Width; image->rows=BitmapHeader1.Height; - bpp=BitmapHeader1.Depth; + bpp=(int) BitmapHeader1.Depth; if ((bpp == 1) && (AcquireImageColormap(image,2,exception) == MagickFalse)) goto NoMemory; @@ -1177,8 +1178,8 @@ static Image *ReadWPGImage(const ImageInfo *image_info,ExceptionInfo *exception) image->colors=WPG_Palette.NumOfEntries; if (AcquireImageColormap(image,image->colors,exception) == MagickFalse) goto NoMemory; - for (i=WPG_Palette.StartIndex; - i < (int)WPG_Palette.NumOfEntries; i++) + for (i=(int) WPG_Palette.StartIndex; + i < (int) WPG_Palette.NumOfEntries; i++) { image->colormap[i].red=ScaleCharToQuantum((unsigned char) ReadBlobByte(image)); @@ -1229,7 +1230,7 @@ static Image *ReadWPGImage(const ImageInfo *image_info,ExceptionInfo *exception) } image->columns=BitmapHeader2.Width; image->rows=BitmapHeader2.Height; - bpp=BitmapHeader2.Depth; + bpp=(int) BitmapHeader2.Depth; UnpackRaster: status=SetImageExtent(image,image->columns,image->rows,exception); @@ -1391,7 +1392,8 @@ static Image *ReadWPGImage(const ImageInfo *image_info,ExceptionInfo *exception) if(EOFBlob(image)) break; - Header.DataOffset=TellBlob(image)+Rec2.RecordLength; + Header.DataOffset=(MagickOffsetType) (TellBlob(image)+(ssize_t) + Rec2.RecordLength); switch(Rec2.RecType) { @@ -1412,14 +1414,14 @@ static Image *ReadWPGImage(const ImageInfo *image_info,ExceptionInfo *exception) if (AcquireImageColormap(image,image->colors,exception) == MagickFalse) ThrowReaderException(ResourceLimitError, "MemoryAllocationFailed"); - for (i=WPG_Palette.StartIndex; - i < (int)WPG_Palette.NumOfEntries; i++) + for (i=(int) WPG_Palette.StartIndex; + i < (int) WPG_Palette.NumOfEntries; i++) { - image->colormap[i].red=ScaleCharToQuantum((char) + image->colormap[i].red=ScaleCharToQuantum((unsigned char) ReadBlobByte(image)); - image->colormap[i].green=ScaleCharToQuantum((char) + image->colormap[i].green=ScaleCharToQuantum((unsigned char) ReadBlobByte(image)); - image->colormap[i].blue=ScaleCharToQuantum((char) + image->colormap[i].blue=ScaleCharToQuantum((unsigned char) ReadBlobByte(image)); image->colormap[i].alpha=OpaqueAlpha; (void) ReadBlobByte(image); /*Opacity??*/ @@ -1484,7 +1486,7 @@ static Image *ReadWPGImage(const ImageInfo *image_info,ExceptionInfo *exception) { case 0: /*Uncompressed raster*/ { - ldblk=(ssize_t) ((bpp*image->columns+7)/8); + ldblk=(ssize_t) ((bpp*(ssize_t) image->columns+7)/8); BImgBuff=(unsigned char *) AcquireQuantumMemory((size_t) ldblk+1,sizeof(*BImgBuff)); if (BImgBuff == (unsigned char *) NULL) @@ -1568,7 +1570,7 @@ static Image *ReadWPGImage(const ImageInfo *image_info,ExceptionInfo *exception) { image=ExtractPostscript(image,image_info, TellBlob(image)+i, /*skip PS header in the wpg2*/ - (ssize_t) (Rec2.RecordLength-i-2),exception); + (ssize_t) Rec2.RecordLength-i-2,exception); if (image == NULL) ThrowReaderException(CorruptImageError, "ImproperImageHeader"); @@ -1576,7 +1578,8 @@ static Image *ReadWPGImage(const ImageInfo *image_info,ExceptionInfo *exception) break; case 0x1B: /*bitmap rectangle*/ - WPG2Flags = LoadWPG2Flags(image,StartWPG.PosSizePrecision,NULL,&CTM); + WPG2Flags = (int) LoadWPG2Flags(image,(char) + StartWPG.PosSizePrecision,NULL,&CTM); (void) WPG2Flags; break; } @@ -1761,9 +1764,9 @@ static void WPGAddRLEByte(WPGRLEInfo *rle_info,Image *image, { rle_info->count++; WPGFlushRLE(rle_info,image,(unsigned char) (rle_info->offset- - rle_info->count-1)); - (void) WriteBlobByte(image,(unsigned char) - rle_info->count | 0x80); + (ssize_t) rle_info->count-1)); + (void) WriteBlobByte(image,(unsigned char) ( + rle_info->count | 0x80)); (void) WriteBlobByte(image,rle_info->pixels[0]); rle_info->offset=1; rle_info->pixels[0]=byte; @@ -1773,7 +1776,7 @@ static void WPGAddRLEByte(WPGRLEInfo *rle_info,Image *image, else rle_info->count++; } - if ((rle_info->offset-rle_info->count) > 0x7E) + if ((rle_info->offset-(ssize_t) rle_info->count) > 0x7E) { WPGFlushRLE(rle_info,image,0x7F); return; @@ -1781,7 +1784,7 @@ static void WPGAddRLEByte(WPGRLEInfo *rle_info,Image *image, if ((rle_info->offset > 0x7E) && (rle_info->count >= 1)) { WPGFlushRLE(rle_info,image,(unsigned char) (rle_info->offset- - rle_info->count-1)); + (ssize_t) rle_info->count-1)); return; } } diff --git a/ImageMagick-7.1.1-15/coders/wpg.h b/ImageMagick-7.1.1-16/coders/wpg.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/wpg.h rename to ImageMagick-7.1.1-16/coders/wpg.h diff --git a/ImageMagick-7.1.1-15/coders/x.c b/ImageMagick-7.1.1-16/coders/x.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/x.c rename to ImageMagick-7.1.1-16/coders/x.c diff --git a/ImageMagick-7.1.1-15/coders/x.h b/ImageMagick-7.1.1-16/coders/x.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/x.h rename to ImageMagick-7.1.1-16/coders/x.h diff --git a/ImageMagick-7.1.1-15/coders/xbm.c b/ImageMagick-7.1.1-16/coders/xbm.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/xbm.c rename to ImageMagick-7.1.1-16/coders/xbm.c index 29c6437d..c1d67653 100644 --- a/ImageMagick-7.1.1-15/coders/xbm.c +++ b/ImageMagick-7.1.1-16/coders/xbm.c @@ -159,7 +159,7 @@ static int XBMInteger(Image *image,short int *hex_digits) value*=16; c&=0xff; if (value <= (unsigned int) ((INT_MAX-1)-hex_digits[c])) - value+=hex_digits[c]; + value+=(unsigned int) hex_digits[c]; } c=ReadBlobByte(image); if (c == EOF) @@ -574,7 +574,7 @@ static MagickBooleanType WriteXBMImage(const ImageInfo *image_info,Image *image, for (x=0; x < (ssize_t) image->columns; x++) { byte>>=1; - if (GetPixelLuma(image,p) < (QuantumRange/2)) + if (GetPixelLuma(image,p) < ((double) QuantumRange/2)) byte|=0x80; bit++; if (bit == 8) diff --git a/ImageMagick-7.1.1-15/coders/xbm.h b/ImageMagick-7.1.1-16/coders/xbm.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/xbm.h rename to ImageMagick-7.1.1-16/coders/xbm.h diff --git a/ImageMagick-7.1.1-15/coders/xc.c b/ImageMagick-7.1.1-16/coders/xc.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/xc.c rename to ImageMagick-7.1.1-16/coders/xc.c diff --git a/ImageMagick-7.1.1-15/coders/xc.h b/ImageMagick-7.1.1-16/coders/xc.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/xc.h rename to ImageMagick-7.1.1-16/coders/xc.h diff --git a/ImageMagick-7.1.1-15/coders/xcf.c b/ImageMagick-7.1.1-16/coders/xcf.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/xcf.c rename to ImageMagick-7.1.1-16/coders/xcf.c index dad2e390..a60b0f92 100644 --- a/ImageMagick-7.1.1-15/coders/xcf.c +++ b/ImageMagick-7.1.1-16/coders/xcf.c @@ -403,7 +403,7 @@ static char *ReadBlobStringWithLongSize(Image *image,char *string,size_t max, string[i]=(char) c; } string[i]='\0'; - offset=SeekBlob(image,(MagickOffsetType) (length-i),SEEK_CUR); + offset=SeekBlob(image,((MagickOffsetType) length-i),SEEK_CUR); if (offset < 0) (void) ThrowMagickException(exception,GetMagickModule(), CorruptImageError,"ImproperImageHeader","`%s'",image->filename); @@ -549,7 +549,7 @@ static MagickBooleanType load_tile_rle(Image *image,Image *tile_image, exception); if (q == (Quantum *) NULL) continue; - size=(MagickOffsetType) tile_image->rows*tile_image->columns; + size=(MagickOffsetType) (tile_image->rows*tile_image->columns); while (size > 0) { if (xcfdata > xcfdatalimit) @@ -566,7 +566,7 @@ static MagickBooleanType load_tile_rle(Image *image,Image *tile_image, length=(size_t) ((*xcfdata << 8) + xcfdata[1]) & 0xffff; xcfdata+=2; } - size-=length; + size-=(MagickOffsetType) length; if (size < 0) goto bogus_rle; if ((length < 1) || (length > data_length)) @@ -623,7 +623,7 @@ static MagickBooleanType load_tile_rle(Image *image,Image *tile_image, length=(size_t) ((*xcfdata << 8) + xcfdata[1]) & 0xffff; xcfdata+=2; } - size-=length; + size-=(MagickOffsetType) length; if (size < 0) goto bogus_rle; if (xcfdata > xcfdatalimit) @@ -1016,7 +1016,7 @@ static MagickBooleanType ReadOneLayer(const ImageInfo *image_info,Image* image, ssize_t scene; - scene=inDocInfo->number_layers-layer-1; + scene=(ssize_t) inDocInfo->number_layers-layer-1; if (scene > (ssize_t) (image_info->scene+image_info->number_scenes-1)) { outLayer->image=CloneImage(image,0,0,MagickTrue,exception); @@ -1406,13 +1406,17 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception) } else { - int - current_layer = 0, - foundAllLayers = MagickFalse, - number_layers = 0; + MagickBooleanType + foundAllLayers = MagickFalse; MagickOffsetType - oldPos=TellBlob(image); + oldPos = TellBlob(image); + + size_t + number_layers = 0; + + ssize_t + current_layer = 0; XCFLayerInfo *layer_info; @@ -1426,7 +1430,11 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception) if (offset == 0) foundAllLayers=MagickTrue; else - number_layers++; + { + number_layers++; + if (AcquireMagickResource(ListLengthResource,number_layers) == MagickFalse) + ThrowReaderException(ResourceLimitError,"ListLengthExceedsLimit"); + } if (EOFBlob(image) != MagickFalse) { ThrowFileException(exception,CorruptImageError, @@ -1434,8 +1442,6 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while (foundAllLayers == MagickFalse); - if (AcquireMagickResource(ListLengthResource,number_layers) == MagickFalse) - ThrowReaderException(ResourceLimitError,"ListLengthExceedsLimit"); doc_info.number_layers=number_layers; offset=SeekBlob(image,oldPos,SEEK_SET); /* restore the position! */ if (offset < 0) diff --git a/ImageMagick-7.1.1-15/coders/xcf.h b/ImageMagick-7.1.1-16/coders/xcf.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/xcf.h rename to ImageMagick-7.1.1-16/coders/xcf.h diff --git a/ImageMagick-7.1.1-15/coders/xpm.c b/ImageMagick-7.1.1-16/coders/xpm.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/xpm.c rename to ImageMagick-7.1.1-16/coders/xpm.c index 09ec991d..57a45d04 100644 --- a/ImageMagick-7.1.1-15/coders/xpm.c +++ b/ImageMagick-7.1.1-16/coders/xpm.c @@ -959,17 +959,15 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image, PixelInfo pixel; - ssize_t - i, - x; - size_t characters_per_pixel; ssize_t + i, j, k, opacity, + x, y; static const char @@ -1011,7 +1009,7 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image, if ((image->storage_class == DirectClass) || (image->colors > 256)) (void) SetImageType(image,PaletteBilevelAlphaType,exception); for (i=0; i < (ssize_t) image->colors; i++) - if (image->colormap[i].alpha != OpaqueAlpha) + if (image->colormap[i].alpha != (double) OpaqueAlpha) { if (opacity < 0) { @@ -1029,16 +1027,16 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image, { (void) SetImageType(image,PaletteBilevelAlphaType,exception); for (i=0; i < (ssize_t) image->colors; i++) - if (image->colormap[i].alpha != OpaqueAlpha) + if (image->colormap[i].alpha != (double) OpaqueAlpha) { if (opacity < 0) { opacity=i; continue; } - alpha=(Quantum) TransparentAlpha-(double) + alpha=(double) TransparentAlpha-(double) image->colormap[i].alpha; - beta=(Quantum) TransparentAlpha-(double) + beta=(double) TransparentAlpha-(double) image->colormap[opacity].alpha; if (alpha < beta) opacity=i; diff --git a/ImageMagick-7.1.1-15/coders/xpm.h b/ImageMagick-7.1.1-16/coders/xpm.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/xpm.h rename to ImageMagick-7.1.1-16/coders/xpm.h diff --git a/ImageMagick-7.1.1-15/coders/xps.c b/ImageMagick-7.1.1-16/coders/xps.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/xps.c rename to ImageMagick-7.1.1-16/coders/xps.c diff --git a/ImageMagick-7.1.1-15/coders/xps.h b/ImageMagick-7.1.1-16/coders/xps.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/xps.h rename to ImageMagick-7.1.1-16/coders/xps.h diff --git a/ImageMagick-7.1.1-15/coders/xwd.c b/ImageMagick-7.1.1-16/coders/xwd.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/xwd.c rename to ImageMagick-7.1.1-16/coders/xwd.c index c05e5147..73ba4ce2 100644 --- a/ImageMagick-7.1.1-15/coders/xwd.c +++ b/ImageMagick-7.1.1-16/coders/xwd.c @@ -430,7 +430,7 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Allocate the pixel buffer. */ - length=(size_t) ximage->bytes_per_line*ximage->height; + length=(size_t) (ximage->bytes_per_line*ximage->height); if (CheckOverflowException(length,ximage->bytes_per_line,ximage->height)) { if (header.ncolors != 0) @@ -444,7 +444,7 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) extent; extent=length; - length*=ximage->depth; + length*=(size_t) ximage->depth; if (CheckOverflowException(length,extent,ximage->depth)) { if (header.ncolors != 0) @@ -544,16 +544,16 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) for (x=0; x < (ssize_t) image->columns; x++) { pixel=XGetPixel(ximage,(int) x,(int) y); - index=(Quantum) ConstrainColormapIndex(image,(ssize_t) (pixel >> - red_shift) & red_mask,exception); + index=(Quantum) ConstrainColormapIndex(image,(ssize_t) ((pixel >> + red_shift) & red_mask),exception); SetPixelRed(image,ScaleShortToQuantum( colors[(ssize_t) index].red),q); - index=(Quantum) ConstrainColormapIndex(image,(ssize_t) (pixel >> - green_shift) & green_mask,exception); + index=(Quantum) ConstrainColormapIndex(image,(ssize_t) ((pixel >> + green_shift) & green_mask),exception); SetPixelGreen(image,ScaleShortToQuantum( colors[(ssize_t) index].green),q); - index=(Quantum) ConstrainColormapIndex(image,(ssize_t) (pixel >> - blue_shift) & blue_mask,exception); + index=(Quantum) ConstrainColormapIndex(image,(ssize_t) ((pixel >> + blue_shift) & blue_mask),exception); SetPixelBlue(image,ScaleShortToQuantum( colors[(ssize_t) index].blue),q); q+=GetPixelChannels(image); diff --git a/ImageMagick-7.1.1-15/coders/xwd.h b/ImageMagick-7.1.1-16/coders/xwd.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/xwd.h rename to ImageMagick-7.1.1-16/coders/xwd.h diff --git a/ImageMagick-7.1.1-15/coders/yaml.c b/ImageMagick-7.1.1-16/coders/yaml.c similarity index 99% rename from ImageMagick-7.1.1-15/coders/yaml.c rename to ImageMagick-7.1.1-16/coders/yaml.c index 69698783..c8b8eb7e 100644 --- a/ImageMagick-7.1.1-15/coders/yaml.c +++ b/ImageMagick-7.1.1-16/coders/yaml.c @@ -591,7 +591,7 @@ static ssize_t PrintChannelLocations(FILE *file,const Image *image, if (traits == UndefinedPixelTrait) continue; offset=GetPixelChannelOffset(image,channel); - match=fabs((double) (p[offset]-target)) < 0.5 ? MagickTrue : MagickFalse; + match=fabs(((double) p[offset]-target)) < 0.5 ? MagickTrue : MagickFalse; if (match != MagickFalse) { if ((max_locations != 0) && (n >= (ssize_t) max_locations)) diff --git a/ImageMagick-7.1.1-15/coders/yaml.h b/ImageMagick-7.1.1-16/coders/yaml.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/yaml.h rename to ImageMagick-7.1.1-16/coders/yaml.h diff --git a/ImageMagick-7.1.1-15/coders/ycbcr.c b/ImageMagick-7.1.1-16/coders/ycbcr.c similarity index 100% rename from ImageMagick-7.1.1-15/coders/ycbcr.c rename to ImageMagick-7.1.1-16/coders/ycbcr.c diff --git a/ImageMagick-7.1.1-15/coders/ycbcr.h b/ImageMagick-7.1.1-16/coders/ycbcr.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/ycbcr.h rename to ImageMagick-7.1.1-16/coders/ycbcr.h diff --git a/ImageMagick-7.1.1-15/coders/yuv.c b/ImageMagick-7.1.1-16/coders/yuv.c similarity index 98% rename from ImageMagick-7.1.1-15/coders/yuv.c rename to ImageMagick-7.1.1-16/coders/yuv.c index 71f3a463..6343f799 100644 --- a/ImageMagick-7.1.1-15/coders/yuv.c +++ b/ImageMagick-7.1.1-16/coders/yuv.c @@ -147,7 +147,7 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) status=SetImageExtent(image,image->columns,image->rows,exception); if (status == MagickFalse) return(DestroyImageList(image)); - quantum=(ssize_t) (image->depth <= 8 ? 1 : 2); + quantum=(size_t) (image->depth <= 8 ? 1 : 2); interlace=image_info->interlace; horizontal_factor=2; vertical_factor=2; @@ -205,9 +205,10 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) status=MagickTrue; do { - chroma_image=CloneImage(image,(image->columns+horizontal_factor-1)/ - horizontal_factor,(image->rows+vertical_factor-1)/vertical_factor, - MagickTrue,exception); + chroma_image=CloneImage(image,(size_t) ((ssize_t) image->columns+ + (ssize_t) horizontal_factor-1)/(size_t) horizontal_factor,(size_t) + (image->rows+(size_t) vertical_factor-1)/ + (size_t) vertical_factor,MagickTrue,exception); if (chroma_image == (Image *) NULL) { scanline=(unsigned char *) RelinquishMagickMemory(scanline); @@ -701,8 +702,8 @@ static MagickBooleanType WriteYUVImage(const ImageInfo *image_info,Image *image, Sample image to an even width and height, if necessary. */ image->depth=(size_t) (quantum == 1 ? 8 : 16); - width=image->columns+(image->columns & (horizontal_factor-1)); - height=image->rows+(image->rows & (vertical_factor-1)); + width=image->columns+(image->columns & (unsigned int) (horizontal_factor-1)); + height=image->rows+(image->rows & (unsigned int) (vertical_factor-1)); yuv_image=ResizeImage(image,width,height,TriangleFilter,exception); if (yuv_image == (Image *) NULL) { @@ -713,8 +714,8 @@ static MagickBooleanType WriteYUVImage(const ImageInfo *image_info,Image *image, /* Downsample image. */ - chroma_image=ResizeImage(image,width/horizontal_factor, - height/vertical_factor,TriangleFilter,exception); + chroma_image=ResizeImage(image,(size_t) ((ssize_t) width/horizontal_factor), + (size_t) ((ssize_t) height/vertical_factor),TriangleFilter,exception); if (chroma_image == (Image *) NULL) { (void) CloseBlob(image); diff --git a/ImageMagick-7.1.1-15/coders/yuv.h b/ImageMagick-7.1.1-16/coders/yuv.h similarity index 100% rename from ImageMagick-7.1.1-15/coders/yuv.h rename to ImageMagick-7.1.1-16/coders/yuv.h diff --git a/ImageMagick-7.1.1-15/configs/arm64/MagickCore/magick-baseconfig.h b/ImageMagick-7.1.1-16/configs/arm64/MagickCore/magick-baseconfig.h similarity index 99% rename from ImageMagick-7.1.1-15/configs/arm64/MagickCore/magick-baseconfig.h rename to ImageMagick-7.1.1-16/configs/arm64/MagickCore/magick-baseconfig.h index 4bb418ff..3b75bf7f 100644 --- a/ImageMagick-7.1.1-15/configs/arm64/MagickCore/magick-baseconfig.h +++ b/ImageMagick-7.1.1-16/configs/arm64/MagickCore/magick-baseconfig.h @@ -1203,7 +1203,7 @@ /* Define to the full name and version of this package. */ #ifndef MAGICKCORE_PACKAGE_STRING -#define MAGICKCORE_PACKAGE_STRING "ImageMagick 7.1.1-15" +#define MAGICKCORE_PACKAGE_STRING "ImageMagick 7.1.1-16" #endif /* Define to the one symbol short name of this package. */ @@ -1218,7 +1218,7 @@ /* Define to the version of this package. */ #ifndef MAGICKCORE_PACKAGE_VERSION -#define MAGICKCORE_PACKAGE_VERSION "7.1.1-15" +#define MAGICKCORE_PACKAGE_VERSION "7.1.1-16" #endif /* Define if you have PANGOCAIRO library */ @@ -1435,7 +1435,7 @@ /* Version number of package */ #ifndef MAGICKCORE_VERSION -#define MAGICKCORE_VERSION "7.1.1-15" +#define MAGICKCORE_VERSION "7.1.1-16" #endif /* Define if you have WEBPMUX library */ diff --git a/ImageMagick-7.1.1-15/configs/arm64/MagickCore/version.h b/ImageMagick-7.1.1-16/configs/arm64/MagickCore/version.h similarity index 96% rename from ImageMagick-7.1.1-15/configs/arm64/MagickCore/version.h rename to ImageMagick-7.1.1-16/configs/arm64/MagickCore/version.h index b13e020f..b9382dc4 100644 --- a/ImageMagick-7.1.1-15/configs/arm64/MagickCore/version.h +++ b/ImageMagick-7.1.1-16/configs/arm64/MagickCore/version.h @@ -30,16 +30,16 @@ extern "C" { #define MagickLibVersion 0x711 #define MagickLibVersionText "7.1.1" #define MagickLibVersionNumber 10,0,1 -#define MagickLibAddendum "'-15" +#define MagickLibAddendum "'-16" #define MagickLibInterface 10 #define MagickLibMinInterface 10 #define MagickPlatform "aarch64" #define MagickppLibVersionText "7.1.1" #define MagickppLibVersionNumber 5:0:0 -#define MagickppLibAddendum "'-15" +#define MagickppLibAddendum "'-16" #define MagickppLibInterface 5 #define MagickppLibMinInterface 5 -#define MagickReleaseDate "2023-07-29" +#define MagickReleaseDate "2023-09-17" #define MagickAuthoritativeLicense \ "https://imagemagick.org/script/license.php" #define MagickAuthoritativeURL "https://imagemagick.org" diff --git a/ImageMagick-7.1.1-15/filters/analyze.c b/ImageMagick-7.1.1-16/filters/analyze.c similarity index 99% rename from ImageMagick-7.1.1-15/filters/analyze.c rename to ImageMagick-7.1.1-16/filters/analyze.c index d7f5d1b4..f0ff4f73 100644 --- a/ImageMagick-7.1.1-15/filters/analyze.c +++ b/ImageMagick-7.1.1-16/filters/analyze.c @@ -198,10 +198,10 @@ ModuleExport size_t analyzeImage(Image **images,const int argc, ConvertRGBToHSL(GetPixelRed(image,p),GetPixelGreen(image,p), GetPixelBlue(image,p),&h,&s,&b); - b*=QuantumRange; + b*=(double) QuantumRange; for (i=1; i <= 4; i++) local_brightness.sum[i]+=pow(b,(double) i); - s*=QuantumRange; + s*=(double) QuantumRange; for (i=1; i <= 4; i++) local_saturation.sum[i]+=pow(s,(double) i); p+=GetPixelChannels(image); diff --git a/ImageMagick-7.1.1-15/utilities/magick.c b/ImageMagick-7.1.1-16/utilities/magick.c similarity index 99% rename from ImageMagick-7.1.1-15/utilities/magick.c rename to ImageMagick-7.1.1-16/utilities/magick.c index ed8456ee..3bc6289b 100644 --- a/ImageMagick-7.1.1-15/utilities/magick.c +++ b/ImageMagick-7.1.1-16/utilities/magick.c @@ -113,12 +113,12 @@ static int MagickMain(int argc,char **argv) MagickBooleanType status; - ssize_t - i; - size_t number_commands; + ssize_t + i; + MagickCoreGenesis(*argv,MagickTrue); MagickWandGenesis(); exception=AcquireExceptionInfo(); @@ -132,7 +132,7 @@ static int MagickMain(int argc,char **argv) if (offset == 0) break; } - i%=(number_commands); + i%=(ssize_t) number_commands; if ((i == 0) && (argc > 1)) { for (i=1; i < (ssize_t) number_commands; i++) @@ -145,7 +145,7 @@ static int MagickMain(int argc,char **argv) break; } } - i%=number_commands; + i%=(ssize_t) number_commands; } metadata=(char *) NULL; status=MagickCommandGenesis(image_info,MagickCommands[i].command,argc,argv, diff --git a/README.md b/README.md index 046d200c..94ad6a9d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Android ImageMagick 7.1.1-15 +# Android ImageMagick 7.1.1-16 [![Build](https://github.com/MolotovCherry/Android-ImageMagick7/actions/workflows/build.yml/badge.svg?event=push)](https://github.com/MolotovCherry/Android-ImageMagick7/actions/workflows/build.yml) [![CodeQL](https://github.com/MolotovCherry/Android-ImageMagick7/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/MolotovCherry/Android-ImageMagick7/actions/workflows/codeql-analysis.yml) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/MolotovCherry/Android-ImageMagick7?style=plastic)