diff --git a/ImageMagick.spec.in b/ImageMagick.spec.in index e94a58e432af94536c72c64b1ff81ece6024696b..d97858f13b5c0a8a45d8610cace72eaa9c935403 100644 --- a/ImageMagick.spec.in +++ b/ImageMagick.spec.in @@ -1,65 +1,130 @@ -%global VERSION @PACKAGE_BASE_VERSION@ -%global Patchlevel @MAGICK_PATCHLEVEL_VERSION@ +%bcond_without tests -Name: @PACKAGE_NAME@ -Version: %{VERSION} -Release: %{Patchlevel} -Summary: Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition resize, rotate, shear, distort and transform images. -License: https://imagemagick.org/script/license.php -Url: https://imagemagick.org/ -Source0: https://imagemagick.org/download/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.xz +%bcond_without libheif + +%if 0%{?flatpak} +%bcond_with perl +%else +%bcond_without perl +%endif + +# Disable automatic .la file removal +%global __brp_remove_la_files %nil -BuildRequires: pkgconfig(bzip2), pkgconfig(freetype2), pkgconfig(libjpeg), pkgconfig(libpng) -BuildRequires: pkgconfig(libtiff-4), giflib-devel, pkgconfig(zlib), perl-devel >= 5.8.1 +%global Version @PACKAGE_BASE_VERSION@ +%global Patchlevel @MAGICK_PATCHLEVEL_VERSION@ +%global libsover 7 +%global libcxxsover 9 + +Name: ImageMagick +Epoch: 1 +Version: %{Version} +Release: %{Patchlevel} +Summary: Use ImageMagick to create, edit, convert, and display raster image files. + +License: ImageMagick +URL: https://imagemagick.org/ +Source0: https://imagemagick.org/archive/releases/%{name}-%{Version}-%{Patchlevel}.tar.xz + +BuildRequires: pkgconfig(bzip2) +BuildRequires: pkgconfig(freetype2) +BuildRequires: pkgconfig(libjpeg) +BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(libtiff-4) +BuildRequires: giflib-devel +BuildRequires: pkgconfig(zlib) +%if %{with perl} +BuildRequires: perl-devel >= 5.8.1 BuildRequires: perl-generators -BuildRequires: libgs-devel, ghostscript-x11 +%endif +%if 0%{?rhel} && 0%{?rhel} < 8 +BuildRequires: ghostscript-devel +%else +BuildRequires: libgs-devel +%endif BuildRequires: pkgconfig(ddjvuapi) -BuildRequires: pkgconfig(libwmf), pkgconfig(jasper), libtool-ltdl-devel -BuildRequires: pkgconfig(x11), pkgconfig(xext), pkgconfig(xt) -BuildRequires: pkgconfig(lcms2), pkgconfig(libxml-2.0), pkgconfig(librsvg-2.0) +BuildRequires: pkgconfig(libwmf) +BuildRequires: pkgconfig(jasper) +BuildRequires: libtool-ltdl-devel +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(xt) +BuildRequires: pkgconfig(lcms2) +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(librsvg-2.0) +%if 0%{?rhel} && 0%{?rhel} < 9 +BuildRequires: pkgconfig(IlmBase), pkgconfig(OpenEXR) < 2.5.6 +%else BuildRequires: pkgconfig(OpenEXR) -BuildRequires: pkgconfig(fftw3), pkgconfig(libwebp) +%endif +BuildRequires: pkgconfig(fftw3) +BuildRequires: pkgconfig(libwebp) BuildRequires: jbigkit-devel +BuildRequires: pkgconfig(libjxl) BuildRequires: pkgconfig(libopenjp2) >= 2.1.0 BuildRequires: pkgconfig(libcgraph) >= 2.9.0 BuildRequires: pkgconfig(raqm) +%if 0%{?fedora} || 0%{?rhel} > 8 BuildRequires: pkgconfig(lqr-1) +%endif BuildRequires: pkgconfig(libraw) >= 0.14.8 BuildRequires: pkgconfig(libzstd) +BuildRequires: pkgconfig(libzip) >= 1.0.0 +BuildRequires: pkgconfig(pango) >= 1.28.1 +BuildRequires: pkgconfig(pangocairo) >= 1.28.1 +BuildRequires: urw-base35-fonts-devel BuildRequires: autoconf automake gcc gcc-c++ +BuildRequires: make +BuildRequires: gnupg2 +# for doc +BuildRequires: doxygen -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +# allow smooth upgrade for 3rd party repository +# providing latest version/soname as ImageMagick7 +Obsoletes: %{name}6 < %{epoch}:%{version}-%{release} +Provides: %{name}6 = %{epoch}:%{version}-%{release} %description -ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, TIFF, DPX, EXR, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. +ImageMagick is a free and open-source software suite used for creating, +editing, converting, and displaying raster image files. It can read and write +over 200 different image file formats. ImageMagick is a powerful tool for +working with images on the command line or through programming interfaces. It +supports a wide range of image processing operations, including resizing, +cropping, rotating, and various color manipulations. -The functionality of ImageMagick is typically utilized from the command-line or you can use the features from programs written in your favorite language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), Lua (LuaJIT), NMagick (Neko/haXe), Magick.NET (.NET), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), IMagick (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images dynamically and automagically. +ImageMagick is widely used in web development, graphic design, and other +areas where image processing is required. It provides a versatile and +efficient way to handle a variety of image-related tasks. Additionally, +ImageMagick has bindings for various programming languages, making it easy +to integrate into software applications +and workflows. -ImageMagick utilizes multiple computational threads to increase performance and can read, process, or write mega-, giga-, or tera-pixel image sizes. - -ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may use, copy, modify, and distribute in both open and proprietary applications. It is distributed under the Apache 2.0 license. - -The ImageMagick development process ensures a stable API and ABI. Before each ImageMagick release, we perform a comprehensive security assessment that includes memory error and thread data race detection to prevent security vulnerabilities. - -The authoritative ImageMagick web site is https://imagemagick.org. The authoritative source code repository is http://git.imagemagick.org/repos/ImageMagick. We maintain a source code mirror at GitHub. %package devel -Summary: Library links and header files for ImageMagick application development -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Summary: Library links and header files for ImageMagick app development +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Obsoletes: %{name}6-devel < %{epoch}:%{version}-%{release} +Provides: %{name}6-devel = %{epoch}:%{version}-%{release} %description devel -ImageMagick-devel contains the library links and header files you'll -need to develop ImageMagick applications. ImageMagick is an image -manipulation program. +ImageMagick-devel contains the library links and header files you'll need to +develop ImageMagick applications. ImageMagick is an image manipulation program. + +If you want to create applications that will use ImageMagick code or APIs, +you need to install ImageMagick-devel as well as ImageMagick. You do not +need to install it if you just want to use ImageMagick, however. -If you want to create applications that will use ImageMagick code or -APIs, you need to install ImageMagick-devel as well as ImageMagick. -You do not need to install it if you just want to use ImageMagick, -however. %package libs Summary: ImageMagick libraries to link with +Obsoletes: %{name}6-libs < %{epoch}:%{version}-%{release} +Provides: %{name}6-libs = %{epoch}:%{version}-%{release} +# These may be used for some functions +Recommends: urw-base35-fonts +# default font is OpenSans-Regular +Recommends: open-sans-fonts %description libs This packages contains a shared libraries to use within other applications. @@ -67,40 +132,63 @@ This packages contains a shared libraries to use within other applications. %package djvu Summary: DjVu plugin for ImageMagick -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Obsoletes: %{name}6-djvu < %{epoch}:%{version}-%{release} +Provides: %{name}6-djvu = %{epoch}:%{version}-%{release} %description djvu This packages contains a plugin for ImageMagick which makes it possible to save and load DjvU files from ImageMagick and libMagickCore using applications. -%package doc -Summary: ImageMagick HTML documentation +%if %{with libheif} +%package heic +Summary: HEIC plugin for ImageMagick +BuildRequires: pkgconfig(libheif) >= 1.4.0 +%if 0%{?rhel} == 7 +# ensure we use our on EL-7 +Requires: libheif%{?_isa} >= 1.4.0 +%endif +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +%description heic +This packages contains a plugin for ImageMagick which makes it possible to +save and load HEIC files from ImageMagick and libMagickCore using applications. +%endif + + +%package doc +Summary: ImageMagick html documentation +Obsoletes: %{name}6-doc < %{epoch}:%{version}-%{release} +Provides: %{name}6-doc = %{epoch}:%{version}-%{release} %description doc -ImageMagick documentation, this package contains usage (for the -commandline tools) and API (for the libraries) documentation in HTML format. +ImageMagick documentation, this package contains usage (for the commandline +tools) and API (for the libraries) documentation in HTML format. Note this documentation can also be found on the ImageMagick website: -https://imagemagick.org/. +https://imagemagick.org/ +%if %{with perl} %package perl -Summary: ImageMagick perl bindings -Requires: %{name}-libs%{?_isa} = %{version}-%{release} -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) - +Summary: ImageMagick perl bindings +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Obsoletes: %{name}6-perl < %{epoch}:%{version}-%{release} +Provides: %{name}6-perl = %{epoch}:%{version}-%{release} %description perl Perl bindings to ImageMagick. Install ImageMagick-perl if you want to use any perl scripts that use ImageMagick. +%endif %package c++ -Summary: ImageMagick Magick++ library (C++ bindings) -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Summary: ImageMagick Magick++ library (C++ bindings) +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Obsoletes: %{name}6-c++ < %{epoch}:%{version}-%{release} +Provides: %{name}6-c++ = %{epoch}:%{version}-%{release} %description c++ This package contains the Magick++ library, a C++ binding to the ImageMagick @@ -110,66 +198,85 @@ Install ImageMagick-c++ if you want to use any applications that use Magick++. %package c++-devel -Summary: C++ bindings for the ImageMagick library -Requires: %{name}-c++%{?_isa} = %{version}-%{release} -Requires: %{name}-devel%{?_isa} = %{version}-%{release} +Summary: C++ bindings for the ImageMagick library +Requires: %{name}-c++%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release} +Obsoletes: %{name}6-c++-devel < %{epoch}:%{version}-%{release} +Provides: %{name}6-c++-devel = %{epoch}:%{version}-%{release} %description c++-devel ImageMagick-devel contains the static libraries and header files you'll need to develop ImageMagick applications using the Magick++ C++ bindings. ImageMagick is an image manipulation program. -If you want to create applications that will use Magick++ code -or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and -ImageMagick. - +If you want to create applications that will use Magick++ code or APIs, you'll +need to install ImageMagick-c++-devel, ImageMagick-devel and ImageMagick. You don't need to install it if you just want to use ImageMagick, or if you want to develop/compile applications using the ImageMagick C interface, however. %prep -%autosetup -p1 -n %{name}-%{VERSION}-%{Patchlevel} +%autosetup -p1 -n %{name}-%{Version}-%{Patchlevel} # for %%doc mkdir Magick++/examples cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples + %build -autoconf -f -i +autoconf -f -i -v +# Reduce thread contention, upstream sets this flag for Linux hosts export CFLAGS="%{optflags} -DIMPNG_SETJMP_IS_THREAD_SAFE" -%configure --enable-shared \ +%configure \ + --enable-shared \ --disable-static \ --with-modules \ +%if %{with perl} --with-perl \ + --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'" \ +%endif --with-x \ --with-threads \ --with-magick_plus_plus \ --with-gslib \ + --with-pango \ + --with-fftw \ --with-wmf \ --with-webp \ --with-openexr \ --with-rsvg \ --with-xml \ - --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'" \ + --with-urw-base35-font-dir="%{urw_base35_fontpath}" \ --without-dps \ --without-gcc-arch \ --with-jbig \ + --with-jxl \ --with-openjp2 \ --with-raw \ +%if 0%{?fedora} || 0%{?rhel} > 8 --with-lqr \ +%endif --with-gvc \ - --with-raqm + --with-raqm \ +%if %{with libheif} + --with-heic \ +%endif # Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild -make -j3 +make -j6 +# Generate API docs +make html-local %install %make_install -cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION} + +cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{Version} +# Do NOT remove .la files for codecs rm %{buildroot}%{_libdir}/*.la +%if %{with perl} # perlmagick: fix perl path of demo files %{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl @@ -179,20 +286,20 @@ find %{buildroot} -name ".packlist" |xargs rm -f find %{buildroot} -name "perllocal.pod" |xargs rm -f # perlmagick: build files list -echo "%defattr(-,root,root,-)" > perl-pkg-files find %{buildroot}/%{_libdir}/perl* -type f -print \ - | sed "s@^%{buildroot}@@g" > perl-pkg-files -#find %{buildroot}%{perl_vendorarch} -type d -print \ -# | sed "s@^%{buildroot}@%dir @g" \ -# | grep -v '^%dir %{perl_vendorarch}$' \ -# | grep -v '/auto$' >> perl-pkg-files + | sed "s@^%{buildroot}@@g" > perl-pkg-files +find %{buildroot}%{perl_vendorarch} -type d -print \ + | sed "s@^%{buildroot}@%dir @g" \ + | grep -v '^%dir %{perl_vendorarch}$' \ + | grep -v '/auto$' >> perl-pkg-files if [ -z perl-pkg-files ] ; then - echo "ERROR: EMPTY FILE LIST" - exit -1 + echo "ERROR: EMPTY FILE LIST" + exit -1 fi +%endif # fix multilib issues: Rename provided file with platform-bits in name. -# Create platform independent file inplace of provided and conditionally include required. +# Create platform independant file inplace of provided and conditionally include required. # $1 - filename.h to process. function multilibFileVersions(){ mv $1 ${1%%.h}-%{__isa_bits}.h @@ -216,81 +323,94 @@ multilibFileVersions %{buildroot}%{_includedir}/%{name}-6/magick/magick-config.h multilibFileVersions %{buildroot}%{_includedir}/%{name}-6/magick/magick-baseconfig.h multilibFileVersions %{buildroot}%{_includedir}/%{name}-6/magick/version.h + %check +%if %{with tests} export LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %make_build check +%endif +rm PerlMagick/demo/Generic.ttf %ldconfig_scriptlets libs %ldconfig_scriptlets c++ %files -%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt +%doc README.txt NOTICE AUTHORS.txt NEWS.txt +%license LICENSE %{_bindir}/[a-z]* %{_mandir}/man[145]/[a-z]* %{_mandir}/man1/%{name}.* %files libs -%doc LICENSE NOTICE AUTHORS.txt QuickStart.txt -%{_libdir}/libMagickCore-6.Q16.so* -%{_libdir}/libMagickWand-6.Q16.so* -%{_libdir}/%{name}-%{VERSION} +%doc NOTICE AUTHORS.txt QuickStart.txt +%license LICENSE +%{_libdir}/libMagickCore-6.Q16.so.%{libsover}{,.*} +%{_libdir}/libMagickWand-6.Q16.so.%{libsover}{,.*} +%{_libdir}/%{name}-%{Version} %{_datadir}/%{name}-6 -%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.* +%exclude %{_libdir}/%{name}-%{Version}/modules-Q16/coders/djvu.* %dir %{_sysconfdir}/%{name}-6 %config(noreplace) %{_sysconfdir}/%{name}-6/*.xml %files devel -%{_bindir}/MagickCore-config %{_bindir}/Magick-config -%{_bindir}/MagickWand-config +%{_bindir}/MagickCore-config %{_bindir}/Wand-config +%{_bindir}/MagickWand-config %{_libdir}/libMagickCore-6.Q16.so %{_libdir}/libMagickWand-6.Q16.so %{_libdir}/pkgconfig/MagickCore.pc %{_libdir}/pkgconfig/MagickCore-6.Q16.pc %{_libdir}/pkgconfig/ImageMagick.pc %{_libdir}/pkgconfig/ImageMagick-6.Q16.pc +%{_libdir}/pkgconfig/ImageMagick++.pc +%{_libdir}/pkgconfig/ImageMagick++-6.Q16.pc %{_libdir}/pkgconfig/MagickWand.pc -%{_libdir}/pkgconfig/MagickWand-6.Q16.pc %{_libdir}/pkgconfig/Wand.pc +%{_libdir}/pkgconfig/MagickWand-6.Q16.pc %{_libdir}/pkgconfig/Wand-6.Q16.pc %dir %{_includedir}/%{name}-6 %{_includedir}/%{name}-6/magick %{_includedir}/%{name}-6/wand %{_mandir}/man1/Magick-config.* %{_mandir}/man1/MagickCore-config.* -%{_mandir}/man1/Wand-config.* %{_mandir}/man1/MagickWand-config.* +%{_mandir}/man1/Wand-config.* %files djvu -%{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.* +%{_libdir}/%{name}-%{Version}/modules-Q16/coders/djvu.* + +%if %{with libheif} +%files heic +%{_libdir}/%{name}-%{Version}/modules-Q16/coders/heic.* +%endif %files doc %doc %{_datadir}/doc/%{name}-6 -%doc %{_datadir}/doc/%{name}-%{VERSION} +%doc %{_datadir}/doc/%{name}-%{Version} %doc LICENSE %files c++ %doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README %doc www/Magick++/COPYING -%{_libdir}/libMagick++-6.Q16.so.* +%{_libdir}/libMagick++-6.Q16.so.%{libcxxsover}{,.*} %files c++-devel %doc Magick++/examples %{_bindir}/Magick++-config -%{_includedir}/%{name}-6/Magick++ +%{_includedir}/%{name}-6/Magick++/ %{_includedir}/%{name}-6/Magick++.h %{_libdir}/libMagick++-6.Q16.so %{_libdir}/pkgconfig/Magick++.pc %{_libdir}/pkgconfig/Magick++-6.Q16.pc -%{_libdir}/pkgconfig/ImageMagick++.pc -%{_libdir}/pkgconfig/ImageMagick++-6.Q16.pc %{_mandir}/man1/Magick++-config.* +%if %{with perl} %files perl -f perl-pkg-files %{_mandir}/man3/* %doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt +%endif %changelog -* Sun May 01 2005 Cristy 1.0-0 -- Port of RedHat's RPM script to support ImageMagick. +* Sat Jan 27 2024 Cristy - 6.9.13-7 +- Port of RedHat's script to create ImageMagick's RPM distribution. diff --git a/LICENSE b/LICENSE index ad5c3388798c8b981a21c920162048ed60f5e7fc..73c0a9181d49f403a8e2e038a964afa4b482b1a9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,6 @@ + ImageMagick License + https://imagemagick.org/script/license.php + Before we get to the text of the license, lets just review what the license says in simple terms: It allows you to: diff --git a/Magick++/bin/Magick++-config.in b/Magick++/bin/Magick++-config.in index 67aa72d3689c9effeb1a9c0f2aa40279433ba976..19450abcd7a7e4d77b1e16af914b459d41043f91 100755 --- a/Magick++/bin/Magick++-config.in +++ b/Magick++/bin/Magick++-config.in @@ -7,6 +7,9 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ +libdir=@libdir@ +pkgconfigdir=@pkgconfigdir@ +export PKG_CONFIG_LIBDIR="${pkgconfigdir}" usage='Usage: Magick++-config [--cppflags] [--cxxflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version] diff --git a/Magick++/demo/analyze.cpp b/Magick++/demo/analyze.cpp index 50f82e254c3d0696247c4a9f933e41239bc42428..13be24fafe3a5f76a63ae0ff0e406cf7c0020051 100644 --- a/Magick++/demo/analyze.cpp +++ b/Magick++/demo/analyze.cpp @@ -8,6 +8,7 @@ // #include +#include #include #include #include diff --git a/Magick++/demo/button.cpp b/Magick++/demo/button.cpp index 88db625b14e9ee82ad619a16103b4aa207060254..a51e467ba071b63be16667fbfdd4b3feb24b65ea 100644 --- a/Magick++/demo/button.cpp +++ b/Magick++/demo/button.cpp @@ -5,6 +5,7 @@ // #include +#include #include #include diff --git a/Magick++/demo/demo.cpp b/Magick++/demo/demo.cpp index 14721dbcd94f11a67b11490b7b07ae2b1458760b..d1df1f02c406efbf324f137b207948a9609b6157 100644 --- a/Magick++/demo/demo.cpp +++ b/Magick++/demo/demo.cpp @@ -11,6 +11,7 @@ // #include +#include #include #include #include diff --git a/Magick++/demo/detrans.cpp b/Magick++/demo/detrans.cpp index 65932d6d680009ece29f01951175e12b616c0dc6..743376e3a21b509304376a660105d4df663f3db3 100644 --- a/Magick++/demo/detrans.cpp +++ b/Magick++/demo/detrans.cpp @@ -11,6 +11,7 @@ // #include +#include #include using namespace std; using namespace Magick; diff --git a/Magick++/demo/flip.cpp b/Magick++/demo/flip.cpp index 61dae1968bef4da5ab7f15e8f6b6657e1af2111f..b32f90359fea684994f925fb8f2480aef8a5f937 100644 --- a/Magick++/demo/flip.cpp +++ b/Magick++/demo/flip.cpp @@ -9,6 +9,7 @@ // #include +#include #include #include #include diff --git a/Magick++/demo/gravity.cpp b/Magick++/demo/gravity.cpp index b853fac0d919a802e1b40f64db77c232e68c993f..af920bca15788ace01710b059cc8cdb12583aef2 100644 --- a/Magick++/demo/gravity.cpp +++ b/Magick++/demo/gravity.cpp @@ -13,6 +13,7 @@ // #include +#include #include #include #include diff --git a/Magick++/demo/piddle.cpp b/Magick++/demo/piddle.cpp index db415b87ecabaa16d6cf1b4eb0e55d6d7b8edcf2..69447ab04b180569fe198563b7d44861d5739657 100644 --- a/Magick++/demo/piddle.cpp +++ b/Magick++/demo/piddle.cpp @@ -7,6 +7,7 @@ // #include +#include #include #include diff --git a/Magick++/demo/shapes.cpp b/Magick++/demo/shapes.cpp index dde746933a60b080ec1fd62f3a04fa2782ea922a..4eea6b726c41bc4a81973c379efb432cdb0ab9bf 100644 --- a/Magick++/demo/shapes.cpp +++ b/Magick++/demo/shapes.cpp @@ -8,6 +8,7 @@ // #include +#include #include #include diff --git a/Magick++/demo/zoom.cpp b/Magick++/demo/zoom.cpp index 8db2c8e3d502cad70c4c5d730b2cac4af89e8d5a..dc9bc32ae900378da1c5d8a8a52b19e5e215ef9a 100644 --- a/Magick++/demo/zoom.cpp +++ b/Magick++/demo/zoom.cpp @@ -9,6 +9,7 @@ // #include +#include #include #include using namespace std; diff --git a/Magick++/lib/Color.cpp b/Magick++/lib/Color.cpp index 2497eb9556e5d434b7eb1c5f767118fa33a5dc35..28d07bd17b0288068cdee208b85ba7fc1a54359e 100644 --- a/Magick++/lib/Color.cpp +++ b/Magick++/lib/Color.cpp @@ -219,7 +219,12 @@ const Magick::Color& Magick::Color::operator=(const std::string &x11color_) _pixelType=RGBPixel; } else - _isValid=false; + { + _isValid = false; + _pixelOwn = false; + delete _pixel; + _pixel = (PixelPacket *)NULL; + } ThrowPPException(false); return(*this); diff --git a/Magick++/lib/Magick++/ImageRef.h b/Magick++/lib/Magick++/ImageRef.h index bb18299930eea17604ad7756142ce66c52c3f379..e86224f433e0234eb9d474768aef97f7a05025e0 100644 --- a/Magick++/lib/Magick++/ImageRef.h +++ b/Magick++/lib/Magick++/ImageRef.h @@ -14,6 +14,7 @@ #include "Magick++/Include.h" #include "Magick++/Thread.h" +#include namespace Magick { diff --git a/Makefile.in b/Makefile.in index 4ff40d38abbe4ddbd22eb7c1687b9063b463fb8a..f17681fa35df4ee20daa2561d16f63e18977961b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -265,8 +265,7 @@ check_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_4) @MAGICKCORE_ZERO_CONFIGURATION_SUPPORT_TRUE@am__append_5 = magick/threshold-map.h subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ac_func_fseeko.m4 \ - $(top_srcdir)/m4/ax_c___attribute__.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_framework.m4 \ @@ -305,12 +304,13 @@ CONFIG_CLEAN_FILES = common.shi config/configure.xml \ config/MagickCore.dox config/MagickWand.dox \ config/Magick++.dox config/policy.xml config/type-apple.xml \ config/type-dejavu.xml config/type-ghostscript.xml \ - config/type-urw-base35.xml config/type-windows.xml \ - config/type.xml ImageMagick.spec Magick++/bin/Magick++-config \ - magick/ImageMagick.pc Magick++/lib/ImageMagick++.pc \ - Magick++/lib/Magick++.pc magick/Magick-config \ - magick/MagickCore-config magick/MagickCore.pc magick/version.h \ - magick.sh PerlMagick/check.sh PerlMagick/default/Magick.pm \ + config/type-urw-base35.xml config/type-urw-base35-type1.xml \ + config/type-windows.xml config/type.xml ImageMagick.spec \ + Magick++/bin/Magick++-config magick/ImageMagick.pc \ + Magick++/lib/ImageMagick++.pc Magick++/lib/Magick++.pc \ + magick/Magick-config magick/MagickCore-config \ + magick/MagickCore.pc magick/version.h magick.sh \ + PerlMagick/check.sh PerlMagick/default/Magick.pm \ PerlMagick/Makefile.PL PerlMagick/default/Makefile.PL \ PerlMagick/quantum/Makefile.PL PerlMagick/quantum/quantum.pm \ PerlMagick/quantum/quantum.xs PerlMagick/quantum/typemap \ @@ -1475,9 +1475,9 @@ am__magick_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_SOURCES_D magick/locale-private.h magick/log.c magick/log.h magick/mac.h \ magick/magic.c magick/magic.h magick/magick.c \ magick/magick-baseconfig.h magick/magick-config.h \ - magick/magick-type.h magick/magick.h magick/matrix.c \ - magick/matrix.h magick/memory.c magick/memory_.h \ - magick/memory-private.h magick/methods.h \ + magick/magick-type.h magick/magick.h magick/magick-private.h \ + magick/matrix.c magick/matrix.h magick/memory.c \ + magick/memory_.h magick/memory-private.h magick/methods.h \ magick/method-attribute.h magick/mime.c magick/mime.h \ magick/module.c magick/module.h magick/monitor.c \ magick/monitor.h magick/monitor-private.h magick/montage.c \ @@ -2939,6 +2939,7 @@ am__DIST_COMMON = $(srcdir)/ImageMagick.spec.in \ $(top_srcdir)/config/type-apple.xml.in \ $(top_srcdir)/config/type-dejavu.xml.in \ $(top_srcdir)/config/type-ghostscript.xml.in \ + $(top_srcdir)/config/type-urw-base35-type1.xml.in \ $(top_srcdir)/config/type-urw-base35.xml.in \ $(top_srcdir)/config/type-windows.xml.in \ $(top_srcdir)/config/type.xml.in \ @@ -3000,6 +3001,7 @@ AWK = @AWK@ BIN_DIR = @BIN_DIR@ BPGDecodeDelegate = @BPGDecodeDelegate@ BPGEncodeDelegate = @BPGEncodeDelegate@ +BZLIB_CFLAGS = @BZLIB_CFLAGS@ BZLIB_LIBS = @BZLIB_LIBS@ BlenderDecodeDelegate = @BlenderDecodeDelegate@ BrowseDelegate = @BrowseDelegate@ @@ -3023,6 +3025,7 @@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +ClipboardDelegate = @ClipboardDelegate@ ConvertDelegate = @ConvertDelegate@ DATA_DIR = @DATA_DIR@ DEFS = @DEFS@ @@ -3095,6 +3098,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JBIG_LIBS = @JBIG_LIBS@ JEMALLOC_LIBS = @JEMALLOC_LIBS@ +JPEG_CFLAGS = @JPEG_CFLAGS@ JPEG_LIBS = @JPEG_LIBS@ JXRDecodeDelegate = @JXRDecodeDelegate@ JXREncodeDelegate = @JXREncodeDelegate@ @@ -3110,8 +3114,8 @@ LIBEXEC_DIR = @LIBEXEC_DIR@ LIBOBJS = @LIBOBJS@ LIBOPENJP2_CFLAGS = @LIBOPENJP2_CFLAGS@ LIBOPENJP2_LIBS = @LIBOPENJP2_LIBS@ +LIBRARY_ABSOLUTE_PATH = @LIBRARY_ABSOLUTE_PATH@ LIBRARY_EXTRA_CPPFLAGS = @LIBRARY_EXTRA_CPPFLAGS@ -LIBRARY_PATH = @LIBRARY_PATH@ LIBS = @LIBS@ LIBSTDCLDFLAGS = @LIBSTDCLDFLAGS@ LIBTOOL = @LIBTOOL@ @@ -3187,6 +3191,7 @@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_DIR = @MAN_DIR@ MATH_LIBS = @MATH_LIBS@ +MKDIRDelegate = @MKDIRDelegate@ MKDIR_P = @MKDIR_P@ MODULES_BASEDIRNAME = @MODULES_BASEDIRNAME@ MODULES_DIRNAME = @MODULES_DIRNAME@ @@ -3279,6 +3284,7 @@ ShowImageDelegate = @ShowImageDelegate@ TAR = @TAR@ TCMALLOC_LIBS = @TCMALLOC_LIBS@ THREAD_LIBS = @THREAD_LIBS@ +TIFF_CFLAGS = @TIFF_CFLAGS@ TIFF_LIBS = @TIFF_LIBS@ TextEncodeDelegate = @TextEncodeDelegate@ TraceEncodeDelegate = @TraceEncodeDelegate@ @@ -3388,6 +3394,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ type_include_files = @type_include_files@ urw_base35_font_dir = @urw_base35_font_dir@ +urw_base35_type1_font_dir = @urw_base35_type1_font_dir@ windows_font_dir = @windows_font_dir@ topincludedir = @includedir@/magick AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) @@ -3470,7 +3477,6 @@ EXTRA_LTLIBRARIES = BUILT_SOURCES = MOSTLYCLEANFILES = M4_EXTRA_DIST = \ - ac_func_fseeko.m4 \ ax_append_flag.m4 \ ax_c___attribute__.m4 \ ax_cflags_warn_all.m4 \ @@ -3532,6 +3538,7 @@ configlib_DATA = \ config/type-dejavu.xml \ config/type-ghostscript.xml \ config/type-urw-base35.xml \ + config/type-urw-base35-type1.xml \ config/type-windows.xml CONFIG_EXTRA_DIST = \ @@ -3562,6 +3569,7 @@ CONFIG_EXTRA_DIST = \ config/type-dejavu.xml.in \ config/type-ghostscript.xml.in \ config/type-urw-base35.xml.in \ + config/type-urw-base35-type1.xml.in \ config/type-windows.xml.in \ config/type.xml.in @@ -4793,6 +4801,7 @@ MAGICK_BASE_SRCS = \ magick/magick-config.h \ magick/magick-type.h \ magick/magick.h \ + magick/magick-private.h \ magick/matrix.c \ magick/matrix.h \ magick/memory.c \ @@ -5047,6 +5056,7 @@ MAGICK_NOINST_HDRS = \ magick/image-private.h \ magick/locale-private.h \ magick/mac.h \ + magick/magick-private.h \ magick/memory-private.h \ magick/mime-private.h \ magick/monitor-private.h \ @@ -5764,6 +5774,8 @@ config/type-ghostscript.xml: $(top_builddir)/config.status $(top_srcdir)/config/ cd $(top_builddir) && $(SHELL) ./config.status $@ config/type-urw-base35.xml: $(top_builddir)/config.status $(top_srcdir)/config/type-urw-base35.xml.in cd $(top_builddir) && $(SHELL) ./config.status $@ +config/type-urw-base35-type1.xml: $(top_builddir)/config.status $(top_srcdir)/config/type-urw-base35-type1.xml.in + cd $(top_builddir) && $(SHELL) ./config.status $@ config/type-windows.xml: $(top_builddir)/config.status $(top_srcdir)/config/type-windows.xml.in cd $(top_builddir) && $(SHELL) ./config.status $@ config/type.xml: $(top_builddir)/config.status $(top_srcdir)/config/type.xml.in diff --git a/PerlMagick/MANIFEST b/PerlMagick/MANIFEST index 36fbef0c72ea71bd0e2ea1a1ca46dc51ce5f6df4..27dbce154baddb5a3f3a0a42706527388e4d51fa 100644 --- a/PerlMagick/MANIFEST +++ b/PerlMagick/MANIFEST @@ -5,7 +5,6 @@ demo/button.pl demo/compose-specials.pl demo/composite.pl demo/demo.pl -demo/dst.png demo/Generic.ttf demo/lsys.pl demo/Makefile @@ -19,7 +18,6 @@ demo/shadow-text.pl demo/shapes.pl demo/single-pixels.pl demo/smile.gif -demo/src.png demo/steganography.pl demo/tile.gif demo/tree.pl diff --git a/PerlMagick/Makefile.PL b/PerlMagick/Makefile.PL index e260163d9be30433f116d754c91634dcdff0f76a..15d85212c8e0085401597f148b195a2c85cd5550 100644 --- a/PerlMagick/Makefile.PL +++ b/PerlMagick/Makefile.PL @@ -161,11 +161,11 @@ foreach my $delegate (@tested_delegates) { } # defaults for LIBS & INC & CCFLAGS params that we later pass to Writemakefile -my $INC_magick = '-I../ -I.. -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I"' . $Config{'usrinc'} . '/ImageMagick"'; +my $INC_magick = '-I../ -I.. -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I"' . $Config{'usrinc'} . '/ImageMagick"'; my $LIBS_magick = '-L../magick/.libs -lMagickCore-6.Q16 -lm -L' . $Config{'archlib'} . '/CORE'; -my $CCFLAGS_magick = "$Config{'ccflags'} -I/usr/include/libxml2 -I/usr/include/webp -I/usr/include/webp -I/usr/include/libraw -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread -I/usr/include/libxml2 -pthread -fopenmp -Wall -g -O2 -mtune=haswell -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16"; -my $LDFLAGS_magick = "-L../magick/.libs -lMagickCore-6.Q16 $Config{'ldflags'} "; -my $LDDLFLAGS_magick = "-L../magick/.libs -lMagickCore-6.Q16 $Config{'lddlflags'} "; +my $CCFLAGS_magick = "$Config{'ccflags'} -I/usr/include/libxml2 -DWITH_GZFILEOP -I/usr/include/webp -I/usr/include/webp -I/usr/include/webp -DWITH_GZFILEOP -I/usr/include/libraw -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/openjpeg-2.5 -I/usr/include/libvmaf -I/usr/include/rav1e -I/usr/include/svt-av1 -DEB_DLL -I/usr/include/openjpeg-2.5 -I/usr/include/webp -DWITH_GZFILEOP -I/usr/include/freetype2 -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/libxml2 -DWITH_GZFILEOP -pthread -DWITH_GZFILEOP -fopenmp -Wall -g -O2 -mtune=haswell -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16"; +my $LDFLAGS_magick = "-L../magick/.libs -lMagickCore-6.Q16 $Config{'ldflags'} "; +my $LDDLFLAGS_magick = "-L../magick/.libs -lMagickCore-6.Q16 $Config{'lddlflags'} "; if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) { my($Ipaths, $Lpaths) = AutodetectWin32gcc(); @@ -173,7 +173,7 @@ if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) { # # Setup for strawberry perl. # - $INC_magick = "$Ipaths"; + $INC_magick = "$Ipaths -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16"; $LIBS_magick = "-lMagickCore-6.Q16"; $CCFLAGS_magick = "$Config{'ccflags'}"; $LDFLAGS_magick = "$Config{'ldflags'} $Lpaths "; @@ -194,13 +194,13 @@ WriteMakefile 'AUTHOR' => 'ImageMagick Studio LLC', # Module version - 'VERSION' => '6.9.12', + 'VERSION' => '6.9.13', # Prerequisite version 'PREREQ_PM' => {'parent' => '0'}, # Preprocessor defines - 'DEFINE' => ' -D_LARGE_FILES=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING' + 'DEFINE' => ' -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -D_LARGEFILE_SOURCE=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING' # Header search specification and preprocessor flags 'INC' => $INC_magick, @@ -209,7 +209,7 @@ WriteMakefile #'CC' => 'gcc', # C pre-processor flags (e.g. -I & -D options) - # 'CPPFLAGS' => "$Config{'cppflags'} -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 ", + # 'CPPFLAGS' => "$Config{'cppflags'} -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16", # C compiler flags (e.g. -O -g) 'CCFLAGS' => $CCFLAGS_magick, diff --git a/PerlMagick/Makefile.PL.in b/PerlMagick/Makefile.PL.in index 35cc33a1951c98f8059c911e25ead987d92d8c26..4a82d863d0e5678b8eee509bd9dd7bb97292586a 100644 --- a/PerlMagick/Makefile.PL.in +++ b/PerlMagick/Makefile.PL.in @@ -173,7 +173,7 @@ if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) { # # Setup for strawberry perl. # - $INC_magick = "$Ipaths"; + $INC_magick = "$Ipaths @CPPFLAGS@"; $LIBS_magick = "-lMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@"; $CCFLAGS_magick = "$Config{'ccflags'}"; $LDFLAGS_magick = "$Config{'ldflags'} $Lpaths "; diff --git a/PerlMagick/README.txt b/PerlMagick/README.txt index dcb3f7d9ab81b99e61608bc05bc9ca65047578bf..6493fb93bf3d2d78a996da6d177d2b2135670744 100644 --- a/PerlMagick/README.txt +++ b/PerlMagick/README.txt @@ -110,6 +110,10 @@ Testing PerlMagick some of the tests will fail if you do not have the proper delegates installed for formats like JPEG, TIFF, etc. + Use the 'prove' utility to execute a test from the build folder: + + prove --blib blib -I `pwd` -bv ./t/read.t + To see a number of PerlMagick demonstration scripts, type cd demo diff --git a/PerlMagick/default/Makefile.PL b/PerlMagick/default/Makefile.PL index febe9be7fb77ce0ea18632c4b82000df70609804..be78c7569b22b959907a394446eed0d98304465b 100644 --- a/PerlMagick/default/Makefile.PL +++ b/PerlMagick/default/Makefile.PL @@ -161,11 +161,11 @@ foreach my $delegate (@tested_delegates) { } # defaults for LIBS & INC & CCFLAGS params that we later pass to Writemakefile -my $INC_magick = '-I../.. -I../.. -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I"' . $Config{'usrinc'} . '/ImageMagick"'; +my $INC_magick = '-I../.. -I../.. -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I"' . $Config{'usrinc'} . '/ImageMagick"'; my $LIBS_magick = '-L../../magick/.libs -lMagickCore-6.Q16 -lm -L' . $Config{'archlib'} . '/CORE'; -my $CCFLAGS_magick = "$Config{'ccflags'} -I/usr/include/libxml2 -I/usr/include/webp -I/usr/include/webp -I/usr/include/libraw -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread -I/usr/include/libxml2 -pthread -fopenmp -Wall -g -O2 -mtune=haswell -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16"; -my $LDFLAGS_magick = "-L../../magick/.libs -lMagickCore-6.Q16 $Config{'ldflags'} "; -my $LDDLFLAGS_magick = "-L../../magick/.libs -lMagickCore-6.Q16 $Config{'lddlflags'} "; +my $CCFLAGS_magick = "$Config{'ccflags'} -I/usr/include/libxml2 -DWITH_GZFILEOP -I/usr/include/webp -I/usr/include/webp -I/usr/include/webp -DWITH_GZFILEOP -I/usr/include/libraw -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/openjpeg-2.5 -I/usr/include/libvmaf -I/usr/include/rav1e -I/usr/include/svt-av1 -DEB_DLL -I/usr/include/openjpeg-2.5 -I/usr/include/webp -DWITH_GZFILEOP -I/usr/include/freetype2 -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/libxml2 -DWITH_GZFILEOP -pthread -DWITH_GZFILEOP -fopenmp -Wall -g -O2 -mtune=haswell -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16"; +my $LDFLAGS_magick = "-L../../magick/.libs -lMagickCore-6.Q16 $Config{'ldflags'} "; +my $LDDLFLAGS_magick = "-L../../magick/.libs -lMagickCore-6.Q16 $Config{'lddlflags'} "; if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) { my($Ipaths, $Lpaths) = AutodetectWin32gcc(); @@ -173,7 +173,7 @@ if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) { # # Setup for strawberry perl. # - $INC_magick = "$Ipaths"; + $INC_magick = "$Ipaths -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16"; $LIBS_magick = "-lMagickCore-6.Q16"; $CCFLAGS_magick = "$Config{'ccflags'}"; $LDFLAGS_magick = "$Config{'ldflags'} $Lpaths "; @@ -194,13 +194,13 @@ WriteMakefile 'AUTHOR' => 'ImageMagick Studio LLC', # Module version - 'VERSION' => '6.9.12', + 'VERSION' => '6.9.13', # Prerequisite version 'PREREQ_PM' => {'parent' => '0'}, # Preprocessor defines - 'DEFINE' => ' -D_LARGE_FILES=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING' + 'DEFINE' => ' -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -D_LARGEFILE_SOURCE=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING' # Header search specification and preprocessor flags 'INC' => $INC_magick, @@ -209,7 +209,7 @@ WriteMakefile #'CC' => 'gcc', # C pre-processor flags (e.g. -I & -D options) - # 'CPPFLAGS' => "$Config{'cppflags'} -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 ", + # 'CPPFLAGS' => "$Config{'cppflags'} -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16", # C compiler flags (e.g. -O -g) 'CCFLAGS' => $CCFLAGS_magick, diff --git a/PerlMagick/default/Makefile.PL.in b/PerlMagick/default/Makefile.PL.in index 5c2ae76682c999a797eaffe09a03f522a088eb25..6276f48d9850b5d65de3d1ca3af325644aaf9d19 100644 --- a/PerlMagick/default/Makefile.PL.in +++ b/PerlMagick/default/Makefile.PL.in @@ -173,7 +173,7 @@ if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) { # # Setup for strawberry perl. # - $INC_magick = "$Ipaths"; + $INC_magick = "$Ipaths @CPPFLAGS@"; $LIBS_magick = "-lMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@"; $CCFLAGS_magick = "$Config{'ccflags'}"; $LDFLAGS_magick = "$Config{'ldflags'} $Lpaths "; diff --git a/PerlMagick/demo/Generic.ttf b/PerlMagick/demo/Generic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..8ea647090f75e7d34bee4c511921299d1f3c1055 Binary files /dev/null and b/PerlMagick/demo/Generic.ttf differ diff --git a/PerlMagick/demo/Makefile b/PerlMagick/demo/Makefile index 851dc16a39b82db41b8a3939fc0b69d8f50d96f9..ad14b69b324da3b928145d66e77a095ea68ed8de 100644 --- a/PerlMagick/demo/Makefile +++ b/PerlMagick/demo/Makefile @@ -13,5 +13,5 @@ all: perl composite.pl clean: - /bin/rm -f demo.jpg button.gif model.png shadow.gif tree.gif \ - compose-specials.jpg single-pixels.gif pixel-fx.gif + /bin/rm -f demo.pam button.pam model.pam shadow.pam tree.pam \ + compose-specials.pam single-pixels.pam pixel-fx.pam diff --git a/PerlMagick/demo/annotate.pl b/PerlMagick/demo/annotate.pl index 01aea6e25b4bf46509ebb8a1bd9c9cf36a49b2f5..ef7ac2eea1b076630013db7919ed78232ed6a4d9 100644 --- a/PerlMagick/demo/annotate.pl +++ b/PerlMagick/demo/annotate.pl @@ -37,5 +37,5 @@ for ($angle=0; $angle < 360; $angle+=30) push(@$image,$label); } $image->Set(delay=>20); -$image->Write("annotate.miff"); -$image->Animate(); +$image->Write("annotate.pam"); +$image->Animate(title=>"Rotating Text"); diff --git a/PerlMagick/demo/annotate_words.pl b/PerlMagick/demo/annotate_words.pl index 3b76b1d1bc7f0828f07a44a47aa182f2714b5878..acf0bb55f97226994ad255aacbfa1e3b54a18336 100755 --- a/PerlMagick/demo/annotate_words.pl +++ b/PerlMagick/demo/annotate_words.pl @@ -65,7 +65,4 @@ foreach my $word (@words){ } -$image->Write("show:"); - -exit; - +$image->Write(magick=>'SHOW',title=>"Annotate Words"); diff --git a/PerlMagick/demo/button.pl b/PerlMagick/demo/button.pl index a771e0128dcdfa4c32528740432eb496729bd370..b60f496eebc540f3b6bc24ffb71bec083700ad72 100644 --- a/PerlMagick/demo/button.pl +++ b/PerlMagick/demo/button.pl @@ -11,5 +11,5 @@ $q->Rotate(-90); $q->Raise('6x6'); $q->Annotate(font=>'Generic.ttf',text=>'Push Me',fill=>'black', gravity=>'Center',pointsize=>18); -$q->Write('button.gif'); -$q->Write('win:'); +$q->Write('button.pam'); +$q->Write(magick=>'SHOW',title=>"Button"); diff --git a/PerlMagick/demo/compose-specials.pl b/PerlMagick/demo/compose-specials.pl index de5482398c6ac53cae39f3589020b6287e37e247..322bf0561e800d79e52ea32b553a48375121a023 100755 --- a/PerlMagick/demo/compose-specials.pl +++ b/PerlMagick/demo/compose-specials.pl @@ -247,6 +247,5 @@ my $montage=$results->Montage(font=>'Generic.ttf', frame=>'6x6+2+2', shadow=>'True', ); -$montage->Write('show:'); -$montage->Write('compose-specials.jpg'); - +$montage->Write('compose-specials.pam'); +$montage->Write(magick=>'SHOW',title=>"Compose"); diff --git a/PerlMagick/demo/composite.pl b/PerlMagick/demo/composite.pl index 987be11543b29272a165b2b4def8bf3bd462118f..5571498d67e891fafc4d53f65338e820681d9b8a 100644 --- a/PerlMagick/demo/composite.pl +++ b/PerlMagick/demo/composite.pl @@ -35,5 +35,5 @@ for ($angle=0; $angle < 360; $angle+=30) push(@$image,$thumbnail); } $image->Set(delay=>20); -$image->Write("composite.miff"); -$image->Animate(); +$image->Write("composite.pam"); +$image->Animate(title=>"Rotating Smiles"); diff --git a/PerlMagick/demo/demo.pl b/PerlMagick/demo/demo.pl index 80abde809892f0b255fbfb962c62c54c3553383f..00ca12a22fa73c119d9944d9c8533f6e1bdf91ac 100644 --- a/PerlMagick/demo/demo.pl +++ b/PerlMagick/demo/demo.pl @@ -513,7 +513,6 @@ $logo->Zoom('40%'); $montage->Composite(image=>$logo,gravity=>'North'); print "Write...\n"; -$montage->Set(matte=>'false'); -$montage->Write('demo.jpg'); +$montage->Write('demo.pam'); print "Display...\n"; -$montage->Write('win:'); +$montage->Write(magick=>'SHOW',title=>"PerlMagick Demo"); diff --git a/PerlMagick/demo/dst.png b/PerlMagick/demo/dst.png deleted file mode 100644 index 2569f632db5c2132c6a085b8e51cb58251eb7ae0..0000000000000000000000000000000000000000 Binary files a/PerlMagick/demo/dst.png and /dev/null differ diff --git a/PerlMagick/demo/lsys.pl b/PerlMagick/demo/lsys.pl index cc1194e578cd80214c6d7a63cd33ba0e2d3d08bb..afd06b7ea0e4315d3c52f414bdcaebbef2fbf8a1 100644 --- a/PerlMagick/demo/lsys.pl +++ b/PerlMagick/demo/lsys.pl @@ -77,7 +77,7 @@ sub lsys_execute if ($translate{$command}) { &{$translate{$command}}(); } } $im->Write($filename); - $im->Write('win:'); + $im->Write(magick=>'SHOW',title=>"L-system"); } 1; diff --git a/PerlMagick/demo/piddle.pl b/PerlMagick/demo/piddle.pl index 1e8d12542fddda9e1b7ceac068aaf7682a837892..5d22a1346df23bfe64b8712b60d4c994939e0f80 100644 --- a/PerlMagick/demo/piddle.pl +++ b/PerlMagick/demo/piddle.pl @@ -61,6 +61,6 @@ $image->Draw(primitive=>'line',points=>'200,260 260,260',stroke=>green, # $image->Annotate(font=>'Generic.ttf',text=>'This is a test!', geometry=>'+30+140',fill=>'green',pointsize=>24,rotate=>45.0); -$image->Write('piddle.gif'); +$image->Write('piddle.pam'); $image->Write('piddle.mvg'); -$image->Write('win:'); +$image->Write(magick=>'SHOW',title=>"Piddle"); diff --git a/PerlMagick/demo/pixel-fx.pl b/PerlMagick/demo/pixel-fx.pl index 7970aad20163369195e13f668786425683288e51..aa7581453f52907cdbb0c85f7623da9c91dfb0e2 100755 --- a/PerlMagick/demo/pixel-fx.pl +++ b/PerlMagick/demo/pixel-fx.pl @@ -48,6 +48,5 @@ for( my $j = 0; $j < $height; $j++ ) { } # display the result (or you could save it) -$dest->Write('win:'); -$dest->Write('pixel-fx.gif'); - +$dest->Write('pixel-fx.pam'); +$dest->Write(magick=>'SHOW',title=>"Pixel FX"); diff --git a/PerlMagick/demo/settings.pl b/PerlMagick/demo/settings.pl index 121b438e10f864e02489006c0d6473fced636d47..f997f1c12aee0bf1c5c857b177575c80f5a77477 100755 --- a/PerlMagick/demo/settings.pl +++ b/PerlMagick/demo/settings.pl @@ -28,5 +28,5 @@ die $e if $e; $e = $im->Trim(); die $e if $e; -$e = $im->Write('settings.png'); +$e = $im->Write('settings.pam'); die $e if $e; diff --git a/PerlMagick/demo/shadow-text.pl b/PerlMagick/demo/shadow-text.pl index f04f3a1a3329b669ffeb5a193fe0dcaa44965510..3385a308cc72fb7c40bd9be39859bad272d81026 100644 --- a/PerlMagick/demo/shadow-text.pl +++ b/PerlMagick/demo/shadow-text.pl @@ -11,5 +11,5 @@ $image->Annotate(font=>'Generic.ttf',fill=>'rgba(100,100,100,0.8)', $image->Blur('0x1'); $image->Annotate(font=>'Generic.ttf',fill=>'red',stroke=>'blue',pointsize=>60, text=>'Works like magick!',geometry=>'+4+86'); -$image->Write('shadow.gif'); -$image->Write('win:'); +$image->Write('shadow.pam'); +$image->Write(magick=>'SHOW',title=>"Shadow Text"); diff --git a/PerlMagick/demo/shapes.pl b/PerlMagick/demo/shapes.pl index 4d97d84b726a5e3521a718e9d214237b21795034..28b9e77f9a4ccd43b9ae60c6d12f13ecdbe226e1 100644 --- a/PerlMagick/demo/shapes.pl +++ b/PerlMagick/demo/shapes.pl @@ -35,6 +35,6 @@ $image->Annotate(font=>'Generic.ttf',fill=>'black',geometry=>'+280+120', # Write image. # print "Write image...\n"; -$image->Write('shapes.gif'); +$image->Write('shapes.pam'); print "Display image...\n"; -$image->Write('win:'); +$image->Write(magick=>'SHOW',title=>"Shapes"); diff --git a/PerlMagick/demo/single-pixels.pl b/PerlMagick/demo/single-pixels.pl index e364c0faec696932fa49de959d21f2275d560a14..8f476ea32fcb4b85390b337d7f3f245a6a54ea88 100755 --- a/PerlMagick/demo/single-pixels.pl +++ b/PerlMagick/demo/single-pixels.pl @@ -43,6 +43,5 @@ $im->Set(page=>'0x0+0+0'); $im->Scale('1000%'); # Output the changed pixels -$im->Write('win:'); -$im->Write('single-pixels.gif'); - +$im->Write('single-pixels.pam'); +$im->Write(magick=>'SHOW',title=>"Single Pixel"); diff --git a/PerlMagick/demo/src.png b/PerlMagick/demo/src.png deleted file mode 100644 index 100dfe27553f4d007262e3400390560ed5a525db..0000000000000000000000000000000000000000 Binary files a/PerlMagick/demo/src.png and /dev/null differ diff --git a/PerlMagick/demo/steganography.pl b/PerlMagick/demo/steganography.pl index def3e06c8daa20c7676d10d8707bc03a78173fa1..7c736d6c9c6e6133639961d74613067996ed63c4 100644 --- a/PerlMagick/demo/steganography.pl +++ b/PerlMagick/demo/steganography.pl @@ -14,13 +14,13 @@ $watermark->ReadImage('smile.gif'); $image=Image::Magick->new; $image->ReadImage('model.gif'); $image->SteganoImage(image=>$watermark,offset=>91); -$image->Write('model.png'); -$image->Write('win:'); +$image->Write('model.pam'); +$image->Write(magick=>'SHOW',title=>"Steganography Model"); # # Extract image from image. # $size="$width" . "x" . "$height" . "+91"; $stegano=Image::Magick->new(size=>$size); -$stegano->ReadImage('stegano:model.png'); -$stegano->Write('stegano.gif'); -$stegano->Write('win:'); +$stegano->ReadImage('stegano:model.pam'); +$stegano->Write('stegano.pam'); +$stegano->Write(magick=>'SHOW',title=>"Hidden Image"); diff --git a/PerlMagick/demo/tree.pl b/PerlMagick/demo/tree.pl index 57b9f812365313d29582ae40f4507ab8722c85ca..73501e7cf7cf4c3c20035741af74bc800a9cef26 100644 --- a/PerlMagick/demo/tree.pl +++ b/PerlMagick/demo/tree.pl @@ -32,4 +32,4 @@ require "lsys.pl"; $changes = \%stemchanges; lsys_init(400); -lsys_execute('A', 10, "tree.gif", %rule); +lsys_execute('A', 10, "tree.pam", %rule); diff --git a/PerlMagick/quantum/Makefile.PL b/PerlMagick/quantum/Makefile.PL index 527624318c0077d104d8c32c66ba9f89bc3a2d85..ebdab95355cc950ac3015ee73ccedd76e3bec333 100644 --- a/PerlMagick/quantum/Makefile.PL +++ b/PerlMagick/quantum/Makefile.PL @@ -161,11 +161,11 @@ foreach my $delegate (@tested_delegates) { } # defaults for LIBS & INC & CCFLAGS params that we later pass to Writemakefile -my $INC_magick = '-I../../ -I../.. -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I"' . $Config{'usrinc'} . '/ImageMagick"'; +my $INC_magick = '-I../../ -I../.. -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I"' . $Config{'usrinc'} . '/ImageMagick"'; my $LIBS_magick = '-L../../magick/.libs -lMagickCore-6.Q16 -lm -L' . $Config{'archlib'} . '/CORE'; -my $CCFLAGS_magick = "$Config{'ccflags'} -I/usr/include/libxml2 -I/usr/include/webp -I/usr/include/webp -I/usr/include/libraw -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread -I/usr/include/libxml2 -pthread -fopenmp -Wall -g -O2 -mtune=haswell -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16"; -my $LDFLAGS_magick = "-L../../magick/.libs -lMagickCore-6.Q16 $Config{'ldflags'} "; -my $LDDLFLAGS_magick = "-L../../magick/.libs -lMagickCore-6.Q16 $Config{'lddlflags'} "; +my $CCFLAGS_magick = "$Config{'ccflags'} -I/usr/include/libxml2 -DWITH_GZFILEOP -I/usr/include/webp -I/usr/include/webp -I/usr/include/webp -DWITH_GZFILEOP -I/usr/include/libraw -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/openjpeg-2.5 -I/usr/include/libvmaf -I/usr/include/rav1e -I/usr/include/svt-av1 -DEB_DLL -I/usr/include/openjpeg-2.5 -I/usr/include/webp -DWITH_GZFILEOP -I/usr/include/freetype2 -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/libxml2 -DWITH_GZFILEOP -pthread -DWITH_GZFILEOP -fopenmp -Wall -g -O2 -mtune=haswell -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16"; +my $LDFLAGS_magick = "-L../../magick/.libs -lMagickCore-6.Q16 $Config{'ldflags'} "; +my $LDDLFLAGS_magick = "-L../../magick/.libs -lMagickCore-6.Q16 $Config{'lddlflags'} "; if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) { my($Ipaths, $Lpaths) = AutodetectWin32gcc(); @@ -173,7 +173,7 @@ if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) { # # Setup for strawberry perl. # - $INC_magick = "$Ipaths"; + $INC_magick = "$Ipaths -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16"; $LIBS_magick = "-lMagickCore-6.Q16"; $CCFLAGS_magick = "$Config{'ccflags'}"; $LDFLAGS_magick = "$Config{'ldflags'} $Lpaths "; @@ -194,10 +194,10 @@ WriteMakefile 'AUTHOR' => 'ImageMagick Studio LLC', # Module version - 'VERSION' => '6.9.12', + 'VERSION' => '6.9.13', # Preprocessor defines - 'DEFINE' => ' -D_LARGE_FILES=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING' + 'DEFINE' => ' -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -D_LARGEFILE_SOURCE=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING' # Header search specification and preprocessor flags 'INC' => $INC_magick, @@ -206,7 +206,7 @@ WriteMakefile #'CC' => 'gcc', # C pre-processor flags (e.g. -I & -D options) - # 'CPPFLAGS' => "$Config{'cppflags'} -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 ", + # 'CPPFLAGS' => "$Config{'cppflags'} -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16", # C compiler flags (e.g. -O -g) 'CCFLAGS' => $CCFLAGS_magick, diff --git a/PerlMagick/quantum/Makefile.PL.in b/PerlMagick/quantum/Makefile.PL.in index a5a0bfa1b0b5caf0e93e34cc2caf2ad806016e0a..9e0945982c81c8199adff06eacaaf354902ab744 100644 --- a/PerlMagick/quantum/Makefile.PL.in +++ b/PerlMagick/quantum/Makefile.PL.in @@ -173,7 +173,7 @@ if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) { # # Setup for strawberry perl. # - $INC_magick = "$Ipaths"; + $INC_magick = "$Ipaths @CPPFLAGS@"; $LIBS_magick = "-lMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@"; $CCFLAGS_magick = "$Config{'ccflags'}"; $LDFLAGS_magick = "$Config{'ldflags'} $Lpaths "; diff --git a/PerlMagick/quantum/quantum.pm b/PerlMagick/quantum/quantum.pm index 66fc6f3d64c0e8e7e52f23417c5d0ad04ce56a4c..8743e0f704ad1859b470e87fdd016b7aa1c8445a 100644 --- a/PerlMagick/quantum/quantum.pm +++ b/PerlMagick/quantum/quantum.pm @@ -43,7 +43,7 @@ require AutoLoader; ConfigureError FatalErrorException ); -$VERSION = '6.9.12'; +$VERSION = '6.9.13'; sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant() diff --git a/PerlMagick/quantum/quantum.xs b/PerlMagick/quantum/quantum.xs index 93e1b1fa8b82619f91ddb2dc100f00d4cbef88fa..6422938ed4d11da8b192c30fc3a86d27fad17be3 100644 --- a/PerlMagick/quantum/quantum.xs +++ b/PerlMagick/quantum/quantum.xs @@ -2173,6 +2173,13 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, (void) SetMagickResourceLimit(TimeResource,limit); break; } + if (LocaleCompare(attribute,"title") == 0) + { + for ( ; image; image=image->next) + (void) CopyMagickString(image->magick_filename,SvPV(sval,na), + MaxTextExtent); + break; + } if (LocaleCompare(attribute,"transparent-color") == 0) { (void) QueryColorDatabase(SvPV(sval,na),&target_color,exception); @@ -5489,6 +5496,18 @@ Get(ref,...) PUSHs(s ? sv_2mortal(s) : &sv_undef); continue; } + if (LocaleNCompare(attribute,"registry:",9) == 0) + { + const char + *value; + + value=(const char *) GetImageRegistry(StringRegistryType, + attribute+9,exception); + if (value != (const char *) NULL) + s=newSVpv(value,0); + PUSHs(s ? sv_2mortal(s) : &sv_undef); + continue; + } if (LocaleCompare(attribute,"rows") == 0) { if (image != (Image *) NULL) @@ -5594,6 +5613,13 @@ Get(ref,...) PUSHs(s ? sv_2mortal(s) : &sv_undef); continue; } + if (LocaleCompare(attribute,"title") == 0) + { + if (image != (Image *) NULL) + s=newSVpv(image->magick_filename,0); + PUSHs(s ? sv_2mortal(s) : &sv_undef); + continue; + } if (LocaleCompare(attribute,"total-ink-density") == 0) { s=newSViv(MAGICKCORE_QUANTUM_DEPTH); diff --git a/PerlMagick/quantum/quantum.xs.in b/PerlMagick/quantum/quantum.xs.in index a14c5a2ec48b08e5cb9349ea75712afce8699e26..0b63cd9a7a345c05234d4f1d7d487e079055f24d 100644 --- a/PerlMagick/quantum/quantum.xs.in +++ b/PerlMagick/quantum/quantum.xs.in @@ -2173,6 +2173,13 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image, (void) SetMagickResourceLimit(TimeResource,limit); break; } + if (LocaleCompare(attribute,"title") == 0) + { + for ( ; image; image=image->next) + (void) CopyMagickString(image->magick_filename,SvPV(sval,na), + MaxTextExtent); + break; + } if (LocaleCompare(attribute,"transparent-color") == 0) { (void) QueryColorDatabase(SvPV(sval,na),&target_color,exception); @@ -5489,6 +5496,18 @@ Get(ref,...) PUSHs(s ? sv_2mortal(s) : &sv_undef); continue; } + if (LocaleNCompare(attribute,"registry:",9) == 0) + { + const char + *value; + + value=(const char *) GetImageRegistry(StringRegistryType, + attribute+9,exception); + if (value != (const char *) NULL) + s=newSVpv(value,0); + PUSHs(s ? sv_2mortal(s) : &sv_undef); + continue; + } if (LocaleCompare(attribute,"rows") == 0) { if (image != (Image *) NULL) @@ -5594,6 +5613,13 @@ Get(ref,...) PUSHs(s ? sv_2mortal(s) : &sv_undef); continue; } + if (LocaleCompare(attribute,"title") == 0) + { + if (image != (Image *) NULL) + s=newSVpv(image->magick_filename,0); + PUSHs(s ? sv_2mortal(s) : &sv_undef); + continue; + } if (LocaleCompare(attribute,"total-ink-density") == 0) { s=newSViv(MAGICKCORE_QUANTUM_DEPTH); diff --git a/PerlMagick/t/input.pict b/PerlMagick/t/input.pict index 0b9d7ad95c1acb606447aa321fe569d76b499b8e..a59960f7fda4eeed09a2ac05b50acc92c71a875d 100644 Binary files a/PerlMagick/t/input.pict and b/PerlMagick/t/input.pict differ diff --git a/PerlMagick/t/montage.t b/PerlMagick/t/montage.t index 7e3bb3347af4a379281e01d880151d22010a69d5..80cf913f7ccdb2f7e7d4de52d8bc1cdf3cbd2e15 100644 --- a/PerlMagick/t/montage.t +++ b/PerlMagick/t/montage.t @@ -154,7 +154,7 @@ testMontage( q/bordercolor=>'blue', mattecolor=>'red'/, q/background=>'#696e7e',, tile=>'4x4', geometry=>'90x80+6+6>', frame=>'8x10', borderwidth=>'0', gravity=>'Center', shadow=>'True',background=>'gray'/, 'd4de864f9004b185297c9c2351f811aaeb779095bdd8fd5f29bcfbee79f09da4', - 'c45f922b6f1f94accacd3946bee3f60cf84fb7930866f1c9bf0d18521218ab5b', + '1228bfeb109e22d89e382394f8da80aee93978e7a3be9ca8769f2aefec017284', '803c926764df2ad940f36fbbeea274e05467d729bfdfb2f28c479cfd27245a85'); # @@ -165,7 +165,7 @@ testMontage( q/bordercolor=>'blue', mattecolor=>'red'/, q/background=>'#696e7e',, tile=>'4x4', geometry=>'90x80+6+6>', frame=>'8x10', borderwidth=>'0', gravity=>'Center', shadow=>'True', texture=>'granite:'/, '8418407b6d56d2c1b67bc735004794d9eb20609d30115a93255eefcad3499e95', - 'a67fd0b6e03bd5610bb58d66f99fc0e8b3a0bf5dec7714ea2ac9f8032eb4d7f5', + '8908c2b5f7d6af5a4064c84f79a60cd34d7c394b59d50846be5bebbd335388d2', '5793a1de15b5d73df297968af79fa01a110c1585cccd46dcbef794674ab5f174'); # diff --git a/PerlMagick/t/ttf/input.ttf b/PerlMagick/t/ttf/input.ttf new file mode 100644 index 0000000000000000000000000000000000000000..8ea647090f75e7d34bee4c511921299d1f3c1055 Binary files /dev/null and b/PerlMagick/t/ttf/input.ttf differ diff --git a/README.md b/README.md index 9eaaf1354d83a04a707745ceae4b28fa1a83c441..5cc1eb2dd4b1188bfbecc40b85c21366243337af 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,28 @@ -# ImageMagick (legacy) +# ImageMagick [![Build Status](https://github.com/ImageMagick/ImageMagick/workflows/main/badge.svg)](https://github.com/ImageMagick/ImageMagick/actions) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/imagemagick.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:imagemagick) [![Donate](https://img.shields.io/badge/%24-donate-ff00ff.svg)](https://github.com/sponsors/ImageMagick)

-ImageMagick logo +ImageMagick logo

-Legacy [ImageMagick®](https://legacy.imagemagick.org/) is a free and [open-source](https://legacy.imagemagick.org/script/license.php) software suite for displaying, converting, and editing raster image and vector image files. It can read and write over 200 image file [formats](https://legacy.imagemagick.org/script/formats.php), and can support a wide range of image manipulation operations, such as resizing, cropping, and color correction. +[ImageMagick®](https://legacy.imagemagick.org/) is a free and [open-source](https://legacy.imagemagick.org/script/license.php) software suite, used for editing and manipulating digital images. It can be used to create, edit, compose, or convert bitmap images, and supports a wide range of file [formats](https://legacy.imagemagick.org/script/formats.php), including JPEG, PNG, GIF, TIFF, and PDF. -#### What is ImageMagick? +### _We recommend upgrading your legacy version of ImageMagick to [version 7](https://imagemagick.org/)_. -ImageMagick is written in C and is available for a wide range of operating systems, including Linux, macOS, and Windows. It can be used as a standalone application, or as a library that can be integrated into other software programs. +## What is ImageMagick? -The main website for legacy ImageMagick can be found at [https://legacy.imagemagick.org](https://legacy.imagemagick.org/). The source code for this software can be accessed through the repository located at [https://github.com/ImageMagick/ImageMagick6](https://github.com/ImageMagick/ImageMagick6). In addition, a more recent version of ImageMagick, version 7, can be found at [https://imagemagick.org](https://imagemagick.org/). +ImageMagick is widely used in industries such as web development, graphic design, and video editing, as well as in scientific research, medical imaging, and astronomy. Its versatile and customizable nature, along with its robust image processing capabilities, make it a popular choice for a wide range of image-related tasks. -#### Features and Capabilities +ImageMagick includes a command-line interface for executing complex image processing tasks, as well as APIs for integrating its features into software applications. It is written in C and can be used on a variety of operating systems, including Linux, Windows, and macOS. + +The main website for ImageMagick can be found at [https://legacy.imagemagick.org](https://legacy.imagemagick.org/). The source code for this software can be accessed through a [repository](https://github.com/ImageMagick/ImageMagick6). + +Creating a security policy that fits your specific local environment before making use of ImageMagick is highly advised. You can find guidance on setting up this [policy](https://legacy.imagemagick.org/script/security-policy.php). Also, it's important to verify your policy using the [validation tool](https://legacy.imagemagick.org/script/security-policy.php). + +## Features and Capabilities One of the key features of ImageMagick is its support for scripting and automation. This allows users to create complex image manipulation pipelines that can be run automatically, without the need for manual intervention. This can be especially useful for tasks that require the processing of large numbers of images, or for tasks that need to be performed on a regular basis. @@ -41,7 +47,7 @@ Here are just a few [examples](https://legacy.imagemagick.org/script/examples.ph * [Distributed pixel cache](https://legacy.imagemagick.org/script/distribute-pixel-cache.php): offload intermediate pixel storage to one or more remote servers. * [Draw](https://legacy.imagemagick.org/Usage/draw/): add shapes or text to an image. * [Encipher or decipher an image](https://legacy.imagemagick.org/script/cipher.php): convert ordinary images into unintelligible gibberish and back again. -* [Format conversion](https://legacy.imagemagick.org/script/convert.php): convert an image from one [format](https://imagemagick.org/script/formats.php) to another (e.g. PNG to JPEG). +* [Format conversion](https://legacy.imagemagick.org/script/convert.php): convert an image from one [format](https://legacy.imagemagick.org/script/formats.php) to another (e.g. PNG to JPEG). * [Generalized pixel distortion](https://legacy.imagemagick.org/Usage/distorts/): correct for, or induce image distortions including perspective. * [Heterogeneous distributed processing](https://legacy.imagemagick.org/script/architecture.php#distributed): certain algorithms are OpenCL-enabled to take advantage of speed-ups offered by executing in concert across heterogeneous platforms consisting of CPUs, GPUs, and other processors. * [High dynamic-range images](https://legacy.imagemagick.org/script/high-dynamic-range.php): accurately represent the wide range of intensity levels found in real scenes ranging from the brightest direct sunlight to the deepest darkest shadows. @@ -55,7 +61,7 @@ Here are just a few [examples](https://legacy.imagemagick.org/script/examples.ph * [Montage](https://legacy.imagemagick.org/script/montage.php): juxtapose image thumbnails on an image canvas. * [Morphology of shapes](https://legacy.imagemagick.org/Usage/morphology/): extract features, describe shapes and recognize patterns in images. * [Motion picture support](https://legacy.imagemagick.org/script/motion-picture.php): read and write the common image formats used in digital film work. -* [Multispectral imagery](https://legacy.imagemagick.org/script/architecture.php#multispectral): support multispectral imagery up to 64 bands. +* [Multispectral imagery](https://legacy.imagemagick.org/script/multispectral-imagery.php): support multispectral imagery up to 64 bands. * [Noise and color reduction](https://legacy.imagemagick.org/Usage/transform/#vision) Kuwahara Filter, mean-shift. * [Perceptual hash](http://www.fmwconcepts.com/misc_tests/perceptual_hash_test_results_510/index.html): maps visually identical images to the same or similar hash-- useful in image retrieval, authentication, indexing, or copy detection as well as digital watermarking. * [Special effects](https://legacy.imagemagick.org/Usage/blur/): blur, sharpen, threshold, or tint an image. @@ -67,11 +73,10 @@ Here are just a few [examples](https://legacy.imagemagick.org/script/examples.ph [Examples of ImageMagick Usage](https://legacy.imagemagick.org/Usage/), demonstrates how to use the software from the [command line](https://legacy.imagemagick.org/script/command-line-processing.php) to achieve various effects. There are also several scripts available on the website called [Fred's ImageMagick Scripts](http://www.fmwconcepts.com/imagemagick/), which can be used to apply geometric transforms, blur and sharpen images, remove noise, and perform other operations. Additionally, there is a tool called [Magick.NET](https://github.com/dlemstra/Magick.NET) that allows users to access the functionality of ImageMagick without having to install the software on their own systems. Finally, the website also includes a [Cookbook](http://im.snibgo.com/) with tips and examples for using ImageMagick on Windows systems. -#### News +## News -ImageMagick best practices **strongly** encourages you to configure a [security policy](https://legacy.imagemagick.org/script/security-policy.php) that suits your local environment. +Creating a security policy that fits your specific local environment before making use of ImageMagick is highly advised. You can find guidance on setting up this [policy](https://legacy.imagemagick.org/script/security-policy.php). Also, it's important to verify your policy using the [validation tool](https://imagemagick-secevaluator.doyensec.com/). As of ImageMagick version 7.1.1-16, you can choose and customize one of these [security policies](https://legacy.imagemagick.org/script/security-policy.php): Open, Limited, Secure, and Websafe. -Now that ImageMagick [version 7](https://imagemagick.org) is released, we recommend upgrading from version 6. Learn how ImageMagick version 7 differs from previous versions with our [porting guide](https://imagemagick.org/script/porting.php). Want more performance from ImageMagick? Try these options: @@ -80,4 +85,4 @@ Want more performance from ImageMagick? Try these options: * reduce lock contention with the [tcmalloc](http://goog-perftools.sourceforge.net/doc/tcmalloc.html) memory allocation library; * push large images to a solid-state drive, see [large image support](https://legacy.imagemagick.org/script/architecture.php#tera-pixel). -If these options are prohibitive, you can reduce the quality of the image results. The default build is Q16 HDRI. If you disable [HDRI](https://legacy.imagemagick.org/script/high-dynamic-range.php), you use half the memory and instead of predominantly floating point operations, you use the typically more efficient integer operations. The tradeoff is reduced precision and you cannot process out of range pixel values (e.g. negative). If you build the Q8 non-HDRI version of ImageMagick, you again reduce the memory requirements in half-- and once again there is a tradeoff, even less precision and no out of range pixel values. For a Q8 non-HDRI build of ImageMagick, use these configure script options: --with-quantum-depth=8 --disable-hdri. +If these options are prohibitive, you can reduce the quality of the image results. The default build is Q16. If you enable [HDRI](https://legacy.imagemagick.org/script/high-dynamic-range.php), you use twice the memory and instead of predominantly integer operations, you use the typically less efficient floating-point operations. The tradeoff is increased precision and you can process out of range pixel values (e.g. negative). If you instead build the Q8 non-HDRI version of ImageMagick, you can reduce the memory requirements in half-- and once again there is a tradeoff, even less precision and no out of range pixel values. For a Q8 non-HDRI build of ImageMagick, use these configure script options: **--with-quantum-depth=8**. diff --git a/aclocal.m4 b/aclocal.m4 index 10de731ae6a103a46d09c131907505f4dc20aa4a..5c4ef63dcd1dc3bafd8a53662a383f0a71d56c5a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -14,8 +14,8 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, +[m4_warning([this file was generated for autoconf 2.72. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) @@ -1267,7 +1267,6 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([m4/ac_func_fseeko.m4]) m4_include([m4/ax_c___attribute__.m4]) m4_include([m4/ax_cflags_warn_all.m4]) m4_include([m4/ax_check_compile_flag.m4]) diff --git a/coders/aai.c b/coders/aai.c index 3c06e46d7d6021fa205f82fe6746c49bf47acac6..aa5af42d472b3fb89af5d3cf8eb53c7449fe828f 100644 --- a/coders/aai.c +++ b/coders/aai.c @@ -236,7 +236,10 @@ static Image *ReadAAIImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while ((width != 0UL) && (height != 0UL)); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -417,6 +420,7 @@ static MagickBooleanType WriteAAIImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/art.c b/coders/art.c index ac776944a2709fe4bc47307dcc5cbc99b5e60e11..5037f4304f2d790824351e71f9e40d3b06ceec92 100644 --- a/coders/art.c +++ b/coders/art.c @@ -203,7 +203,10 @@ static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -366,6 +369,7 @@ static MagickBooleanType WriteARTImage(const ImageInfo *image_info,Image *image) pixels=(unsigned char *) RelinquishMagickMemory(pixels); if (y < (ssize_t) image->rows) ThrowWriterException(CorruptImageError,"UnableToWriteImageData"); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/avs.c b/coders/avs.c index d5f741d402bd29dd3dd1cab120afcc9213ff2af9..c86b5b70895a2263105ab40cc0cb367f8c060328 100644 --- a/coders/avs.c +++ b/coders/avs.c @@ -239,7 +239,8 @@ static Image *ReadAVSImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while ((width != 0UL) && (height != 0UL)); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -422,6 +423,7 @@ static MagickBooleanType WriteAVSImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/bgr.c b/coders/bgr.c index 510b8c042482af75632d0cbc79532786c73d5def..366740fe0ac4dd2326fa3c7ef298e410a567c9cb 100644 --- a/coders/bgr.c +++ b/coders/bgr.c @@ -109,7 +109,7 @@ static Image *ReadBGRImage(const ImageInfo *image_info, *image; MagickBooleanType - status; + status = MagickTrue; MagickOffsetType scene; @@ -720,7 +720,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("G",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -792,7 +793,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("R",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -866,7 +868,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info, } if (image->matte != MagickFalse) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("A",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -984,7 +987,8 @@ static Image *ReadBGRImage(const ImageInfo *image_info, quantum_info=DestroyQuantumInfo(quantum_info); InheritException(&image->exception,&canvas_image->exception); canvas_image=DestroyImage(canvas_image); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -1099,7 +1103,7 @@ ModuleExport void UnregisterBGRImage(void) static MagickBooleanType WriteBGRImage(const ImageInfo *image_info,Image *image) { MagickBooleanType - status; + status = MagickTrue; MagickOffsetType scene; @@ -1367,7 +1371,8 @@ static MagickBooleanType WriteBGRImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("G",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1393,7 +1398,8 @@ static MagickBooleanType WriteBGRImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("R",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1422,7 +1428,8 @@ static MagickBooleanType WriteBGRImage(const ImageInfo *image_info,Image *image) (void) CloseBlob(image); if (quantum_type == BGRAQuantum) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("A",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1470,6 +1477,7 @@ static MagickBooleanType WriteBGRImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/bmp.c b/coders/bmp.c index 14522abf604f0c2bfc73784fef42f1532761782d..4f28257a1ff3950d3b2809df8a981c40fd6b311d 100644 --- a/coders/bmp.c +++ b/coders/bmp.c @@ -212,15 +212,13 @@ static MagickBooleanType DecodeImage(Image *image,const size_t compression, ssize_t i, - x; + x, + y; unsigned char *p, *q; - ssize_t - y; - assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); assert(pixels != (unsigned char *) NULL); @@ -356,7 +354,7 @@ static MagickBooleanType DecodeImage(Image *image,const size_t compression, } (void) ReadBlobByte(image); /* end of line */ (void) ReadBlobByte(image); - return((q-pixels) < (ssize_t) number_pixels ? MagickFalse : MagickTrue); + return((p-pixels) < (ssize_t) number_pixels ? MagickFalse : MagickTrue); } /* @@ -434,7 +432,7 @@ static size_t EncodeImage(Image *image,const size_t bytes_per_line, break; *q++=(unsigned char) i; *q++=(*p); - p+=i; + p+=(ptrdiff_t) i; } /* End of line. @@ -647,6 +645,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); image=AcquireImage(image_info); + image->columns=0; + image->rows=0; status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) { @@ -835,6 +835,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Number of colors: %u",bmp_info.number_colors); } + if ((bmp_info.height < 0) && (bmp_info.compression != 0)) + ThrowReaderException(CoderError,"CompressNotSupported"); if ((bmp_info.size > 40) || (bmp_info.compression == BI_BITFIELDS) || (bmp_info.compression == BI_ALPHABITFIELDS)) { @@ -843,6 +845,11 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) bmp_info.blue_mask=ReadBlobLSBLong(image); if (bmp_info.compression == BI_ALPHABITFIELDS) bmp_info.alpha_mask=ReadBlobLSBLong(image); + if (((bmp_info.size == 40) || + (bmp_info.compression == BI_ALPHABITFIELDS)) && + (bmp_info.bits_per_pixel != 16) && + (bmp_info.bits_per_pixel != 32)) + ThrowReaderException(CorruptImageError,"UnsupportedBitsPerPixel"); } if (bmp_info.size > 40) { @@ -1030,7 +1037,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) image->rows=(size_t) MagickAbsoluteValue(bmp_info.height); image->depth=bmp_info.bits_per_pixel <= 8 ? bmp_info.bits_per_pixel : 8; image->matte=((bmp_info.alpha_mask != 0) && - (bmp_info.compression == BI_BITFIELDS)) ? MagickTrue : MagickFalse; + ((bmp_info.compression == BI_BITFIELDS) || + (bmp_info.compression == BI_ALPHABITFIELDS))) ? MagickTrue : MagickFalse; if (bmp_info.bits_per_pixel < 16) { size_t @@ -1117,15 +1125,15 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) length=(size_t) bytes_per_line*image->rows; if ((MagickSizeType) (length/256) > blob_size) ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); + pixel_info=AcquireVirtualMemory(image->rows,MagickMax(bytes_per_line, + image->columns+1UL)*sizeof(*pixels)); + if (pixel_info == (MemoryInfo *) NULL) + ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + pixels=(unsigned char *) GetVirtualMemoryBlob(pixel_info); if ((bmp_info.compression == BI_RGB) || (bmp_info.compression == BI_BITFIELDS) || (bmp_info.compression == BI_ALPHABITFIELDS)) { - pixel_info=AcquireVirtualMemory(image->rows,MagickMax(bytes_per_line, - image->columns+256UL)*sizeof(*pixels)); - if (pixel_info == (MemoryInfo *) NULL) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - pixels=(unsigned char *) GetVirtualMemoryBlob(pixel_info); if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Reading pixels (%.20g bytes)",(double) length); @@ -1142,11 +1150,6 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Convert run-length encoded raster pixels. */ - pixel_info=AcquireVirtualMemory(image->rows,MagickMax(bytes_per_line, - image->columns+256UL)*sizeof(*pixels)); - if (pixel_info == (MemoryInfo *) NULL) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - pixels=(unsigned char *) GetVirtualMemoryBlob(pixel_info); status=DecodeImage(image,bmp_info.compression,pixels, image->columns*image->rows); if (status == MagickFalse) @@ -1183,7 +1186,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) y=-1; break; } - p+=4; + p+=(ptrdiff_t) 4; } } } @@ -1430,19 +1433,19 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) pixel|=(*p++) << 8; red=((pixel & bmp_info.red_mask) << shift.red) >> 16; if (quantum_bits.red == 5) - red|=((red & 0xe000) >> 5); + red|=((red & 0xff000) >> 5); if (quantum_bits.red <= 8) red|=((red & 0xff00) >> 8); green=((pixel & bmp_info.green_mask) << shift.green) >> 16; if (quantum_bits.green == 5) - green|=((green & 0xe000) >> 5); + green|=((green & 0xff000) >> 5); if (quantum_bits.green == 6) - green|=((green & 0xc000) >> 6); + green|=((green & 0xff00) >> 6); if (quantum_bits.green <= 8) green|=((green & 0xff00) >> 8); blue=((pixel & bmp_info.blue_mask) << shift.blue) >> 16; if (quantum_bits.blue == 5) - blue|=((blue & 0xe000) >> 5); + blue|=((blue & 0xff000) >> 5); if (quantum_bits.blue <= 8) blue|=((blue & 0xff00) >> 8); SetPixelRed(q,ScaleShortToQuantum((unsigned short) red)); @@ -1578,7 +1581,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) unsigned short *p16; - p16=(unsigned short *) pixels+(image->rows-y-1)*bytes_per_line; + p16=(unsigned short *) (pixels+(image->rows-y-1)*bytes_per_line); q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (PixelPacket *) NULL) break; @@ -1706,7 +1709,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while (IsBMP(magick,2) != MagickFalse); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -1840,7 +1844,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image) *p; const StringInfo - *profile; + *profile = (const StringInfo *) NULL; MagickBooleanType have_color_info, @@ -2029,7 +2033,8 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image) } bytes_per_line=4*((image->columns*bmp_info.bits_per_pixel+31)/32); bmp_info.ba_offset=0; - profile=GetImageProfile(image,"icc"); + if (type > 3) + profile=GetImageProfile(image,"icc"); have_color_info=(image->rendering_intent != UndefinedIntent) || (profile != (StringInfo *) NULL) || (image->gamma != 0.0) ? MagickTrue : MagickFalse; @@ -2266,7 +2271,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image) GetPixelBlue(p),31)); } *((unsigned short *) q)=pixel; - q+=2; + q+=(ptrdiff_t) 2; p++; } for (x=2L*(ssize_t) image->columns; x < (ssize_t) bytes_per_line; x++) @@ -2618,6 +2623,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image) if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " File_size: %u bytes",bmp_info.file_size); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/braille.c b/coders/braille.c index 278d277b39c889872adf5fbed1dcb0cf4ff3849f..5f4e3f6e81e6944aa7733e362cd2ad216465bd77 100644 --- a/coders/braille.c +++ b/coders/braille.c @@ -379,6 +379,7 @@ static MagickBooleanType WriteBRAILLEImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/cals.c b/coders/cals.c index ea46da637413d8891adabfdfd8b681ee8449ca34..83cbffc730edd4d4f082c92d2dc151aed7b67f90 100644 --- a/coders/cals.c +++ b/coders/cals.c @@ -582,7 +582,8 @@ static MagickBooleanType WriteCALSImage(const ImageInfo *image_info, if (WriteBlob(image,length,group4) != (ssize_t) length) status=MagickFalse; group4=(unsigned char *) RelinquishMagickMemory(group4); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } #endif diff --git a/coders/caption.c b/coders/caption.c index 23cf4eacfbdec6234dbba3b29a9593a11e086a41..c4714d0386da458cce6a7f32b59dd68bc5d583c5 100644 --- a/coders/caption.c +++ b/coders/caption.c @@ -110,8 +110,7 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, { char *caption, - geometry[MaxTextExtent], - lines[MaxTextExtent], + geometry[MagickPathExtent], *text; const char @@ -129,13 +128,13 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, split, status; - ssize_t - i; - size_t height, width; + ssize_t + i; + TypeMetric metrics; @@ -158,17 +157,18 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, */ option=GetImageOption(image_info,"filename"); if (option == (const char *) NULL) - caption=InterpretImageProperties(image_info,image,image_info->filename); + caption=InterpretImageProperties((ImageInfo *) image_info,image, + image_info->filename); else if (LocaleNCompare(option,"caption:",8) == 0) - caption=InterpretImageProperties(image_info,image,option+8); + caption=InterpretImageProperties((ImageInfo *) image_info,image,option+8); else - caption=InterpretImageProperties(image_info,image,option); + caption=InterpretImageProperties((ImageInfo *) image_info,image,option); if (caption == (char *) NULL) return(DestroyImageList(image)); (void) SetImageProperty(image,"caption",caption); draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL); - width=CastDoubleToUnsigned(draw_info->pointsize*strlen(caption)+0.5); + width=CastDoubleToUnsigned(0.5*draw_info->pointsize*strlen(caption)+0.5); if (AcquireMagickResource(WidthResource,width) == MagickFalse) { caption=DestroyString(caption); @@ -190,8 +190,8 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, AdjustTypeMetricBounds(&metrics); (void) CloneString(&draw_info->text,text); text=DestroyString(text); - (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g", - -metrics.bounds.x1,metrics.ascent); + (void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g", + metrics.bounds.x1,metrics.ascent); if (draw_info->gravity == UndefinedGravity) (void) CloneString(&draw_info->geometry,geometry); status=GetMultilineTypeMetrics(image,draw_info,&metrics); @@ -206,8 +206,8 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, AdjustTypeMetricBounds(&metrics); (void) CloneString(&draw_info->text,text); text=DestroyString(text); - (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g", - -metrics.bounds.x1,metrics.ascent); + (void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g", + metrics.bounds.x1,metrics.ascent); if (draw_info->gravity == UndefinedGravity) (void) CloneString(&draw_info->geometry,geometry); status=GetMultilineTypeMetrics(image,draw_info,&metrics); @@ -221,14 +221,12 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, { caption=DestroyString(caption); draw_info=DestroyDrawInfo(draw_info); - InheritException(exception,&image->exception); return(DestroyImageList(image)); } if (SetImageBackgroundColor(image) == MagickFalse) { caption=DestroyString(caption); draw_info=DestroyDrawInfo(draw_info); - InheritException(exception,&image->exception); image=DestroyImageList(image); return((Image *) NULL); } @@ -244,36 +242,59 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, /* Auto fit text into bounding box. */ - for (n=0; n < 32; n++, draw_info->pointsize*=2.0) - { - text=AcquireString(caption); - i=FormatMagickCaption(image,draw_info,split,&metrics,&text); - AdjustTypeMetricBounds(&metrics); - (void) CloneString(&draw_info->text,text); - text=DestroyString(text); - (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g", - -metrics.bounds.x1,metrics.ascent); - if (draw_info->gravity == UndefinedGravity) - (void) CloneString(&draw_info->geometry,geometry); - status=GetMultilineTypeMetrics(image,draw_info,&metrics); - AdjustTypeMetricBounds(&metrics); - if (status == MagickFalse) - break; - width=CastDoubleToUnsigned(metrics.width+draw_info->stroke_width+0.5); - height=CastDoubleToUnsigned(metrics.height-metrics.underline_position+ - draw_info->interline_spacing+draw_info->stroke_width+0.5); - if ((image->columns != 0) && (image->rows != 0)) + low=1.0; + option=GetImageOption(image_info,"caption:max-pointsize"); + if (option != (const char*) NULL) + { + high=StringToDouble(option,(char**) NULL); + if (high < 1.0) + high=1.0; + high+=1.0; + } + else + { + option=GetImageOption(image_info,"caption:start-pointsize"); + if (option != (const char *) NULL) + { + draw_info->pointsize=StringToDouble(option,(char**) NULL); + if (draw_info->pointsize < 1.0) + draw_info->pointsize=1.0; + } + for (n=0; n < 32; n++, draw_info->pointsize*=2.0) { - if ((width >= image->columns) || (height >= image->rows)) + text=AcquireString(caption); + i=FormatMagickCaption(image,draw_info,split,&metrics,&text); + AdjustTypeMetricBounds(&metrics); + (void) CloneString(&draw_info->text,text); + text=DestroyString(text); + (void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g", + metrics.bounds.x1,metrics.ascent); + if (draw_info->gravity == UndefinedGravity) + (void) CloneString(&draw_info->geometry,geometry); + status=GetMultilineTypeMetrics(image,draw_info,&metrics); + if (status == MagickFalse) break; + AdjustTypeMetricBounds(&metrics); + width=CastDoubleToUnsigned(metrics.width+draw_info->stroke_width+ + 0.5); + height=CastDoubleToUnsigned( + metrics.height-metrics.underline_position+ + draw_info->interline_spacing+draw_info->stroke_width+0.5); + if ((image->columns != 0) && (image->rows != 0)) + { + if ((width > image->columns) && (height > image->rows)) + break; + if ((width <= image->columns) && (height <= image->rows)) + low=draw_info->pointsize; + } + else + if (((image->columns != 0) && (width > image->columns)) || + ((image->rows != 0) && (height > image->rows))) + break; } - else - if (((image->columns != 0) && (width >= image->columns)) || - ((image->rows != 0) && (height >= image->rows))) - break; - } - high=draw_info->pointsize; - for (low=1.0; (high-low) > 0.5; ) + high=draw_info->pointsize; + } + while ((high-low) > 0.5) { draw_info->pointsize=(low+high)/2.0; text=AcquireString(caption); @@ -281,32 +302,33 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, AdjustTypeMetricBounds(&metrics); (void) CloneString(&draw_info->text,text); text=DestroyString(text); - (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g", - -metrics.bounds.x1,metrics.ascent); + (void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g", + metrics.bounds.x1,metrics.ascent); if (draw_info->gravity == UndefinedGravity) (void) CloneString(&draw_info->geometry,geometry); status=GetMultilineTypeMetrics(image,draw_info,&metrics); - AdjustTypeMetricBounds(&metrics); if (status == MagickFalse) break; + AdjustTypeMetricBounds(&metrics); width=CastDoubleToUnsigned(metrics.width+draw_info->stroke_width+0.5); height=CastDoubleToUnsigned(metrics.height-metrics.underline_position+ draw_info->interline_spacing+draw_info->stroke_width+0.5); if ((image->columns != 0) && (image->rows != 0)) { - if ((width < image->columns) && (height < image->rows)) + if ((width <= image->columns) && (height <= image->rows)) low=draw_info->pointsize+0.5; else high=draw_info->pointsize-0.5; } else - if (((image->columns != 0) && (width < image->columns)) || - ((image->rows != 0) && (height < image->rows))) + if (((image->columns != 0) && (width <= image->columns)) || + ((image->rows != 0) && (height <= image->rows))) low=draw_info->pointsize+0.5; else high=draw_info->pointsize-0.5; } - draw_info->pointsize=floor((low+high)/2.0-0.5); + if (status != MagickFalse) + draw_info->pointsize=floor(low-0.5); } /* Draw caption. @@ -328,16 +350,10 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, (void) CloneString(&draw_info->geometry,geometry); status=AnnotateImage(image,draw_info); if (image_info->pointsize == 0.0) - { - char - pointsize[MaxTextExtent]; - - (void) FormatLocaleString(pointsize,MaxTextExtent,"%.20g", - draw_info->pointsize); - (void) SetImageProperty(image,"caption:pointsize",pointsize); - } - (void) FormatLocaleString(lines,MaxTextExtent,"%.20g",((double) i+1)); - (void) SetImageProperty(image,"caption:lines",lines); + (void) FormatImageProperty(image,"caption:pointsize","%.*g", + GetMagickPrecision(),draw_info->pointsize); + (void) FormatImageProperty(image,"caption:lines","%.*g",GetMagickPrecision(), + (double) (i+1)); draw_info=DestroyDrawInfo(draw_info); if (status == MagickFalse) { diff --git a/coders/cin.c b/coders/cin.c index a79b800ae20e617801be8eafbb24c0deca753598..490eb4f462431326435d9105423952e1f366ba2e 100644 --- a/coders/cin.c +++ b/coders/cin.c @@ -794,7 +794,10 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); SetImageColorspace(image,LogColorspace); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -995,7 +998,7 @@ static MagickBooleanType WriteCINImage(const ImageInfo *image_info,Image *image) offset+=WriteBlob(image,sizeof(cin.file.filename),(unsigned char *) cin.file.filename); seconds=GetMagickTime(); - GetMagickUTCtime(&seconds,&utc_time); + GetMagickUTCTime(&seconds,&utc_time); (void) memset(timestamp,0,sizeof(timestamp)); (void) strftime(timestamp,MaxTextExtent,"%Y:%m:%d:%H:%M:%SUTC",&utc_time); (void) memset(cin.file.create_date,0,sizeof(cin.file.create_date)); @@ -1226,6 +1229,7 @@ static MagickBooleanType WriteCINImage(const ImageInfo *image_info,Image *image) break; } quantum_info=DestroyQuantumInfo(quantum_info); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/cip.c b/coders/cip.c index c8d90909a808960605ce2590d56e34fe0f03d59a..20498cbfdf2fa54582ca1e3baabf2ba4bef2bee4 100644 --- a/coders/cip.c +++ b/coders/cip.c @@ -237,7 +237,7 @@ static MagickBooleanType WriteCIPImage(const ImageInfo *image_info,Image *image) (((size_t) (3*ClampToQuantum(GetPixelLuma(image,p+0))/QuantumRange) & 0x03) << 0)); (void) FormatLocaleString(buffer,MaxTextExtent,"%02x",byte); (void) WriteBlobString(image,buffer); - p+=4; + p+=(ptrdiff_t) 4; } if ((image->columns % 4) != 0) { @@ -283,6 +283,7 @@ static MagickBooleanType WriteCIPImage(const ImageInfo *image_info,Image *image) } (void) WriteBlobString(image,"\n"); (void) WriteBlobString(image,"\n"); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/clipboard.c b/coders/clipboard.c index 65da1c5979f68fe8385ca0f9db3c66a5032d9e77..dd114fc281b439b8263579daddeef12255e66d84 100644 --- a/coders/clipboard.c +++ b/coders/clipboard.c @@ -169,7 +169,7 @@ static Image *ReadCLIPBOARDImage(const ImageInfo *image_info, ThrowReaderException(CoderError,"UnableToReadImageData"); } p=(unsigned char *) clip_data; - p+=BMP_HEADER_SIZE; + p+=(ptrdiff_t) BMP_HEADER_SIZE; (void) memcpy(p,clip_mem,clip_size); (void) GlobalUnlock(clip_mem); (void) CloseClipboard(); @@ -191,7 +191,7 @@ static Image *ReadCLIPBOARDImage(const ImageInfo *image_info, offset+=12; } offset+=BMP_HEADER_SIZE; - p-=BMP_HEADER_SIZE; + p-=(ptrdiff_t)BMP_HEADER_SIZE; p[0]='B'; p[1]='M'; p[2]=(unsigned char) total_size; @@ -356,7 +356,7 @@ static MagickBooleanType WriteCLIPBOARDImage(const ImageInfo *image_info, ThrowWriterException(CoderError,"UnableToWriteImageData"); } p=(unsigned char *) clip_data; - p+=BMP_HEADER_SIZE; + p+=(ptrdiff_t) BMP_HEADER_SIZE; (void) memcpy(clip_mem,p,length-BMP_HEADER_SIZE); (void) GlobalUnlock(clip_mem); clip_data=RelinquishMagickMemory(clip_data); diff --git a/coders/cmyk.c b/coders/cmyk.c index 48fa2f7daa2ce48e5bd4ac6a4a515c5db7f80dfc..9f83e8b635109c58b7fc3f8e5e6dd124292625f2 100644 --- a/coders/cmyk.c +++ b/coders/cmyk.c @@ -108,7 +108,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info, *image; MagickBooleanType - status; + status = MagickTrue; MagickOffsetType scene; @@ -799,7 +799,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("M",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -871,7 +872,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("Y",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -943,7 +945,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("K",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -1026,7 +1029,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info, } if (image->matte != MagickFalse) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("A",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -1140,7 +1144,8 @@ static Image *ReadCMYKImage(const ImageInfo *image_info, InheritException(exception,&canvas_image->exception); InheritException(exception,&image->exception); canvas_image=DestroyImage(canvas_image); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -1250,7 +1255,7 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info, Image *image) { MagickBooleanType - status; + status = MagickTrue; MagickOffsetType scene; @@ -1543,7 +1548,8 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("M",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1569,7 +1575,8 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("Y",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1595,7 +1602,8 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("K",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1623,7 +1631,8 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info, } if (quantum_type == CMYKAQuantum) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("A",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1671,6 +1680,7 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info, if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/cut.c b/coders/cut.c index 4959fbc2f02fe0feaae2a06da2d6e0d30c2f0752..04078a1c5558b34d14567931d016b03020bd663e 100644 --- a/coders/cut.c +++ b/coders/cut.c @@ -677,7 +677,10 @@ static Image *ReadCUTImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } diff --git a/coders/dcm.c b/coders/dcm.c index 32db5bf545fa4d44ac7b076468687227308eb7c7..d0767f8cb041fd6ea807da7ca2899dc3fe45e9fe 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -3161,7 +3161,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) while (TellBlob(image) < ((MagickOffsetType) GetBlobSize(image)-10)) { - for (group=0; (group != 0x7FE0) || (element != 0x0010) ; ) + for (group=0; (group != 0x7fe0) || (element != 0x0010) ; ) { /* Read a group. @@ -3169,7 +3169,11 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) image->offset=(ssize_t) TellBlob(image); group=ReadBlobLSBShort(image); element=ReadBlobLSBShort(image); - if ((group == 0xfffc) && (element == 0xfffc)) + /* + Check for end of data. + */ + if (((group == 0xfffc) && (element == 0xfffc)) || + ((group == 0x0000) && (element == 0x0000))) break; if ((group != 0x0002) && (image->endian == MSBEndian)) { @@ -3670,7 +3674,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) else index=(unsigned short) (*p | (*(p+1) << 8)); redmap[i]=(int) index; - p+=2; + p+=(ptrdiff_t) 2; } break; } @@ -3702,7 +3706,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) else index=(unsigned short) (*p | (*(p+1) << 8)); greenmap[i]=(int) index; - p+=2; + p+=(ptrdiff_t) 2; } break; } @@ -3734,7 +3738,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) else index=(unsigned short) (*p | (*(p+1) << 8)); bluemap[i]=(int) index; - p+=2; + p+=(ptrdiff_t) 2; } break; } @@ -3827,7 +3831,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } - if ((group == 0xfffc) && (element == 0xfffc)) + if (((group == 0xfffc) && (element == 0xfffc)) || + ((group == 0x0000) && (element == 0x0000))) { Image *last; @@ -4365,7 +4370,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) redmap=(int *) RelinquishMagickMemory(redmap); if (image == (Image *) NULL) return(image); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); diff --git a/coders/dds.c b/coders/dds.c index 6eae27b640748b2b8ae75bf8f8f4818e36d2c993..8143c19dbdc3ee9427fee078a4cbdc47f38d48d7 100644 --- a/coders/dds.c +++ b/coders/dds.c @@ -1798,10 +1798,7 @@ static Image *ReadDDSImage(const ImageInfo *image_info,ExceptionInfo *exception) image->endian = LSBEndian; image->depth = 8; if (image_info->ping != MagickFalse) - { - (void) CloseBlob(image); - return(GetFirstImageInList(image)); - } + continue; status=SetImageExtent(image,image->columns,image->rows); if (status == MagickFalse) { @@ -1818,7 +1815,10 @@ static Image *ReadDDSImage(const ImageInfo *image_info,ExceptionInfo *exception) } } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -2699,8 +2699,9 @@ static MagickBooleanType WriteDDSImage(const ImageInfo *image_info, if (mipmaps > 0 && WriteMipmaps(image,pixelFormat,compression,mipmaps, clusterFit,weightByAlpha,&image->exception) == MagickFalse) return(MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } static void WriteDDSInfo(Image *image, const size_t pixelFormat, diff --git a/coders/debug.c b/coders/debug.c index 7ea225d989828b0df35425d56784065118b3dee9..3821c4d15625f9fe56ef4155828f57b071e5fa0d 100644 --- a/coders/debug.c +++ b/coders/debug.c @@ -267,6 +267,7 @@ static MagickBooleanType WriteDEBUGImage(const ImageInfo *image_info, if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/dib.c b/coders/dib.c index 29b2ffecc6da730ac0d8652f984a85cfbb453b0e..fa791d90c9764d17a8d9bb6811a2669be9b31f2c 100644 --- a/coders/dib.c +++ b/coders/dib.c @@ -381,7 +381,7 @@ static size_t EncodeImage(Image *image,const size_t bytes_per_line, break; *q++=(unsigned char) i; *q++=(*p); - p+=i; + p+=(ptrdiff_t) i; } /* End of line. @@ -996,7 +996,10 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -1429,6 +1432,7 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image) } (void) WriteBlob(image,dib_info.image_size,pixels); pixels=(unsigned char *) RelinquishMagickMemory(pixels); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/djvu.c b/coders/djvu.c index 066f8b44806b46cf878bbcd88f4fe47302fb7953..708935af1f20974865a0f36e3c64df58150451ee 100644 --- a/coders/djvu.c +++ b/coders/djvu.c @@ -609,6 +609,8 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum, if (tag == 0) break; } while (!ddjvu_page_decoding_done(lc->page)); + if (ddjvu_page_decoding_error(lc->page) != 0) + ThrowReaderException(CorruptImageError,"CorruptImage"); ddjvu_document_get_pageinfo(lc->document, pagenum, &info); image->x_resolution = (float) info.dpi; diff --git a/coders/dng.c b/coders/dng.c index 611f5246c9797c1eae3299e34ca720a4abe63979..37a042823a2597963bcea478b8b2a6c6cc604f97 100644 --- a/coders/dng.c +++ b/coders/dng.c @@ -71,6 +71,9 @@ #include "magick/utility-private.h" #include "magick/xml-tree.h" #if defined(MAGICKCORE_RAW_R_DELEGATE) +#ifdef _MSC_VER +# define _XKEYCHECK_H +#endif #include #endif @@ -132,14 +135,14 @@ static void InitializeDcrawOpenCL(ExceptionInfo *exception) if (name != (char *) NULL) { (void) SetEnvironmentVariable("DCR_CL_PLATFORM",name); - name=RelinquishMagickMemory(name); + name=(char *) RelinquishMagickMemory(name); } GetMagickOpenCLEnvParam(clEnv,MAGICK_OPENCL_ENV_PARAM_DEVICE_NAME, sizeof(char *),&name,exception); if (name != (char *) NULL) { (void) SetEnvironmentVariable("DCR_CL_DEVICE",name); - name=RelinquishMagickMemory(name); + name=(char *) RelinquishMagickMemory(name); } } } @@ -229,93 +232,33 @@ static Image *InvokeDNGDelegate(const ImageInfo *image_info,Image *image, ImageInfo *read_info; + MagickBooleanType + status; + /* - Convert DNG to PPM with delegate. + Convert DNG to TIFF with delegate program. */ (void) DestroyImageList(image); InitializeDcrawOpenCL(exception); image=AcquireImage(image_info); read_info=CloneImageInfo(image_info); SetImageInfoBlob(read_info,(void *) NULL,0); - (void) InvokeDelegate(read_info,image,"dng:decode",(char *) NULL,exception); + status=InvokeDelegate(read_info,image,"dng:decode",(char *) NULL,exception); image=DestroyImage(image); - (void) FormatLocaleString(read_info->filename,MagickPathExtent,"%s.png", + if (status == MagickFalse) + { + read_info=DestroyImageInfo(read_info); + return(image); + } + *read_info->magick='\0'; + (void) FormatLocaleString(read_info->filename,MagickPathExtent,"%s.tif", read_info->unique); sans_exception=AcquireExceptionInfo(); image=ReadImage(read_info,sans_exception); sans_exception=DestroyExceptionInfo(sans_exception); - if (image == (Image *) NULL) - { - (void) FormatLocaleString(read_info->filename,MagickPathExtent,"%s.ppm", - read_info->unique); - image=ReadImage(read_info,exception); - } - (void) RelinquishUniqueFileResource(read_info->filename); if (image != (Image *) NULL) - { - char - filename[MagickPathExtent], - *xml; - - ExceptionInfo - *sans; - - (void) CopyMagickString(image->magick,read_info->magick, - MagickPathExtent); - (void) FormatLocaleString(filename,MagickPathExtent,"%s.ufraw", - read_info->unique); - sans=AcquireExceptionInfo(); - xml=FileToString(filename,MagickPathExtent,sans); - (void) RelinquishUniqueFileResource(filename); - if (xml != (char *) NULL) - { - XMLTreeInfo - *ufraw; - - /* - Inject. - */ - ufraw=NewXMLTree(xml,sans); - if (ufraw != (XMLTreeInfo *) NULL) - { - char - *content, - property[MagickPathExtent]; - - const char - *tag; - - XMLTreeInfo - *next; - - if (image->properties == (void *) NULL) - image->properties=NewSplayTree(CompareSplayTreeString, - RelinquishMagickMemory,RelinquishMagickMemory); - next=GetXMLTreeChild(ufraw,(const char *) NULL); - while (next != (XMLTreeInfo *) NULL) - { - tag=GetXMLTreeTag(next); - if (tag == (char *) NULL) - tag="unknown"; - (void) FormatLocaleString(property,MagickPathExtent,"dng:%s", - tag); - content=ConstantString(GetXMLTreeContent(next)); - (void) StripString(content); - if ((LocaleCompare(tag,"log") != 0) && - (LocaleCompare(tag,"InputFilename") != 0) && - (LocaleCompare(tag,"OutputFilename") != 0) && - (LocaleCompare(tag,"OutputType") != 0) && - (strlen(content) != 0)) - (void) AddValueToSplayTree((SplayTreeInfo *) - image->properties,ConstantString(property),content); - next=GetXMLTreeSibling(next); - } - ufraw=DestroyXMLTree(ufraw); - } - xml=DestroyString(xml); - } - sans=DestroyExceptionInfo(sans); - } + (void) CopyMagickString(image->magick,read_info->magick,MagickPathExtent); + (void) RelinquishUniqueFileResource(read_info->filename); read_info=DestroyImageInfo(read_info); return(image); } @@ -327,6 +270,21 @@ static void SetLibRawParams(const ImageInfo *image_info,Image *image, const char *option; +#if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0,20) +#if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0,21) + raw_info->rawparams.max_raw_memory_mb=8192; +#else + raw_info->params.max_raw_memory_mb=8192; +#endif + option=GetImageOption(image_info,"dng:max-raw-memory"); + if (option != (const char *) NULL) +#if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0,21) + raw_info->rawparams.max_raw_memory_mb=(unsigned int) + StringToInteger(option); +#else + raw_info->params.max_raw_memory_mb=(unsigned int) StringToInteger(option); +#endif +#endif raw_info->params.user_flip=0; raw_info->params.output_bps=16; raw_info->params.use_camera_wb=1; diff --git a/coders/dps.c b/coders/dps.c index fc372ab6cff2e55c348d57d50f9908309cc6982d..97382cde18069c055f3b3bc01289be1a3ce3b4db 100644 --- a/coders/dps.c +++ b/coders/dps.c @@ -528,7 +528,10 @@ static Image *ReadDPSImage(const ImageInfo *image_info,ExceptionInfo *exception) */ XFreeResources(display,visual_info,map_info,(XPixelInfo *) NULL, (XFontStruct *) NULL,&resource_info,(XWindowInfo *) NULL); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } #endif diff --git a/coders/dpx.c b/coders/dpx.c index aecbfa96dca550906f18a978fc10752316205f38..c5c111889817f23e72c42e1bcd76cec28d207b5e 100644 --- a/coders/dpx.c +++ b/coders/dpx.c @@ -1330,7 +1330,8 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -2083,6 +2084,7 @@ static MagickBooleanType WriteDPXImage(const ImageInfo *image_info, quantum_info=DestroyQuantumInfo(quantum_info); if (y < (ssize_t) image->rows) ThrowWriterException(CorruptImageError,"UnableToWriteImageData"); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/ept.c b/coders/ept.c index 339fbd943019c5495d5409c6f9aa19c05b924c74..9c56f2d706bf584452581b1da00047a9e34fc90f 100644 --- a/coders/ept.c +++ b/coders/ept.c @@ -499,6 +499,7 @@ static MagickBooleanType WriteEPTImage(const ImageInfo *image_info,Image *image) ept_info.postscript=(unsigned char *) RelinquishMagickMemory( ept_info.postscript); ept_info.tiff=(unsigned char *) RelinquishMagickMemory(ept_info.tiff); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/exr.c b/coders/exr.c index 83615e234768476dec7308fd76261e20446c0f51..7e4b6768f3bafe6069c4911642a0ca75bb6091c8 100644 --- a/coders/exr.c +++ b/coders/exr.c @@ -218,6 +218,7 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) if (status == MagickFalse) { (void) ImfCloseInputFile(file); + (void) CloseBlob(image); InheritException(exception,&image->exception); return(DestroyImageList(image)); } @@ -233,6 +234,7 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) if (scanline == (ImfRgba *) NULL) { (void) ImfCloseInputFile(file); + (void) CloseBlob(image); image=DestroyImageList(image); ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } @@ -309,7 +311,10 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) ImfCloseInputFile(file); if (status == MagickFalse) ThrowReaderException(CorruptImageError,"UnableToReadImageData"); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } #endif @@ -621,7 +626,8 @@ static MagickBooleanType WriteEXRImage(const ImageInfo *image_info,Image *image) (void) FileToImage(image,write_info->filename); (void) RelinquishUniqueFileResource(write_info->filename); write_info=DestroyImageInfo(write_info); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } #endif diff --git a/coders/fax.c b/coders/fax.c index 844e9b4fa69e788c7c8a2bb4f19c6d949a5c34cb..778a6d501bf61e3d1bddff1a3d74129fec50bee5 100644 --- a/coders/fax.c +++ b/coders/fax.c @@ -142,7 +142,10 @@ static Image* FaxReadG3(Image *image,ExceptionInfo *exception) if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -402,6 +405,7 @@ static MagickBooleanType WriteFAXImage(const ImageInfo *image_info,Image *image) break; } while (write_info->adjoin != MagickFalse); write_info=DestroyImageInfo(write_info); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/fits.c b/coders/fits.c index 6a3ad01259bd64131761543e1f43af45c15325ef..95c661fa0b19855ab4e830570c116d6fb1b160d6 100644 --- a/coders/fits.c +++ b/coders/fits.c @@ -294,6 +294,8 @@ static Image *ReadFITSImage(const ImageInfo *image_info, (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); image=AcquireImage(image_info); + image->columns=0; + image->rows=0; status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) { @@ -345,7 +347,7 @@ static Image *ReadFITSImage(const ImageInfo *image_info, p=value; if (*p == '=') { - p+=2; + p+=(ptrdiff_t) 2; while (isspace((int) ((unsigned char) *p)) != 0) p++; } @@ -562,7 +564,8 @@ static Image *ReadFITSImage(const ImageInfo *image_info, if (status == MagickFalse) break; } while (1); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -909,6 +912,7 @@ static MagickBooleanType WriteFITSImage(const ImageInfo *image_info, break; } while (image_info->adjoin != MagickFalse); fits_info=DestroyString(fits_info); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/flif.c b/coders/flif.c index 9a317aafba21f533bb8127ed36ab4f6ddbcfe5d1..01f5c45e2b4649cc30b209ddca160a85b4a441e9 100644 --- a/coders/flif.c +++ b/coders/flif.c @@ -494,7 +494,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(p)); @@ -531,7 +531,7 @@ static MagickBooleanType WriteFLIFImage(const ImageInfo *image_info, pixels=RelinquishMagickMemory(pixels); flif_status=flif_encoder_encode_memory(flifenc,&buffer,&length); if (flif_status) - WriteBlob(image,length,buffer); + WriteBlob(image,length,(unsigned char *) buffer); CloseBlob(image); flif_destroy_encoder(flifenc); buffer=RelinquishMagickMemory(buffer); diff --git a/coders/fpx.c b/coders/fpx.c index f53134fe05a39ce73f6ad07196e167b2ae3dad0e..84e5a105fc6d5efa6dc502e6d6ba56515c554f89 100644 --- a/coders/fpx.c +++ b/coders/fpx.c @@ -111,6 +111,29 @@ static MagickBooleanType % o exception: return any errors or warnings in this structure. % */ + +static void FPXRelinquishSummaryInfo(FPXSummaryInformation *summary_info) +{ + if (summary_info->title_valid) + (void) FPX_DeleteFPXStr(&summary_info->title); + if (summary_info->subject_valid) + (void) FPX_DeleteFPXStr(&summary_info->subject); + if (summary_info->author_valid) + (void) FPX_DeleteFPXStr(&summary_info->author); + if (summary_info->keywords_valid) + (void) FPX_DeleteFPXStr(&summary_info->keywords); + if (summary_info->comments_valid) + (void) FPX_DeleteFPXStr(&summary_info->comments); + if (summary_info->OLEtemplate_valid) + (void) FPX_DeleteFPXStr(&summary_info->OLEtemplate); + if (summary_info->last_author_valid) + (void) FPX_DeleteFPXStr(&summary_info->last_author); + if (summary_info->rev_number_valid) + (void) FPX_DeleteFPXStr(&summary_info->rev_number); + if (summary_info->appname_valid) + (void) FPX_DeleteFPXStr(&summary_info->appname); +} + static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) { const char @@ -201,6 +224,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Initialize FPX toolkit. */ + (void) memset(&summary_info,0,sizeof(summary_info)); fpx_status=FPX_InitSystem(); if (fpx_status != FPX_OK) ThrowReaderException(CoderError,"UnableToInitializeFPXLibrary"); @@ -208,6 +232,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) fpx_status=FPX_SetToolkitMemoryLimit(&memory_limit); if (fpx_status != FPX_OK) { + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); ThrowReaderException(CoderError,"UnableToInitializeFPXLibrary"); } @@ -228,11 +253,13 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (fpx_status == FPX_LOW_MEMORY_ERROR) { + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } if (fpx_status != FPX_OK) { + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); ThrowFileException(exception,FileOpenError,"UnableToOpenFile", image->filename); @@ -241,6 +268,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (colorspace.numberOfComponents == 0) { + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); ThrowReaderException(CorruptImageError,"ImageTypeNotSupported"); } @@ -265,6 +293,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) fpx_status=FPX_GetSummaryInformation(flashpix,&summary_info); if (fpx_status != FPX_OK) { + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); ThrowReaderException(DelegateError,"UnableToReadSummaryInfo"); } @@ -284,6 +313,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) MaxTextExtent,sizeof(*label)); if (label == (char *) NULL) { + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } @@ -308,6 +338,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) MaxTextExtent,sizeof(*comments)); if (comments == (char *) NULL) { + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } @@ -322,7 +353,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) for (i=1; ; i++) if (((width >> i) < tile_width) || ((height >> i) < tile_height)) break; - scene=i; + scene=(size_t) i; if (image_info->number_scenes != 0) while (scene > image_info->scene) { @@ -335,7 +366,8 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) { width>>=1; height>>=1; - scene--; + if (scene != 0) + scene--; } image->depth=8; image->columns=width; @@ -349,6 +381,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) */ if (AcquireImageColormap(image,MaxColormapSize) == MagickFalse) { + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } @@ -356,6 +389,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image_info->ping != MagickFalse) { (void) FPX_CloseImage(flashpix); + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); return(GetFirstImageInList(image)); } @@ -368,10 +402,11 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Allocate memory for the image and pixel buffer. */ - pixels=(unsigned char *) AcquireQuantumMemory(image->columns,(tile_height+ - 1UL)*colorspace.numberOfComponents*sizeof(*pixels)); + pixels=(unsigned char *) AcquireQuantumMemory(image->columns,(tile_height+1)* + (size_t) colorspace.numberOfComponents*sizeof(*pixels)); if (pixels == (unsigned char *) NULL) { + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); (void) FPX_CloseImage(flashpix); ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); @@ -379,15 +414,15 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Initialize FlashPix image description. */ - fpx_info.numberOfComponents=colorspace.numberOfComponents; + fpx_info.numberOfComponents=(unsigned int) colorspace.numberOfComponents; for (i=0; i < 4; i++) { fpx_info.components[i].myColorType.myDataType=DATA_TYPE_UNSIGNED_BYTE; fpx_info.components[i].horzSubSampFactor=1; fpx_info.components[i].vertSubSampFactor=1; - fpx_info.components[i].columnStride=fpx_info.numberOfComponents; + fpx_info.components[i].columnStride=(int) fpx_info.numberOfComponents; fpx_info.components[i].lineStride=image->columns* - fpx_info.components[i].columnStride; + (size_t) fpx_info.components[i].columnStride; fpx_info.components[i].theData=pixels+i; } fpx_info.components[0].myColorType.myColor=fpx_info.numberOfComponents > 2 ? @@ -421,12 +456,13 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) else fpx_status=FPX_ReadImageTransformRectangle(flashpix,0.0F, (float) y/image->rows,(float) image->columns/image->rows, - (float) (y+tile_height-1)/image->rows,(ssize_t) image->columns, - (ssize_t) tile_height,&fpx_info); + (float) (y+tile_height-1)/image->rows,(int) image->columns, + (int) tile_height,&fpx_info); if (fpx_status == FPX_LOW_MEMORY_ERROR) { pixels=(unsigned char *) RelinquishMagickMemory(pixels); (void) FPX_CloseImage(flashpix); + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } @@ -458,7 +494,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image->matte != MagickFalse) SetPixelAlpha(q,ScaleCharToQuantum(*a)); q++; - r+=red_component->columnStride; + r+=(ptrdiff_t) red_component->columnStride; g+=green_component->columnStride; b+=blue_component->columnStride; a+=alpha_component->columnStride; @@ -472,6 +508,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) } pixels=(unsigned char *) RelinquishMagickMemory(pixels); (void) FPX_CloseImage(flashpix); + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); return(GetFirstImageInList(image)); } @@ -887,25 +924,7 @@ static MagickBooleanType WriteFPXImage(const ImageInfo *image_info,Image *image) /* Set image summary info. */ - summary_info.title_valid=MagickFalse; - summary_info.subject_valid=MagickFalse; - summary_info.author_valid=MagickFalse; - summary_info.comments_valid=MagickFalse; - summary_info.keywords_valid=MagickFalse; - summary_info.OLEtemplate_valid=MagickFalse; - summary_info.last_author_valid=MagickFalse; - summary_info.rev_number_valid=MagickFalse; - summary_info.edit_time_valid=MagickFalse; - summary_info.last_printed_valid=MagickFalse; - summary_info.create_dtm_valid=MagickFalse; - summary_info.last_save_dtm_valid=MagickFalse; - summary_info.page_count_valid=MagickFalse; - summary_info.word_count_valid=MagickFalse; - summary_info.char_count_valid=MagickFalse; - summary_info.thumbnail_valid=MagickFalse; - summary_info.appname_valid=MagickFalse; - summary_info.security_valid=MagickFalse; - summary_info.title.ptr=(unsigned char *) NULL; + (void) memset(&summary_info,0,sizeof(summary_info)); label=GetImageProperty(image,"label"); if (label != (const char *) NULL) { @@ -946,15 +965,15 @@ static MagickBooleanType WriteFPXImage(const ImageInfo *image_info,Image *image) if (quantum_info == (QuantumInfo *) NULL) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); pixels=GetQuantumPixels(quantum_info); - fpx_info.numberOfComponents=colorspace.numberOfComponents; + fpx_info.numberOfComponents=(unsigned int) colorspace.numberOfComponents; for (i=0; i < (ssize_t) fpx_info.numberOfComponents; i++) { fpx_info.components[i].myColorType.myDataType=DATA_TYPE_UNSIGNED_BYTE; fpx_info.components[i].horzSubSampFactor=1; fpx_info.components[i].vertSubSampFactor=1; - fpx_info.components[i].columnStride=fpx_info.numberOfComponents; - fpx_info.components[i].lineStride= - image->columns*fpx_info.components[i].columnStride; + fpx_info.components[i].columnStride=(int) fpx_info.numberOfComponents; + fpx_info.components[i].lineStride=(size_t) (image->columns* + fpx_info.components[i].columnStride); fpx_info.components[i].theData=pixels+i; } fpx_info.components[0].myColorType.myColor=fpx_info.numberOfComponents != 1 ? @@ -1117,6 +1136,7 @@ static MagickBooleanType WriteFPXImage(const ImageInfo *image_info,Image *image) } } (void) FPX_CloseImage(flashpix); + FPXRelinquishSummaryInfo(&summary_info); FPX_ClearSystem(); return(MagickTrue); } diff --git a/coders/ghostscript-private.h b/coders/ghostscript-private.h index 53059379168f93796a3abcf66be6cb56343cec57..94b283688133f3200c7e2fdfd399ef81a48e535c 100644 --- a/coders/ghostscript-private.h +++ b/coders/ghostscript-private.h @@ -235,11 +235,11 @@ static inline void ReadGhostScriptXMPProfile(MagickByteBuffer *buffer, ssize_t count; - if (*profile != (StringInfo *) NULL) - return; status=CompareMagickByteBuffer(buffer,BeginXMPPacket,strlen(BeginXMPPacket)); if (status == MagickFalse) return; + if (*profile != (StringInfo *) NULL) + *profile=DestroyStringInfo(*profile); length=8192; *profile=AcquireStringInfo(length); found_end=MagickFalse; diff --git a/coders/gif.c b/coders/gif.c index 5b1758ab806f582f6d061f09e669e0930603cc9c..86c678a44234f181e51a433da7e03fb31b58fc42 100644 --- a/coders/gif.c +++ b/coders/gif.c @@ -1321,8 +1321,9 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) image->transparent_color=image->colormap[opacity]; } } - image->background_color=image->colormap[MagickMin((ssize_t) background, - (ssize_t) image->colors-1)]; + if (image->colors > 0) + image->background_color=image->colormap[MagickMin((ssize_t) + background,(ssize_t) image->colors-1)]; } else { @@ -1421,7 +1422,8 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) global_colormap=(unsigned char *) RelinquishMagickMemory(global_colormap); if ((image->columns == 0) || (image->rows == 0)) ThrowReaderException(CorruptImageError,"NegativeOrZeroImageSize"); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -1963,6 +1965,7 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image) global_colormap=(unsigned char *) RelinquishMagickMemory(global_colormap); colormap=(unsigned char *) RelinquishMagickMemory(colormap); write_info=DestroyImageInfo(write_info); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/gray.c b/coders/gray.c index 12fd53038dba450a79b0890399de310f6dc735f0..ffc742a69b2a16760db3417e981325f916a312c5 100644 --- a/coders/gray.c +++ b/coders/gray.c @@ -108,7 +108,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, *image; MagickBooleanType - status; + status = MagickTrue; MagickOffsetType scene; @@ -575,8 +575,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, if (DiscardBlobBytes(image,(MagickSizeType) image->offset) == MagickFalse) { status=MagickFalse; - ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", - image->filename); + ThrowFileException(exception,CorruptImageError, + "UnexpectedEndOfFile",image->filename); break; } length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum); @@ -649,7 +649,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, (void) CloseBlob(image); if (image->matte != MagickFalse) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("A",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -763,7 +764,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, quantum_info=DestroyQuantumInfo(quantum_info); InheritException(&image->exception,&canvas_image->exception); canvas_image=DestroyImage(canvas_image); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -871,7 +873,7 @@ static MagickBooleanType WriteGRAYImage(const ImageInfo *image_info, Image *image) { MagickBooleanType - status; + status = MagickTrue; MagickOffsetType scene; @@ -1088,7 +1090,8 @@ static MagickBooleanType WriteGRAYImage(const ImageInfo *image_info, (void) CloseBlob(image); if (quantum_type == GrayAlphaQuantum) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("A",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1136,6 +1139,7 @@ static MagickBooleanType WriteGRAYImage(const ImageInfo *image_info, if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/hald.c b/coders/hald.c index 64524c111af427f149320161e94c27b209e266d1..ade3fc27c42393347393ed0bd7e765e25e460b35 100644 --- a/coders/hald.c +++ b/coders/hald.c @@ -184,7 +184,8 @@ static Image *ReadHALDImage(const ImageInfo *image_info, if (SyncAuthenticPixels(image,exception) == MagickFalse) status=MagickFalse; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); if (image_info->scene != 0) diff --git a/coders/hdr.c b/coders/hdr.c index 80c2f9f178fd15fd6b3ff7a92d678d8421d020eb..38668a4189db2b04a155e1baeef3ea4b861dc176 100644 --- a/coders/hdr.c +++ b/coders/hdr.c @@ -456,7 +456,7 @@ static Image *ReadHDRImage(const ImageInfo *image_info,ExceptionInfo *exception) count=ReadBlob(image,(size_t) count*sizeof(*p),p); if (count < 1) break; - p+=count; + p+=(ptrdiff_t) count; } } } @@ -509,7 +509,10 @@ static Image *ReadHDRImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -625,7 +628,7 @@ static size_t HDRWriteRunlengthPixels(Image *image,unsigned char *pixels) previous_count=0; while ((runlength < MinimumRunlength) && (q < image->columns)) { - q+=runlength; + q+=(ptrdiff_t) runlength; previous_count=(ssize_t) runlength; runlength=1; while ((pixels[q] == pixels[q+runlength]) && @@ -650,7 +653,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+=(ptrdiff_t) count; } if (runlength >= MinimumRunlength) { @@ -658,7 +661,7 @@ static size_t HDRWriteRunlengthPixels(Image *image,unsigned char *pixels) pixel[1]=pixels[q]; if (WriteBlob(image,2*sizeof(*pixel),pixel) < 1) break; - p+=runlength; + p+=(ptrdiff_t) runlength; } } return(p); @@ -834,6 +837,7 @@ static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image) break; } pixels=(unsigned char *) RelinquishMagickMemory(pixels); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/heic.c b/coders/heic.c index 4ac90003be95445da533603eb5e651ac41692452..cce794cc795a011300d407646a150598ce4f969a 100644 --- a/coders/heic.c +++ b/coders/heic.c @@ -69,16 +69,18 @@ #include "magick/option.h" #include "magick/pixel-accessor.h" #include "magick/quantum-private.h" +#include "magick/resource_.h" #include "magick/static.h" #include "magick/string_.h" #include "magick/string-private.h" #include "magick/module.h" #include "magick/utility.h" #if defined(MAGICKCORE_HEIC_DELEGATE) -#if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__) -#include -#else +#define HEIC_COMPUTE_NUMERIC_VERSION(major,minor,patch) \ + ((major<<24) | (minor<<16) | (patch<<8) | 0) #include +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,17,0) +#include #endif #endif @@ -88,8 +90,8 @@ */ static MagickBooleanType WriteHEICImage(const ImageInfo *,Image *); - -/*x + +/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % @@ -359,6 +361,73 @@ static MagickBooleanType ReadHEICImageHandle(const ImageInfo *image_info, "heic:preserve-orientation")); if (preserve_orientation == MagickFalse) (void) SetImageProperty(image,"exif:Orientation","1"); + else + { +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,17,0) + heif_item_id + item_id; + + heif_property_id + transforms[1]; + + int + count; + + struct heif_context + *heif_context; + + heif_context=heif_image_handle_get_context(image_handle); + item_id=heif_image_handle_get_item_id(image_handle); + count=heif_item_get_transformation_properties(heif_context,item_id, + transforms,1); + if (count == 1) + { + enum heif_transform_mirror_direction + mirror; + + int + rotation_ccw; + + mirror=heif_item_get_property_transform_mirror(heif_context,item_id, + transforms[0]); + rotation_ccw=heif_item_get_property_transform_rotation_ccw( + heif_context,item_id,transforms[0]); + switch(mirror) + { + case heif_transform_mirror_direction_horizontal: + { + if (rotation_ccw == 0) + image->orientation=TopRightOrientation; + else if (rotation_ccw == 270) + image->orientation=LeftTopOrientation; + break; + } + case heif_transform_mirror_direction_vertical: + { + if (rotation_ccw == 0) + image->orientation=BottomLeftOrientation; + else if (rotation_ccw == 270) + image->orientation=RightBottomOrientation; + break; + } + case heif_transform_mirror_direction_invalid: + { + if (rotation_ccw == 0) + image->orientation=TopLeftOrientation; + else if (rotation_ccw == 90) + image->orientation=LeftBottomOrientation; + else if (rotation_ccw == 180) + image->orientation=BottomRightOrientation; + else if (rotation_ccw == 270) + image->orientation=RightTopOrientation; + break; + } + } + } +#endif + image->columns=(size_t) heif_image_handle_get_ispe_width(image_handle); + image->rows=(size_t) heif_image_handle_get_ispe_height(image_handle); + } if (ReadHEICColorProfile(image,image_handle,exception) == MagickFalse) return(MagickFalse); if (ReadHEICExifProfile(image,image_handle,exception) == MagickFalse) @@ -373,6 +442,33 @@ static MagickBooleanType ReadHEICImageHandle(const ImageInfo *image_info, if (status == MagickFalse) return(MagickFalse); decode_options=heif_decoding_options_alloc(); +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,16,0) + { + const char + *option; + + option=GetImageOption(image_info,"heic:chroma-upsampling"); + if (option != (char *) NULL) + { + if (LocaleCompare(option,"nearest-neighbor") == 0) + { + decode_options->color_conversion_options. + only_use_preferred_chroma_algorithm=1; + decode_options->color_conversion_options. + preferred_chroma_upsampling_algorithm= + heif_chroma_upsampling_nearest_neighbor; + } + else if (LocaleCompare(option,"bilinear") == 0) + { + decode_options->color_conversion_options. + only_use_preferred_chroma_algorithm=1; + decode_options->color_conversion_options. + preferred_chroma_upsampling_algorithm= + heif_chroma_upsampling_bilinear; + } + } + } +#endif if (preserve_orientation != MagickFalse) decode_options->ignore_transformations=1; chroma=heif_chroma_interleaved_RGB; @@ -452,15 +548,15 @@ static MagickBooleanType ReadHEICImageHandle(const ImageInfo *image_info, for (x=0; x < (ssize_t) image->columns; x++) { unsigned short pixel = (((unsigned short) *(p+1) << 8) | - (*(p+0))) << shift; p+=2; + (*(p+0))) << shift; p+=(ptrdiff_t) 2; SetPixelRed(q,ScaleShortToQuantum(pixel)); - pixel=(((unsigned short) *(p+1) << 8) | (*(p+0))) << shift; p+=2; + pixel=(((unsigned short) *(p+1) << 8) | (*(p+0))) << shift; p+=(ptrdiff_t) 2; SetPixelGreen(q,ScaleShortToQuantum(pixel)); - pixel=(((unsigned short) *(p+1) << 8) | (*(p+0))) << shift; p+=2; + pixel=(((unsigned short) *(p+1) << 8) | (*(p+0))) << shift; p+=(ptrdiff_t) 2; SetPixelBlue(q,ScaleShortToQuantum(pixel)); if (image->matte != MagickFalse) { - pixel=(((unsigned short) *(p+1) << 8) | (*(p+0))) << shift; p+=2; + pixel=(((unsigned short) *(p+1) << 8) | (*(p+0))) << shift; p+=(ptrdiff_t) 2; SetPixelAlpha(q,ScaleShortToQuantum(pixel)); } q++; @@ -527,6 +623,9 @@ static Image *ReadHEICImage(const ImageInfo *image_info, Image *image; + int + max_size; + MagickBooleanType status; @@ -543,7 +642,7 @@ static Image *ReadHEICImage(const ImageInfo *image_info, *image_handle; unsigned char - magic[12]; + magic[128]; /* Open image file. @@ -565,7 +664,7 @@ static Image *ReadHEICImage(const ImageInfo *image_info, if (filetype_check == heif_filetype_no) ThrowReaderException(CoderError,"ImageTypeNotSupported"); (void) CloseBlob(image); -#if LIBHEIF_NUMERIC_VERSION >= 0x010b0000 +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,11,0) if (heif_has_compatible_brand(magic,sizeof(magic), "avif") == 1) (void) CopyMagickString(image->magick,"AVIF",MagickPathExtent); #endif @@ -575,6 +674,12 @@ static Image *ReadHEICImage(const ImageInfo *image_info, heif_context=heif_context_alloc(); if (heif_context == (struct heif_context *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + max_size=(int) MagickMin(MagickMin(GetMagickResourceLimit(WidthResource), + GetMagickResourceLimit(HeightResource)),INT_MAX); +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,19,0) + if (max_size != INT_MAX) + heif_context_set_maximum_image_size_limit(heif_context,max_size); +#endif error=heif_context_read_from_file(heif_context,image->filename, (const struct heif_reading_options *) NULL); if (IsHEIFSuccess(image,&error,exception) == MagickFalse) @@ -727,8 +832,10 @@ ModuleExport size_t RegisterHEICImage(void) MagickInfo *entry; -#if defined(MAGICKCORE_HEIC_DELEGATE) && (LIBHEIF_NUMERIC_VERSION >= 0x010e0000) - heif_init(NULL); +#if defined(MAGICKCORE_HEIC_DELEGATE) +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,14,0) + heif_init((struct heif_init_params *) NULL); +#endif #endif entry=SetMagickInfo("HEIC"); #if defined(MAGICKCORE_HEIC_DELEGATE) @@ -760,7 +867,7 @@ ModuleExport size_t RegisterHEICImage(void) entry->seekable_stream=MagickTrue; entry->blob_support=MagickFalse; (void) RegisterMagickInfo(entry); -#if LIBHEIF_NUMERIC_VERSION > 0x01060200 +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,7,0) entry=SetMagickInfo("AVIF"); #if defined(MAGICKCORE_HEIC_DELEGATE) if (heif_have_decoder_for_format(heif_compression_AV1)) @@ -802,14 +909,16 @@ ModuleExport size_t RegisterHEICImage(void) */ ModuleExport void UnregisterHEICImage(void) { -#if LIBHEIF_NUMERIC_VERSION > 0x01060200 +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,7,0) (void) UnregisterMagickInfo("AVIF"); #endif (void) UnregisterMagickInfo("HEIC"); (void) UnregisterMagickInfo("HEIF"); -#if defined(MAGICKCORE_HEIC_DELEGATE) && (LIBHEIF_NUMERIC_VERSION >= 0x010e0000) +#if defined(MAGICKCORE_HEIC_DELEGATE) +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,14,0) heif_deinit(); #endif +#endif } /* @@ -883,7 +992,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) @@ -1171,7 +1281,7 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info, Image *image) { MagickBooleanType -#if LIBHEIF_NUMERIC_VERSION > 0x01060200 +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,7,0) encode_avif, #endif status; @@ -1205,12 +1315,15 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info, return(status); scene=0; heif_context=heif_context_alloc(); -#if LIBHEIF_NUMERIC_VERSION > 0x01060200 +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,7,0) encode_avif=(LocaleCompare(image_info->magick,"AVIF") == 0) ? MagickTrue : MagickFalse; #endif do { + const char + *option; + const StringInfo *profile; @@ -1229,7 +1342,7 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info, /* Get encoder for the specified format. */ -#if LIBHEIF_NUMERIC_VERSION > 0x01060200 +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,7,0) if (encode_avif != MagickFalse) error=heif_context_get_encoder_for_format(heif_context, heif_compression_AV1,&heif_encoder); @@ -1304,32 +1417,54 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info, status=IsHEIFSuccess(image,&error,&image->exception); if (status == MagickFalse) break; -#if LIBHEIF_NUMERIC_VERSION > 0x01060200 - if (encode_avif != MagickFalse) + option=GetImageOption(image_info,"heic:speed"); + if (option != (char *) NULL) { - const char - *option; - - option=GetImageOption(image_info,"heic:speed"); - if (option != (char *) NULL) + error=heif_encoder_set_parameter(heif_encoder,"speed",option); + status=IsHEIFSuccess(image,&error,&image->exception); + if (status == MagickFalse) + break; + } + option=GetImageOption(image_info,"heic:chroma"); + if (option != (char *) NULL) + { + error=heif_encoder_set_parameter(heif_encoder,"chroma",option); + status=IsHEIFSuccess(image,&error,&image->exception); + if (status == MagickFalse) + break; + } + options=heif_encoding_options_alloc(); +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,16,0) + option=GetImageOption(image_info,"heic:chroma-downsampling"); + if (option != (char *) NULL) + { + if (LocaleCompare(option,"nearest-neighbor") == 0) { - error=heif_encoder_set_parameter(heif_encoder,"speed",option); - status=IsHEIFSuccess(image,&error,&image->exception); - if (status == MagickFalse) - break; + options->color_conversion_options. + only_use_preferred_chroma_algorithm=1; + options->color_conversion_options. + preferred_chroma_downsampling_algorithm= + heif_chroma_downsampling_nearest_neighbor; } - option=GetImageOption(image_info,"heic:chroma"); - if (option != (char *) NULL) + else if (LocaleCompare(option,"average") == 0) { - error=heif_encoder_set_parameter(heif_encoder,"chroma",option); - status=IsHEIFSuccess(image,&error,&image->exception); - if (status == MagickFalse) - break; + options->color_conversion_options. + only_use_preferred_chroma_algorithm=1; + options->color_conversion_options. + preferred_chroma_downsampling_algorithm= + heif_chroma_downsampling_average; + } + else if (LocaleCompare(option,"sharp-yuv") == 0) + { + options->color_conversion_options. + only_use_preferred_chroma_algorithm=1; + options->color_conversion_options. + preferred_chroma_downsampling_algorithm= + heif_chroma_downsampling_sharp_yuv; } } #endif - options=heif_encoding_options_alloc(); -#if LIBHEIF_NUMERIC_VERSION >= 0x010e0000 +#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,14,0) if (image->orientation != UndefinedOrientation) options->image_orientation=(enum heif_orientation) image->orientation; #endif @@ -1371,7 +1506,8 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info, if (heif_image != (struct heif_image*) NULL) heif_image_release(heif_image); heif_context_free(heif_context); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } #endif diff --git a/coders/hrz.c b/coders/hrz.c index 8a2da11c3495c105dd67e450db926f10a2b2ab64..c731bcfb95444db2808aafa01d6a7d33c588d047 100644 --- a/coders/hrz.c +++ b/coders/hrz.c @@ -100,23 +100,19 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception) MagickBooleanType status; - ssize_t - x; - PixelPacket *q; - unsigned char - *p; + size_t + length; ssize_t count, + x, y; - size_t - length; - unsigned char + *p, *pixels; /* @@ -142,6 +138,11 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception) image->columns=256; image->rows=240; image->depth=8; + if (image_info->ping != MagickFalse) + { + (void) CloseBlob(image); + return(GetFirstImageInList(image)); + } status=SetImageExtent(image,image->columns,image->rows); if (status == MagickFalse) { @@ -182,7 +183,10 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -273,28 +277,24 @@ ModuleExport void UnregisterHRZImage(void) */ static MagickBooleanType WriteHRZImage(const ImageInfo *image_info,Image *image) { + const PixelPacket + *p; + Image *hrz_image; MagickBooleanType status; - const PixelPacket - *p; - ssize_t + count, x, y; unsigned char + *pixels, *q; - ssize_t - count; - - unsigned char - *pixels; - /* Open output image file. */ @@ -333,9 +333,9 @@ static MagickBooleanType WriteHRZImage(const ImageInfo *image_info,Image *image) q=pixels; for (x=0; x < (ssize_t) hrz_image->columns; x++) { - *q++=ScaleQuantumToChar(GetPixelRed(p)/4); - *q++=ScaleQuantumToChar(GetPixelGreen(p)/4); - *q++=ScaleQuantumToChar(GetPixelBlue(p)/4); + *q++=ScaleQuantumToChar(GetPixelRed(p))/4; + *q++=ScaleQuantumToChar(GetPixelGreen(p))/4; + *q++=ScaleQuantumToChar(GetPixelBlue(p))/4; p++; } count=WriteBlob(image,(size_t) (q-pixels),pixels); @@ -347,6 +347,7 @@ static MagickBooleanType WriteHRZImage(const ImageInfo *image_info,Image *image) } pixels=(unsigned char *) RelinquishMagickMemory(pixels); hrz_image=DestroyImage(hrz_image); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/icon.c b/coders/icon.c index d716b04f72602d41e2f4cb35148962ea597dc7e5..b47867345f0fcfcdbbcfef91fd06ce3fb52c1be0 100644 --- a/coders/icon.c +++ b/coders/icon.c @@ -93,48 +93,14 @@ typedef struct _IconEntry offset; } IconEntry; -typedef struct _IconFile +typedef struct _IconDirectory { - short - reserved, - resource_type, + size_t count; IconEntry - directory[MaxIcons]; -} IconFile; - -typedef struct _IconInfo -{ - size_t - file_size, - ba_offset, - offset_bits, - size; - - ssize_t - width, - height; - - unsigned short - planes, - bits_per_pixel; - - size_t - compression, - image_size, - x_pixels, - y_pixels, - number_colors, - red_mask, - green_mask, - blue_mask, - alpha_mask, - colors_important; - - ssize_t - colorspace; -} IconInfo; + **icons; +} IconDirectory; /* Forward declarations. @@ -146,61 +112,52 @@ static Image static MagickBooleanType WriteICONImage(const ImageInfo *,Image *); -Image *AutoResizeImage(const Image *image,const char *option, - MagickOffsetType *count,ExceptionInfo *exception) +static IconDirectory *RelinquishIconDirectory(IconDirectory *directory) { - #define MAX_SIZES 16 - - char - *q; + ssize_t + i; - const char - *p; + assert(directory != (IconDirectory *) NULL); - Image - *resized, - *images; + if (directory->icons != (IconEntry **) NULL) + { + for (i=0; i < (ssize_t) directory->count; i++) + { + if (directory->icons[i] != (IconEntry *) NULL) + directory->icons[i]=(IconEntry *) RelinquishMagickMemory( + directory->icons[i]); + } + directory->icons=(IconEntry **) RelinquishMagickMemory(directory->icons); + } + directory=(IconDirectory *) RelinquishMagickMemory(directory); + return(directory); +} - size_t - sizes[MAX_SIZES]={256, 192, 128, 96, 64, 48, 40, 32, 24, 16}; +static IconDirectory *AcquireIconDirectory(size_t count) +{ + IconDirectory + *directory; ssize_t i; - images=NULL; - *count=0; - i=0; - p=option; - while (*p != '\0' && i < MAX_SIZES) + directory=(IconDirectory*) AcquireMagickMemory(sizeof(*directory)); + if (directory == (IconDirectory*) NULL) + return(directory); + directory->icons=(IconEntry **) AcquireQuantumMemory(count, + sizeof(*directory->icons)); + if (directory->icons == (IconEntry **) NULL) + return(RelinquishIconDirectory(directory)); + memset(directory->icons,0,count*sizeof(*directory->icons)); + for (i=0; i < (ssize_t) count; i++) { - size_t - size; - - while ((isspace((int) ((unsigned char) *p)) != 0)) - p++; - size=(size_t)strtol(p,&q,10); - if ((p == q) || (size < 16) || (size > 256)) - return((Image *) NULL); - p=q; - sizes[i++]=size; - while ((isspace((int) ((unsigned char) *p)) != 0) || (*p == ',')) - p++; + directory->icons[i]=(IconEntry *) AcquireMagickMemory( + sizeof(**directory->icons)); + if (directory->icons[i] == (IconEntry *) NULL) + return(RelinquishIconDirectory(directory)); } - if (i == 0) - i=10; - *count=i; - for (i=0; i < *count; i++) - { - resized=ResizeImage(image,sizes[i],sizes[i],image->filter,image->blur, - exception); - if (resized == (Image *) NULL) - return(DestroyImageList(images)); - if (images == (Image *) NULL) - images=resized; - else - AppendImageToList(&images,resized); - } - return(images); + directory->count=count; + return(directory); } /* @@ -231,19 +188,14 @@ Image *AutoResizeImage(const Image *image,const char *option, % */ -static Image *Read1XImage(const ImageInfo *image_info,Image *image, - ExceptionInfo *exception) +static Image *Read1XImage(Image *image,ExceptionInfo *exception) { - MagickBooleanType - status; - size_t columns, rows; ssize_t - i, - y; + i; /* Read Windows 1.0 Icon. @@ -253,20 +205,26 @@ static Image *Read1XImage(const ImageInfo *image_info,Image *image, rows=(size_t) (ReadBlobLSBShort(image)); (void) ReadBlobLSBShort(image); /* width of bitmap in bytes */ (void) ReadBlobLSBShort(image); /* cursor color */ + if (((rows != 32) && (rows != 64)) || ((columns != 32) && (columns != 64))) + { + (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError, + "ImproperImageHeader","`%s'",image->filename); + return(DestroyImageList(image)); + } /* Convert bitmap scanline. */ - status=MagickTrue; - for (i=0; ; i++) + if (SetImageExtent(image,columns,rows) == MagickFalse) + return(DestroyImageList(image)); + image->matte=MagickTrue; + if (AcquireImageColormap(image,3) == MagickFalse) + return(DestroyImageList(image)); + image->colormap[1].opacity=TransparentOpacity; + for (i=0; i < 2; i++) { - status=SetImageExtent(image,columns,rows); - if (status == MagickFalse) - break; - if (AcquireImageColormap(image,2) == MagickFalse) - { - status=MagickFalse; - break; - } + ssize_t + y; + for (y=0; y < (ssize_t) image->columns; y++) { IndexPacket @@ -275,10 +233,6 @@ static Image *Read1XImage(const ImageInfo *image_info,Image *image, PixelPacket *q; - size_t - bit, - byte; - ssize_t x; @@ -288,51 +242,56 @@ static Image *Read1XImage(const ImageInfo *image_info,Image *image, indexes=GetAuthenticIndexQueue(image); for (x=0; x < (ssize_t) (image->columns-7); x+=8) { + size_t + bit, + byte; + byte=(size_t) ReadBlobByte(image); for (bit=0; bit < 8; bit++) - SetPixelIndex(indexes+x+bit,((byte & (0x80 >> bit)) != 0 ? - 0x01 : 0x00)); - } - if ((image->columns % 8) != 0) { - byte=(size_t) ReadBlobByte(image); - for (bit=0; bit < (image->columns % 8); bit++) - SetPixelIndex(indexes+x+bit,((byte & (0x80 >> bit)) != 0 ? - 0x01 : 0x00)); + Quantum + index; + + index=((byte & (0x80 >> bit)) != 0 ? (i == 0 ? 0x01 : 0x02) : 0x00); + if (i == 0) + SetPixelIndex(indexes+x+bit,index); + else + if (GetPixelIndex(indexes+x+bit) != 0x01) + SetPixelIndex(indexes+x+bit,index); + q++; } + } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; - if (image->previous == (Image *) NULL) - { - status=SetImageProgress(image,LoadImageTag,y,image->rows); - if (status == MagickFalse) - break; - } } - if (i > 0) - break; - AcquireNextImage(image_info,image); - if (GetNextImageInList(image) == (Image *) NULL) - { - status=MagickFalse; - break; - } - image=SyncNextImageInList(image); } - (void) CloseBlob(image); - if (status == MagickFalse) + if (SyncImage(image) == MagickFalse) + return(DestroyImageList(image)); + if (CloseBlob(image) == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); } +static inline size_t GetICONSize(size_t directory_size,size_t image_size) +{ + if (image_size != 0) + return(image_size); + if (directory_size != 0) + return(directory_size); + return(256); +} + static Image *ReadICONImage(const ImageInfo *image_info, ExceptionInfo *exception) { - IconFile - icon_file; +#define ThrowICONReaderException(exception,message) \ +{ \ + directory=RelinquishIconDirectory(directory); \ + ThrowReaderException(exception,message) \ +} - IconInfo - icon_info; + IconDirectory + *directory; Image *image; @@ -346,15 +305,12 @@ static Image *ReadICONImage(const ImageInfo *image_info, IndexPacket *indexes; - ssize_t - i, - x; - PixelPacket *q; - unsigned char - *p; + short + reserved, + resource_type; size_t bit, @@ -364,10 +320,17 @@ static Image *ReadICONImage(const ImageInfo *image_info, scanline_pad; ssize_t - count, + i, offset, + x, y; + unsigned char + *p; + + unsigned short + icon_count; + /* Open image file. */ @@ -383,58 +346,71 @@ static Image *ReadICONImage(const ImageInfo *image_info, image=DestroyImageList(image); return((Image *) NULL); } - (void) memset(&icon_file,0,sizeof(icon_file)); - icon_file.reserved=(short) ReadBlobLSBShort(image); - if ((icon_file.reserved == 0x0001) || (icon_file.reserved == 0x0101) || - (icon_file.reserved == 0x0201)) - return(Read1XImage(image_info,image,exception)); - icon_file.resource_type=(short) ReadBlobLSBShort(image); - icon_file.count=(short) ReadBlobLSBShort(image); - if ((icon_file.reserved != 0) || - ((icon_file.resource_type != 1) && (icon_file.resource_type != 2)) || - (icon_file.count > MaxIcons)) + reserved=(short) ReadBlobLSBShort(image); + if ((reserved == 0x0001) || (reserved == 0x0101) || + (reserved == 0x0201)) + return(Read1XImage(image,exception)); + resource_type=(short) ReadBlobLSBShort(image); + icon_count=(short) ReadBlobLSBShort(image); + if ((reserved != 0) || ((resource_type != 1) && (resource_type != 2)) || + (icon_count > MaxIcons)) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + directory=AcquireIconDirectory((size_t) icon_count); + if (directory == (IconDirectory *) NULL) + ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); extent=0; - for (i=0; i < icon_file.count; i++) + for (i=0; i < directory->count; i++) { - icon_file.directory[i].width=(unsigned char) ReadBlobByte(image); - icon_file.directory[i].height=(unsigned char) ReadBlobByte(image); - icon_file.directory[i].colors=(unsigned char) ReadBlobByte(image); - icon_file.directory[i].reserved=(unsigned char) ReadBlobByte(image); - icon_file.directory[i].planes=(unsigned short) ReadBlobLSBShort(image); - icon_file.directory[i].bits_per_pixel=(unsigned short) + directory->icons[i]->width=(unsigned char) ReadBlobByte(image); + directory->icons[i]->height=(unsigned char) ReadBlobByte(image); + directory->icons[i]->colors=(unsigned char) ReadBlobByte(image); + directory->icons[i]->reserved=(unsigned char) ReadBlobByte(image); + directory->icons[i]->planes=(unsigned short) ReadBlobLSBShort(image); + directory->icons[i]->bits_per_pixel=(unsigned short) ReadBlobLSBShort(image); - icon_file.directory[i].size=ReadBlobLSBLong(image); - icon_file.directory[i].offset=ReadBlobLSBLong(image); + directory->icons[i]->size=ReadBlobLSBLong(image); + directory->icons[i]->offset=ReadBlobLSBLong(image); if (EOFBlob(image) != MagickFalse) break; - extent=MagickMax(extent,icon_file.directory[i].size); + extent=MagickMax(extent,directory->icons[i]->size); } if ((EOFBlob(image) != MagickFalse) || (extent > GetBlobSize(image))) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); + ThrowICONReaderException(CorruptImageError,"UnexpectedEndOfFile"); one=1; - for (i=0; i < icon_file.count; i++) + for (i=0; i < (ssize_t) directory->count; i++) { + size_t + size; + + ssize_t + count, + width, + height; + + unsigned short + bits_per_pixel, + planes; + /* Verify Icon identifier. */ offset=(ssize_t) SeekBlob(image,(MagickOffsetType) - icon_file.directory[i].offset,SEEK_SET); + directory->icons[i]->offset,SEEK_SET); if (offset < 0) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); - icon_info.size=ReadBlobLSBLong(image); - icon_info.width=(unsigned char) ReadBlobLSBSignedLong(image); - icon_info.height=(unsigned char) (ReadBlobLSBSignedLong(image)/2); - icon_info.planes=ReadBlobLSBShort(image); - icon_info.bits_per_pixel=ReadBlobLSBShort(image); + size=ReadBlobLSBLong(image); + width=ReadBlobLSBSignedLong(image); + height=(ReadBlobLSBSignedLong(image)/2); + planes=ReadBlobLSBShort(image); + bits_per_pixel=ReadBlobLSBShort(image); if (EOFBlob(image) != MagickFalse) { ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); break; } - if (((icon_info.planes == 18505) && (icon_info.bits_per_pixel == 21060)) || - (icon_info.size == 0x474e5089)) + if (((planes == 18505) && (bits_per_pixel == 21060)) || + (size == 0x474e5089)) { Image *icon_image; @@ -451,22 +427,22 @@ static Image *ReadICONImage(const ImageInfo *image_info, /* Icon image encoded as a compressed PNG image. */ - length=icon_file.directory[i].size; + length=directory->icons[i]->size; if ((length < 16) || (~length < 16)) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + ThrowICONReaderException(ResourceLimitError,"MemoryAllocationFailed"); png=(unsigned char *) AcquireQuantumMemory(length,sizeof(*png)); if (png == (unsigned char *) NULL) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + ThrowICONReaderException(ResourceLimitError,"MemoryAllocationFailed"); (void) memcpy(png,"\211PNG\r\n\032\n\000\000\000\015",12); - png[12]=(unsigned char) icon_info.planes; - png[13]=(unsigned char) (icon_info.planes >> 8); - png[14]=(unsigned char) icon_info.bits_per_pixel; - png[15]=(unsigned char) (icon_info.bits_per_pixel >> 8); + png[12]=(unsigned char) planes; + png[13]=(unsigned char) (planes >> 8); + png[14]=(unsigned char) bits_per_pixel; + png[15]=(unsigned char) (bits_per_pixel >> 8); count=ReadBlob(image,length-16,png+16); if (count != (ssize_t) (length-16)) { png=(unsigned char *) RelinquishMagickMemory(png); - ThrowReaderException(CorruptImageError, + ThrowICONReaderException(CorruptImageError, "InsufficientImageDataInFile"); } read_info=CloneImageInfo(image_info); @@ -483,28 +459,23 @@ static Image *ReadICONImage(const ImageInfo *image_info, } else { - if (icon_info.bits_per_pixel > 32) - ThrowReaderException(CorruptImageError,"ImproperImageHeader"); - icon_info.compression=ReadBlobLSBLong(image); - icon_info.image_size=ReadBlobLSBLong(image); - icon_info.x_pixels=ReadBlobLSBLong(image); - icon_info.y_pixels=ReadBlobLSBLong(image); - icon_info.number_colors=ReadBlobLSBLong(image); - if (icon_info.number_colors > GetBlobSize(image)) - ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); - icon_info.colors_important=ReadBlobLSBLong(image); + size_t + number_colors; + + if (bits_per_pixel > 32) + ThrowICONReaderException(CorruptImageError,"ImproperImageHeader"); + (void) ReadBlobLSBLong(image); /* compression */ + (void) ReadBlobLSBLong(image); /* image_size */ + (void) ReadBlobLSBLong(image); /* x_pixels */ + (void) ReadBlobLSBLong(image); /* y_pixels */ + number_colors=ReadBlobLSBLong(image); + if (number_colors > GetBlobSize(image)) + ThrowICONReaderException(CorruptImageError,"InsufficientImageDataInFile"); + (void) ReadBlobLSBLong(image); /* colors_important */ image->matte=MagickTrue; - image->columns=(size_t) icon_file.directory[i].width; - if ((ssize_t) image->columns > icon_info.width) - image->columns=(size_t) icon_info.width; - if (image->columns == 0) - image->columns=256; - image->rows=(size_t) icon_file.directory[i].height; - if ((ssize_t) image->rows > icon_info.height) - image->rows=(size_t) icon_info.height; - if (image->rows == 0) - image->rows=256; - image->depth=icon_info.bits_per_pixel; + image->columns=GetICONSize(directory->icons[i]->width,width); + image->rows=GetICONSize(directory->icons[i]->height,height); + image->depth=bits_per_pixel; if (image->depth > 16) image->depth=8; if (image->debug != MagickFalse) @@ -512,24 +483,24 @@ static Image *ReadICONImage(const ImageInfo *image_info, (void) LogMagickEvent(CoderEvent,GetMagickModule(), " scene = %.20g",(double) i); (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " size = %.20g",(double) icon_info.size); + " size = %.20g",(double) size); (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " width = %.20g",(double) icon_file.directory[i].width); + " width = %.20g",(double) width); (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " height = %.20g",(double) icon_file.directory[i].height); + " height = %.20g",(double) height); (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " colors = %.20g",(double ) icon_info.number_colors); + " colors = %.20g",(double ) number_colors); (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " planes = %.20g",(double) icon_info.planes); + " planes = %.20g",(double) planes); (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " bpp = %.20g",(double) icon_info.bits_per_pixel); + " bpp = %.20g",(double) bits_per_pixel); } - if ((icon_info.number_colors != 0) || (icon_info.bits_per_pixel <= 16U)) + if ((number_colors != 0) || (bits_per_pixel <= 16U)) { image->storage_class=PseudoClass; - image->colors=icon_info.number_colors; + image->colors=number_colors; if ((image->colors == 0) || (image->colors > 256)) - image->colors=one << icon_info.bits_per_pixel; + image->colors=one << bits_per_pixel; } if (image->storage_class == PseudoClass) { @@ -543,20 +514,20 @@ static Image *ReadICONImage(const ImageInfo *image_info, Read Icon raster colormap. */ if (image->colors > GetBlobSize(image)) - ThrowReaderException(CorruptImageError, + ThrowICONReaderException(CorruptImageError, "InsufficientImageDataInFile"); if (AcquireImageColormap(image,image->colors) == MagickFalse) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + ThrowICONReaderException(ResourceLimitError,"MemoryAllocationFailed"); icon_colormap=(unsigned char *) AcquireQuantumMemory((size_t) image->colors,4UL*sizeof(*icon_colormap)); if (icon_colormap == (unsigned char *) NULL) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + ThrowICONReaderException(ResourceLimitError,"MemoryAllocationFailed"); count=ReadBlob(image,(size_t) (4*image->colors),icon_colormap); if (count != (ssize_t) (4*image->colors)) { icon_colormap=(unsigned char *) RelinquishMagickMemory( icon_colormap); - ThrowReaderException(CorruptImageError, + ThrowICONReaderException(CorruptImageError, "InsufficientImageDataInFile"); } p=icon_colormap; @@ -582,12 +553,12 @@ static Image *ReadICONImage(const ImageInfo *image_info, InheritException(exception,&image->exception); return(DestroyImageList(image)); } - bytes_per_line=(((image->columns*icon_info.bits_per_pixel)+31) & + bytes_per_line=(((image->columns*bits_per_pixel)+31) & ~31) >> 3; (void) bytes_per_line; - scanline_pad=((((image->columns*icon_info.bits_per_pixel)+31) & ~31)- - (image->columns*icon_info.bits_per_pixel)) >> 3; - switch (icon_info.bits_per_pixel) + scanline_pad=((((image->columns*bits_per_pixel)+31) & ~31)- + (image->columns*bits_per_pixel)) >> 3; + switch (bits_per_pixel) { case 1: { @@ -744,12 +715,12 @@ static Image *ReadICONImage(const ImageInfo *image_info, ReadBlobByte(image))); SetPixelRed(q,ScaleCharToQuantum((unsigned char) ReadBlobByte(image))); - if (icon_info.bits_per_pixel == 32) + if (bits_per_pixel == 32) SetPixelAlpha(q,ScaleCharToQuantum((unsigned char) ReadBlobByte(image))); q++; } - if (icon_info.bits_per_pixel == 24) + if (bits_per_pixel == 24) for (x=0; x < (ssize_t) scanline_pad; x++) (void) ReadBlobByte(image); if (SyncAuthenticPixels(image,exception) == MagickFalse) @@ -765,12 +736,11 @@ static Image *ReadICONImage(const ImageInfo *image_info, break; } default: - ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + ThrowICONReaderException(CorruptImageError,"ImproperImageHeader"); } - if ((image_info->ping == MagickFalse) && - (icon_info.bits_per_pixel <= 16)) + if ((image_info->ping == MagickFalse) && (bits_per_pixel <= 16)) (void) SyncImage(image); - if (icon_info.bits_per_pixel != 32) + if (bits_per_pixel != 32) { /* Read the ICON alpha mask. @@ -815,7 +785,7 @@ static Image *ReadICONImage(const ImageInfo *image_info, if (image_info->number_scenes != 0) if (image->scene >= (image_info->scene+image_info->number_scenes-1)) break; - if (i < (ssize_t) (icon_file.count-1)) + if (i < ((ssize_t) directory->count-1)) { /* Allocate next image structure. @@ -833,6 +803,7 @@ static Image *ReadICONImage(const ImageInfo *image_info, break; } } + directory=RelinquishIconDirectory(directory); (void) CloseBlob(image); if (status == MagickFalse) return(DestroyImageList(image)); @@ -951,9 +922,74 @@ ModuleExport void UnregisterICONImage(void) % o image: The image. % */ + +Image *AutoResizeImage(const Image *image,const char *option, + MagickOffsetType *count,ExceptionInfo *exception) +{ +#define MAX_SIZES 11 + + char + *q; + + const char + *p; + + Image + *resized, + *images; + + size_t + sizes[MAX_SIZES] = { 512, 256, 192, 128, 96, 64, 48, 40, 32, 24, 16 }; + + ssize_t + i; + + images=NULL; + *count=0; + i=0; + p=option; + while (*p != '\0' && i < MAX_SIZES) + { + size_t + size; + + while ((isspace((int) ((unsigned char) *p)) != 0)) + p++; + size=(size_t)strtol(p,&q,10); + if ((p == q) || (size < 16) || (size > 512)) + return((Image *) NULL); + p=q; + sizes[i++]=size; + while ((isspace((int) ((unsigned char) *p)) != 0) || (*p == ',')) + p++; + } + if (i == 0) + i=MAX_SIZES; + *count=i; + for (i=0; i < *count; i++) + { + resized=ResizeImage(image,sizes[i],sizes[i],image->filter,image->blur, + exception); + if (resized == (Image *) NULL) + return(DestroyImageList(images)); + if (images == (Image *) NULL) + images=resized; + else + AppendImageToList(&images,resized); + } + return(images); +} + static MagickBooleanType WriteICONImage(const ImageInfo *image_info, Image *image) { +#define ThrowICONWriterException(exception,message) \ +{ \ + directory=RelinquishIconDirectory(directory); \ + images=DestroyImageList(images); \ + ThrowWriterException(exception,message) \ +} + const char *option; @@ -963,11 +999,8 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, const PixelPacket *p; - IconFile - icon_file; - - IconInfo - icon_info; + IconDirectory + *directory; Image *images, @@ -1021,12 +1054,11 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, next=image; do { - if ((image->columns > 256L) || (image->rows > 256L)) + if ((image->columns > 512L) || (image->rows > 512L)) ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit"); scene++; next=SyncNextImageInList(next); - } while ((next != (Image *) NULL) && (image_info->adjoin != - MagickFalse)); + } while ((next != (Image *) NULL) && (image_info->adjoin != MagickFalse)); } /* Dump out a ICON header template to be properly initialized later. @@ -1034,30 +1066,35 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, (void) WriteBlobLSBShort(image,0); (void) WriteBlobLSBShort(image,1); (void) WriteBlobLSBShort(image,(unsigned char) scene); - (void) memset(&icon_file,0,sizeof(icon_file)); - (void) memset(&icon_info,0,sizeof(icon_info)); - scene=0; next=(images != (Image *) NULL) ? images : image; + number_scenes=0; do { - (void) WriteBlobByte(image,icon_file.directory[scene].width); - (void) WriteBlobByte(image,icon_file.directory[scene].height); - (void) WriteBlobByte(image,icon_file.directory[scene].colors); - (void) WriteBlobByte(image,icon_file.directory[scene].reserved); - (void) WriteBlobLSBShort(image,icon_file.directory[scene].planes); - (void) WriteBlobLSBShort(image,icon_file.directory[scene].bits_per_pixel); - (void) WriteBlobLSBLong(image,(unsigned int) - icon_file.directory[scene].size); - (void) WriteBlobLSBLong(image,(unsigned int) - icon_file.directory[scene].offset); - scene++; + number_scenes++; + (void) WriteBlobByte(image,0); /* width */ + (void) WriteBlobByte(image,0); /* height */ + (void) WriteBlobByte(image,0); /* colors */ + (void) WriteBlobByte(image,0); /* reserved */ + (void) WriteBlobLSBShort(image,0); /* planes */ + (void) WriteBlobLSBShort(image,0); /* bits_per_pixel */ + (void) WriteBlobLSBLong(image,0); /* size */ + (void) WriteBlobLSBLong(image,0); /* offset */ next=SyncNextImageInList(next); } while ((next != (Image *) NULL) && (image_info->adjoin != MagickFalse)); scene=0; next=(images != (Image *) NULL) ? images : image; - number_scenes=GetImageListLength(image); + directory=AcquireIconDirectory(number_scenes); + if (directory == (IconDirectory *) NULL) + ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); do { + size_t + size; + + unsigned short + bits_per_pixel, + planes; + if ((next->columns > 255L) && (next->rows > 255L) && ((next->compression == UndefinedCompression) || (next->compression == ZipCompression))) @@ -1077,49 +1114,58 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, write_image=CloneImage(next,0,0,MagickTrue,&image->exception); if (write_image == (Image *) NULL) { + directory=RelinquishIconDirectory(directory); images=DestroyImageList(images); return(MagickFalse); } write_info=CloneImageInfo(image_info); - (void) CopyMagickString(write_info->magick,"PNG",MagickPathExtent); + (void) CopyMagickString(write_info->magick,"PNG32",MagickPathExtent); length=0; - /* Don't write any ancillary chunks except for gAMA */ - (void) SetImageArtifact(write_image,"png:include-chunk","none,gama"); - + /* Don't write any ancillary chunks except for gAMA,tRNS */ + (void) SetImageArtifact(write_image,"png:include-chunk", + "none,gama,tRNS"); /* Only write PNG32 formatted PNG (32-bit RGBA), 8 bits per channel */ - (void) SetImageArtifact(write_image,"png:format","png32"); - (void) SetImageArtifact(write_image,"png:color-type","6"); + (void) SetImageArtifact(write_image,"png:IHDR.color-type-orig","6"); + (void) SetImageArtifact(write_image,"png:IHDR.bit-depth-orig","8"); png=(unsigned char *) ImageToBlob(write_info,write_image,&length, &image->exception); write_image=DestroyImageList(write_image); write_info=DestroyImageInfo(write_info); if (png == (unsigned char *) NULL) { + directory=RelinquishIconDirectory(directory); images=DestroyImageList(images); return(MagickFalse); } - icon_file.directory[scene].width=0; - icon_file.directory[scene].height=0; - icon_file.directory[scene].colors=0; - icon_file.directory[scene].reserved=0; - icon_file.directory[scene].planes=1; - icon_file.directory[scene].bits_per_pixel=32; - icon_file.directory[scene].size=(size_t) length; - icon_file.directory[scene].offset=(size_t) TellBlob(image); + directory->icons[scene]->width=0; + directory->icons[scene]->height=0; + directory->icons[scene]->colors=0; + directory->icons[scene]->reserved=0; + directory->icons[scene]->planes=1; + directory->icons[scene]->bits_per_pixel=32; + directory->icons[scene]->size=(size_t) length; + directory->icons[scene]->offset=(size_t) TellBlob(image); (void) WriteBlob(image,(size_t) length,png); png=(unsigned char *) RelinquishMagickMemory(png); } else { + size_t + image_size, + number_colors, + x_pixels, + y_pixels; + + ssize_t + width, + height; + /* Initialize ICON raster file header. */ if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse) - (void) TransformImageColorspace(image,sRGBColorspace); - icon_info.file_size=14+12+28; - icon_info.offset_bits=icon_info.file_size; - icon_info.compression=IconRgbCompression; + (void) TransformImageColorspace(image,sRGBColorspace); if ((next->storage_class != DirectClass) && (next->colors > 256)) (void) SetImageStorageClass(next,DirectClass); if (next->storage_class == DirectClass) @@ -1127,87 +1173,64 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, /* Full color ICON raster. */ - icon_info.number_colors=0; - icon_info.bits_per_pixel=32; - icon_info.compression=IconRgbCompression; + number_colors=0; + bits_per_pixel=32; } else { - size_t - one; - /* Colormapped ICON raster. */ - icon_info.bits_per_pixel=8; + bits_per_pixel=8; if (next->colors <= 16) - icon_info.bits_per_pixel=4; + bits_per_pixel=4; if (next->colors <= 2) - icon_info.bits_per_pixel=1; - one=1; - icon_info.number_colors=one << icon_info.bits_per_pixel; - if (icon_info.number_colors < next->colors) + bits_per_pixel=1; + number_colors=(size_t) 1 << bits_per_pixel; + if (number_colors < next->colors) { (void) SetImageStorageClass(next,DirectClass); - icon_info.number_colors=0; - icon_info.bits_per_pixel=(unsigned short) 24; - icon_info.compression=IconRgbCompression; - } - else - { - size_t - one; - - one=1; - icon_info.file_size+=3*(one << icon_info.bits_per_pixel); - icon_info.offset_bits+=3*(one << icon_info.bits_per_pixel); - icon_info.file_size+=(one << icon_info.bits_per_pixel); - icon_info.offset_bits+=(one << icon_info.bits_per_pixel); + number_colors=0; + bits_per_pixel=(unsigned short) 24; } } - bytes_per_line=(((next->columns*icon_info.bits_per_pixel)+31) & + bytes_per_line=(((next->columns*bits_per_pixel)+31) & ~31) >> 3; - icon_info.ba_offset=0; - icon_info.width=(ssize_t) next->columns; - icon_info.height=(ssize_t) next->rows; - icon_info.planes=1; - icon_info.image_size=bytes_per_line*next->rows; - 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.file_size+=icon_info.image_size; - icon_info.x_pixels=0; - icon_info.y_pixels=0; + width=(ssize_t) next->columns; + height=(ssize_t) next->rows; + planes=1; + image_size=bytes_per_line*next->rows; + size=40; + size+=(4*number_colors); + size+=image_size; + size+=(((width+31) & ~31) >> 3)*height; + x_pixels=0; + y_pixels=0; switch (next->units) { case UndefinedResolution: case PixelsPerInchResolution: { - icon_info.x_pixels=(size_t) (100.0*next->x_resolution/2.54); - icon_info.y_pixels=(size_t) (100.0*next->y_resolution/2.54); + x_pixels=(size_t) (100.0*next->x_resolution/2.54); + y_pixels=(size_t) (100.0*next->y_resolution/2.54); break; } case PixelsPerCentimeterResolution: { - icon_info.x_pixels=(size_t) (100.0*next->x_resolution); - icon_info.y_pixels=(size_t) (100.0*next->y_resolution); + x_pixels=(size_t) (100.0*next->x_resolution); + y_pixels=(size_t) (100.0*next->y_resolution); break; } } - icon_info.colors_important=icon_info.number_colors; /* Convert MIFF to ICON raster pixels. */ - pixels=(unsigned char *) AcquireQuantumMemory((size_t) - icon_info.image_size,sizeof(*pixels)); + pixels=(unsigned char *) AcquireQuantumMemory(image_size, + sizeof(*pixels)); if (pixels == (unsigned char *) NULL) - { - images=DestroyImageList(images); - ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); - } - (void) memset(pixels,0,(size_t) icon_info.image_size); - switch (icon_info.bits_per_pixel) + ThrowICONWriterException(ResourceLimitError,"MemoryAllocationFailed"); + (void) memset(pixels,0,image_size); + switch (bits_per_pixel) { case 1: { @@ -1337,7 +1360,7 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, *q++=ScaleQuantumToChar(GetPixelAlpha(p)); p++; } - if (icon_info.bits_per_pixel == 24) + if (bits_per_pixel == 24) for (x=3L*(ssize_t) next->columns; x < (ssize_t) bytes_per_line; x++) *q++=0x00; if (next->previous == (Image *) NULL) @@ -1353,26 +1376,25 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, /* Write 40-byte version 3+ bitmap header. */ - icon_file.directory[scene].width=(unsigned char) icon_info.width; - icon_file.directory[scene].height=(unsigned char) icon_info.height; - icon_file.directory[scene].colors=(unsigned char) - icon_info.number_colors; - icon_file.directory[scene].reserved=0; - icon_file.directory[scene].planes=icon_info.planes; - icon_file.directory[scene].bits_per_pixel=icon_info.bits_per_pixel; - icon_file.directory[scene].size=icon_info.size; - icon_file.directory[scene].offset=(size_t) TellBlob(image); + directory->icons[scene]->width=(unsigned char) width; + directory->icons[scene]->height=(unsigned char) height; + directory->icons[scene]->colors=(unsigned char) number_colors; + directory->icons[scene]->reserved=0; + directory->icons[scene]->planes=planes; + directory->icons[scene]->bits_per_pixel=bits_per_pixel; + directory->icons[scene]->size=size; + directory->icons[scene]->offset=(size_t) TellBlob(image); (void) WriteBlobLSBLong(image,(unsigned int) 40); - (void) WriteBlobLSBLong(image,(unsigned int) icon_info.width); - (void) WriteBlobLSBLong(image,(unsigned int) icon_info.height*2); - (void) WriteBlobLSBShort(image,icon_info.planes); - (void) WriteBlobLSBShort(image,icon_info.bits_per_pixel); - (void) WriteBlobLSBLong(image,(unsigned int) icon_info.compression); - (void) WriteBlobLSBLong(image,(unsigned int) icon_info.image_size); - (void) WriteBlobLSBLong(image,(unsigned int) icon_info.x_pixels); - (void) WriteBlobLSBLong(image,(unsigned int) icon_info.y_pixels); - (void) WriteBlobLSBLong(image,(unsigned int) icon_info.number_colors); - (void) WriteBlobLSBLong(image,(unsigned int) icon_info.colors_important); + (void) WriteBlobLSBLong(image,(unsigned int) width); + (void) WriteBlobLSBLong(image,(unsigned int) height*2); + (void) WriteBlobLSBShort(image,planes); + (void) WriteBlobLSBShort(image,bits_per_pixel); + (void) WriteBlobLSBLong(image,(unsigned int) IconRgbCompression); + (void) WriteBlobLSBLong(image,(unsigned int) image_size); + (void) WriteBlobLSBLong(image,(unsigned int) x_pixels); + (void) WriteBlobLSBLong(image,(unsigned int) y_pixels); + (void) WriteBlobLSBLong(image,(unsigned int) number_colors); + (void) WriteBlobLSBLong(image,(unsigned int) number_colors); if (next->storage_class == PseudoClass) { unsigned char @@ -1381,14 +1403,11 @@ 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 + << bits_per_pixel,4UL*sizeof(*icon_colormap)); if (icon_colormap == (unsigned char *) NULL) - { - images=DestroyImageList(images); - ThrowWriterException(ResourceLimitError, - "MemoryAllocationFailed"); - } + ThrowICONWriterException(ResourceLimitError, + "MemoryAllocationFailed"); q=icon_colormap; for (i=0; i < (ssize_t) next->colors; i++) { @@ -1397,19 +1416,19 @@ 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 << bits_per_pixel; i++) { *q++=(unsigned char) 0x00; *q++=(unsigned char) 0x00; *q++=(unsigned char) 0x00; *q++=(unsigned char) 0x00; } - (void) WriteBlob(image,(size_t) (4UL*(1UL << - icon_info.bits_per_pixel)),icon_colormap); + (void) WriteBlob(image,(size_t) (4UL*(1UL << bits_per_pixel)), + icon_colormap); icon_colormap=(unsigned char *) RelinquishMagickMemory( icon_colormap); } - (void) WriteBlob(image,(size_t) icon_info.image_size,pixels); + (void) WriteBlob(image,image_size,pixels); pixels=(unsigned char *) RelinquishMagickMemory(pixels); /* Write matte mask. @@ -1459,19 +1478,20 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, next=(images != (Image *) NULL) ? images : image; do { - (void) WriteBlobByte(image,icon_file.directory[scene].width); - (void) WriteBlobByte(image,icon_file.directory[scene].height); - (void) WriteBlobByte(image,icon_file.directory[scene].colors); - (void) WriteBlobByte(image,icon_file.directory[scene].reserved); - (void) WriteBlobLSBShort(image,icon_file.directory[scene].planes); - (void) WriteBlobLSBShort(image,icon_file.directory[scene].bits_per_pixel); + (void) WriteBlobByte(image,directory->icons[scene]->width); + (void) WriteBlobByte(image,directory->icons[scene]->height); + (void) WriteBlobByte(image,directory->icons[scene]->colors); + (void) WriteBlobByte(image,directory->icons[scene]->reserved); + (void) WriteBlobLSBShort(image,directory->icons[scene]->planes); + (void) WriteBlobLSBShort(image,directory->icons[scene]->bits_per_pixel); (void) WriteBlobLSBLong(image,(unsigned int) - icon_file.directory[scene].size); + directory->icons[scene]->size); (void) WriteBlobLSBLong(image,(unsigned int) - icon_file.directory[scene].offset); + directory->icons[scene]->offset); scene++; next=SyncNextImageInList(next); } while ((next != (Image *) NULL) && (image_info->adjoin != MagickFalse)); + directory=RelinquishIconDirectory(directory); (void) CloseBlob(image); images=DestroyImageList(images); return(MagickTrue); diff --git a/coders/info.c b/coders/info.c index 62be6f376f6962c5bc4f8b4886c059dd311425cf..846b9e3ae628cd0831a75bada66806dac8948495 100644 --- a/coders/info.c +++ b/coders/info.c @@ -215,6 +215,7 @@ static MagickBooleanType WriteINFOImage(const ImageInfo *image_info, if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/inline.c b/coders/inline.c index e0e5174b26ed010c6153a3c90704dfe588288bd2..072b567041c8034796ca483086273ea61f6f2b47 100644 --- a/coders/inline.c +++ b/coders/inline.c @@ -356,6 +356,7 @@ static MagickBooleanType WriteINLINEImage(const ImageInfo *image_info, (void) WriteBlobString(image,message); (void) WriteBlobString(image,base64); base64=DestroyString(base64); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/jbig.c b/coders/jbig.c index a117c0e61f1a7cf7911393017a234872f16057d5..1a7701754a14e9b05d411c235f9e33adcb5ae4af 100644 --- a/coders/jbig.c +++ b/coders/jbig.c @@ -128,17 +128,12 @@ static Image *ReadJBIGImage(const ImageInfo *image_info, IndexPacket *indexes; - ssize_t - x; - PixelPacket *q; - unsigned char - *p; - ssize_t length, + x, y; struct jbg_dec_state @@ -147,7 +142,8 @@ static Image *ReadJBIGImage(const ImageInfo *image_info, unsigned char bit, *buffer, - byte; + byte, + *p; /* Open image file. @@ -169,6 +165,9 @@ static Image *ReadJBIGImage(const ImageInfo *image_info, /* Initialize JBIG toolkit. */ + if ((image->columns != (unsigned long) image->columns) || + (image->rows != (unsigned long) image->rows)) + ThrowReaderException(ImageError,"WidthOrHeightExceedsLimit"); jbg_dec_init(&jbig_info); jbg_dec_maxsize(&jbig_info,(unsigned long) image->columns,(unsigned long) image->rows); @@ -200,7 +199,7 @@ static Image *ReadJBIGImage(const ImageInfo *image_info, count; status=jbg_dec_in(&jbig_info,p,length,&count); - p+=count; + p+=(ptrdiff_t) count; length-=(ssize_t) count; } } while ((status == JBG_EAGAIN) || (status == JBG_EOK)); @@ -276,7 +275,10 @@ static Image *ReadJBIGImage(const ImageInfo *image_info, */ jbg_dec_free(&jbig_info); buffer=(unsigned char *) RelinquishMagickMemory(buffer); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } #endif @@ -417,6 +419,9 @@ static void JBIGEncode(unsigned char *pixels,size_t length,void *data) static MagickBooleanType WriteJBIGImage(const ImageInfo *image_info, Image *image) { + const PixelPacket + *p; + double version; @@ -429,20 +434,12 @@ static MagickBooleanType WriteJBIGImage(const ImageInfo *image_info, MemoryInfo *pixel_info; - const PixelPacket - *p; - - ssize_t - x; - - unsigned char - *q; - size_t number_images, number_packets; ssize_t + x, y; struct jbg_enc_state @@ -451,7 +448,8 @@ static MagickBooleanType WriteJBIGImage(const ImageInfo *image_info, unsigned char bit, byte, - *pixels; + *pixels, + *q; /* Open image file. @@ -570,7 +568,8 @@ static MagickBooleanType WriteJBIGImage(const ImageInfo *image_info, if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } #endif diff --git a/coders/jnx.c b/coders/jnx.c index 4897a4eee231054eaa595370dada9433d4288002..69c42f11776e7db8a06bb57bdae4c384cbc13b99 100644 --- a/coders/jnx.c +++ b/coders/jnx.c @@ -155,6 +155,8 @@ static Image *ReadJNXImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); image=AcquireImage(image_info); + image->columns=0; + image->rows=0; status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) { diff --git a/coders/jp2.c b/coders/jp2.c index 02f826f0209b291894d64d646bce7f9e0c6569af..2fe92a55dbd93b9111cef1801f74f343a069af7c 100644 --- a/coders/jp2.c +++ b/coders/jp2.c @@ -356,7 +356,9 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception) ThrowReaderException(DelegateError,"UnableToDecodeImageFile"); } if ((AcquireMagickResource(WidthResource,(size_t) jp2_image->comps[0].w) == MagickFalse) || - (AcquireMagickResource(HeightResource,(size_t) jp2_image->comps[0].h) == MagickFalse)) + (AcquireMagickResource(WidthResource,(size_t) jp2_image->x1) == MagickFalse) || + (AcquireMagickResource(HeightResource,(size_t) jp2_image->comps[0].h) == MagickFalse) || + (AcquireMagickResource(HeightResource,(size_t) jp2_image->y1) == MagickFalse)) { opj_stream_destroy(jp2_stream); opj_destroy_codec(jp2_codec); @@ -819,7 +821,7 @@ static void CinemaProfileCompliance(const opj_image_t *jp2_image, 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->cp_disto_alloc=1; + parameters->cp_disto_alloc=OPJ_TRUE; } static inline int CalculateNumResolutions(size_t width,size_t height) @@ -865,9 +867,7 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image) *jp2_stream; ssize_t - i; - - ssize_t + i, y; unsigned int @@ -896,30 +896,30 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image) if (option != (const char *) NULL) parameters->numresolution=StringToInteger(option); else - parameters->numresolution=CalculateNumResolutions(image->columns, - image->rows); + parameters->numresolution=CalculateNumResolutions((size_t) image->columns, + (size_t) image->rows); parameters->tcp_numlayers=1; parameters->tcp_rates[0]=0; /* lossless */ - parameters->cp_disto_alloc=1; + parameters->cp_disto_alloc=OPJ_TRUE; if ((image_info->quality != 0) && (image_info->quality != 100)) { parameters->tcp_distoratio[0]=(double) image_info->quality; parameters->cp_fixed_quality=OPJ_TRUE; - parameters->cp_disto_alloc=0; + parameters->cp_disto_alloc=OPJ_FALSE; } if (image_info->extract != (char *) NULL) { - RectangleInfo - geometry; - int flags; + RectangleInfo + geometry; + /* 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 +929,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) @@ -954,7 +954,7 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image) } parameters->tcp_numlayers=i+1; parameters->cp_fixed_quality=OPJ_TRUE; - parameters->cp_disto_alloc=0; + parameters->cp_disto_alloc=OPJ_FALSE; } option=GetImageOption(image_info,"jp2:progression-order"); if (option != (const char *) NULL) @@ -982,7 +982,7 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image) p=option; for (i=0; sscanf(p,"%f",¶meters->tcp_rates[i]) == 1; i++) { - if (i > 100) + if (i >= 100) break; while ((*p != '\0') && (*p != ',')) p++; @@ -993,19 +993,28 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image) parameters->tcp_numlayers=i+1; parameters->cp_disto_alloc=OPJ_TRUE; } - if (image_info->sampling_factor != (const char *) NULL) - (void) sscanf(image_info->sampling_factor,"%d:%d", - ¶meters->subsampling_dx,¶meters->subsampling_dy); + if (image_info->sampling_factor != (char *) NULL) + { + GeometryInfo + geometry_info; + + MagickStatusType + flags; + + flags=ParseGeometry(image_info->sampling_factor,&geometry_info); + if ((flags & RhoValue) != 0) + parameters->subsampling_dx=(int) geometry_info.rho; + parameters->subsampling_dy=parameters->subsampling_dx; + if ((flags & SigmaValue) != 0) + parameters->subsampling_dy=(int) geometry_info.sigma; + } property=GetImageProperty(image,"comment"); if (property != (const char *) NULL) parameters->cp_comment=(char *) property; channels=3; jp2_colorspace=OPJ_CLRSPC_SRGB; if (image->colorspace == YUVColorspace) - { - jp2_colorspace=OPJ_CLRSPC_SYCC; - parameters->subsampling_dx=2; - } + jp2_colorspace=OPJ_CLRSPC_SYCC; else { if (IsGrayColorspace(image->colorspace) != MagickFalse) @@ -1029,10 +1038,10 @@ 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].w=(unsigned int) image->columns; - jp2_info[i].h=(unsigned int) image->rows; + 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; } jp2_image=opj_image_create(channels,jp2_info,jp2_colorspace); if (jp2_image == (opj_image_t *) NULL) @@ -1040,12 +1049,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))) @@ -1166,7 +1175,8 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image) opj_destroy_codec(jp2_codec); opj_image_destroy(jp2_image); parameters=(opj_cparameters_t *) RelinquishMagickMemory(parameters); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } #endif diff --git a/coders/jpeg.c b/coders/jpeg.c index 739ec662e2baefe049d932b1a23305d19d216b60..339aefa25bfed7c81cc8d6073d45934e7cbfff15 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -98,10 +98,14 @@ /* Define declarations. */ -#define ICC_MARKER (JPEG_APP0+2) +#define COMMENT_INDEX 0 +#define APP_INDEX 0 +#define APP_MARKER (JPEG_APP0+APP_INDEX) +#define ICC_INDEX 2 +#define ICC_MARKER (JPEG_APP0+ICC_INDEX) #define ICC_PROFILE "ICC_PROFILE" -#define IPTC_MARKER (JPEG_APP0+13) -#define XML_MARKER (JPEG_APP0+1) +#define IPTC_INDEX 13 +#define IPTC_MARKER (JPEG_APP0+IPTC_INDEX) #define MaxJPEGProfiles 16 #define MaxJPEGScans 1024 @@ -725,7 +729,7 @@ static boolean ReadIPTCProfile(j_decompress_ptr jpeg_info) return(TRUE); } -static boolean ReadProfile(j_decompress_ptr jpeg_info) +static boolean ReadAPPProfiles(j_decompress_ptr jpeg_info) { char name[MaxTextExtent]; @@ -1219,14 +1223,28 @@ static Image *ReadJPEGImage_(const ImageInfo *image_info, JPEGSourceManager(jpeg_info,image); jpeg_set_marker_processor(jpeg_info,JPEG_COM,ReadComment); option=GetImageOption(image_info,"profile:skip"); - if (IsOptionMember("ICC",option) == MagickFalse) - jpeg_set_marker_processor(jpeg_info,ICC_MARKER,ReadICCProfile); - if (IsOptionMember("IPTC",option) == MagickFalse) - jpeg_set_marker_processor(jpeg_info,IPTC_MARKER,ReadIPTCProfile); for (i=1; i < MaxJPEGProfiles; i++) - if ((i != 2) && (i != 13) && (i != 14)) - if (IsOptionMember("APP",option) == MagickFalse) - jpeg_set_marker_processor(jpeg_info,(int) (JPEG_APP0+i),ReadProfile); + { + if (i == ICC_INDEX) + { + if (IsOptionMember("ICC",option) == MagickFalse) + jpeg_set_marker_processor(jpeg_info,ICC_MARKER,ReadICCProfile); + } + else if (i == IPTC_INDEX) + { + if (IsOptionMember("IPTC",option) == MagickFalse) + jpeg_set_marker_processor(jpeg_info,IPTC_MARKER,ReadIPTCProfile); + } + else if (i != 14) + { + /* + Ignore APP14 as this will change the colors of the image. + */ + if (IsOptionMember("APP",option) == MagickFalse) + jpeg_set_marker_processor(jpeg_info,(int) (JPEG_APP0+i), + ReadAPPProfiles); + } + } i=(ssize_t) jpeg_read_header(jpeg_info,TRUE); if (IsYCbCrCompatibleColorspace(image_info->colorspace) != MagickFalse) jpeg_info->out_color_space=JCS_YCbCr; @@ -1624,7 +1642,10 @@ static Image *ReadJPEGImage_(const ImageInfo *image_info, jpeg_destroy_decompress(jpeg_info); client_info=(JPEGClientInfo *) RelinquishMagickMemory(client_info); memory_info=RelinquishVirtualMemory(memory_info); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -2136,7 +2157,7 @@ static void WriteProfiles(j_compress_ptr jpeg_info,Image *image) image->filename); length=65533L; } - jpeg_write_marker(jpeg_info,XML_MARKER,GetStringInfoDatum(profile), + jpeg_write_marker(jpeg_info,APP_MARKER+1,GetStringInfoDatum(profile), (unsigned int) length); } if (LocaleCompare(name,"ICC") == 0) @@ -2205,7 +2226,7 @@ static void WriteProfiles(j_compress_ptr jpeg_info,Image *image) ConcatenateStringInfo(xmp_profile,profile); GetStringInfoDatum(xmp_profile)[XMPNamespaceExtent]='\0'; length=GetStringInfoLength(xmp_profile); - jpeg_write_marker(jpeg_info,XML_MARKER, + jpeg_write_marker(jpeg_info,APP_MARKER+1, GetStringInfoDatum(xmp_profile),(unsigned int) length); xmp_profile=DestroyStringInfo(xmp_profile); } @@ -2323,9 +2344,7 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info, *q; ssize_t - i; - - ssize_t + i, y; struct jpeg_error_mgr @@ -2439,6 +2458,9 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info, } } jpeg_set_defaults(jpeg_info); + option=GetImageOption(image_info,"jpeg:restart-interval"); + if (option != (const char *) NULL) + jpeg_info->restart_interval=StringToInteger(option); if (jpeg_info->in_color_space == JCS_CMYK) jpeg_set_colorspace(jpeg_info,JCS_YCCK); if ((jpeg_info->data_precision != 12) && (image->depth <= 8)) @@ -2448,22 +2470,29 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info, if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Image resolution: %.20g,%.20g",image->x_resolution,image->y_resolution); - if ((image->x_resolution >= 0) && (image->x_resolution < (double) SHRT_MAX) && - (image->y_resolution >= 0) && (image->y_resolution < (double) SHRT_MAX)) + if ((image->x_resolution > 0) && (image->x_resolution < (double) SHRT_MAX) && + (image->y_resolution > 0) && (image->y_resolution < (double) SHRT_MAX)) { - /* - Set image resolution. - */ - jpeg_info->write_JFIF_header=TRUE; - jpeg_info->X_density=(UINT16) image->x_resolution; - jpeg_info->Y_density=(UINT16) image->y_resolution; - /* - Set image resolution units. - */ - if (image->units == PixelsPerInchResolution) - jpeg_info->density_unit=(UINT8) 1; - if (image->units == PixelsPerCentimeterResolution) - jpeg_info->density_unit=(UINT8) 2; + UINT16 + x_density=(UINT16) image->x_resolution, + y_density=(UINT16) image->y_resolution; + + if ((x_density > 0) && (y_density > 0)) + { + /* + Set image resolution. + */ + jpeg_info->write_JFIF_header=TRUE; + jpeg_info->X_density=x_density; + jpeg_info->Y_density=y_density; + /* + Set image resolution units. + */ + if (image->units == PixelsPerInchResolution) + jpeg_info->density_unit=(UINT8) 1; + else if (image->units == PixelsPerCentimeterResolution) + jpeg_info->density_unit=(UINT8) 2; + } } dct_method=GetImageOption(image_info,"jpeg:dct-method"); if (dct_method != (const char *) NULL) @@ -2611,14 +2640,27 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info, { (void) AcquireUniqueFilename(jpeg_image->filename); jpeg_image->quality=minimum+(maximum-minimum+1)/2; - (void) WriteJPEGImage(jpeg_info,jpeg_image); + status=WriteJPEGImage(jpeg_info,jpeg_image); + (void) RelinquishUniqueFileResource(jpeg_image->filename); + if (status == MagickFalse) + continue; if (GetBlobSize(jpeg_image) <= extent) minimum=jpeg_image->quality+1; else maximum=jpeg_image->quality-1; + } + while (minimum > 2) + { + (void) AcquireUniqueFilename(jpeg_image->filename); + jpeg_image->quality=minimum--; + status=WriteJPEGImage(jpeg_info,jpeg_image); (void) RelinquishUniqueFileResource(jpeg_image->filename); + if (status == MagickFalse) + continue; + if (GetBlobSize(jpeg_image) <= extent) + break; } - quality=(int) minimum-1; + quality=(int) minimum; jpeg_image=DestroyImage(jpeg_image); } jpeg_info=DestroyImageInfo(jpeg_info); @@ -3118,10 +3160,11 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info, jpeg_destroy_compress(jpeg_info); client_info=(JPEGClientInfo *) RelinquishMagickMemory(client_info); memory_info=RelinquishVirtualMemory(memory_info); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (jps_image != (Image *) NULL) jps_image=DestroyImage(jps_image); - return(MagickTrue); + return(status); } static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info, diff --git a/coders/json.c b/coders/json.c index b1d0f0046c113ec817262c96a6b05c9cb3f4c269..df02d7b65866f5e19cefe0864c587a5a0ad381c5 100644 --- a/coders/json.c +++ b/coders/json.c @@ -300,7 +300,7 @@ static void JSONFormatLocaleFile(FILE *file,const char *format, if (((int) *p >= 0x00) && ((int) *p <= 0x1f)) { (void) FormatLocaleString(q,7,"\\u%04X",(int) *p); - q+=6; + q+=(ptrdiff_t) 6; break; } *q++=(*p); @@ -758,24 +758,31 @@ static ssize_t PrintChannelStatistics(FILE *file,const ChannelType channel, if (channel == AlphaChannel) n=FormatLocaleFile(file,StatisticsFormat,name,GetMagickPrecision(), + channel_statistics[channel].minima == MagickMaximumValue ? 0.0 : + (double) ClampToQuantum(scale*((MagickRealType) QuantumRange- + channel_statistics[channel].minima)),GetMagickPrecision(), + channel_statistics[channel].maxima == -MagickMaximumValue ? 0.0 : (double) ClampToQuantum(scale*((MagickRealType) QuantumRange- - channel_statistics[channel].minima)),GetMagickPrecision(),(double) - ClampToQuantum(scale*((MagickRealType) QuantumRange- channel_statistics[channel].maxima)),GetMagickPrecision(),scale* ((MagickRealType) QuantumRange-channel_statistics[channel].mean), - GetMagickPrecision(),IsNaN(channel_statistics[channel].standard_deviation) != 0 ? + GetMagickPrecision(), + IsNaN(channel_statistics[channel].standard_deviation) != 0 ? MagickEpsilon : scale*channel_statistics[channel].standard_deviation, GetMagickPrecision(),channel_statistics[channel].kurtosis, GetMagickPrecision(),channel_statistics[channel].skewness, GetMagickPrecision(),channel_statistics[channel].entropy); else n=FormatLocaleFile(file,StatisticsFormat,name,GetMagickPrecision(), + channel_statistics[channel].minima == MagickMaximumValue ? 0.0 : (double) ClampToQuantum(scale*channel_statistics[channel].minima), - GetMagickPrecision(),(double) ClampToQuantum(scale* - channel_statistics[channel].maxima),GetMagickPrecision(),scale* - channel_statistics[channel].mean,GetMagickPrecision(), - IsNaN(channel_statistics[channel].standard_deviation) != 0 ? MagickEpsilon : - scale*channel_statistics[channel].standard_deviation,GetMagickPrecision(), + GetMagickPrecision(), + channel_statistics[channel].maxima == -MagickMaximumValue ? 0.0 : + (double) ClampToQuantum(scale*channel_statistics[channel].maxima), + GetMagickPrecision(),scale*channel_statistics[channel].mean, + GetMagickPrecision(), + IsNaN(channel_statistics[channel].standard_deviation) != 0 ? + MagickEpsilon : scale*channel_statistics[channel].standard_deviation, + GetMagickPrecision(), channel_statistics[channel].kurtosis,GetMagickPrecision(), channel_statistics[channel].skewness,GetMagickPrecision(), channel_statistics[channel].entropy); @@ -1788,7 +1795,9 @@ static MagickBooleanType WriteJSONImage(const ImageInfo *image_info, MaxTextExtent); image->magick_columns=image->columns; image->magick_rows=image->rows; - (void) EncodeImageAttributes(image,GetBlobFileHandle(image)); + status=EncodeImageAttributes(image,GetBlobFileHandle(image)); + if (status == MagickFalse) + break; if (GetNextImageInList(image) == (Image *) NULL) { (void) WriteBlobString(image,"]"); @@ -1800,6 +1809,7 @@ static MagickBooleanType WriteJSONImage(const ImageInfo *image_info, if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/label.c b/coders/label.c index 389ae8d148833d05b72ed1213ee4b0e025c9565d..b481be702091dd8097dc49fcf0e32d9b41f1efaa 100644 --- a/coders/label.c +++ b/coders/label.c @@ -53,11 +53,13 @@ #include "magick/magick.h" #include "magick/memory_.h" #include "magick/pixel-accessor.h" +#include "magick/option.h" #include "magick/property.h" #include "magick/quantum-private.h" #include "magick/resource_.h" #include "magick/static.h" #include "magick/string_.h" +#include "magick/string-private.h" #include "magick/module.h" #include "magick/utility.h" @@ -118,13 +120,13 @@ static Image *ReadLABELImage(const ImageInfo *image_info, left_bearing, status; + TypeMetric + metrics; + size_t height, width; - TypeMetric - metrics; - /* Initialize Image structure. */ @@ -144,7 +146,8 @@ static Image *ReadLABELImage(const ImageInfo *image_info, return(DestroyImageList(image)); (void) SetImageBackgroundColor(image); } - label=InterpretImageProperties(image_info,image,image_info->filename); + label=InterpretImageProperties((ImageInfo *) image_info,image, + image_info->filename); if (label == (char *) NULL) return(DestroyImageList(image)); (void) SetImageProperty(image,"label",label); @@ -170,6 +173,9 @@ static Image *ReadLABELImage(const ImageInfo *image_info, (((image->columns == 0) || (image->rows == 0)) || (fabs(image_info->pointsize) < MagickEpsilon))) { + const char + *option; + double high, low; @@ -180,48 +186,71 @@ static Image *ReadLABELImage(const ImageInfo *image_info, /* Auto fit text into bounding box. */ - for (n=0; n < 32; n++, draw_info->pointsize*=2.0) - { - (void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g", - -metrics.bounds.x1,metrics.ascent); - if (draw_info->gravity == UndefinedGravity) - (void) CloneString(&draw_info->geometry,geometry); - status=GetMultilineTypeMetrics(image,draw_info,&metrics); - AdjustTypeMetricBounds(&metrics); - if (status == MagickFalse) - break; - width=CastDoubleToUnsigned(metrics.width+draw_info->stroke_width+0.5); - height=CastDoubleToUnsigned(metrics.height-metrics.underline_position+ - draw_info->stroke_width+0.5); - if ((image->columns != 0) && (image->rows != 0)) + low=1.0; + option=GetImageOption(image_info,"label:max-pointsize"); + if (option != (const char*) NULL) + { + high=StringToDouble(option,(char**) NULL); + if (high < 1.0) + high=1.0; + high+=1.0; + } + else + { + option=GetImageOption(image_info,"label:start-pointsize"); + if (option != (const char *) NULL) + { + draw_info->pointsize=StringToDouble(option,(char**) NULL); + if (draw_info->pointsize < 1.0) + draw_info->pointsize=1.0; + } + for (n=0; n < 32; n++, draw_info->pointsize*=2.0) { - if ((width >= image->columns) || (height >= image->rows)) + (void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g", + metrics.bounds.x1,metrics.ascent); + if (draw_info->gravity == UndefinedGravity) + (void) CloneString(&draw_info->geometry,geometry); + status=GetMultilineTypeMetrics(image,draw_info,&metrics); + if (status == MagickFalse) break; + AdjustTypeMetricBounds(&metrics); + width=CastDoubleToUnsigned(metrics.width+draw_info->stroke_width+ + 0.5); + height=CastDoubleToUnsigned( + metrics.height-metrics.underline_position+ + draw_info->stroke_width+0.5); + if ((image->columns != 0) && (image->rows != 0)) + { + if ((width > image->columns) && (height > image->rows)) + break; + if ((width <= image->columns) && (height <= image->rows)) + low=draw_info->pointsize; + } + else + if (((image->columns != 0) && (width > image->columns)) || + ((image->rows != 0) && (height > image->rows))) + break; } - else - if (((image->columns != 0) && (width >= image->columns)) || - ((image->rows != 0) && (height >= image->rows))) - break; - } - if (status == MagickFalse) - { - label=DestroyString(label); - draw_info=DestroyDrawInfo(draw_info); - image=DestroyImageList(image); - return((Image *) NULL); + if (status == MagickFalse) + { + label=DestroyString(label); + draw_info=DestroyDrawInfo(draw_info); + image=DestroyImageList(image); + return((Image *) NULL); + } + high=draw_info->pointsize; } - high=draw_info->pointsize; - for (low=1.0; (high-low) > 0.5; ) + while ((high-low) > 0.5) { draw_info->pointsize=(low+high)/2.0; (void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g", - -metrics.bounds.x1,metrics.ascent); + metrics.bounds.x1,metrics.ascent); if (draw_info->gravity == UndefinedGravity) (void) CloneString(&draw_info->geometry,geometry); status=GetMultilineTypeMetrics(image,draw_info,&metrics); - AdjustTypeMetricBounds(&metrics); if (status == MagickFalse) break; + AdjustTypeMetricBounds(&metrics); width=CastDoubleToUnsigned(metrics.width+draw_info->stroke_width+0.5); height=CastDoubleToUnsigned(metrics.height-metrics.underline_position+ draw_info->stroke_width+0.5); @@ -240,20 +269,20 @@ static Image *ReadLABELImage(const ImageInfo *image_info, high=draw_info->pointsize-0.5; } if (status != MagickFalse) - { - draw_info->pointsize=floor((low+high)/2.0-0.5); - status=GetMultilineTypeMetrics(image,draw_info,&metrics); - AdjustTypeMetricBounds(&metrics); - } + draw_info->pointsize=floor(low-0.5); } - label=DestroyString(label); - if (status == MagickFalse) - { - draw_info=DestroyDrawInfo(draw_info); - InheritException(exception,&image->exception); - image=DestroyImageList(image); - return((Image *) NULL); - } + label=DestroyString(label); + if (status == MagickFalse) + { + draw_info=DestroyDrawInfo(draw_info); + image=DestroyImageList(image); + return((Image *) NULL); + } + /* + Draw label. + */ + status=GetMultilineTypeMetrics(image,draw_info,&metrics); + AdjustTypeMetricBounds(&metrics); if (image->columns == 0) image->columns=(size_t) floor(metrics.width+draw_info->stroke_width+0.5); if (image->columns == 0) @@ -268,13 +297,11 @@ static Image *ReadLABELImage(const ImageInfo *image_info, if (status == MagickFalse) { draw_info=DestroyDrawInfo(draw_info); - InheritException(exception,&image->exception); return(DestroyImageList(image)); } if (SetImageBackgroundColor(image) == MagickFalse) { draw_info=DestroyDrawInfo(draw_info); - InheritException(exception,&image->exception); image=DestroyImageList(image); return((Image *) NULL); } @@ -282,7 +309,7 @@ static Image *ReadLABELImage(const ImageInfo *image_info, Draw label. */ left_bearing=((draw_info->gravity == UndefinedGravity) || - (draw_info->gravity == NorthWestGravity) || + (draw_info->gravity == NorthWestGravity) || (draw_info->gravity == WestGravity) || (draw_info->gravity == SouthWestGravity)) ? MagickTrue : MagickFalse; (void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g", diff --git a/coders/mac.c b/coders/mac.c index fb223ab94f80e217c5c06eaf42d73040ae00a7e0..dd17552c51eab12e222d30ccc1df86312e4d5b63 100644 --- a/coders/mac.c +++ b/coders/mac.c @@ -263,7 +263,10 @@ static Image *ReadMACImage(const ImageInfo *image_info,ExceptionInfo *exception) } pixels=(unsigned char *) RelinquishMagickMemory(pixels); (void) SyncImage(image); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } diff --git a/coders/map.c b/coders/map.c index 2582066abd213c6dcaad85d004b0dfb0f943e803..113b71f6d45f427b9ea4ee59f8d28bce10571670 100644 --- a/coders/map.c +++ b/coders/map.c @@ -255,7 +255,10 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception) if (y < (ssize_t) image->rows) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -458,6 +461,7 @@ static MagickBooleanType WriteMAPImage(const ImageInfo *image_info,Image *image) (void) WriteBlob(image,(size_t) (q-pixels),pixels); } pixels=(unsigned char *) RelinquishMagickMemory(pixels); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/mat.c b/coders/mat.c index 3fe6d1dd5b5427d3ba63c1ff4a0fb37eb504ce4f..22f4dd7b3e792d0e8f00d3af366a531b2df1f3fc 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -577,7 +577,7 @@ ssize_t TotalSize = 0; zip_status = inflate(&zip_info,Z_NO_FLUSH); if ((zip_status != Z_OK) && (zip_status != Z_STREAM_END)) break; - extent=fwrite(decompress_block, 4096-zip_info.avail_out, 1, mat_file); + extent=fwrite(decompress_block, 1, 4096-zip_info.avail_out, mat_file); (void) extent; TotalSize += 4096-zip_info.avail_out; @@ -598,6 +598,8 @@ DblBreak: if((clone_info->file=fopen(clone_info->filename,"rb"))==NULL) goto UnlinkFile; if( (image2 = AcquireImage(clone_info))==NULL ) goto EraseFile; + image2->columns=0; + image2->rows=0; status = OpenBlob(clone_info,image2,ReadBinaryBlobMode,exception); if (status == MagickFalse) { @@ -851,7 +853,8 @@ skip_reading_current: if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -1643,7 +1646,7 @@ static MagickBooleanType WriteMATImage(const ImageInfo *image_info,Image *image) image->depth=8; current_time=GetMagickTime(); - GetMagickUTCtime(¤t_time,&utc_time); + GetMagickUTCTime(¤t_time,&utc_time); (void) memset(MATLAB_HDR,' ',MagickMin(sizeof(MATLAB_HDR),124)); FormatLocaleString(MATLAB_HDR,sizeof(MATLAB_HDR), "MATLAB 5.0 MAT-file, Platform: %s, Created on: %s %s %2d %2d:%2d:%2d %d", @@ -1758,6 +1761,7 @@ static MagickBooleanType WriteMATImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/meta.c b/coders/meta.c index 2357df9a0af2bc89e78901052ecfd4c1e78dd592..a72032576ba2fee11d6002a22d6de552bac86d77 100644 --- a/coders/meta.c +++ b/coders/meta.c @@ -322,6 +322,9 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile) unsigned int recnum; + MagickBooleanType + status; + MagickOffsetType savedpos, currentpos; @@ -343,6 +346,7 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile) return(-1); newstr = name = token = (char *) NULL; savedpos = 0; + status=MagickTrue; token_info=AcquireTokenInfo(); while (super_fgets(&line,&inputlen,ifile)!=NULL) { @@ -447,21 +451,21 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile) currentpos = TellBlob(ofile); if (currentpos < 0) { - line=DestroyString(line); - return(-1); + status=MagickFalse; + break; } offset=SeekBlob(ofile,savedpos,SEEK_SET); if (offset < 0) { - line=DestroyString(line); - return(-1); + status=MagickFalse; + break; } (void) WriteBlobMSBLong(ofile,(unsigned int) diff); offset=SeekBlob(ofile,currentpos,SEEK_SET); if (offset < 0) { - line=DestroyString(line); - return(-1); + status=MagickFalse; + break; } savedolen = 0L; } @@ -506,7 +510,10 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile) /* patch in a fake length for now and fix it later */ savedpos = TellBlob(ofile); if (savedpos < 0) - return(-1); + { + status=MagickFalse; + break; + } (void) WriteBlobMSBLong(ofile,0xFFFFFFFFU); outputlen += 4; savedolen = outputlen; @@ -536,6 +543,8 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile) newstr=DestroyString(newstr); if (name != (char *) NULL) name=DestroyString(name); + if (status == MagickFalse) + break; } token_info=DestroyTokenInfo(token_info); if (token != (char *) NULL) @@ -564,7 +573,7 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile) return(-1); savedolen = 0L; } - return(outputlen); + return(status == MagickFalse ? -1 : outputlen); } static char *super_fgets_w(char **b, size_t *blen, Image *file) @@ -650,6 +659,9 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile) savedolen = 0L, outputlen = 0L; + MagickBooleanType + status; + MagickOffsetType savedpos, currentpos; @@ -664,6 +676,7 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile) return(-1); newstr = name = token = (char *) NULL; savedpos = 0; + status=MagickTrue; token_info=AcquireTokenInfo(); while (super_fgets_w(&line,&inputlen,ifile) != NULL) { @@ -765,14 +778,23 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile) ssize_t diff = outputlen - savedolen; currentpos = TellBlob(ofile); if (currentpos < 0) - return(-1); + { + status=MagickFalse; + break; + } offset=SeekBlob(ofile,savedpos,SEEK_SET); if (offset < 0) - return(-1); + { + status=MagickFalse; + break; + } (void) WriteBlobMSBLong(ofile,(unsigned int) diff); offset=SeekBlob(ofile,currentpos,SEEK_SET); if (offset < 0) - return(-1); + { + status=MagickFalse; + break; + } savedolen = 0L; } if (outputlen & 1) @@ -816,7 +838,10 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile) /* patch in a fake length for now and fix it later */ savedpos = TellBlob(ofile); if (savedpos < 0) - return(-1); + { + status=MagickFalse; + break; + } (void) WriteBlobMSBLong(ofile,0xFFFFFFFFU); outputlen += 4; savedolen = outputlen; @@ -846,6 +871,8 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile) newstr=DestroyString(newstr); if (name != (char *) NULL) name=DestroyString(name); + if (status == MagickFalse) + break; } token_info=DestroyTokenInfo(token_info); if (token != (char *) NULL) @@ -874,7 +901,7 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile) return(-1); savedolen = 0L; } - return outputlen; + return(status == MagickFalse ? -1 : outputlen); } /* some defines for the different JPEG block types */ @@ -1440,7 +1467,10 @@ static Image *ReadMETAImage(const ImageInfo *image_info, blob=(unsigned char *) RelinquishMagickMemory(blob); buff=DestroyImage(buff); } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -1679,23 +1709,23 @@ static size_t GetIPTCStream(unsigned char **info,size_t length) { if (strncmp((const char *) p,"8BIM",4)) break; - p+=4; + p+=(ptrdiff_t) 4; extent-=4; marker=(unsigned int) (*p) << 8 | *(p+1); - p+=2; + p+=(ptrdiff_t) 2; extent-=2; c=*p++; extent--; c|=0x01; if ((size_t) c >= extent) break; - p+=c; + p+=(ptrdiff_t) c; extent-=c; if (extent < 4) break; tag_length=(((size_t) *p) << 24) | (((size_t) *(p+1)) << 16) | (((size_t) *(p+2)) << 8) | ((size_t) *(p+3)); - p+=4; + p+=(ptrdiff_t) 4; extent-=4; if (tag_length > extent) break; @@ -1706,7 +1736,7 @@ static size_t GetIPTCStream(unsigned char **info,size_t length) } if ((tag_length & 0x01) != 0) tag_length++; - p+=tag_length; + p+=(ptrdiff_t) tag_length; extent-=tag_length; } /* @@ -1803,7 +1833,7 @@ iptc_find: } if (tag_length > (length+1)) break; - p+=tag_length; + p+=(ptrdiff_t) tag_length; length-=tag_length; if (length == 0) break; diff --git a/coders/miff.c b/coders/miff.c index 824e4a80cf5edf615525bedfd733cf98356e5739..7297a22635b306f91f6d12c863d067bb442ce626 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -227,14 +227,14 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels, *index=ConstrainColormapIndex(image,(ssize_t) (((size_t) *p << 24) | ((size_t) *(p+1) << 16) | ((size_t) *(p+2) << 8) | (size_t) *(p+3))); - p+=4; + p+=(ptrdiff_t) 4; break; } case 16: { *index=ConstrainColormapIndex(image,(ssize_t) ((size_t) (*p << 8) | (size_t) *(p+1))); - p+=2; + p+=(ptrdiff_t) 2; break; } case 8: @@ -628,7 +628,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, Get the keyword value. */ c=ReadBlobByte(image); - while ((c != (int) '}') && (c != EOF)) + while ((c != (int) '{') && (c != (int) '}') && (c != EOF)) { if ((size_t) (p-options+1) >= length) { @@ -645,7 +645,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, if (c == '\\') { c=ReadBlobByte(image); - if (c == (int) '}') + if ((c == (int) '{') || (c == (int) '}')) { *p++=(char) c; c=ReadBlobByte(image); @@ -1320,6 +1320,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, if (quantum_format != UndefinedQuantumFormat) { status=SetQuantumFormat(image,quantum_info,quantum_format); + image->depth=quantum_info->depth; if (status == MagickFalse) ThrowMIFFException(ResourceLimitError,"MemoryAllocationFailed"); } @@ -1736,7 +1737,8 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, break; } } while (c != EOF && ((c == 'i') || (c == 'I'))); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -2108,8 +2110,12 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, } } else - if (image->depth < 16) - (void) DeleteImageProperty(image,"quantum:format"); + if ((quantum_info->format == FloatingPointQuantumFormat) && + (image->depth < 16)) + { + status=SetQuantumFormat(image,quantum_info,UnsignedQuantumFormat); + status=SetQuantumDepth(image,quantum_info,image->depth); + } compression=UndefinedCompression; if (image_info->compression != UndefinedCompression) compression=image_info->compression; @@ -2368,19 +2374,21 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, length=strlen(value); for (i=0; i < (ssize_t) length; i++) if ((isspace((int) ((unsigned char) value[i])) != 0) || - (value[i] == '}')) + (value[i] == '{') || (value[i] == '}')) break; if ((i == (ssize_t) length) && (i != 0)) (void) WriteBlob(image,length,(const unsigned char *) value); else { (void) WriteBlobByte(image,'{'); - if (strchr(value,'}') == (char *) NULL) + if ((strchr(value,'{') == (char *) NULL) && + (strchr(value,'}') == (char *) NULL)) (void) WriteBlob(image,length,(const unsigned char *) value); else for (i=0; i < (ssize_t) length; i++) { - if (value[i] == (int) '}') + if ((value[i] == (int) '{') || (value[i] == (int) '}') || + (value[i] == (int) '\\')) (void) WriteBlobByte(image,'\\'); (void) WriteBlobByte(image,(unsigned char) value[i]); } @@ -2805,6 +2813,7 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/mono.c b/coders/mono.c index c73ee124e454031b17b69e0e9fe9d2dcd09a6d99..6afc161620fc93e76308b32f2a9e140802b22f39 100644 --- a/coders/mono.c +++ b/coders/mono.c @@ -195,7 +195,10 @@ static Image *ReadMONOImage(const ImageInfo *image_info, if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -359,6 +362,7 @@ static MagickBooleanType WriteMONOImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/mpc.c b/coders/mpc.c index 38b946ccd5fd7e1ae575d2e06ea7fd9475d0e75a..65906107ab9c5a30fc0f1bf2a80137ea93129af5 100644 --- a/coders/mpc.c +++ b/coders/mpc.c @@ -311,7 +311,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) Get the keyword value. */ c=ReadBlobByte(image); - while ((c != (int) '}') && (c != EOF)) + while ((c != (int) '{') && (c != (int) '}') && (c != EOF)) { if ((size_t) (p-options+1) >= length) { @@ -328,7 +328,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) if (c == '\\') { c=ReadBlobByte(image); - if (c == (int) '}') + if ((c == (int) '{') || (c == (int) '}')) { *p++=(char) c; c=ReadBlobByte(image); @@ -1012,7 +1012,8 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while ((c != EOF) && ((c == 'i') || (c == 'I'))); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -1389,12 +1390,13 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image) else { (void) WriteBlobByte(image,'{'); - if (strchr(value,'}') == (char *) NULL) + if ((strchr(value,'{') == (char *) NULL) && + (strchr(value,'}') == (char *) NULL)) (void) WriteBlob(image,length,(const unsigned char *) value); else for (i=0; i < (ssize_t) length; i++) { - if (value[i] == (int) '}') + if ((value[i] == (int) '{') || (value[i] == (int) '}')) (void) WriteBlobByte(image,'\\'); (void) WriteBlobByte(image,(unsigned char) value[i]); } @@ -1531,6 +1533,7 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image) } scene++; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/mtv.c b/coders/mtv.c index 52e0cc91305ff3ae5b9ff8775dd55ba3356a1dff..3705b0570d9d89342d94c26e37767fda7b69c472 100644 --- a/coders/mtv.c +++ b/coders/mtv.c @@ -238,7 +238,8 @@ static Image *ReadMTVImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while (count > 0); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -417,6 +418,7 @@ static MagickBooleanType WriteMTVImage(const ImageInfo *image_info,Image *image) break; scene++; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/mvg.c b/coders/mvg.c index 777dc4482926a07ec5a9680595d18198657dceee..bcd74b5358b2b887de83abceef32a71b8b6195eb 100644 --- a/coders/mvg.c +++ b/coders/mvg.c @@ -177,8 +177,8 @@ static Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception) continue; (void) sscanf(p,"viewbox %lf %lf %lf %lf",&bounds.x1,&bounds.y1, &bounds.x2,&bounds.y2); - image->columns=(size_t) floor((bounds.x2-bounds.x1)+0.5); - image->rows=(size_t) floor((bounds.y2-bounds.y1)+0.5); + image->columns=CastDoubleToUnsigned(floor((bounds.x2-bounds.x1)+0.5)); + image->rows=CastDoubleToUnsigned(floor((bounds.y2-bounds.y1)+0.5)); break; } } @@ -191,8 +191,8 @@ static Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception) 96.0; draw_info->affine.sy=image->y_resolution == 0.0 ? 1.0 : image->y_resolution/ 96.0; - image->columns=(size_t) (draw_info->affine.sx*image->columns); - image->rows=(size_t) (draw_info->affine.sy*image->rows); + image->columns=CastDoubleToUnsigned(draw_info->affine.sx*image->columns); + image->rows=CastDoubleToUnsigned(draw_info->affine.sy*image->rows); status=SetImageExtent(image,image->columns,image->rows); if (status == MagickFalse) { @@ -243,7 +243,10 @@ static Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) DrawImage(image,draw_info); (void) SetImageArtifact(image,"mvg:vector-graphics",draw_info->primitive); draw_info=DestroyDrawInfo(draw_info); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -360,6 +363,7 @@ static MagickBooleanType WriteMVGImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) return(status); (void) WriteBlob(image,strlen(value),(const unsigned char *) value); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/otb.c b/coders/otb.c index f729f5d2d20feba46e88ea26e2c01b37af227de5..d8ea1a8350265ec0dd228d2a8eec4d594e7f6179 100644 --- a/coders/otb.c +++ b/coders/otb.c @@ -213,7 +213,10 @@ static Image *ReadOTBImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -390,6 +393,7 @@ static MagickBooleanType WriteOTBImage(const ImageInfo *image_info,Image *image) break; } } - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/palm.c b/coders/palm.c index c1cfbaffc7c021bda452721b9cd5f5197a2c227d..5885f89731b77109e862435a4531476ab76f6744 100644 --- a/coders/palm.c +++ b/coders/palm.c @@ -598,7 +598,8 @@ static Image *ReadPALMImage(const ImageInfo *image_info, break; } } while (nextDepthOffset != 0); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); diff --git a/coders/pcd.c b/coders/pcd.c index b78b56d16419bd072b1fbfb3c83814560fda560b..21587cbb238f43919d138a57197947d3ad6e0326 100644 --- a/coders/pcd.c +++ b/coders/pcd.c @@ -468,9 +468,9 @@ static void Upsample(const size_t width,const size_t height, *q=(unsigned char) ((((size_t) *p)+((size_t) *r)+1) >> 1); *(q+1)=(unsigned char) ((((size_t) *p)+((size_t) *(p+2))+ ((size_t) *r)+((size_t) *(r+2))+2) >> 2); - q+=2; - p+=2; - r+=2; + q+=(ptrdiff_t) 2; + p+=(ptrdiff_t) 2; + r+=(ptrdiff_t) 2; } *q++=(unsigned char) ((((size_t) *p++)+((size_t) *r++)+1) >> 1); *q++=(unsigned char) ((((size_t) *p++)+((size_t) *r++)+1) >> 1); diff --git a/coders/pcl.c b/coders/pcl.c index e584d8bbb0ba307c5dcdb858360f17a1c48058f7..5091d85f85fcc022646fe855a43096d7e401c10f 100644 --- a/coders/pcl.c +++ b/coders/pcl.c @@ -169,7 +169,8 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception) *read_info; int - c; + c, + exit_code; MagickBooleanType cmyk, @@ -334,10 +335,10 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception) image->x_resolution,image->y_resolution); if (image_info->ping != MagickFalse) (void) FormatLocaleString(density,MagickPathExtent,"2.0x2.0"); - page.width=CastDoubleToUnsigned((double) page.width*image->x_resolution/delta.x+ - 0.5); - page.height=CastDoubleToUnsigned((double) page.height*image->y_resolution/delta.y+ - 0.5); + page.width=CastDoubleToUnsigned((double) page.width*image->x_resolution/ + delta.x+0.5); + page.height=CastDoubleToUnsigned((double) page.height*image->y_resolution/ + delta.y+0.5); (void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double) page.width,(double) page.height); image=DestroyImage(image); @@ -365,8 +366,13 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception) read_info->filename,input_filename); options=DestroyString(options); density=DestroyString(density); - status=ExternalDelegateCommand(MagickFalse,read_info->verbose,command, - (char *) NULL,exception) != 0 ? MagickTrue : MagickFalse; + exit_code=ExternalDelegateCommand(MagickFalse,read_info->verbose,command, + (char *) NULL,exception); + if (exit_code != 0) + { + read_info=DestroyImageInfo(read_info); + ThrowReaderException(DelegateError,"PCLDelegateFailed"); + } image=ReadImage(read_info,exception); (void) RelinquishUniqueFileResource(read_info->filename); (void) RelinquishUniqueFileResource(input_filename); @@ -995,6 +1001,7 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image) break; } while (image_info->adjoin != MagickFalse); (void) WriteBlobString(image,"\033E"); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/pcx.c b/coders/pcx.c index 28b048caee043bbb711ac3e1da55cb2c7cb93f2e..56614e7c9d1967b656ebace07f7883c631ea3d6e 100644 --- a/coders/pcx.c +++ b/coders/pcx.c @@ -486,6 +486,8 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) /* 256 color images have their color map at the end of the file. */ + offset=SeekBlob(image,(MagickOffsetType) GetBlobSize(image)-3* + image->colors-1,SEEK_SET); pcx_info.colormap_signature=(unsigned char) ReadBlobByte(image); count=ReadBlob(image,3*image->colors,pcx_colormap); p=pcx_colormap; @@ -538,7 +540,7 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } - r+=pcx_info.planes; + r+=(ptrdiff_t) pcx_info.planes; } } else @@ -693,7 +695,8 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (page_table != (MagickOffsetType *) NULL) page_table=(MagickOffsetType *) RelinquishMagickMemory(page_table); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -1207,6 +1210,7 @@ static MagickBooleanType WritePCXImage(const ImageInfo *image_info,Image *image) FileOpenError,"UnableToWriteFile","`%s': %s",image->filename,message); message=DestroyString(message); } - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/pdb.c b/coders/pdb.c index 0d4635f556f5e2514bd1d0f6628c509393c6c0bd..a508c1fd4486da4972138fa1eac786c7264c1063 100644 --- a/coders/pdb.c +++ b/coders/pdb.c @@ -635,7 +635,10 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) SetImageProperty(image,"comment",comment); comment=DestroyString(comment); } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -1012,6 +1015,7 @@ static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image) runlength=(unsigned char *) RelinquishMagickMemory(runlength); if (comment != (const char *) NULL) (void) WriteBlobString(image,comment); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/pdf.c b/coders/pdf.c index 7097586e9cfac73a729f594c4af1d2ba1e359bc2..82a7df8522956968e07f098c687d101b687934b8 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -3022,7 +3022,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image) hex_digits[15]='F'; (void) FormatLocaleString(buffer,MagickPathExtent,"/Title > 12) & 0x0f]); (void) WriteBlobByte(image,hex_digits[(utf16[i] >> 8) & 0x0f]); @@ -3035,7 +3035,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image) } (void) WriteBlobString(image,buffer); seconds=GetMagickTime(); - GetMagickUTCtime(&seconds,&utc_time); + GetMagickUTCTime(&seconds,&utc_time); (void) FormatLocaleString(date,MaxTextExtent,"D:%04d%02d%02d%02d%02d%02d", utc_time.tm_year+1900,utc_time.tm_mon+1,utc_time.tm_mday, utc_time.tm_hour,utc_time.tm_min,utc_time.tm_sec); @@ -3087,6 +3087,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image) (void) WriteBlobString(image,buffer); (void) WriteBlobString(image,"%%EOF\n"); xref=(MagickOffsetType *) RelinquishMagickMemory(xref); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/pgx.c b/coders/pgx.c index b0bbb11ea12d28ed3979336d828065cada1507b4..37940a273ae5dcdccd0e1b5124b8a8211b426dab 100644 --- a/coders/pgx.c +++ b/coders/pgx.c @@ -234,7 +234,10 @@ static Image *ReadPGXImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -394,6 +397,7 @@ static MagickBooleanType WritePGXImage(const ImageInfo *image_info,Image *image) quantum_info=DestroyQuantumInfo(quantum_info); if (y < (ssize_t) image->rows) ThrowWriterException(CorruptImageError,"UnableToWriteImageData"); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/pict.c b/coders/pict.c index dcf09119b6d9232399a442a4a485c87e8c0a0649..822b012e910892933557eb7e9878b08f387d12ad 100644 --- a/coders/pict.c +++ b/coders/pict.c @@ -502,7 +502,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image, for (y=0; y < (ssize_t) image->rows; y++) { q=pixels+y*width; - if (bytes_per_line > 200) + if (bytes_per_line > 250) scanline_length=ReadBlobMSBShort(blob); else scanline_length=(size_t) ReadBlobByte(blob); @@ -526,7 +526,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image, &number_pixels); if ((q-pixels+number_pixels) <= *extent) (void) memcpy(q,p,(size_t) number_pixels); - q+=number_pixels; + q+=(ptrdiff_t) number_pixels; j+=(ssize_t) (length*bytes_per_pixel+1); } else @@ -539,7 +539,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image, { if ((q-pixels+number_pixels) <= *extent) (void) memcpy(q,p,(size_t) number_pixels); - q+=number_pixels; + q+=(ptrdiff_t) number_pixels; } j+=(ssize_t) bytes_per_pixel+1; } @@ -692,7 +692,7 @@ static size_t EncodeImage(Image *image,const unsigned char *scanline, Write the number of and the packed length. */ length=(size_t) (q-pixels); - if (bytes_per_line > 200) + if (bytes_per_line > 250) { (void) WriteBlobMSBShort(image,(unsigned short) length); length+=2; @@ -1097,7 +1097,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, if (EOFBlob(image) != MagickFalse) break; - if (length > 200) + if (length > 250) scanline_length=ReadBlobMSBShort(image); else scanline_length=ReadBlobByte(image); @@ -1354,7 +1354,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+=(ptrdiff_t) (pixmap.component_count-1)*tile_image->columns; if (p < pixels) break; } @@ -1556,7 +1556,10 @@ static Image *ReadPICTImage(const ImageInfo *image_info, continue; } } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } #endif @@ -2115,6 +2118,7 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info, scanline=(unsigned char *) RelinquishMagickMemory(scanline); packed_scanline=(unsigned char *) RelinquishMagickMemory(packed_scanline); buffer=(unsigned char *) RelinquishMagickMemory(buffer); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/pix.c b/coders/pix.c index 9ad2bd53be3cfd837b4918633d59827ceb794392..e0208d490d6f89ce5a268242710efe6b581a4794 100644 --- a/coders/pix.c +++ b/coders/pix.c @@ -263,7 +263,8 @@ static Image *ReadPIXImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while (status != MagickFalse); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); diff --git a/coders/png.c b/coders/png.c index 5e611f40526004a85815c52ae27dd2e66229ded9..f5691e9a45dabe858d92dbecf40ea0d07d521621 100644 --- a/coders/png.c +++ b/coders/png.c @@ -1876,8 +1876,6 @@ 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; - (void) FormatLocaleString(key,MagickPathExtent,"png:%s",(const char *) - GetStringInfoDatum(profile)); if (((MagickOffsetType) size-offset) < 1) { profile=DestroyStringInfo(profile); @@ -1995,7 +1993,7 @@ static int read_user_chunk_callback(png_struct *ping, png_unknown_chunkp chunk) if (s[0] == 'E' && s[1] == 'x' && s[2] == 'i' && s[3] == 'f' && s[4] == '\0' && s[5] == '\0') { - s+=6; + s+=(ptrdiff_t) 6; i=6; SetStringInfoLength(profile,chunk->size); p=GetStringInfoDatum(profile); @@ -2062,11 +2060,11 @@ static int read_user_chunk_callback(png_struct *ping, png_unknown_chunkp chunk) /* iTXt */ if ((chunk->name[0] == 105) && (chunk->name[1] == 84) && (chunk->name[2] == 88) && (chunk->name[3] == 116)) - { + { image=(Image *) png_get_user_chunk_ptr(ping); - + error_info=(PNGErrorInfo *) png_get_error_ptr(ping); - + return(PNGParseiTXt(image,chunk->data,chunk->size, error_info->exception)); } @@ -2438,8 +2436,6 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, if (option != (const char *) NULL) png_set_chunk_malloc_max(ping,(png_alloc_size_t) MagickMin( MAGICK_SSIZE_MAX,StringToLong(option))); - else - png_set_chunk_malloc_max(ping,(png_alloc_size_t) GetMaxMemoryRequest()); #endif } #endif /* PNG_SET_USER_LIMITS_SUPPORTED */ @@ -5486,7 +5482,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, " MNG height: %.20g",(double) mng_info->mng_height); } - p+=8; + p+=(ptrdiff_t) 8; mng_info->ticks_per_second=(size_t) mng_get_long(p); if (mng_info->ticks_per_second == 0) @@ -5500,7 +5496,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, simplicity=0; /* Skip nominal layer count, frame count, and play time */ - p+=16; + p+=(ptrdiff_t) 16; simplicity=(size_t) mng_get_long(p); mng_type=1; /* Full MNG */ @@ -5904,7 +5900,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, if (change_delay == 2) default_frame_delay=frame_delay; - p+=4; + p+=(ptrdiff_t) 4; if (logging != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -5925,7 +5921,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, if (change_timeout == 2) default_frame_timeout=frame_timeout; - p+=4; + p+=(ptrdiff_t) 4; if (logging != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -5935,7 +5931,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, if (change_clipping && ((p-chunk) < (ssize_t) (length-16))) { fb=mng_read_box(previous_fb,(char) p[0],&p[1]); - p+=16; + p+=(ptrdiff_t) 16; previous_fb=fb; if (logging != MagickFalse) @@ -6030,7 +6026,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, { first_object=(p[0] << 8) | p[1]; last_object=(p[2] << 8) | p[3]; - p+=4; + p+=(ptrdiff_t) 4; for (i=(int) first_object; i <= (int) last_object; i++) { @@ -6108,7 +6104,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, { first_object=(p[0] << 8) | p[1]; last_object=(p[2] << 8) | p[3]; - p+=4; + p+=(ptrdiff_t) 4; for (i=(ssize_t) first_object; i <= (ssize_t) last_object; i++) { @@ -6734,6 +6730,12 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, return(DestroyImageList(image)); } + if (exception->severity > ErrorException) + { + (void) CloseBlob(image); + return(DestroyImageList(image)); + } + mng_info->image=image; if (mng_type) @@ -6979,7 +6981,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, 1,exception); if (q == (PixelPacket *) NULL) break; - q+=(large_image->columns-image->columns); + q+=(ptrdiff_t) (large_image->columns-image->columns); for (x=(ssize_t) image->columns-1; x >= 0; x--) { @@ -8257,6 +8259,75 @@ static void write_tIME_chunk(Image *image,png_struct *ping,png_info *info, } #endif + +static void Magick_png_set_text(png_struct *ping,png_info *ping_info, + MngInfo *mng_info,const ImageInfo *image_info,const char *key, + const char *value) +{ +#if PNG_LIBPNG_VER >= 10600 + const char + *c; + + MagickBooleanType + write_itxt=MagickFalse; +#endif + + int + compresion_none = PNG_TEXT_COMPRESSION_NONE, + compresion_zTXt = PNG_TEXT_COMPRESSION_zTXt; + + png_textp + text; + + size_t + length; + +#if PNG_LIBPNG_VER >= 10600 + /* + Check if the string contains non-Latin1 characters. + */ + c=value; + while (*c != '\0') + { + if (((const unsigned char) *c) > 255) { + write_itxt=MagickTrue; + compresion_none=PNG_ITXT_COMPRESSION_NONE; + compresion_zTXt=PNG_ITXT_COMPRESSION_zTXt; + break; + } + c++; + } +#endif +#if PNG_LIBPNG_VER >= 10400 + text=(png_textp) png_malloc(ping,(png_alloc_size_t) sizeof(png_text)); +#else + text=(png_textp) png_malloc(ping,(png_size_t) sizeof(png_text)); +#endif + if (text == (png_textp) NULL) + return; + (void) memset(text,0,sizeof(png_text)); + text[0].key=(char *) key; + text[0].text=(char *) value; + length=strlen(value); +#if PNG_LIBPNG_VER >= 10600 + if (write_itxt != MagickFalse) + text[0].itxt_length=length; + else +#endif + text[0].text_length=length; + if (mng_info->ping_exclude_tEXt != MagickFalse) + text[0].compression=compresion_zTXt; + else + if (mng_info->ping_exclude_zTXt != MagickFalse) + text[0].compression=compresion_none; + else + text[0].compression=(image_info->compression == NoCompression) || + ((image_info->compression == UndefinedCompression) && + (length < 128)) ? compresion_none : compresion_zTXt; + png_set_text(ping,ping_info,text,1); + png_free(ping,text); +} + /* Write one PNG image */ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, const ImageInfo *image_info,Image *image) @@ -11617,72 +11688,46 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, (void) LogMagickEvent(CoderEvent,GetMagickModule(), " PNG Interlace method: %d",ping_interlace_method); } - /* - Generate text chunks after IDAT. - */ if (ping_exclude_tEXt == MagickFalse || ping_exclude_zTXt == MagickFalse) { - ResetImagePropertyIterator(image); - while ((property=GetNextImageProperty(image)) != (const char *) NULL) - { - png_textp - text; - - /* Don't write any "png:" or "jpeg:" properties; those are just for - * "identify" or for passing through to another JPEG - */ - if ((LocaleNCompare(property,"png:",4) == 0 || - LocaleNCompare(property,"jpeg:",5) == 0)) - continue; - /* Suppress density and units if we wrote a pHYs chunk */ - if ((ping_exclude_pHYs == MagickFalse) && ( - ((LocaleCompare(property,"exif:ResolutionUnit") == 0) || - (LocaleCompare(property,"exif:XResolution") == 0) || - (LocaleCompare(property,"exif:YResolution") == 0) || - (LocaleCompare(property,"tiff:ResolutionUnit") == 0) || - (LocaleCompare(property,"tiff:XResolution") == 0) || - (LocaleCompare(property,"tiff:YResolution") == 0) || - (LocaleCompare(property,"density") == 0) || - (LocaleCompare(property,"units") == 0)))) - continue; - /* Suppress the IM-generated date:create and date:modify */ - if ((ping_exclude_date == MagickFalse) && - (LocaleNCompare(property, "date:",5) == 0)) - continue; - value=GetImageProperty(image,property); - if (value == (const char *) NULL) - continue; -#if PNG_LIBPNG_VER >= 10400 - text=(png_textp) png_malloc(ping, - (png_alloc_size_t) sizeof(png_text)); -#else - text=(png_textp) png_malloc(ping,(png_size_t) sizeof(png_text)); -#endif - text[0].key=(char *) property; - text[0].text=(char *) value; - text[0].text_length=strlen(value); - if (ping_exclude_tEXt != MagickFalse) - text[0].compression=PNG_TEXT_COMPRESSION_zTXt; - else if (ping_exclude_zTXt != MagickFalse) - text[0].compression=PNG_TEXT_COMPRESSION_NONE; - else + /* + Generate text chunks after IDAT. + */ + Image *property_image = CloneImage(image,0,0,MagickTrue,&image->exception); + if (property_image != (Image *) NULL) { - text[0].compression=image_info->compression == NoCompression || - (image_info->compression == UndefinedCompression && - text[0].text_length < 128) ? PNG_TEXT_COMPRESSION_NONE : - PNG_TEXT_COMPRESSION_zTXt ; - } - if (logging != MagickFalse) + ResetImagePropertyIterator(property_image); + while ((property=GetNextImageProperty(property_image)) != (const char *) NULL) { - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " Setting up text chunk"); - - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " keyword: '%s'",text[0].key); + /* Don't write any "png:" or "jpeg:" properties; those are just for + * "identify" or for passing through to another JPEG + */ + if ((LocaleNCompare(property,"png:",4) == 0 || + LocaleNCompare(property,"jpeg:",5) == 0)) + continue; + /* Suppress density and units if we wrote a pHYs chunk */ + if ((ping_exclude_pHYs == MagickFalse) && ( + ((LocaleCompare(property,"exif:ResolutionUnit") == 0) || + (LocaleCompare(property,"exif:XResolution") == 0) || + (LocaleCompare(property,"exif:YResolution") == 0) || + (LocaleCompare(property,"tiff:ResolutionUnit") == 0) || + (LocaleCompare(property,"tiff:XResolution") == 0) || + (LocaleCompare(property,"tiff:YResolution") == 0) || + (LocaleCompare(property,"density") == 0) || + (LocaleCompare(property,"units") == 0)))) + continue; + /* Suppress the IM-generated date:create and date:modify */ + if ((ping_exclude_date == MagickFalse) && + (LocaleNCompare(property, "date:",5) == 0)) + continue; + value=GetImageProperty(property_image,property); + if (value == (const char *) NULL) + continue; + Magick_png_set_text(ping,ping_info,mng_info,image_info,property, + value); } - png_set_text(ping,ping_info,text,1); - png_free(ping,text); - } + property_image=DestroyImage(property_image); + } } /* write eXIf profile */ @@ -12184,10 +12229,8 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info,Image *image) mng_info->write_png_depth = 16; else - (void) ThrowMagickException(&image->exception, - GetMagickModule(),CoderWarning, - "ignoring invalid defined png:bit-depth", - "=%s",value); + (void) ThrowMagickException(&image->exception,GetMagickModule(), + CoderWarning,"ignoring invalid defined png:bit-depth","=%s",value); if (logging != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -12215,10 +12258,8 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info,Image *image) mng_info->write_png_colortype = 7; else - (void) ThrowMagickException(&image->exception, - GetMagickModule(),CoderWarning, - "ignoring invalid defined png:color-type", - "=%s",value); + (void) ThrowMagickException(&image->exception,GetMagickModule(), + CoderWarning,"ignoring invalid defined png:color-type","=%s",value); if (logging != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -12342,10 +12383,9 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info,Image *image) mng_info->write_png_compression_level = 10; else - (void) ThrowMagickException(&image->exception, - GetMagickModule(),CoderWarning, - "ignoring invalid defined png:compression-level", - "=%s",value); + (void) ThrowMagickException(&image->exception,GetMagickModule(), + CoderWarning,"ignoring invalid defined png:compression-level","=%s", + value); } value=GetImageOption(image_info,"png:compression-strategy"); @@ -12377,10 +12417,9 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info,Image *image) #endif else - (void) ThrowMagickException(&image->exception, - GetMagickModule(),CoderWarning, - "ignoring invalid defined png:compression-strategy", - "=%s",value); + (void) ThrowMagickException(&image->exception,GetMagickModule(), + CoderWarning,"ignoring invalid defined png:compression-strategy","=%s", + value); } value=GetImageOption(image_info,"png:compression-filter"); @@ -12396,11 +12435,10 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info,Image *image) */ mng_info->write_png_compression_filter = StringToUnsignedLong(value)+1; - if (mng_info->write_png_compression_filter > 5) - (void) ThrowMagickException(&image->exception, - GetMagickModule(),CoderWarning, - "ignoring invalid defined png:compression-filter", - "=%s",value); + if (mng_info->write_png_compression_filter > 6) + (void) ThrowMagickException(&image->exception,GetMagickModule(), + CoderWarning,"ignoring invalid defined png:compression-filter","=%s", + value); } for (source=0; source<8; source++) @@ -13107,7 +13145,7 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info, (((unsigned int) *(p + 1) & 0xff) << 16) + (((unsigned int) *(p + 2) & 0xff) << 8) + (((unsigned int) *(p + 3) & 0xff) ) ; - p+=4; + p+=(ptrdiff_t) 4; if (*(p)==73 && *(p+1)==68 && *(p+2)==65 && *(p+3)==84) /* IDAT */ { @@ -13125,7 +13163,7 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info, " Skipping %c%c%c%c chunk, length=%.20g.", *(p),*(p+1),*(p+2),*(p+3),(double) len); } - p+=(8+len); + p+=(ptrdiff_t) (8+len); } } else if (length != 0) diff --git a/coders/pnm.c b/coders/pnm.c index e14ad8158fdbb734ef0581e544356f056ea998c8..ede9693539faaedd45837ce5e43b5caf6808125e 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -1851,7 +1851,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image) q=pixels; } (void) memcpy((char *) q,buffer,extent); - q+=extent; + q+=(ptrdiff_t) extent; p++; } *q++='\n'; @@ -1927,7 +1927,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image) q=pixels; } (void) memcpy((char *) q,buffer,extent); - q+=extent; + q+=(ptrdiff_t) extent; p++; } *q++='\n'; @@ -2485,6 +2485,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/ps.c b/coders/ps.c index b359de50d0b3dd72f1964874892d23848ffa0b24..e23786d37eb5abbbe90798fa931d3ffbb99a75e7 100644 --- a/coders/ps.c +++ b/coders/ps.c @@ -2221,6 +2221,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image) (void) WriteBlobString(image,buffer); } (void) WriteBlobString(image,"%%EOF\n"); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/ps2.c b/coders/ps2.c index e81a6e2006fa4ccb21f9a79751823e0d5f92894e..1b0f6abac34b6c1ab27647283b3b3d6c3d1e1feb 100644 --- a/coders/ps2.c +++ b/coders/ps2.c @@ -1125,6 +1125,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image) (void) WriteBlobString(image,buffer); } (void) WriteBlobString(image,"%%EOF\n"); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/ps3.c b/coders/ps3.c index 945aca73c578d83f6e89c090d6c81f35c7b72802..7aae93e96a529ad77aed68835a2c7c3d524524e8 100644 --- a/coders/ps3.c +++ b/coders/ps3.c @@ -1611,6 +1611,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image) (void) WriteBlobString(image,buffer); } (void) WriteBlobString(image,"%%EOF\n"); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/psd.c b/coders/psd.c index 31b3b1341f81600cdea74244092552bdffae8599..c2996faefeafb89400b6bc7fe52d531f70138bf0 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -767,12 +767,12 @@ static StringInfo *ParseImageResourceBlocks(Image *image, { if (LocaleNCompare((const char *) p,"8BIM",4) != 0) break; - p+=4; + p+=(ptrdiff_t) 4; p=PushShortPixel(MSBEndian,p,&id); p=PushCharPixel(p,&name_length); if ((name_length % 2) == 0) name_length++; - p+=name_length; + p+=(ptrdiff_t) name_length; if (p > (blocks+length-4)) break; p=PushLongPixel(MSBEndian,p,&count); @@ -817,12 +817,12 @@ static StringInfo *ParseImageResourceBlocks(Image *image, { if ((offset > 4) && (*(p+4) == 0)) *has_merged_image=MagickFalse; - p+=offset; + p+=(ptrdiff_t) offset; break; } default: { - p+=offset; + p+=(ptrdiff_t) offset; break; } } @@ -1310,9 +1310,9 @@ static MagickBooleanType ReadPSDChannelZip(Image *image,const size_t channels, } else *(p+1)+=*p; - p+=packet_size; + p+=(ptrdiff_t) packet_size; } - p+=packet_size; + p+=(ptrdiff_t) packet_size; count-=row_size; } } @@ -1325,7 +1325,7 @@ static MagickBooleanType ReadPSDChannelZip(Image *image,const size_t channels, if (status == MagickFalse) break; - p+=row_size; + p+=(ptrdiff_t) row_size; } compact_pixels=(unsigned char *) RelinquishMagickMemory(compact_pixels); @@ -1482,6 +1482,9 @@ static MagickBooleanType ReadPSDLayer(Image *image,const ImageInfo *image_info, (void) FormatLocaleString(message,MaxTextExtent,"%.20g",(double) layer_info->opacity); (void) SetImageArtifact(layer_info->image,"psd:layer.opacity",message); + (void) FormatLocaleString(message,MagickPathExtent,"%.20g",(double) + layer_info->visible); + (void) SetImageArtifact(layer_info->image,"psd:layer.visible",message); (void) SetImageProperty(layer_info->image,"label",(char *) layer_info->name); status=MagickTrue; @@ -2457,7 +2460,10 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) } profile=DestroyStringInfo(profile); } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -3173,7 +3179,7 @@ static void RemoveICCProfileFromResourceBlock(StringInfo *bim_profile) } break; } - p+=count; + p+=(ptrdiff_t) count; if ((count & 0x01) != 0) p++; } @@ -3227,7 +3233,7 @@ static void RemoveResolutionFromResourceBlock(StringInfo *bim_profile) SetStringInfoLength(bim_profile,length-(cnt+12)); break; } - p+=count; + p+=(ptrdiff_t) count; if ((count & 0x01) != 0) p++; } @@ -3292,7 +3298,7 @@ static const StringInfo *GetAdditionalInformation(const ImageInfo *image_info, while (remaining_length >= 12) { /* skip over signature */ - p+=4; + p+=(ptrdiff_t) 4; key[0]=(char) (*p++); key[1]=(char) (*p++); key[2]=(char) (*p++); @@ -3323,7 +3329,7 @@ static const StringInfo *GetAdditionalInformation(const ImageInfo *image_info, continue; } length+=(size_t) size+12; - p+=size; + p+=(ptrdiff_t) size; } profile=RemoveImageProfile(image,"psd:additional-info"); if (length == 0) @@ -3703,6 +3709,7 @@ static MagickBooleanType WritePSDImage(const ImageInfo *image_info, status=MagickFalse; image->compression=compression; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/raw.c b/coders/raw.c index 799e44459cb2ca8cbac5de23cf3dcb3571d33633..4bdcc4ac57178a61ea0dc47f8ee5942bcd4a75ac 100644 --- a/coders/raw.c +++ b/coders/raw.c @@ -292,7 +292,8 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception) InheritException(exception,&canvas_image->exception); InheritException(exception,&image->exception); canvas_image=DestroyImage(canvas_image); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -618,6 +619,7 @@ static MagickBooleanType WriteRAWImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/rgb.c b/coders/rgb.c index e7258bf77e1ca07acd5e148abd2d55e8fa63677a..e2323d8394434ceae959446d36f28ed53346703b 100644 --- a/coders/rgb.c +++ b/coders/rgb.c @@ -732,7 +732,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception) if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("G",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -804,7 +805,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception) if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("B",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -878,7 +880,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (image->matte != MagickFalse) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("A",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -992,7 +995,8 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception) quantum_info=DestroyQuantumInfo(quantum_info); InheritException(&image->exception,&canvas_image->exception); canvas_image=DestroyImage(canvas_image); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -1108,7 +1112,7 @@ ModuleExport void UnregisterRGBImage(void) static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,Image *image) { MagickBooleanType - status; + status = MagickTrue; MagickOffsetType scene; @@ -1383,7 +1387,8 @@ static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("G",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1409,7 +1414,8 @@ static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("B",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1437,7 +1443,8 @@ static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,Image *image) } if (quantum_type == RGBAQuantum) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("A",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1485,6 +1492,7 @@ static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/rgf.c b/coders/rgf.c index e06c355a319b190ead5637def2bfc15417a177d9..9dec1296aca1e11c27346e021ae41b3aac15923a 100644 --- a/coders/rgf.c +++ b/coders/rgf.c @@ -222,7 +222,10 @@ static Image *ReadRGFImage(const ImageInfo *image_info,ExceptionInfo *exception) } data=(unsigned char *) RelinquishMagickMemory(data); (void) SyncImage(image); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -397,6 +400,7 @@ static MagickBooleanType WriteRGFImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/rla.c b/coders/rla.c index 7fa88a7f745afd4a10eb4b27f947dc4c863cf972..d3a15a6cf3e902018868c4e8e60420e9f79577a7 100644 --- a/coders/rla.c +++ b/coders/rla.c @@ -414,7 +414,10 @@ static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } diff --git a/coders/rle.c b/coders/rle.c index 8dfc978c42ad5edd19941d2f39c46d57ec123c8e..735beaaa053a19bf7f818cb8ba58f478694aa6ac 100644 --- a/coders/rle.c +++ b/coders/rle.c @@ -353,8 +353,8 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) */ number_planes_filled=(number_planes % 2 == 0) ? number_planes : number_planes+1; - if ((number_pixels*number_planes_filled) != (size_t) (number_pixels* - number_planes_filled)) + if ((number_pixels*number_planes_filled) != + (MagickSizeType) (((size_t) number_pixels*number_planes_filled))) ThrowRLEException(ResourceLimitError,"MemoryAllocationFailed"); pixel_info=AcquireVirtualMemory(image->columns,image->rows* MagickMax(number_planes_filled,4)*sizeof(*pixels)); @@ -467,7 +467,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) if ((y < (ssize_t) image->rows) && ((x+i) < (ssize_t) image->columns)) *p=pixel; - p+=number_planes; + p+=(ptrdiff_t) number_planes; } if (operand & 0x01) (void) ReadBlobByte(image); @@ -499,7 +499,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) if ((y < (ssize_t) image->rows) && ((x+i) < (ssize_t) image->columns)) *p=pixel; - p+=number_planes; + p+=(ptrdiff_t) number_planes; } x+=operand; break; @@ -716,7 +716,8 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) } while ((count != 0) && (memcmp(magick,"\122\314",2) == 0)); if (colormap != (unsigned char *) NULL) colormap=(unsigned char *) RelinquishMagickMemory(colormap); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); diff --git a/coders/scr.c b/coders/scr.c index 7c0c7db075bf4536f51ceb630cdcb7a265134941..b4cd3b7965667affbf67d331dc564fec7b6c43a3 100644 --- a/coders/scr.c +++ b/coders/scr.c @@ -248,7 +248,10 @@ static Image *ReadSCRImage(const ImageInfo *image_info,ExceptionInfo *exception) } } } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } diff --git a/coders/sct.c b/coders/sct.c index 66abb4d7d4a94941407e6653e95989ba30550d91..e085c6bd0af9657522aaee8c1b547eb83c8c79be 100644 --- a/coders/sct.c +++ b/coders/sct.c @@ -133,6 +133,9 @@ static Image *ReadSCTImage(const ImageInfo *image_info,ExceptionInfo *exception) MagickBooleanType status; + MagickSizeType + extent; + MagickRealType height, width; @@ -240,6 +243,13 @@ static Image *ReadSCTImage(const ImageInfo *image_info,ExceptionInfo *exception) InheritException(exception,&image->exception); return(DestroyImageList(image)); } + extent=(MagickSizeType) image->rows*image->columns*separations; + if (extent > GetBlobSize(image)) + { + ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", + image->filename); + return(DestroyImageList(image)); + } /* Convert SCT raster image to pixel packets. */ @@ -294,7 +304,8 @@ static Image *ReadSCTImage(const ImageInfo *image_info,ExceptionInfo *exception) if (SyncAuthenticPixels(image,exception) == MagickFalse) break; if ((image->columns % 2) != 0) - (void) ReadBlobByte(image); /* pad */ + if (ReadBlobByte(image) == EOF) /* pad */ + break; } if (i < (ssize_t) separations) break; @@ -306,7 +317,10 @@ static Image *ReadSCTImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } diff --git a/coders/sfw.c b/coders/sfw.c index 5220c0ddd2c89413ebbb3eb2d1cc64355f18936f..8fbfdb3b0cb9c699eeb7e224d7f0a9c2607f471a 100644 --- a/coders/sfw.c +++ b/coders/sfw.c @@ -285,7 +285,7 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception) Translate remaining markers. */ offset=header+2; - offset+=(((unsigned int) offset[2]) << 8)+offset[3]+2; + offset+=(((size_t) offset[2]) << 8)+(size_t) offset[3]+2; for ( ; ; ) { if ((offset+4) > (buffer+count-1)) @@ -296,7 +296,7 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception) TranslateSFWMarker(offset); if (offset[1] == 0xda) break; - offset+=(((unsigned int) offset[2]) << 8)+offset[3]+2; + offset+=(((size_t) offset[2]) << 8)+(size_t) offset[3]+2; } offset--; data=SFWScan(offset,buffer+count-1,(const unsigned char *) "\377\311",2); @@ -326,10 +326,10 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception) image=DestroyImageList(image); return((Image *) NULL); } - extent=fwrite(header,(size_t) (offset-header+1),1,file); + extent=fwrite(header,1,(size_t) (offset-header+1),file); (void) extent; extent=fwrite(HuffmanTable,1,sizeof(HuffmanTable)/sizeof(*HuffmanTable),file); - extent=fwrite(offset+1,(size_t) (data-offset),1,file); + extent=fwrite(offset+1,1,(size_t) (data-offset),file); status=ferror(file) != 0 ? MagickFalse : MagickTrue; (void) fclose(file); (void) close(unique_file); diff --git a/coders/sgi.c b/coders/sgi.c index 36c50fc6eeada3833ed6d45920c63d06bd24dc6c..33990d037f1fba2ea543be009237043d286a2828 100644 --- a/coders/sgi.c +++ b/coders/sgi.c @@ -201,7 +201,7 @@ static MagickBooleanType SGIDecode(const size_t bytes_per_pixel, return(MagickFalse); *q=(*p++); *(q+1)=(*p++); - q+=8; + q+=(ptrdiff_t) 8; } else { @@ -213,7 +213,7 @@ static MagickBooleanType SGIDecode(const size_t bytes_per_pixel, { *q=(unsigned char) (pixel >> 8); *(q+1)=(unsigned char) pixel; - q+=8; + q+=(ptrdiff_t) 8; } } } @@ -236,7 +236,7 @@ static MagickBooleanType SGIDecode(const size_t bytes_per_pixel, if (number_packets-- == 0) return(MagickFalse); *q=(*p++); - q+=4; + q+=(ptrdiff_t) 4; } else { @@ -246,7 +246,7 @@ static MagickBooleanType SGIDecode(const size_t bytes_per_pixel, for ( ; count != 0; count--) { *q=(unsigned char) pixel; - q+=4; + q+=(ptrdiff_t) 4; } } } @@ -390,8 +390,8 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) */ bytes_per_pixel=(size_t) iris_info.bytes_per_pixel; number_pixels=(MagickSizeType) iris_info.columns*iris_info.rows; - if ((4*bytes_per_pixel*number_pixels) != ((MagickSizeType) (size_t) - (4*bytes_per_pixel*number_pixels))) + if ((4*bytes_per_pixel*number_pixels) != + ((MagickSizeType) ((size_t) (4*bytes_per_pixel*number_pixels)))) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); pixel_info=AcquireVirtualMemory(iris_info.columns,iris_info.rows*4* bytes_per_pixel*sizeof(*pixels)); @@ -428,13 +428,13 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) { *p=scanline[2*x]; *(p+1)=scanline[2*x+1]; - p+=8; + p+=(ptrdiff_t) 8; } else for (x=0; x < (ssize_t) iris_info.columns; x++) { *p=scanline[x]; - p+=4; + p+=(ptrdiff_t) 4; } } if (y < (ssize_t) iris_info.rows) @@ -538,7 +538,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowReaderException(CorruptImageError, "ImproperImageHeader"); } - p+=(iris_info.columns*4*bytes_per_pixel); + p+=(ptrdiff_t) (iris_info.columns*4*bytes_per_pixel); } if (y < (ssize_t) iris_info.rows) break; @@ -581,7 +581,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (z < (ssize_t) iris_info.depth) break; - p+=(iris_info.columns*4*bytes_per_pixel); + p+=(ptrdiff_t) (iris_info.columns*4*bytes_per_pixel); } offset=(ssize_t) SeekBlob(image,position,SEEK_SET); } @@ -617,7 +617,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image->matte != MagickFalse) SetPixelAlpha(q,ScaleShortToQuantum((unsigned short) ((*(p+6) << 8) | (*(p+7))))); - p+=8; + p+=(ptrdiff_t) 8; q++; } if (SyncAuthenticPixels(image,exception) == MagickFalse) @@ -646,7 +646,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) SetPixelOpacity(q,OpaqueOpacity); if (image->matte != MagickFalse) SetPixelAlpha(q,ScaleCharToQuantum(*(p+3))); - p+=4; + p+=(ptrdiff_t) 4; q++; } if (SyncAuthenticPixels(image,exception) == MagickFalse) @@ -687,7 +687,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) quantum=(*p << 8); quantum|=(*(p+1)); SetPixelIndex(indexes+x,quantum); - p+=8; + p+=(ptrdiff_t) 8; q++; } if (SyncAuthenticPixels(image,exception) == MagickFalse) @@ -712,7 +712,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) for (x=0; x < (ssize_t) image->columns; x++) { SetPixelIndex(indexes+x,*p); - p+=4; + p+=(ptrdiff_t) 4; q++; } if (SyncAuthenticPixels(image,exception) == MagickFalse) @@ -759,7 +759,8 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while (iris_info.magic == 0x01DA); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -873,10 +874,10 @@ static size_t SGIEncode(unsigned char *pixels,size_t length, while (p < limit) { mark=p; - p+=8; + p+=(ptrdiff_t) 8; while ((p < limit) && ((*(p-8) != *(p-4)) || (*(p-4) != *p))) - p+=4; - p-=8; + p+=(ptrdiff_t) 4; + p-=(ptrdiff_t)8; length=(size_t) (p-mark) >> 2; while (length != 0) { @@ -890,9 +891,9 @@ static size_t SGIEncode(unsigned char *pixels,size_t length, } } mark=p; - p+=4; + p+=(ptrdiff_t) 4; while ((p < limit) && (*p == *mark)) - p+=4; + p+=(ptrdiff_t) 4; length=(size_t) (p-mark) >> 2; while (length != 0) { @@ -1048,7 +1049,7 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image) *q; q=(unsigned char *) pixels; - q+=((iris_info.rows-1)-y)*(4*iris_info.columns)+4*x; + q+=(ptrdiff_t) ((iris_info.rows-1)-y)*(4*iris_info.columns)+4*x; *q++=ScaleQuantumToChar(GetPixelRed(p)); *q++=ScaleQuantumToChar(GetPixelGreen(p)); *q++=ScaleQuantumToChar(GetPixelBlue(p)); @@ -1062,7 +1063,7 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image) *q; q=(unsigned short *) pixels; - q+=((iris_info.rows-1)-y)*(4*iris_info.columns)+4*x; + q+=(ptrdiff_t) ((iris_info.rows-1)-y)*(4*iris_info.columns)+4*x; *q++=ScaleQuantumToShort(GetPixelRed(p)); *q++=ScaleQuantumToShort(GetPixelGreen(p)); *q++=ScaleQuantumToShort(GetPixelBlue(p)); @@ -1095,7 +1096,7 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image) *q; q=(unsigned char *) pixels; - q+=y*(4*iris_info.columns)+4*x+z; + q+=(ptrdiff_t) y*(4*iris_info.columns)+4*x+z; (void) WriteBlobByte(image,*q); } else @@ -1105,7 +1106,7 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image) *q; q=(unsigned short *) pixels; - q+=y*(4*iris_info.columns)+4*x+z; + q+=(ptrdiff_t) y*(4*iris_info.columns)+4*x+z; (void) WriteBlobMSBShort(image,*q); } } @@ -1163,7 +1164,7 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image) runlength[y+z*iris_info.rows]=(size_t) length; offset+=(ssize_t) length; } - q+=(iris_info.columns*4); + q+=(ptrdiff_t) (iris_info.columns*4); } /* Write out line start and length tables and runlength-encoded pixels. @@ -1190,6 +1191,7 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/sixel.c b/coders/sixel.c index d9c2ccea62be22f702b5aeef86834b864f0741ec..f2cc3a2295e290994c7d00367f839c4eb517c6a0 100644 --- a/coders/sixel.c +++ b/coders/sixel.c @@ -1048,7 +1048,7 @@ static Image *ReadSIXELImage(const ImageInfo *image_info,ExceptionInfo *exceptio continue; if ((*p == '}') && (*(p+1) == ';')) break; - p+=strlen(p); + p+=(ptrdiff_t) strlen(p); offset=p-sixel_buffer; if ((size_t) (offset+MaxTextExtent+1) < length) continue; @@ -1133,7 +1133,10 @@ static Image *ReadSIXELImage(const ImageInfo *image_info,ExceptionInfo *exceptio */ sixel_pixels=(unsigned char *) RelinquishMagickMemory(sixel_pixels); sixel_palette=(unsigned char *) RelinquishMagickMemory(sixel_palette); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -1372,6 +1375,7 @@ static MagickBooleanType WriteSIXELImage(const ImageInfo *image_info, sixel_palette, image->colors, -1, output); sixel_pixels =(unsigned char *) RelinquishMagickMemory(sixel_pixels); output = (sixel_output_t *) RelinquishMagickMemory(output); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/sun.c b/coders/sun.c index 779f06d4376efcc0b283e0b86957fc5ffd854622..c0a6e8d3ca034c1e587b3e6465f87b82b5a7a18b 100644 --- a/coders/sun.c +++ b/coders/sun.c @@ -654,7 +654,8 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while (sun_info.magic == 0x59a66a95); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -1033,6 +1034,7 @@ static MagickBooleanType WriteSUNImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/svg.c b/coders/svg.c index 514c8df07ddb2b1b121e1683203bca64ef254398..bd48ede37ad71958dc5841db03f708977d0f192f 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -304,13 +304,14 @@ 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); + if (AcquireUniqueSymbolicLink(image->filename,input_filename) == MagickFalse) + return((Image *) NULL); (void) AcquireUniqueFilename(unique); (void) FormatLocaleString(output_filename,MagickPathExtent,"%s.png",unique); - (void) AcquireUniqueFilename(unique); + (void) RelinquishUniqueFileResource(unique); density=AcquireString(""); (void) FormatLocaleString(density,MagickPathExtent,"%.20g", - ceil(sqrt(image->x_resolution*image->y_resolution)-0.5)); + sqrt(image->x_resolution*image->y_resolution)); (void) FormatLocaleString(background,MagickPathExtent, "rgb(%.20g%%,%.20g%%,%.20g%%)", 100.0*QuantumScale*(MagickRealType) image->background_color.red, @@ -321,12 +322,11 @@ static Image *RenderSVGImage(const ImageInfo *image_info,Image *image, image->background_color.opacity)); (void) FormatLocaleString(command,MagickPathExtent, GetDelegateCommands(delegate_info),input_filename,output_filename,density, - background,opacity,unique); + background,opacity); density=DestroyString(density); status=ExternalDelegateCommand(MagickFalse,image_info->verbose,command, (char *) NULL,exception); - (void) RelinquishUniqueFileResource(unique); - (void) RelinquishUniqueFileResource(input_filename); + (void) (unique); if ((status == 0) && (stat(output_filename,&attributes) == 0) && (attributes.st_size > 0)) { @@ -441,21 +441,27 @@ static Image *RenderRSVGImage(const ImageInfo *image_info,Image *image, rsvg_handle_set_base_uri(svg_handle,image_info->filename); if ((fabs(image->x_resolution) > MagickEpsilon) && (fabs(image->y_resolution) > MagickEpsilon)) - rsvg_handle_set_dpi_x_y(svg_handle,image->x_resolution, - image->y_resolution); + rsvg_handle_set_dpi_x_y(svg_handle,image->x_resolution,image->y_resolution); while ((n=ReadBlob(image,MagickMaxBufferExtent-1,buffer)) != 0) { buffer[n]='\0'; error=(GError *) NULL; (void) rsvg_handle_write(svg_handle,buffer,n,&error); if (error != (GError *) NULL) - g_error_free(error); + { + g_error_free(error); + break; + } } buffer=(unsigned char *) RelinquishMagickMemory(buffer); error=(GError *) NULL; rsvg_handle_close(svg_handle,&error); if (error != (GError *) NULL) - g_error_free(error); + { + g_error_free(error); + g_object_unref(svg_handle); + ThrowReaderException(CorruptImageError,"UnableToReadImageData"); + } #if defined(MAGICKCORE_CAIRO_DELEGATE) apply_density=MagickTrue; rsvg_handle_get_dimensions(svg_handle,&dimension_info); @@ -547,8 +553,7 @@ static Image *RenderRSVGImage(const ImageInfo *image_info,Image *image, if (pixel_info == (MemoryInfo *) NULL) { g_object_unref(svg_handle); - ThrowReaderException(ResourceLimitError, - "MemoryAllocationFailed"); + ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } pixels=(unsigned char *) GetVirtualMemoryBlob(pixel_info); #endif @@ -606,10 +611,10 @@ static Image *RenderRSVGImage(const ImageInfo *image_info,Image *image, gamma=1.0-QuantumScale*(MagickRealType) fill_color.opacity; gamma=PerceptibleReciprocal(gamma); - fill_color.blue=(Quantum) ((MagickRealType) fill_color.red*gamma); + fill_color.red=(Quantum) ((MagickRealType) fill_color.red*gamma); fill_color.green=(Quantum) ((MagickRealType) fill_color.green* gamma); - fill_color.red=(Quantum) ((MagickRealType) fill_color.blue*gamma); + fill_color.blue=(Quantum) ((MagickRealType) fill_color.blue*gamma); } #endif MagickCompositeOver(&fill_color,fill_color.opacity,q, @@ -975,7 +980,7 @@ static void SVGStripString(const MagickBooleanType trim,char *message) for ( ; *p != '\0'; p++) if ((*p == '*') && (*(p+1) == '/')) { - p+=2; + p+=(ptrdiff_t) 2; break; } if (*p == '\0') @@ -1903,7 +1908,7 @@ static void SVGStartElement(void *context,const xmlChar *name, (void) FormatLocaleFile(svg_info->file,"fill-opacity 1\n"); (void) FormatLocaleFile(svg_info->file,"stroke \"none\"\n"); (void) FormatLocaleFile(svg_info->file,"stroke-width 1\n"); - (void) FormatLocaleFile(svg_info->file,"stroke-opacity 1\n"); + (void) FormatLocaleFile(svg_info->file,"stroke-opacity 0\n"); (void) FormatLocaleFile(svg_info->file,"fill-rule nonzero\n"); break; } @@ -3979,6 +3984,9 @@ static MagickBooleanType IsPoint(const char *point) static MagickBooleanType TraceSVGImage(Image *image,ExceptionInfo *exception) { + MagickBooleanType + status = MagickTrue; + #if defined(MAGICKCORE_AUTOTRACE_DELEGATE) { at_bitmap @@ -4054,7 +4062,8 @@ static MagickBooleanType TraceSVGImage(Image *image,ExceptionInfo *exception) char *base64, filename[MaxTextExtent], - message[MaxTextExtent]; + message[MaxTextExtent], + *p; const DelegateInfo *delegate_info; @@ -4065,12 +4074,6 @@ static MagickBooleanType TraceSVGImage(Image *image,ExceptionInfo *exception) ImageInfo *image_info; - MagickBooleanType - status; - - char - *p; - size_t blob_length, encode_length; @@ -4138,7 +4141,7 @@ static MagickBooleanType TraceSVGImage(Image *image,ExceptionInfo *exception) { (void) FormatLocaleString(message,MaxTextExtent,"%.76s",p); (void) WriteBlobString(image,message); - p+=76; + p+=(ptrdiff_t) 76; if (i > 76) (void) WriteBlobString(image,"\n"); } @@ -4147,8 +4150,9 @@ static MagickBooleanType TraceSVGImage(Image *image,ExceptionInfo *exception) (void) WriteBlobString(image,"\n"); } #endif - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image) @@ -5295,6 +5299,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image) token=DestroyString(token); if (primitive_info != (PrimitiveInfo *) NULL) primitive_info=(PrimitiveInfo *) RelinquishMagickMemory(primitive_info); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/tga.c b/coders/tga.c index 6337566720a928a2f0c530e20a25411055b9b570..35cf418ef331d778a98f89a7dc7e85ed7de0949e 100644 --- a/coders/tga.c +++ b/coders/tga.c @@ -472,7 +472,7 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception) if (q == (PixelPacket *) NULL) break; if (flip_x != MagickFalse) - q+=(image->columns-1); + q+=(ptrdiff_t) (image->columns-1); indexes=GetAuthenticIndexQueue(image); for (x=0; x < (ssize_t) image->columns; x++) { @@ -658,7 +658,10 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception) } } } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -939,12 +942,27 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image) else tga_info.colormap_size=24; } - if ((image->orientation == BottomRightOrientation) || - (image->orientation == TopRightOrientation)) - tga_info.attributes|=(1UL << 4); - if ((image->orientation == TopLeftOrientation) || - (image->orientation == TopRightOrientation)) - tga_info.attributes|=(1UL << 5); + switch (image->orientation) + { + case BottomRightOrientation: + { + tga_info.attributes|=0x10; + break; + } + case UndefinedOrientation: + case TopLeftOrientation: + { + tga_info.attributes|=0x20; + break; + } + case TopRightOrientation: + { + tga_info.attributes|=0x30; + break; + } + default: + break; + } value=GetImageArtifact(image,"tga:image-origin"); /* deprecated */ if (value != (const char *) NULL) { @@ -1063,7 +1081,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image) if (i < 3) { count+=i; - p+=i; + p+=(ptrdiff_t) i; indexes+=i; } if ((i >= 3) || (count == 128) || @@ -1085,7 +1103,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image) { (void) WriteBlobByte(image,(unsigned char) ((i-1) | 0x80)); WriteTGAPixel(image,tga_info.image_type,indexes,p,range,midpoint); - p+=i; + p+=(ptrdiff_t) i; indexes+=i; } x+=i; @@ -1112,6 +1130,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image) break; } } - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/thumbnail.c b/coders/thumbnail.c index 41b7e690d4965f665b18a6e9be40fa36821bea59..b36a0849337c6c3a6ec83771819cd0b9e2782322 100644 --- a/coders/thumbnail.c +++ b/coders/thumbnail.c @@ -186,11 +186,11 @@ static MagickBooleanType WriteTHUMBNAILImage(const ImageInfo *image_info, profile=GetImageProfile(image,"exif"); if (profile == (const StringInfo *) NULL) ThrowWriterException(CoderError,"ImageDoesNotHaveAThumbnail"); - property=GetImageProperty(image,"exif:JPEGInterchangeFormat"); + property=GetImageProperty(image,"exif:thumbnail:JPEGInterchangeFormat"); if (property == (const char *) NULL) ThrowWriterException(CoderError,"ImageDoesNotHaveAThumbnail"); offset=(ssize_t) StringToLong(property); - property=GetImageProperty(image,"exif:JPEGInterchangeFormatLength"); + property=GetImageProperty(image,"exif:thumbnail:JPEGInterchangeFormatLength"); if (property == (const char *) NULL) ThrowWriterException(CoderError,"ImageDoesNotHaveAThumbnail"); length=(size_t) StringToLong(property); diff --git a/coders/tiff.c b/coders/tiff.c index fc163690df22eb1961dff9a4c5c619c435ef043a..949a6de7eb5e3f3a0639cef09b1e1452e47bf76d 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -91,9 +91,6 @@ #include "magick/utility.h" #include "psd-private.h" #if defined(MAGICKCORE_TIFF_DELEGATE) -# if defined(MAGICKCORE_HAVE_TIFFCONF_H) -# include -# endif # include # include # if !defined(COMPRESSION_ADOBE_DEFLATE) @@ -302,9 +299,8 @@ static Image *ReadGROUP4Image(const ImageInfo *image_info, size_t length; - ssize_t - offset, - strip_offset; + TIFF + *tiff; /* Open image file. @@ -323,76 +319,71 @@ static Image *ReadGROUP4Image(const ImageInfo *image_info, image=DestroyImageList(image); return((Image *) NULL); } + (void) SetMagickThreadValue(tiff_exception,exception); /* Write raw CCITT Group 4 wrapped as a TIFF image file. */ - file=(FILE *) NULL; + file=(FILE *) NULL; unique_file=AcquireUniqueFileResource(filename); if (unique_file != -1) file=fdopen(unique_file,"wb"); if ((unique_file == -1) || (file == (FILE *) NULL)) ThrowImageException(FileOpenError,"UnableToCreateTemporaryFile"); - length=fwrite("\111\111\052\000\010\000\000\000\016\000",1,10,file); - if (length != 10) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - length=fwrite("\376\000\003\000\001\000\000\000\000\000\000\000",1,12,file); - length=fwrite("\000\001\004\000\001\000\000\000",1,8,file); - length=WriteLSBLong(file,(unsigned int) image->columns); - length=fwrite("\001\001\004\000\001\000\000\000",1,8,file); - length=WriteLSBLong(file,(unsigned int) image->rows); - length=fwrite("\002\001\003\000\001\000\000\000\001\000\000\000",1,12,file); - length=fwrite("\003\001\003\000\001\000\000\000\004\000\000\000",1,12,file); - length=fwrite("\006\001\003\000\001\000\000\000\000\000\000\000",1,12,file); - length=fwrite("\021\001\003\000\001\000\000\000",1,8,file); - strip_offset=10+(12*14)+4+8; - length=WriteLSBLong(file,(unsigned int) strip_offset); - length=fwrite("\022\001\003\000\001\000\000\000",1,8,file); - length=WriteLSBLong(file,(unsigned int) image_info->orientation); - length=fwrite("\025\001\003\000\001\000\000\000\001\000\000\000",1,12,file); - length=fwrite("\026\001\004\000\001\000\000\000",1,8,file); - length=WriteLSBLong(file,(unsigned int) image->rows); - length=fwrite("\027\001\004\000\001\000\000\000\000\000\000\000",1,12,file); - offset=(ssize_t) ftell(file)-4; - length=fwrite("\032\001\005\000\001\000\000\000",1,8,file); - length=WriteLSBLong(file,(unsigned int) (strip_offset-8)); - length=fwrite("\033\001\005\000\001\000\000\000",1,8,file); - length=WriteLSBLong(file,(unsigned int) (strip_offset-8)); - length=fwrite("\050\001\003\000\001\000\000\000\002\000\000\000",1,12,file); - length=fwrite("\000\000\000\000",1,4,file); - length=WriteLSBLong(file,(unsigned int) image->x_resolution); - length=WriteLSBLong(file,1); - status=MagickTrue; - for (length=0; (c=ReadBlobByte(image)) != EOF; length++) - if (fputc(c,file) != c) - status=MagickFalse; - offset=(ssize_t) fseek(file,(off_t) offset,SEEK_SET); - length=WriteLSBLong(file,(unsigned int) length); - if (ferror(file) != 0) + tiff=TIFFOpen(filename,"w"); + if (tiff == (TIFF *) NULL) { - (void) fclose(file); + (void) RelinquishUniqueFileResource(filename); ThrowImageException(FileOpenError,"UnableToCreateTemporaryFile"); } - (void) fclose(file); + TIFFSetField(tiff,TIFFTAG_IMAGEWIDTH,(uint32) image->columns); + TIFFSetField(tiff,TIFFTAG_IMAGELENGTH,(uint32) image->rows); + TIFFSetField(tiff,TIFFTAG_BITSPERSAMPLE,1); + TIFFSetField(tiff,TIFFTAG_SAMPLESPERPIXEL,1); + TIFFSetField(tiff,TIFFTAG_PHOTOMETRIC,PHOTOMETRIC_MINISBLACK); + TIFFSetField(tiff,TIFFTAG_ORIENTATION,ORIENTATION_TOPLEFT); + TIFFSetField(tiff,TIFFTAG_COMPRESSION,COMPRESSION_CCITTFAX4); + TIFFSetField(tiff,TIFFTAG_ROWSPERSTRIP,(uint32) image->rows); + if ((image->x_resolution > 0.0) && (image->y_resolution > 0.0)) + { + if (image->units == PixelsPerCentimeterResolution) + TIFFSetField(tiff,TIFFTAG_RESOLUTIONUNIT,RESUNIT_CENTIMETER); + else + TIFFSetField(tiff,TIFFTAG_RESOLUTIONUNIT,RESUNIT_INCH); + TIFFSetField(tiff,TIFFTAG_XRESOLUTION,(uint32) image->x_resolution); + TIFFSetField(tiff,TIFFTAG_YRESOLUTION,(uint32) image->y_resolution); + } + status=MagickTrue; + c=ReadBlobByte(image); + for (length=0; c != EOF; length++) + { + unsigned char byte = (unsigned char) c; + if (TIFFWriteRawStrip(tiff,0,&byte,1) < 0) + { + status=MagickFalse; + break; + } + c=ReadBlobByte(image); + } + TIFFSetField(tiff,TIFFTAG_STRIPBYTECOUNTS,(uint32) length); + TIFFClose(tiff); (void) CloseBlob(image); image=DestroyImage(image); /* Read TIFF image. */ read_info=CloneImageInfo((ImageInfo *) NULL); - (void) FormatLocaleString(read_info->filename,MaxTextExtent,"%s",filename); + (void) FormatLocaleString(read_info->filename,MagickPathExtent,"%s",filename); image=ReadTIFFImage(read_info,exception); read_info=DestroyImageInfo(read_info); if (image != (Image *) NULL) { (void) CopyMagickString(image->filename,image_info->filename, - MaxTextExtent); + MagickPathExtent); (void) CopyMagickString(image->magick_filename,image_info->filename, - MaxTextExtent); - (void) CopyMagickString(image->magick,"GROUP4",MaxTextExtent); + MagickPathExtent); + (void) CopyMagickString(image->magick,"GROUP4",MagickPathExtent); } (void) RelinquishUniqueFileResource(filename); - if (status == MagickFalse) - image=DestroyImage(image); return(image); } #endif @@ -489,24 +480,19 @@ static MagickBooleanType DecodeLabImage(Image *image,ExceptionInfo *exception) return(status); } -static MagickBooleanType ReadProfile(Image *image,const char *name, +static void ReadProfile(Image *image,const char *name, const unsigned char *datum,ssize_t length) { - MagickBooleanType - status; - StringInfo *profile; if (length < 4) - return(MagickFalse); + return; profile=BlobToStringInfo(datum,(size_t) length); if (profile == (StringInfo *) NULL) - ThrowBinaryImageException(ResourceLimitError,"MemoryAllocationFailed", - image->filename); - status=SetImageProfile(image,name,profile); + return; + (void) SetImageProfile(image,name,profile); profile=DestroyStringInfo(profile); - return(status); } #if defined(__cplusplus) || defined(c_plusplus) @@ -548,27 +534,23 @@ static toff_t TIFFGetBlobSize(thandle_t image) return((toff_t) GetBlobSize((Image *) image)); } -static MagickBooleanType TIFFGetProfiles(TIFF *tiff,Image *image) +static void TIFFGetProfiles(TIFF *tiff,Image *image) { - MagickBooleanType - status; - uint32 length = 0; unsigned char *profile = (unsigned char *) NULL; - status=MagickTrue; #if defined(TIFFTAG_ICCPROFILE) if ((TIFFGetField(tiff,TIFFTAG_ICCPROFILE,&length,&profile) == 1) && (profile != (unsigned char *) NULL)) - status=ReadProfile(image,"icc",profile,(ssize_t) length); + ReadProfile(image,"icc",profile,(ssize_t) length); #endif #if defined(TIFFTAG_PHOTOSHOP) if ((TIFFGetField(tiff,TIFFTAG_PHOTOSHOP,&length,&profile) == 1) && (profile != (unsigned char *) NULL)) - status=ReadProfile(image,"8bim",profile,(ssize_t) length); + ReadProfile(image,"8bim",profile,(ssize_t) length); #endif #if defined(TIFFTAG_RICHTIFFIPTC) && (TIFFLIB_VERSION >= 20191103) if ((TIFFGetField(tiff,TIFFTAG_RICHTIFFIPTC,&length,&profile) == 1) && @@ -580,13 +562,13 @@ static MagickBooleanType TIFFGetProfiles(TIFF *tiff,Image *image) field=TIFFFieldWithTag(tiff,TIFFTAG_RICHTIFFIPTC); if ((field != (const TIFFField *) NULL) && (TIFFFieldDataType(field) == TIFF_LONG)) - status=ReadProfile(image,"iptc",profile,length); - else { if (TIFFIsByteSwapped(tiff) != 0) - TIFFSwabArrayOfLong((uint32 *) profile,(size_t) length); - status=ReadProfile(image,"iptc",profile,4L*length); + TIFFSwabArrayOfLong((uint32 *) profile,(tmsize_t) length); + ReadProfile(image,"iptc",profile,4L*length); } + else + ReadProfile(image,"iptc",profile,length); } #endif #if defined(TIFFTAG_XMLPACKET) @@ -596,7 +578,7 @@ static MagickBooleanType TIFFGetProfiles(TIFF *tiff,Image *image) StringInfo *dng; - status=ReadProfile(image,"xmp",profile,(ssize_t) length); + ReadProfile(image,"xmp",profile,(ssize_t) length); dng=BlobToStringInfo(profile,length); if (dng != (StringInfo *) NULL) { @@ -611,11 +593,10 @@ static MagickBooleanType TIFFGetProfiles(TIFF *tiff,Image *image) #endif if ((TIFFGetField(tiff,34118,&length,&profile) == 1) && (profile != (unsigned char *) NULL)) - status=ReadProfile(image,"tiff:34118",profile,(ssize_t) length); + ReadProfile(image,"tiff:34118",profile,(ssize_t) length); if ((TIFFGetField(tiff,37724,&length,&profile) == 1) && (profile != (unsigned char *) NULL)) - status=ReadProfile(image,"tiff:37724",profile,(ssize_t) length); - return(status); + ReadProfile(image,"tiff:37724",profile,(ssize_t) length); } static MagickBooleanType TIFFGetProperties(TIFF *tiff,Image *image) @@ -766,7 +747,6 @@ static MagickBooleanType TIFFSetImageProperties(TIFF *tiff,Image *image, static MagickBooleanType TIFFGetEXIFProperties(TIFF *tiff,Image *image) { -#if defined(MAGICKCORE_HAVE_TIFFREADEXIFDIRECTORY) MagickBooleanType status; @@ -795,16 +775,11 @@ static MagickBooleanType TIFFGetEXIFProperties(TIFF *tiff,Image *image) status=TIFFSetImageProperties(tiff,image,"exif:"); TIFFSetDirectory(tiff,directory); return(status); -#else - (void) tiff; - (void) image; - return(MagickTrue); -#endif } static MagickBooleanType TIFFGetGPSProperties(TIFF *tiff,Image *image) { -#if defined(MAGICKCORE_HAVE_TIFFREADGPSDIRECTORY) +#if (TIFFLIB_VERSION >= 20210416) MagickBooleanType status; @@ -834,9 +809,8 @@ static MagickBooleanType TIFFGetGPSProperties(TIFF *tiff,Image *image) TIFFSetDirectory(tiff,directory); return(status); #else - (void) tiff; - (void) image; - return(MagickTrue); + magick_unreferenced(tiff); + magick_unreferenced(image); #endif } @@ -1236,10 +1210,8 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, do { /* TIFFPrintDirectory(tiff,stdout,MagickFalse); */ - photometric=PHOTOMETRIC_RGB; if ((TIFFGetField(tiff,TIFFTAG_IMAGEWIDTH,&width) != 1) || (TIFFGetField(tiff,TIFFTAG_IMAGELENGTH,&height) != 1) || - (TIFFGetFieldDefaulted(tiff,TIFFTAG_PHOTOMETRIC,&photometric,sans) != 1) || (TIFFGetFieldDefaulted(tiff,TIFFTAG_COMPRESSION,&compress_tag,sans) != 1) || (TIFFGetFieldDefaulted(tiff,TIFFTAG_FILLORDER,&endian,sans) != 1) || (TIFFGetFieldDefaulted(tiff,TIFFTAG_PLANARCONFIG,&interlace,sans) != 1) || @@ -1258,15 +1230,15 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, TIFFClose(tiff); ThrowReaderException(CorruptImageError,"UnsupportedBitsPerPixel"); } - 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"); } if (sample_format == SAMPLEFORMAT_IEEEFP) (void) SetImageProperty(image,"quantum:format","floating-point"); + if (TIFFGetField(tiff,TIFFTAG_PHOTOMETRIC,&photometric) != 1) + photometric=PHOTOMETRIC_RGB; switch (photometric) { case PHOTOMETRIC_MINISBLACK: @@ -1351,7 +1323,6 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, image->endian=MSBEndian; if (endian == FILLORDER_LSB2MSB) image->endian=LSBEndian; -#if defined(MAGICKCORE_HAVE_TIFFISBIGENDIAN) if (TIFFIsBigEndian(tiff) == 0) { (void) SetImageProperty(image,"tiff:endian","lsb"); @@ -1362,7 +1333,6 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, (void) SetImageProperty(image,"tiff:endian","msb"); image->endian=MSBEndian; } -#endif if ((photometric == PHOTOMETRIC_MINISBLACK) || (photometric == PHOTOMETRIC_MINISWHITE)) image->colorspace=GRAYColorspace; @@ -1374,13 +1344,7 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, (compress_tag != COMPRESSION_OJPEG) && (compress_tag != COMPRESSION_JPEG)) image->colorspace=YCbCrColorspace; - status=TIFFGetProfiles(tiff,image); - if (status == MagickFalse) - { - TIFFClose(tiff); - InheritException(exception,&image->exception); - return(DestroyImageList(image)); - } + TIFFGetProfiles(tiff,image); status=TIFFGetProperties(tiff,image); if (status == MagickFalse) { @@ -1439,14 +1403,12 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, image->chromaticity.blue_primary.y=chromaticity[5]; } } -#if defined(MAGICKCORE_HAVE_TIFFISCODECCONFIGURED) || (TIFFLIB_VERSION > 20040919) if ((compress_tag != COMPRESSION_NONE) && (TIFFIsCODECConfigured(compress_tag) == 0)) { TIFFClose(tiff); ThrowReaderException(CoderError,"CompressNotSupported"); } -#endif switch (compress_tag) { case COMPRESSION_NONE: image->compression=NoCompression; break; @@ -1611,37 +1573,49 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, } tiff_status=TIFFGetFieldDefaulted(tiff,TIFFTAG_EXTRASAMPLES,&extra_samples, &sample_info,sans); - if (tiff_status == 1) + if (extra_samples == 0) { - (void) SetImageProperty(image,"tiff:alpha","unspecified"); - if (extra_samples == 0) - { - if ((samples_per_pixel == 4) && (photometric == PHOTOMETRIC_RGB)) + if ((samples_per_pixel == 4) && (photometric == PHOTOMETRIC_RGB)) + image->matte=MagickTrue; + } + else + { + for (i=0; i < extra_samples; i++) + { + if (sample_info[i] == EXTRASAMPLE_ASSOCALPHA) + { image->matte=MagickTrue; - } - else - for (i=0; i < extra_samples; i++) - { - image->matte=MagickTrue; - if (sample_info[i] == EXTRASAMPLE_ASSOCALPHA) + SetQuantumAlphaType(quantum_info,AssociatedQuantumAlpha); + (void) SetImageProperty(image,"tiff:alpha","associated"); + break; + } + else + if (sample_info[i] == EXTRASAMPLE_UNASSALPHA) { - SetQuantumAlphaType(quantum_info,AssociatedQuantumAlpha); - (void) SetImageProperty(image,"tiff:alpha","associated"); + image->matte=MagickTrue; + SetQuantumAlphaType(quantum_info,DisassociatedQuantumAlpha); + (void) SetImageProperty(image,"tiff:alpha","unassociated"); break; } - else - if (sample_info[i] == EXTRASAMPLE_UNASSALPHA) - { - SetQuantumAlphaType(quantum_info,DisassociatedQuantumAlpha); - (void) SetImageProperty(image,"tiff:alpha","unassociated"); - break; - } + } + if ((image->matte == MagickFalse) && (extra_samples >= 1)) + { + const char + *option; + + option=GetImageOption(image_info,"tiff:assume-alpha"); + if (IsStringTrue(option) != MagickFalse) + image->matte=MagickTrue; } if (image->matte != MagickFalse) extra_samples--; } if (image->matte != MagickFalse) - (void) SetImageAlphaChannel(image,OpaqueAlphaChannel); + { + if (quantum_info->alpha_type == UndefinedQuantumAlpha) + (void) SetImageProperty(image,"tiff:alpha","unspecified"); + (void) SetImageAlphaChannel(image,OpaqueAlphaChannel); + } method=ReadGenericMethod; rows_per_strip=(uint32) image->rows; if (TIFFGetField(tiff,TIFFTAG_ROWSPERSTRIP,&rows_per_strip) == 1) @@ -1678,7 +1652,11 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, if (image->compression == JPEGCompression) method=GetJPEGMethod(image,tiff,photometric,bits_per_sample, samples_per_pixel); +#if defined(WORDS_BIGENDIAN) + quantum_info->endian=MSBEndian; +#else quantum_info->endian=LSBEndian; +#endif scanline_size=TIFFScanlineSize(tiff); if (scanline_size <= 0) ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); @@ -1698,382 +1676,395 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, quantum_type=IndexQuantum; if (interlace != PLANARCONFIG_SEPARATE) { - size_t + ssize_t pad; - pad=(size_t) MagickMax((ssize_t) samples_per_pixel-1,0); - if (image->matte != MagickFalse) - { - if (image->storage_class == PseudoClass) - quantum_type=IndexAlphaQuantum; - else - quantum_type=samples_per_pixel == 1 ? AlphaQuantum : - GrayAlphaQuantum; - } + pad=(ssize_t) samples_per_pixel; if (samples_per_pixel > 2) { if (image->colorspace == CMYKColorspace) { + pad-=4; quantum_type=CMYKQuantum; - pad=(size_t) MagickMax((ssize_t) samples_per_pixel+ - extra_samples-4,0); if (image->matte != MagickFalse) { + pad--; quantum_type=CMYKAQuantum; - pad=(size_t) MagickMax((ssize_t) samples_per_pixel+ - extra_samples-5,0); } } - else if (image->matte != MagickFalse) - { - quantum_type=RGBAQuantum; - pad=(size_t) MagickMax((ssize_t) samples_per_pixel+ - extra_samples-4,0); - } else { + pad-=3; quantum_type=RGBQuantum; - pad=(size_t) MagickMax((ssize_t) samples_per_pixel+ - extra_samples-3,0); + if (image->matte != MagickFalse) + { + pad--; + quantum_type=RGBAQuantum; + } } - status=SetQuantumPad(image,quantum_info,pad*((bits_per_sample+7) >> - 3)); + } + else + { + pad--; + if (image->matte != MagickFalse) + { + if (samples_per_pixel == 1) + quantum_type=AlphaQuantum; + else + { + pad--; + if (image->storage_class == PseudoClass) + quantum_type=IndexAlphaQuantum; + else + quantum_type=GrayAlphaQuantum; + } + } + } + if (pad < 0) + ThrowTIFFException(CorruptImageError,"CorruptImage"); + if (pad > 0) + { + status=SetQuantumPad(image,quantum_info,(size_t) pad* + ((bits_per_sample+7) >> 3)); if (status == MagickFalse) ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); } } - switch (method) - { - case ReadYCCKMethod: + if (exception->severity < ErrorException) + switch (method) { - /* - Convert YCC TIFF image. - */ - for (y=0; y < (ssize_t) image->rows; y++) + case ReadYCCKMethod: { - int - status; + /* + Convert YCC TIFF image. + */ + for (y=0; y < (ssize_t) image->rows; y++) + { + int + status; - IndexPacket - *indexes; + IndexPacket + *indexes; - PixelPacket - *magick_restrict q; + PixelPacket + *magick_restrict q; - ssize_t - x; + ssize_t + x; - unsigned char - *p; + unsigned char + *p; - status=TIFFReadPixels(tiff,0,y,(char *) pixels); - if (status == -1) - break; - q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (PixelPacket *) NULL) - break; - indexes=GetAuthenticIndexQueue(image); - p=pixels; - for (x=0; x < (ssize_t) image->columns; x++) - { - SetPixelCyan(q,ScaleCharToQuantum(ClampYCC((double) *p+ - (1.402*(double) *(p+2))-179.456))); - SetPixelMagenta(q,ScaleCharToQuantum(ClampYCC((double) *p- - (0.34414*(double) *(p+1))-(0.71414*(double ) *(p+2))+ - 135.45984))); - SetPixelYellow(q,ScaleCharToQuantum(ClampYCC((double) *p+ - (1.772*(double) *(p+1))-226.816))); - SetPixelBlack(indexes+x,ScaleCharToQuantum((unsigned char)*(p+3))); - q++; - p+=4; - } - if (SyncAuthenticPixels(image,exception) == MagickFalse) - break; - if (image->previous == (Image *) NULL) + status=TIFFReadPixels(tiff,0,y,(char *) pixels); + if (status == -1) + break; + q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); + if (q == (PixelPacket *) NULL) + break; + indexes=GetAuthenticIndexQueue(image); + p=pixels; + for (x=0; x < (ssize_t) image->columns; x++) { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, - image->rows); - if (status == MagickFalse) - break; + SetPixelCyan(q,ScaleCharToQuantum(ClampYCC((double) *p+ + (1.402*(double) *(p+2))-179.456))); + SetPixelMagenta(q,ScaleCharToQuantum(ClampYCC((double) *p- + (0.34414*(double) *(p+1))-(0.71414*(double ) *(p+2))+ + 135.45984))); + SetPixelYellow(q,ScaleCharToQuantum(ClampYCC((double) *p+ + (1.772*(double) *(p+1))-226.816))); + SetPixelBlack(indexes+x,ScaleCharToQuantum((unsigned char)* + (p+3))); + q++; + p+=(ptrdiff_t) 4; } + if (SyncAuthenticPixels(image,exception) == MagickFalse) + break; + if (image->previous == (Image *) NULL) + { + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, + image->rows); + if (status == MagickFalse) + break; + } + } + break; } - break; - } - case ReadStripMethod: - { - size_t - extent, - length; + case ReadStripMethod: + { + size_t + extent, + length; - ssize_t - stride, - strip_id; + ssize_t + stride, + strip_id; + + tsize_t + strip_size; - tsize_t - strip_size; + unsigned char + *p, + *strip_pixels; + + /* + Convert stripped TIFF image. + */ + strip_size=TIFFStripSize(tiff); + stride=(ssize_t) TIFFVStripSize(tiff,1); + length=GetQuantumExtent(image,quantum_info,quantum_type); + extent=MagickMax((size_t) strip_size,(size_t) rows_per_strip* + MagickMax((size_t) stride,(size_t) length)); + strip_pixels=(unsigned char *) AcquireQuantumMemory(extent, + sizeof(*strip_pixels)); + if (strip_pixels == (unsigned char *) NULL) + ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); + (void) memset(strip_pixels,0,extent*sizeof(*strip_pixels)); + strip_id=0; + p=strip_pixels; + for (i=0; i < (ssize_t) samples_per_pixel; i++) + { + size_t + rows_remaining; - unsigned char - *p, - *strip_pixels; + tmsize_t + size = 0; - /* - Convert stripped TIFF image. - */ - strip_size=TIFFStripSize(tiff); - stride=(ssize_t) TIFFVStripSize(tiff,1); - length=GetQuantumExtent(image,quantum_info,quantum_type); - extent=MagickMax((size_t) strip_size,(size_t) rows_per_strip* - MagickMax((size_t) stride,(size_t) length)); - strip_pixels=(unsigned char *) AcquireQuantumMemory(extent, - sizeof(*strip_pixels)); - if (strip_pixels == (unsigned char *) NULL) - ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); - (void) memset(strip_pixels,0,extent*sizeof(*strip_pixels)); - strip_id=0; - p=strip_pixels; - for (i=0; i < (ssize_t) samples_per_pixel; i++) + switch (i) + { + case 0: break; + case 1: quantum_type=GreenQuantum; break; + case 2: quantum_type=BlueQuantum; break; + case 3: + { + quantum_type=AlphaQuantum; + if (image->colorspace == CMYKColorspace) + quantum_type=BlackQuantum; + break; + } + case 4: quantum_type=AlphaQuantum; break; + default: break; + } + rows_remaining=0; + for (y=0; y < (ssize_t) image->rows; y++) + { + PixelPacket + *magick_restrict q; + + q=GetAuthenticPixels(image,0,y,image->columns,1,exception); + if (q == (PixelPacket *) NULL) + break; + if (rows_remaining == 0) + { + size=TIFFReadEncodedStrip(tiff,strip_id,strip_pixels, + strip_size); + (void) size; + if (strip_size == -1) + break; + rows_remaining=rows_per_strip; + p=strip_pixels; + strip_id++; + } + (void) ImportQuantumPixels(image,(CacheView *) NULL, + quantum_info,quantum_type,p,exception); + p+=(ptrdiff_t) stride; + rows_remaining--; + if (SyncAuthenticPixels(image,exception) == MagickFalse) + break; + if (image->previous == (Image *) NULL) + { + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) + y,image->rows); + if (status == MagickFalse) + break; + } + } + if ((size == -1) || ((samples_per_pixel > 1) && + (interlace != PLANARCONFIG_SEPARATE))) + break; + } + strip_pixels=(unsigned char *) RelinquishMagickMemory(strip_pixels); + break; + } + case ReadTileMethod: { size_t - rows_remaining; + extent, + length; + + ssize_t + stride; tmsize_t - size = 0; + tile_size; - switch (i) + uint32 + columns, + rows; + + unsigned char + *p, + *tile_pixels; + + /* + Convert tiled TIFF image. + */ + if ((TIFFGetField(tiff,TIFFTAG_TILEWIDTH,&columns) != 1) || + (TIFFGetField(tiff,TIFFTAG_TILELENGTH,&rows) != 1)) + ThrowTIFFException(CoderError,"ImageIsNotTiled"); + number_pixels=(MagickSizeType) columns*rows; + if (HeapOverflowSanityCheck(rows,sizeof(*tile_pixels)) != MagickFalse) + ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); + tile_size=TIFFTileSize(tiff); + stride=(ssize_t) TIFFTileRowSize(tiff); + length=GetQuantumExtent(image,quantum_info,quantum_type); + extent=(size_t) MagickMax((size_t) tile_size,rows* + MagickMax((size_t) stride,length)); + tile_pixels=(unsigned char *) AcquireQuantumMemory(extent, + sizeof(*tile_pixels)); + if (tile_pixels == (unsigned char *) NULL) + ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); + (void) memset(tile_pixels,0,extent*sizeof(*tile_pixels)); + for (i=0; i < (ssize_t) samples_per_pixel; i++) { - case 0: break; - case 1: quantum_type=GreenQuantum; break; - case 2: quantum_type=BlueQuantum; break; - case 3: + switch (i) { - quantum_type=AlphaQuantum; - if (image->colorspace == CMYKColorspace) - quantum_type=BlackQuantum; - break; + case 0: break; + case 1: quantum_type=GreenQuantum; break; + case 2: quantum_type=BlueQuantum; break; + case 3: + { + quantum_type=AlphaQuantum; + if (image->colorspace == CMYKColorspace) + quantum_type=BlackQuantum; + break; + } + case 4: quantum_type=AlphaQuantum; break; + default: break; } - case 4: quantum_type=AlphaQuantum; break; - default: break; - } - rows_remaining=0; - for (y=0; y < (ssize_t) image->rows; y++) - { - PixelPacket - *magick_restrict q; + for (y=0; y < (ssize_t) image->rows; y+=rows) + { + ssize_t + x; - q=GetAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (PixelPacket *) NULL) - break; - if (rows_remaining == 0) + size_t + rows_remaining; + + rows_remaining=image->rows-y; + if ((ssize_t) (y+rows) < (ssize_t) image->rows) + rows_remaining=rows; + for (x=0; x < (ssize_t) image->columns; x+=columns) { - size=TIFFReadEncodedStrip(tiff,strip_id,strip_pixels, - strip_size); - (void) size; - if (strip_size == -1) + size_t + columns_remaining, + row; + + columns_remaining=image->columns-x; + if ((ssize_t) (x+columns) < (ssize_t) image->columns) + columns_remaining=columns; + tiff_status=TIFFReadTile(tiff,tile_pixels,(uint32) x,(uint32) y, + 0,i); + if (tiff_status == -1) break; - rows_remaining=rows_per_strip; - p=strip_pixels; - strip_id++; + p=tile_pixels; + for (row=0; row < rows_remaining; row++) + { + PixelPacket + *magick_restrict q; + + q=GetAuthenticPixels(image,x,y+row,columns_remaining,1, + exception); + if (q == (PixelPacket *) NULL) + break; + (void) ImportQuantumPixels(image,(CacheView *) NULL, + quantum_info,quantum_type,p,exception); + p+=(ptrdiff_t) TIFFTileRowSize(tiff); + if (SyncAuthenticPixels(image,exception) == MagickFalse) + break; + } } - (void) ImportQuantumPixels(image,(CacheView *) NULL, - quantum_info,quantum_type,p,exception); - p+=stride; - rows_remaining--; - if (SyncAuthenticPixels(image,exception) == MagickFalse) + } + if ((samples_per_pixel > 1) && (interlace != PLANARCONFIG_SEPARATE)) break; if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, - image->rows); + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) i, + samples_per_pixel); if (status == MagickFalse) break; } } - if ((size == -1) || ((samples_per_pixel > 1) && - (interlace != PLANARCONFIG_SEPARATE))) - break; + tile_pixels=(unsigned char *) RelinquishMagickMemory(tile_pixels); + break; } - strip_pixels=(unsigned char *) RelinquishMagickMemory(strip_pixels); - break; - } - case ReadTileMethod: - { - size_t - extent, - length; - - ssize_t - stride; - - tmsize_t - tile_size; - - uint32 - columns, - rows; + case ReadGenericMethod: + default: + { + MemoryInfo + *generic_info = (MemoryInfo *) NULL; - unsigned char - *p, - *tile_pixels; + uint32 + *p; - /* - Convert tiled TIFF image. - */ - if ((TIFFGetField(tiff,TIFFTAG_TILEWIDTH,&columns) != 1) || - (TIFFGetField(tiff,TIFFTAG_TILELENGTH,&rows) != 1)) - ThrowTIFFException(CoderError,"ImageIsNotTiled"); - number_pixels=(MagickSizeType) columns*rows; - if (HeapOverflowSanityCheck(rows,sizeof(*tile_pixels)) != MagickFalse) - ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); - tile_size=TIFFTileSize(tiff); - stride=(ssize_t) TIFFTileRowSize(tiff); - length=GetQuantumExtent(image,quantum_info,quantum_type); - extent=(size_t) MagickMax((size_t) tile_size,rows* - MagickMax((size_t) stride,length)); - tile_pixels=(unsigned char *) AcquireQuantumMemory(extent, - sizeof(*tile_pixels)); - if (tile_pixels == (unsigned char *) NULL) - ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); - (void) memset(tile_pixels,0,extent*sizeof(*tile_pixels)); - for (i=0; i < (ssize_t) samples_per_pixel; i++) - { - switch (i) - { - case 0: break; - case 1: quantum_type=GreenQuantum; break; - case 2: quantum_type=BlueQuantum; break; - case 3: + uint32 + *pixels; + + /* + Convert generic TIFF image. + */ + if (HeapOverflowSanityCheck(image->rows,sizeof(*pixels)) != MagickFalse) + ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); + number_pixels=(MagickSizeType) image->columns*image->rows; + generic_info=AcquireVirtualMemory(number_pixels,sizeof(*pixels)); + if (generic_info == (MemoryInfo *) NULL) + ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); + pixels=(uint32 *) GetVirtualMemoryBlob(generic_info); + tiff_status=TIFFReadRGBAImage(tiff,(uint32) image->columns,(uint32) + image->rows,(uint32 *) pixels,0); + if (tiff_status == -1) { - quantum_type=AlphaQuantum; - if (image->colorspace == CMYKColorspace) - quantum_type=BlackQuantum; + generic_info=RelinquishVirtualMemory(generic_info); break; } - case 4: quantum_type=AlphaQuantum; break; - default: break; - } - for (y=0; y < (ssize_t) image->rows; y+=rows) + p=pixels+(image->columns*image->rows)-1; + for (y=0; y < (ssize_t) image->rows; y++) { ssize_t x; - size_t - rows_remaining; + PixelPacket + *magick_restrict q; - rows_remaining=image->rows-y; - if ((ssize_t) (y+rows) < (ssize_t) image->rows) - rows_remaining=rows; - for (x=0; x < (ssize_t) image->columns; x+=columns) + q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); + if (q == (PixelPacket *) NULL) + break; + q+=(ptrdiff_t) image->columns-1; + for (x=0; x < (ssize_t) image->columns; x++) { - size_t - columns_remaining, - row; - - columns_remaining=image->columns-x; - if ((ssize_t) (x+columns) < (ssize_t) image->columns) - columns_remaining=columns; - tiff_status=TIFFReadTile(tiff,tile_pixels,(uint32) x,(uint32) y, - 0,i); - if (tiff_status == -1) - break; - p=tile_pixels; - for (row=0; row < rows_remaining; row++) + SetPixelRed(q,ScaleCharToQuantum((unsigned char) TIFFGetR(*p))); + SetPixelGreen(q,ScaleCharToQuantum((unsigned char) TIFFGetG(*p))); + SetPixelBlue(q,ScaleCharToQuantum((unsigned char) TIFFGetB(*p))); + if (image->matte == MagickFalse) + SetPixelOpacity(q,OpaqueOpacity); + else + SetPixelAlpha(q,ScaleCharToQuantum((unsigned char) + TIFFGetA(*p))); + p--; + q--; + } + if (SyncAuthenticPixels(image,exception) == MagickFalse) + break; + if (image->previous == (Image *) NULL) { - PixelPacket - *magick_restrict q; - - q=GetAuthenticPixels(image,x,y+row,columns_remaining,1, - exception); - if (q == (PixelPacket *) NULL) - break; - (void) ImportQuantumPixels(image,(CacheView *) NULL, - quantum_info,quantum_type,p,exception); - p+=TIFFTileRowSize(tiff); - if (SyncAuthenticPixels(image,exception) == MagickFalse) + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, + image->rows); + if (status == MagickFalse) break; } - } } - if ((samples_per_pixel > 1) && (interlace != PLANARCONFIG_SEPARATE)) - break; - if (image->previous == (Image *) NULL) - { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) i, - samples_per_pixel); - if (status == MagickFalse) - break; - } - } - tile_pixels=(unsigned char *) RelinquishMagickMemory(tile_pixels); - break; - } - case ReadGenericMethod: - default: - { - MemoryInfo - *generic_info = (MemoryInfo *) NULL; - - uint32 - *p; - - uint32 - *pixels; - - /* - Convert generic TIFF image. - */ - if (HeapOverflowSanityCheck(image->rows,sizeof(*pixels)) != MagickFalse) - ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); - number_pixels=(MagickSizeType) image->columns*image->rows; - generic_info=AcquireVirtualMemory(number_pixels,sizeof(*pixels)); - if (generic_info == (MemoryInfo *) NULL) - ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); - pixels=(uint32 *) GetVirtualMemoryBlob(generic_info); - tiff_status=TIFFReadRGBAImage(tiff,(uint32) image->columns,(uint32) - image->rows,(uint32 *) pixels,0); - if (tiff_status == -1) - { - generic_info=RelinquishVirtualMemory(generic_info); - break; - } - p=pixels+(image->columns*image->rows)-1; - for (y=0; y < (ssize_t) image->rows; y++) - { - ssize_t - x; - - PixelPacket - *magick_restrict q; - - q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (PixelPacket *) NULL) - break; - q+=image->columns-1; - for (x=0; x < (ssize_t) image->columns; x++) - { - SetPixelRed(q,ScaleCharToQuantum((unsigned char) TIFFGetR(*p))); - SetPixelGreen(q,ScaleCharToQuantum((unsigned char) TIFFGetG(*p))); - SetPixelBlue(q,ScaleCharToQuantum((unsigned char) TIFFGetB(*p))); - if (image->matte == MagickFalse) - SetPixelOpacity(q,OpaqueOpacity); - else - SetPixelAlpha(q,ScaleCharToQuantum((unsigned char) TIFFGetA(*p))); - p--; - q--; - } - if (SyncAuthenticPixels(image,exception) == MagickFalse) - break; - if (image->previous == (Image *) NULL) - { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, - image->rows); - if (status == MagickFalse) - break; - } + generic_info=RelinquishVirtualMemory(generic_info); + break; } - generic_info=RelinquishVirtualMemory(generic_info); - break; } - } pixel_info=RelinquishVirtualMemory(pixel_info); SetQuantumImageType(image,quantum_type); next_tiff_frame: @@ -2155,7 +2146,6 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, */ #if defined(MAGICKCORE_TIFF_DELEGATE) -#if defined(MAGICKCORE_HAVE_TIFFMERGEFIELDINFO) && defined(MAGICKCORE_HAVE_TIFFSETTAGEXTENDER) static TIFFExtendProc tag_extender = (TIFFExtendProc) NULL; @@ -2253,7 +2243,6 @@ static void TIFFTagExtender(TIFF *tiff) TIFFIgnoreTags(tiff); } #endif -#endif ModuleExport size_t RegisterTIFFImage(void) { @@ -2313,10 +2302,8 @@ ModuleExport size_t RegisterTIFFImage(void) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); error_handler=TIFFSetErrorHandler(TIFFErrors); warning_handler=TIFFSetWarningHandler(TIFFWarnings); -#if defined(MAGICKCORE_HAVE_TIFFMERGEFIELDINFO) && defined(MAGICKCORE_HAVE_TIFFSETTAGEXTENDER) if (tag_extender == (TIFFExtendProc) NULL) tag_extender=TIFFSetTagExtender(TIFFTagExtender); -#endif instantiate_key=MagickTrue; } UnlockSemaphoreInfo(tiff_semaphore); @@ -2445,12 +2432,10 @@ ModuleExport void UnregisterTIFFImage(void) LockSemaphoreInfo(tiff_semaphore); if (instantiate_key != MagickFalse) { - if (DeleteMagickThreadKey(tiff_exception) == MagickFalse) - ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); -#if defined(MAGICKCORE_HAVE_TIFFMERGEFIELDINFO) && defined(MAGICKCORE_HAVE_TIFFSETTAGEXTENDER) if (tag_extender == (TIFFExtendProc) NULL) (void) TIFFSetTagExtender(tag_extender); -#endif + if (DeleteMagickThreadKey(tiff_exception) == MagickFalse) + ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) TIFFSetWarningHandler(warning_handler); (void) TIFFSetErrorHandler(error_handler); instantiate_key=MagickFalse; @@ -2624,7 +2609,8 @@ static MagickBooleanType WriteGROUP4Image(const ImageInfo *image_info, huffman_image=DestroyImage(huffman_image); (void) fclose(file); (void) RelinquishUniqueFileResource(filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } #endif @@ -3281,6 +3267,8 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, (void) SetImageDepth(image,1); } image->depth=1; + if (image->matte != MagickFalse) + compression=UndefinedCompression; break; } case JPEGCompression: @@ -3391,7 +3379,6 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, break; } } -#if defined(MAGICKCORE_HAVE_TIFFISCODECCONFIGURED) || (TIFFLIB_VERSION > 20040919) if ((compress_tag != COMPRESSION_NONE) && (TIFFIsCODECConfigured(compress_tag) == 0)) { @@ -3400,40 +3387,6 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, MagickCompressOptions,(ssize_t) compression)); compress_tag=COMPRESSION_NONE; } -#else - switch (compress_tag) - { -#if defined(CCITT_SUPPORT) - case COMPRESSION_CCITTFAX3: - case COMPRESSION_CCITTFAX4: -#endif -#if defined(YCBCR_SUPPORT) && defined(JPEG_SUPPORT) - case COMPRESSION_JPEG: -#endif -#if defined(LZMA_SUPPORT) && defined(COMPRESSION_LZMA) - case COMPRESSION_LZMA: -#endif -#if defined(LZW_SUPPORT) - case COMPRESSION_LZW: -#endif -#if defined(PACKBITS_SUPPORT) - case COMPRESSION_PACKBITS: -#endif -#if defined(ZIP_SUPPORT) - case COMPRESSION_ADOBE_DEFLATE: -#endif - case COMPRESSION_NONE: - break; - default: - { - (void) ThrowMagickException(&image->exception,GetMagickModule(), - CoderError,"CompressionNotSupported","`%s'",CommandOptionToMnemonic( - MagickCompressOptions,(ssize_t) compression)); - compress_tag=COMPRESSION_NONE; - break; - } - } -#endif if (image->colorspace == CMYKColorspace) { photometric=PHOTOMETRIC_SEPARATED; @@ -3590,42 +3543,44 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, (void) TIFFSetField(tiff,TIFFTAG_JPEGQUALITY,image_info->quality); (void) TIFFSetField(tiff,TIFFTAG_JPEGCOLORMODE,JPEGCOLORMODE_RAW); if (IssRGBCompatibleColorspace(image->colorspace) != MagickFalse) + (void) TIFFSetField(tiff,TIFFTAG_JPEGCOLORMODE,JPEGCOLORMODE_RGB); + if (IsYCbCrCompatibleColorspace(image->colorspace) != MagickFalse) { const char + *sampling_factor, *value; - (void) TIFFSetField(tiff,TIFFTAG_JPEGCOLORMODE,JPEGCOLORMODE_RGB); - if (IsYCbCrCompatibleColorspace(image->colorspace) != MagickFalse) - { - const char - *sampling_factor; - - GeometryInfo - geometry_info; + GeometryInfo + geometry_info; - MagickStatusType - flags; + MagickStatusType + flags; - sampling_factor=(const char *) NULL; - value=GetImageProperty(image,"jpeg:sampling-factor"); - if (value != (char *) NULL) - { - sampling_factor=value; - if (image->debug != MagickFalse) - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " Input sampling-factors=%s",sampling_factor); - } - if (image_info->sampling_factor != (char *) NULL) - sampling_factor=image_info->sampling_factor; - if (sampling_factor != (const char *) NULL) - { - flags=ParseGeometry(sampling_factor,&geometry_info); - if ((flags & SigmaValue) == 0) - geometry_info.sigma=geometry_info.rho; - (void) TIFFSetField(tiff,TIFFTAG_YCBCRSUBSAMPLING,(uint16) - geometry_info.rho,(uint16) geometry_info.sigma); - } - } + sampling_factor=(const char *) NULL; + value=GetImageOption(image_info,"jpeg:sampling-factor"); + if (value == (char *) NULL) + value=GetImageProperty(image,"jpeg:sampling-factor"); + if (value != (char *) NULL) + { + sampling_factor=value; + if (image->debug != MagickFalse) + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + " Input sampling-factors=%s",sampling_factor); + } + if (image_info->sampling_factor != (char *) NULL) + sampling_factor=image_info->sampling_factor; + if (sampling_factor != (const char *) NULL) + { + flags=ParseGeometry(sampling_factor,&geometry_info); + if ((flags & SigmaValue) == 0) + geometry_info.sigma=geometry_info.rho; + /* + To do: write pixel data in YCBCR subsampled format. + + (void) TIFFSetField(tiff,TIFFTAG_YCBCRSUBSAMPLING,(uint16) + geometry_info.rho,(uint16) geometry_info.sigma); + */ + } } (void) TIFFGetFieldDefaulted(tiff,TIFFTAG_BITSPERSAMPLE, &bits_per_sample,sans); @@ -4091,6 +4046,8 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); + if (TIFFFlush(tiff) != 1) + status=MagickFalse; TIFFClose(tiff); return(status); } diff --git a/coders/tim.c b/coders/tim.c index 4f23801853464e5de9dc78a2c3bab987ff72a3da..ac0380f43fe14a569a14a6889d38f13165197a70 100644 --- a/coders/tim.c +++ b/coders/tim.c @@ -432,7 +432,8 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while (tim_info.id == 0x00000010); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); diff --git a/coders/ttf.c b/coders/ttf.c index 113313df98eb61a7361c311ec691c88b9ec21bd0..ed03a65731561590532970e21214d672ce98b228 100644 --- a/coders/ttf.c +++ b/coders/ttf.c @@ -291,7 +291,10 @@ static Image *ReadTTFImage(const ImageInfo *image_info,ExceptionInfo *exception) */ (void) RelinquishUniqueFileResource(draw_info->font); draw_info=DestroyDrawInfo(draw_info); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } #endif /* MAGICKCORE_FREETYPE_DELEGATE */ diff --git a/coders/txt.c b/coders/txt.c index 99a869696e054b1cecb67f1ecf325734104435b7..c2a556ca03a8e0591fd6257418fcaff54ef3a1ce 100644 --- a/coders/txt.c +++ b/coders/txt.c @@ -353,7 +353,8 @@ static Image *ReadTEXTImage(const ImageInfo *image_info, if (texture != (Image *) NULL) texture=DestroyImageList(texture); draw_info=DestroyDrawInfo(draw_info); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -874,6 +875,7 @@ static MagickBooleanType WriteTXTImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/uil.c b/coders/uil.c index d7543828182d788bcaada529585dcfefec45c9ed..6e351d68be843476d05d6f7c0166aa74dc9bf06e 100644 --- a/coders/uil.c +++ b/coders/uil.c @@ -380,6 +380,7 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image) break; } symbol=DestroyString(symbol); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/url.c b/coders/url.c index 42d05210b1bf4786bef1d0fba123b84a008c809d..2facd6926a8a61fb966bbbd15458fdb192ca03e0 100644 --- a/coders/url.c +++ b/coders/url.c @@ -124,7 +124,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,1,size,file); (void) length; } #endif @@ -263,7 +263,7 @@ static Image *ReadURLImage(const ImageInfo *image_info,ExceptionInfo *exception) count; while ((bytes=xmlNanoHTTPRead(context,buffer,MaxBufferExtent)) > 0) - count=(ssize_t) fwrite(buffer,bytes,1,file); + count=(ssize_t) fwrite(buffer,1,bytes,file); (void) count; xmlNanoHTTPClose(context); xmlFree(type); diff --git a/coders/uyvy.c b/coders/uyvy.c index a2f54bc239bb497bf05c225d8b5801bb08bd41c6..b8ce897d065b1f4defb0f64dab32afda1c6f87fc 100644 --- a/coders/uyvy.c +++ b/coders/uyvy.c @@ -185,7 +185,10 @@ static Image *ReadUYVYImage(const ImageInfo *image_info, if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -365,6 +368,7 @@ static MagickBooleanType WriteUYVYImage(const ImageInfo *image_info, break; } uyvy_image=DestroyImage(uyvy_image); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/vicar.c b/coders/vicar.c index fa2d69ba09bc968196ee31f3dc241438856d6e4c..c1d319eb930acf875a0809b8d20ea154c6250fe4 100644 --- a/coders/vicar.c +++ b/coders/vicar.c @@ -331,7 +331,10 @@ static Image *ReadVICARImage(const ImageInfo *image_info, if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -504,6 +507,7 @@ static MagickBooleanType WriteVICARImage(const ImageInfo *image_info, break; } quantum_info=DestroyQuantumInfo(quantum_info); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/video.c b/coders/video.c index 6c7a2606708f0e7ab486d731ded0ca1f1c809a98..cf964f4ec86123a5f3682188b5d669572c9f9683 100644 --- a/coders/video.c +++ b/coders/video.c @@ -257,19 +257,21 @@ static Image *ReadVIDEOImage(const ImageInfo *image_info, GetDelegateCommands(delegate_info),read_info->filename,options, read_info->unique); options=DestroyString(options); - (void) CopyMagickString(read_info->magick,intermediate_format, - MagickPathExtent); - (void) CopyMagickString(read_info->filename,read_info->unique, - MagickPathExtent); exit_code=ExternalDelegateCommand(MagickFalse,image_info->verbose, command,message,exception); + (void) RelinquishUniqueFileResource(read_info->filename); if (exit_code == 0) - images=ReadImage(read_info,exception); + { + (void) CopyMagickString(read_info->magick,intermediate_format, + MagickPathExtent); + (void) CopyMagickString(read_info->filename,read_info->unique, + MagickPathExtent); + images=ReadImage(read_info,exception); + } else if (*message != '\0') (void) ThrowMagickException(exception,GetMagickModule(),DelegateError, "VideoDelegateFailed","`%s'",message); - (void) RelinquishUniqueFileResource(read_info->filename); (void) RelinquishUniqueFileResource(read_info->unique); if (images != (Image *) NULL) for (next=images; next != (Image *) NULL; next=next->next) diff --git a/coders/viff.c b/coders/viff.c index fc279a7c7f2f7aaf16f99a01149711c73a2e394b..9b1888ce5fad270c402e6f42ed827d3420aadd32 100644 --- a/coders/viff.c +++ b/coders/viff.c @@ -789,7 +789,8 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, break; } } while ((count != 0) && (viff_info.identifier == 0xab)); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -1271,6 +1272,7 @@ static MagickBooleanType WriteVIFFImage(const ImageInfo *image_info, if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/vips.c b/coders/vips.c index 07cae5c7a9ed3f015ffdfea5159c512c8d692d3f..ba4b1446dc29e6d67d62e94c188de88dcf50ac85 100644 --- a/coders/vips.c +++ b/coders/vips.c @@ -523,7 +523,8 @@ static Image *ReadVIPSImage(const ImageInfo *image_info, SetImageProperty(image,"vips:metadata",metadata); metadata=(char *) RelinquishMagickMemory(metadata); } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return((Image *) NULL); return(image); @@ -760,6 +761,7 @@ static MagickBooleanType WriteVIPSImage(const ImageInfo *image_info, metadata=GetImageProperty(image,"vips:metadata"); if (metadata != (const char*) NULL) WriteBlobString(image,metadata); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/wbmp.c b/coders/wbmp.c index 632c15f3041d3ffc84b109d0b5466db44f8ad609..92ddb8d9d36bcad9c205603d1c8f0c05285d55d5 100644 --- a/coders/wbmp.c +++ b/coders/wbmp.c @@ -228,7 +228,10 @@ static Image *ReadWBMPImage(const ImageInfo *image_info, if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -423,6 +426,7 @@ static MagickBooleanType WriteWBMPImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/webp.c b/coders/webp.c index ad5af6ef6e11f6bb4c9d26fc0b9f9938033f6c1f..75e0d6e8ca57f7454cfaa6aa7f6e2b8c4dc34fa8 100644 --- a/coders/webp.c +++ b/coders/webp.c @@ -163,6 +163,19 @@ static inline uint32_t ReadWebPLSBWord( return(value); } +static inline void WriteWebPLSBWord(unsigned char *magick_restrict data, + const size_t value) +{ + unsigned char + *p; + + p=data; + *(p++)=(unsigned char) value; + *(p++)=(unsigned char) (value >> 8); + *(p++)=(unsigned char) (value >> 16); + *(p++)=(unsigned char) (value >> 24); +} + static MagickBooleanType IsWEBPImageLossless(const unsigned char *stream, const size_t length) { @@ -521,6 +534,7 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, status; size_t + blob_size, length; ssize_t @@ -566,8 +580,17 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, length=(size_t) (ReadWebPLSBWord(header+4)+8); if (length < 12) ThrowWEBPException(CorruptImageError,"CorruptImage"); - if ((MagickSizeType) length > GetBlobSize(image)) - ThrowWEBPException(CorruptImageError,"InsufficientImageDataInFile"); + blob_size=(size_t) GetBlobSize(image); + if (length > blob_size) + { + size_t + delta = length-blob_size; + + if ((delta != 12) && (delta != (12 + 8))) + ThrowWEBPException(CorruptImageError,"InsufficientImageDataInFile"); + length-=delta; + WriteWebPLSBWord(header+4,length-8); + } stream=(unsigned char *) AcquireQuantumMemory(length,sizeof(*stream)); if (stream == (unsigned char *) NULL) ThrowWEBPException(ResourceLimitError,"MemoryAllocationFailed"); @@ -1148,10 +1171,13 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, if (WebPConfigInit(&configure) == 0) ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile"); if (image->quality != UndefinedCompressionQuality) + { + configure.quality=(float) image->quality; #if WEBP_ENCODER_ABI_VERSION >= 0x020e configure.near_lossless=(float) image->quality; #endif - if (image->quality >= 100) + } + if (image->quality >= 100) configure.lossless=1; SetBooleanOption(image_info,"webp:lossless",&configure.lossless); value=GetImageOption(image_info,"webp:image-hint"); @@ -1176,8 +1202,7 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, &configure.alpha_compression); SetIntegerOption(image_info,"webp:alpha-filtering", &configure.alpha_filtering); - SetIntegerOption(image_info,"webp:alpha-quality", - &configure.alpha_quality); + SetIntegerOption(image_info,"webp:alpha-quality",&configure.alpha_quality); SetIntegerOption(image_info,"webp:filter-strength", &configure.filter_strength); SetIntegerOption(image_info,"webp:filter-sharpness", @@ -1213,15 +1238,38 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, ThrowWriterException(ResourceLimitError,"UnableToEncodeImageFile"); #if defined(MAGICKCORE_WEBPMUX_DELEGATE) { + Image + *next; + WebPData webp_data; memset(&webp_data,0,sizeof(webp_data)); - if ((image_info->adjoin != MagickFalse) && - (GetPreviousImageInList(image) == (Image *) NULL) && - (GetNextImageInList(image) != (Image *) NULL)) - status=WriteAnimatedWEBPImage(image_info,image,&configure,&webp_data, - &image->exception); + next=GetNextImageInList(image); + if ((next != (Image *) NULL) && (image_info->adjoin != MagickFalse)) + { + Image + *coalesce_image=(Image *) NULL;; + + while (next != (Image *) NULL) + { + if ((next->rows != image->rows) || (next->columns != image->columns)) + { + coalesce_image=CoalesceImages(image,&image->exception); + break; + } + next=GetNextImageInList(next); + } + if (coalesce_image != (Image *) NULL) + { + status=WriteAnimatedWEBPImage(image_info,coalesce_image,&configure, + &webp_data,&image->exception); + (void) DestroyImageList(coalesce_image); + } + else + status=WriteAnimatedWEBPImage(image_info,image,&configure,&webp_data, + &image->exception); + } else { WebPMemoryWriterInit(&writer); @@ -1249,7 +1297,8 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info, (void) WriteBlob(image,writer.size,writer.mem); WebPMemoryWriterClear(&writer); #endif - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } #endif diff --git a/coders/wpg.c b/coders/wpg.c index 77dc9d3a734088cd7eadce87e85cef02e4a8ff97..ed7f2f8017d0c6b942e850f740c5783cd1d2fed2 100644 --- a/coders/wpg.c +++ b/coders/wpg.c @@ -1105,6 +1105,8 @@ static Image *ReadWPGImage(const ImageInfo *image_info, assert(exception->signature == MagickCoreSignature); one=1; image=AcquireImage(image_info); + image->columns=0; + image->rows=0; image->depth=8; status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -1998,6 +2000,7 @@ static MagickBooleanType WriteWPGImage(const ImageInfo *image_info,Image *image) (void) WriteBlobLSBShort(image,offset & 0xffff); if (y < (ssize_t) image->rows) ThrowWriterException(CorruptImageError,"UnableToWriteImageData"); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; return(status); } diff --git a/coders/xbm.c b/coders/xbm.c index c367a2c3ea67911cf263cd5751d2a93cd613bfcd..da1958ac45b6df7af7e70d0913f380a2d19d4518 100644 --- a/coders/xbm.c +++ b/coders/xbm.c @@ -177,37 +177,37 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) Image *image; + IndexPacket + *indexes; + int c; + + long + height, + width; + MagickBooleanType status; - IndexPacket - *indexes; - - ssize_t - i, - x; + MagickOffsetType + offset; PixelPacket *q; - unsigned char - *p; - - long - height, - width; - short int hex_digits[256]; ssize_t + i, + x, y; unsigned char - *data; + *data, + *p; unsigned int bit, @@ -261,18 +261,20 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) Scan until hex digits. */ version=11; + offset=TellBlob(image); while (ReadBlobString(image,buffer) != (char *) NULL) { if (sscanf(buffer,"static short %1024s = {",name) == 1) version=10; + else if (sscanf(buffer,"static unsigned char %s = {",name) == 1) + version=11; + else if (sscanf(buffer,"static char %1024s = {",name) == 1) + version=11; else - if (sscanf(buffer,"static unsigned char %s = {",name) == 1) - version=11; - else - if (sscanf(buffer,"static char %1024s = {",name) == 1) - version=11; - else - continue; + { + offset=TellBlob(image); + continue; + } p=(unsigned char *) strrchr(name,'_'); if (p == (unsigned char *) NULL) p=(unsigned char *) name; @@ -306,6 +308,9 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) InheritException(exception,&image->exception); return(DestroyImageList(image)); } + p=(unsigned char *) strrchr(buffer,'{'); + if (p != (unsigned char *) NULL) + (void) SeekBlob(image,offset+((char *) p-buffer)+1,SEEK_SET); /* Initialize hex values. */ @@ -413,7 +418,10 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) } data=(unsigned char *) RelinquishMagickMemory(data); (void) SyncImage(image); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -449,6 +457,7 @@ ModuleExport size_t RegisterXBMImage(void) entry->decoder=(DecodeImageHandler *) ReadXBMImage; entry->encoder=(EncodeImageHandler *) WriteXBMImage; entry->magick=(IsImageFormatHandler *) IsXBM; + entry->seekable_stream=MagickTrue; entry->adjoin=MagickFalse; entry->description=ConstantString( "X Windows system bitmap (black and white)"); @@ -626,6 +635,7 @@ static MagickBooleanType WriteXBMImage(const ImageInfo *image_info,Image *image) } (void) CopyMagickString(buffer,"};\n",MaxTextExtent); (void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/xpm.c b/coders/xpm.c index 69a6a8c8534b711ddd4277bec55ea8c7ec59c0fb..e114bd4d4ff669263b296b35d2a13d30ef167051 100644 --- a/coders/xpm.c +++ b/coders/xpm.c @@ -325,7 +325,7 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception) continue; if ((*p == '}') && (*(p+1) == ';')) break; - p+=strlen(p); + p+=(ptrdiff_t) strlen(p); offset=p-xpm_buffer; if ((size_t) (offset+MaxTextExtent) < length) continue; @@ -511,7 +511,7 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image->storage_class == PseudoClass) SetPixelIndex(indexes+x,j); *r=image->colormap[j]; - p+=count; + p+=(ptrdiff_t) count; r++; } if (x < (ssize_t) image->columns) @@ -531,7 +531,10 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception) */ xpm_colors=DestroySplayTree(xpm_colors); xpm_buffer=DestroyString(xpm_buffer); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } @@ -946,8 +949,9 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info, } picon=DestroyImage(picon); (void) WriteBlobString(image,"};\n"); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } /* diff --git a/coders/xwd.c b/coders/xwd.c index f11addc35f0afedc55aaff195c0ac9525fbf4fc0..53902f11b9281835cebefbeb929d753f7fdde354 100644 --- a/coders/xwd.c +++ b/coders/xwd.c @@ -654,7 +654,10 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); } #endif diff --git a/coders/ycbcr.c b/coders/ycbcr.c index 41ff67044ca0e80ee233f5d4d327e6276cf877ae..44972593c19cc03b15a3fd357bb082cf01972d90 100644 --- a/coders/ycbcr.c +++ b/coders/ycbcr.c @@ -108,7 +108,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, *image; MagickBooleanType - status; + status = MagickTrue; MagickOffsetType scene; @@ -713,7 +713,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("Cb",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -785,7 +786,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("Cr",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -859,7 +861,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, } if (image->matte != MagickFalse) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("A",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -972,7 +975,8 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info, quantum_info=DestroyQuantumInfo(quantum_info); InheritException(exception,&canvas_image->exception); canvas_image=DestroyImage(canvas_image); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -1083,7 +1087,7 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info, *p; MagickBooleanType - status; + status = MagickTrue; MagickOffsetType scene; @@ -1324,7 +1328,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("Cb",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1347,7 +1352,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info, if (status == MagickFalse) break; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("Cr",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1372,7 +1378,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info, } if (quantum_type == RGBAQuantum) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("A",image->filename); status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode : AppendBinaryBlobMode,&image->exception); @@ -1417,6 +1424,7 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info, if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/coders/yuv.c b/coders/yuv.c index 86a89dd35ab3bc347b5f80e952e7b94e40634d3b..3c70a9ec263423874914fda73f79cade4af38760 100644 --- a/coders/yuv.c +++ b/coders/yuv.c @@ -271,14 +271,14 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) { SetPixelGreen(chroma_pixels,ScaleShortToQuantum(((*p) << 8) | *(p+1))); - p+=2; + p+=(ptrdiff_t) 2; } if (quantum == 1) SetPixelRed(q,ScaleCharToQuantum(*p++)); else { SetPixelRed(q,ScaleShortToQuantum(((*p) << 8) | *(p+1))); - p+=2; + p+=(ptrdiff_t) 2; } SetPixelGreen(q,0); SetPixelBlue(q,0); @@ -291,14 +291,14 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) { SetPixelBlue(chroma_pixels,ScaleShortToQuantum(((*p) << 8) | *(p+1))); - p+=2; + p+=(ptrdiff_t) 2; } if (quantum == 1) SetPixelRed(q,ScaleCharToQuantum(*p++)); else { SetPixelRed(q,ScaleShortToQuantum(((*p) << 8) | *(p+1))); - p+=2; + p+=(ptrdiff_t) 2; } chroma_pixels++; q++; @@ -329,7 +329,7 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) else { SetPixelRed(q,ScaleShortToQuantum(((*p) << 8) | *(p+1))); - p+=2; + p+=(ptrdiff_t) 2; } SetPixelGreen(q,0); SetPixelBlue(q,0); @@ -351,7 +351,8 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (interlace == PartitionInterlace) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("U",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -386,7 +387,7 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) else { SetPixelGreen(q,ScaleShortToQuantum(((*p) << 8) | *(p+1))); - p+=2; + p+=(ptrdiff_t) 2; } SetPixelBlue(q,0); q++; @@ -396,7 +397,8 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (interlace == PartitionInterlace) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("V",image->filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) @@ -428,7 +430,7 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) else { SetPixelBlue(q,ScaleShortToQuantum(((*p) << 8) | *(p+1))); - p+=2; + p+=(ptrdiff_t) 2; } q++; } @@ -504,7 +506,8 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) } while (count != 0); scanline=(unsigned char *) RelinquishMagickMemory(scanline); InheritException(exception,&image->exception); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) return(DestroyImageList(image)); return(GetFirstImageInList(image)); @@ -795,7 +798,8 @@ static MagickBooleanType WriteYUVImage(const ImageInfo *image_info,Image *image) */ if (interlace == PartitionInterlace) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("U",image->filename); status=OpenBlob(image_info,image,WriteBinaryBlobMode, &image->exception); @@ -829,7 +833,8 @@ static MagickBooleanType WriteYUVImage(const ImageInfo *image_info,Image *image) */ if (interlace == PartitionInterlace) { - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + break; AppendImageFormat("V",image->filename); status=OpenBlob(image_info,image,WriteBinaryBlobMode, &image->exception); @@ -869,6 +874,7 @@ static MagickBooleanType WriteYUVImage(const ImageInfo *image_info,Image *image) if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); - (void) CloseBlob(image); - return(MagickTrue); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; + return(status); } diff --git a/config/Makefile.am b/config/Makefile.am index 4664e6b5d976812173481ae25c0bfc100a31af82..839a82ba081995c6c0a4dfa3a05a28fb42585052 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -46,6 +46,7 @@ configlib_DATA = \ config/type-dejavu.xml \ config/type-ghostscript.xml \ config/type-urw-base35.xml \ + config/type-urw-base35-type1.xml \ config/type-windows.xml CONFIG_EXTRA_DIST = \ @@ -76,5 +77,6 @@ CONFIG_EXTRA_DIST = \ config/type-dejavu.xml.in \ config/type-ghostscript.xml.in \ config/type-urw-base35.xml.in \ + config/type-urw-base35-type1.xml.in \ config/type-windows.xml.in \ config/type.xml.in diff --git a/config/config.guess b/config/config.guess index c7f17e8fb9787eb359cce8caf87c5615c0494482..f9c22a043af4d7d7be84e047a97fcba1a4a3ca44 100755 --- a/config/config.guess +++ b/config/config.guess @@ -1,10 +1,10 @@ #!/usr/bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2022 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2022-05-25' +timestamp='2024-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] -Output the configuration name of the system \`$me' is run on. +Output the configuration name of the system '$me' is run on. Options: -h, --help print this help, then exit @@ -60,13 +60,13 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2022 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -102,8 +102,8 @@ GUESS= # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. +# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still +# use 'HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. @@ -155,6 +155,9 @@ Linux|GNU|GNU/*) set_cc_for_build cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else #include #if defined(__UCLIBC__) LIBC=uclibc @@ -162,6 +165,8 @@ Linux|GNU|GNU/*) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm #else #include /* First heuristic to detect musl libc. */ @@ -169,6 +174,7 @@ Linux|GNU|GNU/*) LIBC=musl #endif #endif + #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" @@ -459,7 +465,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in UNAME_RELEASE=`uname -v` ;; esac - # Japanese Language versions have a version number like `4.1.3-JL'. + # Japanese Language versions have a version number like '4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; @@ -904,7 +910,7 @@ EOF fi ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; @@ -966,11 +972,37 @@ EOF GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __ARM_EABI__ + #ifdef __ARM_PCS_VFP + ABI=eabihf + #else + ABI=eabi + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; + esac + fi + GUESS=$CPU-unknown-linux-$LIBCABI ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be @@ -1036,7 +1068,16 @@ EOF k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; - loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + kvx:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:cos:*:*) + GUESS=$UNAME_MACHINE-unknown-cos + ;; + kvx:mbr:*:*) + GUESS=$UNAME_MACHINE-unknown-mbr + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) @@ -1191,7 +1232,7 @@ EOF GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility + # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; @@ -1332,7 +1373,7 @@ EOF GUESS=ns32k-sni-sysv fi ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; @@ -1554,6 +1595,9 @@ EOF *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; + *:Ironclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad + ;; esac # Do we have a guess based on uname results? diff --git a/config/config.h.in b/config/config.h.in index a986374233d1df4602791b49b93781efc8a63a95..97bbf9bc3a37f7606b417841e2244b0d800797ce 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -67,10 +67,10 @@ /* Define if you have GVC library */ #undef GVC_DELEGATE -/* Define to 1 if you have the `acosh' function. */ +/* Define to 1 if you have the 'acosh' function. */ #undef HAVE_ACOSH -/* Define to 1 if you have the `aligned_malloc' function. */ +/* Define to 1 if you have the 'aligned_malloc' function. */ #undef HAVE_ALIGNED_MALLOC /* Define to 1 if you have the header file. */ @@ -79,37 +79,37 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H -/* Define to 1 if you have the `asinh' function. */ +/* Define to 1 if you have the 'asinh' function. */ #undef HAVE_ASINH -/* Define to 1 if you have the `atanh' function. */ +/* Define to 1 if you have the 'atanh' function. */ #undef HAVE_ATANH -/* Define to 1 if you have the `atexit' function. */ +/* Define to 1 if you have the 'atexit' function. */ #undef HAVE_ATEXIT -/* Define to 1 if you have the `atoll' function. */ +/* Define to 1 if you have the 'atoll' function. */ #undef HAVE_ATOLL /* define if bool is a built-in type */ #undef HAVE_BOOL -/* Define to 1 if you have the `cabs' function. */ +/* Define to 1 if you have the 'cabs' function. */ #undef HAVE_CABS -/* Define to 1 if you have the `carg' function. */ +/* Define to 1 if you have the 'carg' function. */ #undef HAVE_CARG -/* Define to 1 if you have the `cimag' function. */ +/* Define to 1 if you have the 'cimag' function. */ #undef HAVE_CIMAG -/* Define to 1 if you have the `clock' function. */ +/* Define to 1 if you have the 'clock' function. */ #undef HAVE_CLOCK -/* Define to 1 if you have the `clock_getres' function. */ +/* Define to 1 if you have the 'clock_getres' function. */ #undef HAVE_CLOCK_GETRES -/* Define to 1 if you have the `clock_gettime' function. */ +/* Define to 1 if you have the 'clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if clock_gettime supports CLOCK_REALTIME. */ @@ -121,56 +121,56 @@ /* Define to 1 if you have the header file. */ #undef HAVE_COMPLEX_H -/* Define to 1 if you have the `creal' function. */ +/* Define to 1 if you have the 'creal' function. */ #undef HAVE_CREAL -/* Define to 1 if you have the `ctime_r' function. */ +/* Define to 1 if you have the 'ctime_r' function. */ #undef HAVE_CTIME_R -/* Define to 1 if you have the declaration of `pread', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'pread', and to 0 if you don't. */ #undef HAVE_DECL_PREAD -/* Define to 1 if you have the declaration of `pwrite', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'pwrite', and to 0 if you don't. */ #undef HAVE_DECL_PWRITE -/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you +/* Define to 1 if you have the declaration of 'strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R -/* Define to 1 if you have the declaration of `strlcpy', and to 0 if you +/* Define to 1 if you have the declaration of 'strlcpy', and to 0 if you don't. */ #undef HAVE_DECL_STRLCPY -/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME -/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you +/* Define to 1 if you have the declaration of 'vsnprintf', and to 0 if you don't. */ #undef HAVE_DECL_VSNPRINTF -/* Define to 1 if you have the `directio' function. */ +/* Define to 1 if you have the 'directio' function. */ #undef HAVE_DIRECTIO -/* Define to 1 if you have the header file, and it defines `DIR'. +/* Define to 1 if you have the header file, and it defines 'DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H -/* Define to 1 if you have the `erf' function. */ +/* Define to 1 if you have the 'erf' function. */ #undef HAVE_ERF /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H -/* Define to 1 if you have the `execvp' function. */ +/* Define to 1 if you have the 'execvp' function. */ #undef HAVE_EXECVP -/* Define to 1 if you have the `fchmod' function. */ +/* Define to 1 if you have the 'fchmod' function. */ #undef HAVE_FCHMOD /* Define to 1 if you have the header file. */ @@ -179,76 +179,76 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H -/* Define to 1 if you have the `floor' function. */ +/* Define to 1 if you have the 'floor' function. */ #undef HAVE_FLOOR -/* Define to 1 if you have the `fork' function. */ +/* Define to 1 if you have the 'fork' function. */ #undef HAVE_FORK -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +/* Define to 1 if fseeko (and ftello) are declared in stdio.h. */ #undef HAVE_FSEEKO -/* Define to 1 if you have the `ftime' function. */ +/* Define to 1 if you have the 'ftime' function. */ #undef HAVE_FTIME -/* Define to 1 if you have the `ftruncate' function. */ +/* Define to 1 if you have the 'ftruncate' function. */ #undef HAVE_FTRUNCATE -/* Define to 1 if you have the `getcwd' function. */ +/* Define to 1 if you have the 'getcwd' function. */ #undef HAVE_GETCWD -/* Define to 1 if you have the `getc_unlocked' function. */ +/* Define to 1 if you have the 'getc_unlocked' function. */ #undef HAVE_GETC_UNLOCKED -/* Define to 1 if you have the `getdtablesize' function. */ +/* Define to 1 if you have the 'getdtablesize' function. */ #undef HAVE_GETDTABLESIZE -/* Define to 1 if you have the `getentropy' function. */ +/* Define to 1 if you have the 'getentropy' function. */ #undef HAVE_GETENTROPY -/* Define to 1 if you have the `getexecname' function. */ +/* Define to 1 if you have the 'getexecname' function. */ #undef HAVE_GETEXECNAME -/* Define to 1 if you have the `getpagesize' function. */ +/* Define to 1 if you have the 'getpagesize' function. */ #undef HAVE_GETPAGESIZE -/* Define to 1 if you have the `getpid' function. */ +/* Define to 1 if you have the 'getpid' function. */ #undef HAVE_GETPID -/* Define to 1 if you have the `getpwnam_r' function. */ +/* Define to 1 if you have the 'getpwnam_r' function. */ #undef HAVE_GETPWNAM_R -/* Define to 1 if you have the `getrlimit' function. */ +/* Define to 1 if you have the 'getrlimit' function. */ #undef HAVE_GETRLIMIT -/* Define to 1 if you have the `getrusage' function. */ +/* Define to 1 if you have the 'getrusage' function. */ #undef HAVE_GETRUSAGE -/* Define to 1 if you have the `gettimeofday' function. */ +/* Define to 1 if you have the 'gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY -/* Define to 1 if you have the `gmtime_r' function. */ +/* Define to 1 if you have the 'gmtime_r' function. */ #undef HAVE_GMTIME_R /* [Compile with hugepage support] */ #undef HAVE_HUGEPAGES -/* Define to 1 if the system has the type `intmax_t'. */ +/* Define to 1 if the system has the type 'intmax_t'. */ #undef HAVE_INTMAX_T -/* Define to 1 if the system has the type `intptr_t'. */ +/* Define to 1 if the system has the type 'intptr_t'. */ #undef HAVE_INTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the `isnan' function. */ +/* Define to 1 if you have the 'isnan' function. */ #undef HAVE_ISNAN -/* Define to 1 if you have the `j0' function. */ +/* Define to 1 if you have the 'j0' function. */ #undef HAVE_J0 -/* Define to 1 if you have the `j1' function. */ +/* Define to 1 if you have the 'j1' function. */ #undef HAVE_J1 /* Define if you have jemalloc memory allocation library */ @@ -260,7 +260,7 @@ /* Define if you have the header file. */ #undef HAVE_LCMS2_LCMS2_H -/* Define to 1 if you have the `gcov' library (-lgcov). */ +/* Define to 1 if you have the 'gcov' library (-lgcov). */ #undef HAVE_LIBGCOV /* Define to 1 if you have the header file. */ @@ -272,19 +272,19 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_UNISTD_H -/* Define to 1 if you have the `lltostr' function. */ +/* Define to 1 if you have the 'lltostr' function. */ #undef HAVE_LLTOSTR /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H -/* Define to 1 if you have the `localtime_r' function. */ +/* Define to 1 if you have the 'localtime_r' function. */ #undef HAVE_LOCALTIME_R -/* Define to 1 if the system has the type `long long int'. */ +/* Define to 1 if the system has the type 'long long int'. */ #undef HAVE_LONG_LONG_INT -/* Define to 1 if you have the `lstat' function. */ +/* Define to 1 if you have the 'lstat' function. */ #undef HAVE_LSTAT /* Define to 1 if you have the header file. */ @@ -299,28 +299,28 @@ /* Define to 1 if declares mbstate_t. */ #undef HAVE_MBSTATE_T -/* Define to 1 if you have the `memmove' function. */ +/* Define to 1 if you have the 'memmove' function. */ #undef HAVE_MEMMOVE -/* Define to 1 if you have the `memset' function. */ +/* Define to 1 if you have the 'memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file. */ #undef HAVE_MINIX_CONFIG_H -/* Define to 1 if you have the `mkdir' function. */ +/* Define to 1 if you have the 'mkdir' function. */ #undef HAVE_MKDIR -/* Define to 1 if you have the `mkstemp' function. */ +/* Define to 1 if you have the 'mkstemp' function. */ #undef HAVE_MKSTEMP -/* Define to 1 if you have a working `mmap' system call. */ +/* Define to 1 if you have a working 'mmap' system call. */ #undef HAVE_MMAP /* Define if you have the mtmalloc memory allocation library */ #undef HAVE_MTMALLOC -/* Define to 1 if you have the `munmap' function. */ +/* Define to 1 if you have the 'munmap' function. */ #undef HAVE_MUNMAP /* define if the compiler implements namespaces */ @@ -329,10 +329,10 @@ /* Define if g++ supports namespace std. */ #undef HAVE_NAMESPACE_STD -/* Define to 1 if you have the `nanosleep' function. */ +/* Define to 1 if you have the 'nanosleep' function. */ #undef HAVE_NANOSLEEP -/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* Define to 1 if you have the header file, and it defines 'DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ @@ -341,7 +341,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H -/* Define to 1 if you have the `newlocale' function. */ +/* Define to 1 if you have the 'newlocale' function. */ #undef HAVE_NEWLOCALE /* Define to 1 if you have the header file. */ @@ -350,34 +350,34 @@ /* Define to 1 if you have the header file. */ #undef HAVE_OS_H -/* Define to 1 if you have the `pclose' function. */ +/* Define to 1 if you have the 'pclose' function. */ #undef HAVE_PCLOSE -/* Define to 1 if you have the `poll' function. */ +/* Define to 1 if you have the 'poll' function. */ #undef HAVE_POLL -/* Define to 1 if you have the `popen' function. */ +/* Define to 1 if you have the 'popen' function. */ #undef HAVE_POPEN -/* Define to 1 if you have the `posix_fadvise' function. */ +/* Define to 1 if you have the 'posix_fadvise' function. */ #undef HAVE_POSIX_FADVISE -/* Define to 1 if you have the `posix_fallocate' function. */ +/* Define to 1 if you have the 'posix_fallocate' function. */ #undef HAVE_POSIX_FALLOCATE -/* Define to 1 if you have the `posix_madvise' function. */ +/* Define to 1 if you have the 'posix_madvise' function. */ #undef HAVE_POSIX_MADVISE -/* Define to 1 if you have the `posix_memalign' function. */ +/* Define to 1 if you have the 'posix_memalign' function. */ #undef HAVE_POSIX_MEMALIGN -/* Define to 1 if you have the `posix_spawnp' function. */ +/* Define to 1 if you have the 'posix_spawnp' function. */ #undef HAVE_POSIX_SPAWNP -/* Define to 1 if you have the `pow' function. */ +/* Define to 1 if you have the 'pow' function. */ #undef HAVE_POW -/* Define to 1 if you have the `pread' function. */ +/* Define to 1 if you have the 'pread' function. */ #undef HAVE_PREAD /* Define to 1 if you have the header file. */ @@ -389,40 +389,40 @@ /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT -/* Define to 1 if you have the `putenv' function. */ +/* Define to 1 if you have the 'putenv' function. */ #undef HAVE_PUTENV -/* Define to 1 if you have the `pwrite' function. */ +/* Define to 1 if you have the 'pwrite' function. */ #undef HAVE_PWRITE -/* Define to 1 if you have the `qsort_r' function. */ +/* Define to 1 if you have the 'qsort_r' function. */ #undef HAVE_QSORT_R -/* Define to 1 if you have the `raise' function. */ +/* Define to 1 if you have the 'raise' function. */ #undef HAVE_RAISE -/* Define to 1 if you have the `rand_r' function. */ +/* Define to 1 if you have the 'rand_r' function. */ #undef HAVE_RAND_R -/* Define to 1 if you have the `readlink' function. */ +/* Define to 1 if you have the 'readlink' function. */ #undef HAVE_READLINK -/* Define to 1 if you have the `realpath' function. */ +/* Define to 1 if you have the 'realpath' function. */ #undef HAVE_REALPATH -/* Define to 1 if you have the `seekdir' function. */ +/* Define to 1 if you have the 'seekdir' function. */ #undef HAVE_SEEKDIR -/* Define to 1 if you have the `select' function. */ +/* Define to 1 if you have the 'select' function. */ #undef HAVE_SELECT -/* Define to 1 if you have the `sendfile' function. */ +/* Define to 1 if you have the 'sendfile' function. */ #undef HAVE_SENDFILE -/* Define to 1 if you have the `setlocale' function. */ +/* Define to 1 if you have the 'setlocale' function. */ #undef HAVE_SETLOCALE -/* Define to 1 if you have the `setvbuf' function. */ +/* Define to 1 if you have the 'setvbuf' function. */ #undef HAVE_SETVBUF /* X11 server supports shape extension */ @@ -431,22 +431,22 @@ /* X11 server supports shared memory extension */ #undef HAVE_SHARED_MEMORY -/* Define to 1 if you have the `sigaction' function. */ +/* Define to 1 if you have the 'sigaction' function. */ #undef HAVE_SIGACTION -/* Define to 1 if you have the `sigemptyset' function. */ +/* Define to 1 if you have the 'sigemptyset' function. */ #undef HAVE_SIGEMPTYSET -/* Define to 1 if you have the `socket' function. */ +/* Define to 1 if you have the 'socket' function. */ #undef HAVE_SOCKET -/* Define to 1 if you have the `spawnvp' function. */ +/* Define to 1 if you have the 'spawnvp' function. */ #undef HAVE_SPAWNVP -/* Define to 1 if you have the `sqrt' function. */ +/* Define to 1 if you have the 'sqrt' function. */ #undef HAVE_SQRT -/* Define to 1 if you have the `stat' function. */ +/* Define to 1 if you have the 'stat' function. */ #undef HAVE_STAT /* Define to 1 if you have the header file. */ @@ -467,25 +467,25 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H -/* Define to 1 if you have the `strcasecmp' function. */ +/* Define to 1 if you have the 'strcasecmp' function. */ #undef HAVE_STRCASECMP -/* Define to 1 if you have the `strcasestr' function. */ +/* Define to 1 if you have the 'strcasestr' function. */ #undef HAVE_STRCASESTR -/* Define to 1 if you have the `strchr' function. */ +/* Define to 1 if you have the 'strchr' function. */ #undef HAVE_STRCHR -/* Define to 1 if you have the `strcspn' function. */ +/* Define to 1 if you have the 'strcspn' function. */ #undef HAVE_STRCSPN -/* Define to 1 if you have the `strdup' function. */ +/* Define to 1 if you have the 'strdup' function. */ #undef HAVE_STRDUP -/* Define to 1 if you have the `strerror' function. */ +/* Define to 1 if you have the 'strerror' function. */ #undef HAVE_STRERROR -/* Define if you have `strerror_r'. */ +/* Define if you have 'strerror_r'. */ #undef HAVE_STRERROR_R /* Define to 1 if cpp supports the ANSI # stringizing operator. */ @@ -497,55 +497,55 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the `strlcat' function. */ +/* Define to 1 if you have the 'strlcat' function. */ #undef HAVE_STRLCAT -/* Define to 1 if you have the `strlcpy' function. */ +/* Define to 1 if you have the 'strlcpy' function. */ #undef HAVE_STRLCPY -/* Define to 1 if you have the `strncasecmp' function. */ +/* Define to 1 if you have the 'strncasecmp' function. */ #undef HAVE_STRNCASECMP -/* Define to 1 if you have the `strpbrk' function. */ +/* Define to 1 if you have the 'strpbrk' function. */ #undef HAVE_STRPBRK -/* Define to 1 if you have the `strrchr' function. */ +/* Define to 1 if you have the 'strrchr' function. */ #undef HAVE_STRRCHR -/* Define to 1 if you have the `strspn' function. */ +/* Define to 1 if you have the 'strspn' function. */ #undef HAVE_STRSPN -/* Define to 1 if you have the `strstr' function. */ +/* Define to 1 if you have the 'strstr' function. */ #undef HAVE_STRSTR -/* Define to 1 if you have the `strtod' function. */ +/* Define to 1 if you have the 'strtod' function. */ #undef HAVE_STRTOD -/* Define to 1 if you have the `strtod_l' function. */ +/* Define to 1 if you have the 'strtod_l' function. */ #undef HAVE_STRTOD_L -/* Define to 1 if you have the `strtol' function. */ +/* Define to 1 if you have the 'strtol' function. */ #undef HAVE_STRTOL -/* Define to 1 if you have the `strtoul' function. */ +/* Define to 1 if you have the 'strtoul' function. */ #undef HAVE_STRTOUL -/* Define to 1 if `tm_zone' is a member of `struct tm'. */ +/* Define to 1 if 'tm_zone' is a member of 'struct tm'. */ #undef HAVE_STRUCT_TM_TM_ZONE /* Define to 1 if you have the header file. */ #undef HAVE_SUN_PREFETCH_H -/* Define to 1 if you have the `symlink' function. */ +/* Define to 1 if you have the 'symlink' function. */ #undef HAVE_SYMLINK -/* Define to 1 if you have the `sysconf' function. */ +/* Define to 1 if you have the 'sysconf' function. */ #undef HAVE_SYSCONF -/* Define to 1 if you have the `system' function. */ +/* Define to 1 if you have the 'system' function. */ #undef HAVE_SYSTEM -/* Define to 1 if you have the header file, and it defines `DIR'. +/* Define to 1 if you have the header file, and it defines 'DIR'. */ #undef HAVE_SYS_DIR_H @@ -555,7 +555,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H -/* Define to 1 if you have the header file, and it defines `DIR'. +/* Define to 1 if you have the header file, and it defines 'DIR'. */ #undef HAVE_SYS_NDIR_H @@ -595,60 +595,30 @@ /* Define if you have the tcmalloc memory allocation library */ #undef HAVE_TCMALLOC -/* Define to 1 if you have the `telldir' function. */ +/* Define to 1 if you have the 'telldir' function. */ #undef HAVE_TELLDIR -/* Define to 1 if you have the `tempnam' function. */ +/* Define to 1 if you have the 'tempnam' function. */ #undef HAVE_TEMPNAM -/* Define to 1 if you have the header file. */ -#undef HAVE_TIFFCONF_H - -/* Define to 1 if you have the `TIFFIsBigEndian' function. */ -#undef HAVE_TIFFISBIGENDIAN - -/* Define to 1 if you have the `TIFFIsCODECConfigured' function. */ -#undef HAVE_TIFFISCODECCONFIGURED - -/* Define to 1 if you have the `TIFFMergeFieldInfo' function. */ -#undef HAVE_TIFFMERGEFIELDINFO - -/* Define to 1 if you have the `TIFFReadEXIFDirectory' function. */ -#undef HAVE_TIFFREADEXIFDIRECTORY - -/* Define to 1 if you have the `TIFFReadGPSDirectory' function. */ -#undef HAVE_TIFFREADGPSDIRECTORY - -/* Define to 1 if you have the `TIFFSetErrorHandlerExt' function. */ -#undef HAVE_TIFFSETERRORHANDLEREXT - -/* Define to 1 if you have the `TIFFSetTagExtender' function. */ -#undef HAVE_TIFFSETTAGEXTENDER - -/* Define to 1 if you have the `TIFFSetWarningHandlerExt' function. */ -#undef HAVE_TIFFSETWARNINGHANDLEREXT - -/* Define to 1 if you have the `TIFFSwabArrayOfTriples' function. */ -#undef HAVE_TIFFSWABARRAYOFTRIPLES - -/* Define to 1 if you have the `times' function. */ +/* Define to 1 if you have the 'times' function. */ #undef HAVE_TIMES -/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use - `HAVE_STRUCT_TM_TM_ZONE' instead. */ +/* Define to 1 if your 'struct tm' has 'tm_zone'. Deprecated, use + 'HAVE_STRUCT_TM_TM_ZONE' instead. */ #undef HAVE_TM_ZONE -/* Define to 1 if you don't have `tm_zone' but do have the external array - `tzname'. */ +/* Define to 1 if you don't have 'tm_zone' but do have the external array + 'tzname'. */ #undef HAVE_TZNAME -/* Define to 1 if the system has the type `uintmax_t'. */ +/* Define to 1 if the system has the type 'uintmax_t'. */ #undef HAVE_UINTMAX_T -/* Define to 1 if the system has the type `uintptr_t'. */ +/* Define to 1 if the system has the type 'uintptr_t'. */ #undef HAVE_UINTPTR_T -/* Define to 1 if you have the `ulltostr' function. */ +/* Define to 1 if you have the 'ulltostr' function. */ #undef HAVE_ULLTOSTR /* Define if you have umem memory allocation library */ @@ -657,37 +627,37 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if the system has the type `unsigned long long int'. */ +/* Define to 1 if the system has the type 'unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT -/* Define to 1 if you have the `uselocale' function. */ +/* Define to 1 if you have the 'uselocale' function. */ #undef HAVE_USELOCALE -/* Define to 1 if you have the `usleep' function. */ +/* Define to 1 if you have the 'usleep' function. */ #undef HAVE_USLEEP -/* Define to 1 if you have the `utime' function. */ +/* Define to 1 if you have the 'utime' function. */ #undef HAVE_UTIME /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H -/* Define to 1 if you have the `vfprintf' function. */ +/* Define to 1 if you have the 'vfprintf' function. */ #undef HAVE_VFPRINTF -/* Define to 1 if you have the `vfprintf_l' function. */ +/* Define to 1 if you have the 'vfprintf_l' function. */ #undef HAVE_VFPRINTF_L -/* Define to 1 if you have the `vsnprintf' function. */ +/* Define to 1 if you have the 'vsnprintf' function. */ #undef HAVE_VSNPRINTF -/* Define to 1 if you have the `vsnprintf_l' function. */ +/* Define to 1 if you have the 'vsnprintf_l' function. */ #undef HAVE_VSNPRINTF_L -/* Define to 1 if you have the `vsprintf' function. */ +/* Define to 1 if you have the 'vsprintf' function. */ #undef HAVE_VSPRINTF -/* Define to 1 if you have the `waitpid' function. */ +/* Define to 1 if you have the 'waitpid' function. */ #undef HAVE_WAITPID /* Define to 1 if you have the header file. */ @@ -696,28 +666,28 @@ /* Define to 1 if you have the header file. */ #undef HAVE_XLOCALE_H -/* Define to 1 if you have the `_aligned_malloc' function. */ +/* Define to 1 if you have the '_aligned_malloc' function. */ #undef HAVE__ALIGNED_MALLOC -/* Define to 1 if the system has the type `_Bool'. */ +/* Define to 1 if the system has the type '_Bool'. */ #undef HAVE__BOOL -/* Define to 1 if you have the `_exit' function. */ +/* Define to 1 if you have the '_exit' function. */ #undef HAVE__EXIT -/* Define to 1 if you have the `_NSGetExecutablePath' function. */ +/* Define to 1 if you have the '_NSGetExecutablePath' function. */ #undef HAVE__NSGETEXECUTABLEPATH -/* Define to 1 if you have the `_pclose' function. */ +/* Define to 1 if you have the '_pclose' function. */ #undef HAVE__PCLOSE -/* Define to 1 if you have the `_popen' function. */ +/* Define to 1 if you have the '_popen' function. */ #undef HAVE__POPEN -/* Define to 1 if you have the `_wfopen' function. */ +/* Define to 1 if you have the '_wfopen' function. */ #undef HAVE__WFOPEN -/* Define to 1 if you have the `_wstat' function. */ +/* Define to 1 if you have the '_wstat' function. */ #undef HAVE__WSTAT /* define if your compiler has __attribute__ */ @@ -751,7 +721,7 @@ #undef LIBOPENJP2_DELEGATE /* Directory where architecture-dependent files live. */ -#undef LIBRARY_PATH +#undef LIBRARY_ABSOLUTE_PATH /* Subdirectory of lib where ImageMagick architecture dependent files are installed. */ @@ -872,31 +842,34 @@ live. */ #undef SHARE_RELATIVE_PATH -/* The size of `double', as computed by sizeof. */ +/* The size of 'double', as computed by sizeof. */ #undef SIZEOF_DOUBLE -/* The size of `double_t', as computed by sizeof. */ +/* The size of 'double_t', as computed by sizeof. */ #undef SIZEOF_DOUBLE_T -/* The size of `float', as computed by sizeof. */ +/* The size of 'float', as computed by sizeof. */ #undef SIZEOF_FLOAT -/* The size of `float_t', as computed by sizeof. */ +/* The size of 'float_t', as computed by sizeof. */ #undef SIZEOF_FLOAT_T -/* The size of `long double', as computed by sizeof. */ +/* The size of 'long double', as computed by sizeof. */ #undef SIZEOF_LONG_DOUBLE -/* The size of `unsigned long long', as computed by sizeof. */ +/* The size of 'size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T + +/* The size of 'unsigned long long', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_LONG_LONG -/* The size of `void *', as computed by sizeof. */ +/* The size of 'void *', as computed by sizeof. */ #undef SIZEOF_VOID_P -/* Define to 1 if the `S_IS*' macros in do not work properly. */ +/* Define to 1 if the 'S_IS*' macros in do not work properly. */ #undef STAT_MACROS_BROKEN -/* Define to 1 if all of the C90 standard headers exist (not just the ones +/* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS @@ -910,10 +883,10 @@ /* Define if you have TIFF library */ #undef TIFF_DELEGATE -/* Define to 1 if your declares `struct tm'. */ +/* Define to 1 if your declares 'struct tm'. */ #undef TM_IN_SYS_TIME -/* Enable extensions on AIX 3, Interix. */ +/* Enable extensions on AIX, Interix, z/OS. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif @@ -974,11 +947,15 @@ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif +/* Enable extensions specified by C23 Annex F. */ +#ifndef __STDC_WANT_IEC_60559_EXT__ +# undef __STDC_WANT_IEC_60559_EXT__ +#endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif -/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif @@ -1055,12 +1032,15 @@ /* enable run-time bounds-checking */ #undef _FORTIFY_SOURCE -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* Define to 1 if necessary to make fseeko visible. */ #undef _LARGEFILE_SOURCE -/* Define for large files, on AIX-style hosts. */ +/* Define to 1 on platforms where this makes off_t a 64-bit type. */ #undef _LARGE_FILES +/* Number of bits in time_t, on hosts where this is settable. */ +#undef _TIME_BITS + /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ @@ -1076,22 +1056,25 @@ #define below would cause a syntax error. */ #undef _UINT8_T -/* Define to 1 if type `char' is unsigned and your compiler does not +/* Define to 1 if type 'char' is unsigned and your compiler does not predefine this macro. */ #ifndef __CHAR_UNSIGNED__ # undef __CHAR_UNSIGNED__ #endif +/* Define to 1 on platforms where this makes time_t a 64-bit type. */ +#undef __MINGW_USE_VC2005_COMPAT + /* Define to appropriate substitute if compiler does not have __func__ */ #undef __func__ -/* Define to empty if `const' does not conform to ANSI C. */ +/* Define to empty if 'const' does not conform to ANSI C. */ #undef const -/* Define to `int' if doesn't define. */ +/* Define as 'int' if doesn't define. */ #undef gid_t -/* Define to `__inline__' or `__inline' if that's what the C compiler +/* Define to '__inline__' or '__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline @@ -1124,10 +1107,10 @@ /* Define to a type if does not define. */ #undef mbstate_t -/* Define to `int' if does not define. */ +/* Define to 'int' if does not define. */ #undef mode_t -/* Define to `long int' if does not define. */ +/* Define to 'long int' if does not define. */ #undef off_t /* Define as a signed integer type capable of holding a process identifier. */ @@ -1148,13 +1131,13 @@ # define __restrict__ #endif -/* Define to `unsigned int' if does not define. */ +/* Define as 'unsigned int' if doesn't define. */ #undef size_t -/* Define to `int' if does not define. */ +/* Define as 'int' if doesn't define. */ #undef ssize_t -/* Define to `int' if doesn't define. */ +/* Define as 'int' if doesn't define. */ #undef uid_t /* Define to the type of an unsigned integer type of width exactly 16 bits if @@ -1181,6 +1164,6 @@ pointer, if such a type exists, and if the system does not define it. */ #undef uintptr_t -/* Define to empty if the keyword `volatile' does not work. Warning: valid - code using `volatile' can become incorrect without. Disable with care. */ +/* Define to empty if the keyword 'volatile' does not work. Warning: valid + code using 'volatile' can become incorrect without. Disable with care. */ #undef volatile diff --git a/config/config.sub b/config/config.sub index b41da55df458bdec628586bfd8daee9ad321163b..df5f563de2f25e733e995b7f67912ef3e8889f68 100755 --- a/config/config.sub +++ b/config/config.sub @@ -1,10 +1,10 @@ #!/usr/bin/sh # Configuration validation subroutine script. -# Copyright 1992-2022 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2022-01-03' +timestamp='2024-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -76,13 +76,13 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2022 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -130,7 +130,7 @@ IFS=$saved_IFS # Separate into logical components for further validation case $1 in *-*-*-*-*) - echo Invalid configuration \`"$1"\': more than four components >&2 + echo "Invalid configuration '$1': more than four components" >&2 exit 1 ;; *-*-*-*) @@ -145,7 +145,8 @@ case $1 in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) + | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \ + | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; @@ -943,7 +944,7 @@ $basic_machine EOF IFS=$saved_IFS ;; - # We use `pc' rather than `unknown' + # We use 'pc' rather than 'unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) @@ -1075,7 +1076,7 @@ case $cpu-$vendor in pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) cpu=i586 ;; - pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) + pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*) cpu=i686 ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) @@ -1180,7 +1181,7 @@ case $cpu-$vendor in case $cpu in 1750a | 580 \ | a29k \ - | aarch64 | aarch64_be \ + | aarch64 | aarch64_be | aarch64c | arm64ec \ | abacus \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ @@ -1199,50 +1200,29 @@ case $cpu-$vendor in | d10v | d30v | dlx | dsp16xx \ | e2k | elxsi | epiphany \ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | javascript \ | h8300 | h8500 \ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i*86 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ + | kvx \ | le32 | le64 \ | lm32 \ - | loongarch32 | loongarch64 | loongarchx32 \ + | loongarch32 | loongarch64 \ | m32c | m32r | m32rle \ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ | m88110 | m88k | maxq | mb | mcore | mep | metag \ | microblaze | microblazeel \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64eb | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r3 | mipsisa32r3el \ - | mipsisa32r5 | mipsisa32r5el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r3 | mipsisa64r3el \ - | mipsisa64r5 | mipsisa64r5el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ + | mips* \ | mmix \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ + | nanomips* \ | nds32 | nds32le | nds32be \ | nfp \ | nios | nios2 | nios2eb | nios2el \ @@ -1274,6 +1254,7 @@ case $cpu-$vendor in | ubicom32 \ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ | vax \ + | vc4 \ | visium \ | w65 \ | wasm32 | wasm64 \ @@ -1285,7 +1266,7 @@ case $cpu-$vendor in ;; *) - echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2 exit 1 ;; esac @@ -1306,11 +1287,12 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if test x$basic_os != x +if test x"$basic_os" != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. +obj= case $basic_os in gnu/linux*) kernel=linux @@ -1341,6 +1323,10 @@ EOF kernel=linux os=`echo "$basic_os" | sed -e 's|linux|gnu|'` ;; + managarm*) + kernel=managarm + os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'` + ;; *) kernel= os=$basic_os @@ -1506,10 +1492,16 @@ case $os in os=eabi ;; *) - os=elf + os= + obj=elf ;; esac ;; + aout* | coff* | elf* | pe*) + # These are machine code file formats, not OSes + obj=$os + os= + ;; *) # No normalization, but not necessarily accepted, that comes below. ;; @@ -1528,12 +1520,15 @@ else # system, and we'll never get to this point. kernel= +obj= case $cpu-$vendor in score-*) - os=elf + os= + obj=elf ;; spu-*) - os=elf + os= + obj=elf ;; *-acorn) os=riscix1.2 @@ -1543,28 +1538,35 @@ case $cpu-$vendor in os=gnu ;; arm*-semi) - os=aout + os= + obj=aout ;; c4x-* | tic4x-*) - os=coff + os= + obj=coff ;; c8051-*) - os=elf + os= + obj=elf ;; clipper-intergraph) os=clix ;; hexagon-*) - os=elf + os= + obj=elf ;; tic54x-*) - os=coff + os= + obj=coff ;; tic55x-*) - os=coff + os= + obj=coff ;; tic6x-*) - os=coff + os= + obj=coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1586,19 +1588,24 @@ case $cpu-$vendor in os=sunos3 ;; m68*-cisco) - os=aout + os= + obj=aout ;; mep-*) - os=elf + os= + obj=elf ;; mips*-cisco) - os=elf + os= + obj=elf ;; - mips*-*) - os=elf + mips*-*|nanomips*-*) + os= + obj=elf ;; or32-*) - os=coff + os= + obj=coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=sysv3 @@ -1607,7 +1614,8 @@ case $cpu-$vendor in os=sunos4.1.1 ;; pru-*) - os=elf + os= + obj=elf ;; *-be) os=beos @@ -1688,10 +1696,12 @@ case $cpu-$vendor in os=uxpv ;; *-rom68k) - os=coff + os= + obj=coff ;; *-*bug) - os=coff + os= + obj=coff ;; *-apple) os=macos @@ -1709,10 +1719,11 @@ esac fi -# Now, validate our (potentially fixed-up) OS. +# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ). + case $os in # Sometimes we do "kernel-libc", so those need to count as OSes. - musl* | newlib* | relibc* | uclibc*) + llvm* | musl* | newlib* | relibc* | uclibc*) ;; # Likewise for "kernel-abi" eabi* | gnueabi*) @@ -1720,6 +1731,9 @@ case $os in # VxWorks passes extra cpu info in the 4th filed. simlinux | simwindows | spe) ;; + # See `case $cpu-$os` validation below + ghcjs) + ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. @@ -1728,7 +1742,7 @@ case $os in | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ | hiux* | abug | nacl* | netware* | windows* \ - | os9* | macos* | osx* | ios* \ + | os9* | macos* | osx* | ios* | tvos* | watchos* \ | mpw* | magic* | mmixware* | mon960* | lnews* \ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | aos* | aros* | cloudabi* | sortix* | twizzler* \ @@ -1737,11 +1751,11 @@ case $os in | mirbsd* | netbsd* | dicos* | openedition* | ose* \ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ - | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ - | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | bosx* | nextstep* | cxux* | oabi* \ + | ptx* | ecoff* | winnt* | domain* | vsta* \ | udi* | lites* | ieee* | go32* | aux* | hcos* \ | chorusrdb* | cegcc* | glidix* | serenity* \ - | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | cygwin* | msys* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | mint* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | interix* | uwin* | mks* | rhapsody* | darwin* \ @@ -1754,49 +1768,116 @@ case $os in | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ - | fiwix* ) + | fiwix* | mlibc* | cos* | mbr* | ironclad* ) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) # Don't forget version if it is 3.2v4 or newer. ;; + # This refers to builds using the UEFI calling convention + # (which depends on the architecture) and PE file format. + # Note that this is both a different calling convention and + # different file format than that of GNU-EFI + # (x86_64-w64-mingw32). + uefi) + ;; none) ;; + kernel* | msvc* ) + # Restricted further below + ;; + '') + if test x"$obj" = x + then + echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2 + fi + ;; + *) + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; *) - echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* ) +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- ) + ;; + uclinux-uclibc*- ) + ;; + managarm-mlibc*- | managarm-kernel*- ) ;; - uclinux-uclibc* ) + windows*-msvc*-) ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. - echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) + -kernel*- ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 + exit 1 ;; - vxworks-simlinux | vxworks-simwindows | vxworks-spe) + *-kernel*- ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + exit 1 ;; - nto-qnx*) + *-msvc*- ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 ;; - os2-emx) + kfreebsd*-gnu*- | kopensolaris*-gnu*-) + ;; + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) + ;; + nto-qnx*-) + ;; + os2-emx-) ;; - *-eabi* | *-gnueabi*) + *-eabi*- | *-gnueabi*-) ;; - -*) + none--*) + # None (no kernel, i.e. freestanding / bare metal), + # can be paired with an machine code file format + ;; + -*-) # Blank kernel with real OS is always fine. ;; - *-*) - echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac @@ -1879,7 +1960,7 @@ case $vendor in ;; esac -echo "$cpu-$vendor-${kernel:+$kernel-}$os" +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: diff --git a/config/configure.xml.in b/config/configure.xml.in index f3d6c060972385c73ee539d0b8410152ae04bc4d..222b6e31fb235033b201462afdd7f6bda83aca3c 100644 --- a/config/configure.xml.in +++ b/config/configure.xml.in @@ -27,11 +27,11 @@ - + - + diff --git a/config/delegates.xml.in b/config/delegates.xml.in index 77142c137b1c53fe9ca7656d0a8e655672919165..6a775ce0f20ff9e601a6396e3efc5209bf3c0e77 100644 --- a/config/delegates.xml.in +++ b/config/delegates.xml.in @@ -58,64 +58,72 @@ will it read any output image. --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/config/english.xml b/config/english.xml index 4abc829a22167f9fc05c4f0846e4090ac378935c..ec24a8516d71fde6404c5e2a049c6e9391dae33b 100644 --- a/config/english.xml +++ b/config/english.xml @@ -521,9 +521,6 @@ image size differs - - images too dissimilar - left and right image sizes differ @@ -550,6 +547,9 @@ associate profile with image, a source and destination color profile required for transform + + images too dissimilar + unable to transform colorspace @@ -692,7 +692,6 @@ missing required argument - missing an image filename @@ -1054,6 +1053,9 @@ pixel cache allocation failed + + time limit exceeded + too many exceptions @@ -1083,9 +1085,6 @@ - - time limit exceeded - unable to allocate dash pattern diff --git a/config/francais.xml b/config/francais.xml index f2dd8a5e78960a20216a79438745b91f7891b23a..2f8fb50c603a01fb67106a616dbdd9c8b1b94b26 100644 --- a/config/francais.xml +++ b/config/francais.xml @@ -531,9 +531,6 @@ différences dans la taille de l'image - - images too dissimilar - différences dans les tailles des images gauche et droite @@ -560,6 +557,9 @@ associate profile with image, a source and destination color profile required for transform + + images too dissimilar + impossible de colorimétrique la transformation @@ -689,7 +689,6 @@ manque argument obligatoire - nom de fichier d'image absent @@ -1042,6 +1041,9 @@ Échec allocation du cache pixel + + time limit exceeded + too many exceptions @@ -1071,9 +1073,6 @@ - - time limit exceeded - impossible d'allouer le motif de traits diff --git a/config/install-sh b/config/install-sh index ec298b53740270ce82b326c4c2deaa5dcdec4596..73cbd673adf98f1747a1e483f070462a086ccfd7 100755 --- a/config/install-sh +++ b/config/install-sh @@ -1,7 +1,7 @@ -#!/bin/sh +#!/usr/bin/sh # install - install a program, script, or datafile -scriptversion=2020-11-14.01; # UTC +scriptversion=2023-11-23.18; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -124,9 +124,9 @@ it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. -Email bug reports to bug-automake@gnu.org. -Automake home page: https://www.gnu.org/software/automake/ -" +Report bugs to . +GNU Automake home page: . +General help using GNU software: ." while test $# -ne 0; do case $1 in diff --git a/config/mime.xml b/config/mime.xml index 61f72281ff146e3096613d89f9ef3be95ab6d678..ff1b83b90b47eb20444432bc0ff09ec4898990af 100644 --- a/config/mime.xml +++ b/config/mime.xml @@ -763,7 +763,11 @@ + + + + @@ -775,7 +779,9 @@ - + + + diff --git a/config/policy-open.xml b/config/policy-open.xml index 88077d1355a6bddbf3d38f32a065e0dde5a81286..17cb250aa63a3f55efcdd84ab0cef81f09cb4bbf 100644 --- a/config/policy-open.xml +++ b/config/policy-open.xml @@ -85,8 +85,8 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/type-urw-base35.xml.in b/config/type-urw-base35.xml.in index a2a750019ab38c77dff42982fc8e39edd071e00b..c85d3aa0fadf982dcdc31602816d1ecf2448e968 100644 --- a/config/type-urw-base35.xml.in +++ b/config/type-urw-base35.xml.in @@ -1,5 +1,6 @@ - - + @@ -10,41 +11,40 @@ version CDATA #IMPLIED weight CDATA #REQUIRED> ]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configure b/configure index b3bede9c44f6fab3bf9893efeb931dcd07a15a5f..3561c0684a1cb913bbb1909b5dabfcba5b25bb6f 100755 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for ImageMagick 6.9.12-98. +# Generated by GNU Autoconf 2.72 for ImageMagick 6.9.13-25. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -17,7 +17,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -26,12 +25,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -103,7 +103,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -133,15 +133,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -149,12 +148,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -172,8 +172,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -195,14 +196,15 @@ test \$(( 1 + 1 )) = 2 || exit 1 if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -235,12 +237,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -262,7 +265,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -282,7 +285,8 @@ $0: manually run the script under such a shell if you do $0: have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -321,14 +325,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -397,11 +393,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -415,21 +412,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -503,6 +493,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -551,7 +543,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -563,9 +554,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -590,10 +581,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} @@ -621,8 +614,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ImageMagick' PACKAGE_TARNAME='ImageMagick' -PACKAGE_VERSION='6.9.12-98' -PACKAGE_STRING='ImageMagick 6.9.12-98' +PACKAGE_VERSION='6.9.13-25' +PACKAGE_STRING='ImageMagick 6.9.13-25' PACKAGE_BUGREPORT='https://github.com/ImageMagick/ImageMagick6/issues' PACKAGE_URL='https://legacy.imagemagick.org' @@ -660,6 +653,7 @@ ac_includes_default="\ ac_header_c_list= ac_func_c_list= +enable_year2038=no ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -713,6 +707,7 @@ TAR ShowImageDelegate type_include_files windows_font_dir +urw_base35_type1_font_dir urw_base35_font_dir ghostscript_font_dir dejavu_font_dir @@ -722,6 +717,8 @@ XPSDelegate WWWDecodeDelegate WebPEncodeDelegate WebPDecodeDelegate +VIDEOEncodeDelegate +VIDEODecodeDelegate TraceEncodeDelegate TextEncodeDelegate SVGDecodeDelegate @@ -731,9 +728,8 @@ PSDelegate PCLDelegate MVDelegate MrSIDDecodeDelegate -VIDEOEncodeDelegate -VIDEODecodeDelegate MogrifyDelegate +MKDIRDelegate LaunchDelegate LPRDelegate LPDelegate @@ -751,6 +747,7 @@ ConvertDelegate DVIDecodeDelegate DOCDecodeDelegate DNGDecodeDelegate +ClipboardDelegate BrowseDelegate BlenderDecodeDelegate BPGEncodeDelegate @@ -776,7 +773,7 @@ LIB_BIN_DIR_PATH LIB_BIN_DIR_RELATIVE_PATH LIB_BIN_DIR LIB_BIN_BASEDIRNAME -LIBRARY_PATH +LIBRARY_ABSOLUTE_PATH EXECUTABLE_PATH INCLUDEARCH_PATH INCLUDE_PATH @@ -797,9 +794,10 @@ WEBPMUX_LIBS WEBPMUX_CFLAGS WEBP_LIBS WEBP_CFLAGS -TIFF_LIBS TIFF_DELEGATE_FALSE TIFF_DELEGATE_TRUE +TIFF_LIBS +TIFF_CFLAGS CAIRO_DELEGATE_FALSE CAIRO_DELEGATE_TRUE RSVG_DELEGATE_FALSE @@ -844,9 +842,10 @@ LCMS_DELEGATE_FALSE LCMS_DELEGATE_TRUE LCMS2_LIBS LCMS2_CFLAGS -JPEG_LIBS JPEG_DELEGATE_FALSE JPEG_DELEGATE_TRUE +JPEG_LIBS +JPEG_CFLAGS JBIG_LIBS JBIG_DELEGATE_FALSE JBIG_DELEGATE_TRUE @@ -922,9 +921,10 @@ X_LIBS X_PRE_LIBS X_CFLAGS XMKMF -BZLIB_LIBS BZLIB_DELEGATE_FALSE BZLIB_DELEGATE_TRUE +BZLIB_LIBS +BZLIB_CFLAGS CCMALLOCDelegate UMEM_LIBS HAVE_UMEM_FALSE @@ -1200,7 +1200,6 @@ with_modules enable_delegate_build enable_deprecated enable_installed -enable_cipher enable_zero_configuration enable_hdri enable_pipes @@ -1261,11 +1260,14 @@ with_raw with_rsvg with_tiff with_urw_base35_font_dir +with_urw_base35_type1_font_dir with_webp with_windows_font_dir with_wmf with_xml enable_docs +enable_cipher +enable_year2038 ' ac_precious_vars='build_alias host_alias @@ -1284,6 +1286,8 @@ CXX CXXFLAGS CCC CXXCPP +BZLIB_CFLAGS +BZLIB_LIBS XMKMF ZLIB_CFLAGS ZLIB_LIBS @@ -1305,6 +1309,8 @@ GVC_CFLAGS GVC_LIBS HEIF_CFLAGS HEIF_LIBS +JPEG_CFLAGS +JPEG_LIBS LCMS2_CFLAGS LCMS2_LIBS LIBOPENJP2_CFLAGS @@ -1325,6 +1331,8 @@ RSVG_CFLAGS RSVG_LIBS CAIRO_SVG_CFLAGS CAIRO_SVG_LIBS +TIFF_CFLAGS +TIFF_LIBS WEBP_CFLAGS WEBP_LIBS WEBPMUX_CFLAGS @@ -1439,7 +1447,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1465,7 +1473,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1678,7 +1686,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1694,7 +1702,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1724,8 +1732,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1733,7 +1741,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1783,7 +1791,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1851,7 +1859,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1879,7 +1887,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ImageMagick 6.9.12-98 to adapt to many kinds of systems. +'configure' configures ImageMagick 6.9.13-25 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1893,11 +1901,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1905,10 +1913,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1955,7 +1963,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ImageMagick 6.9.12-98:";; + short | recursive ) echo "Configuration of ImageMagick 6.9.13-25:";; esac cat <<\_ACEOF @@ -1988,7 +1996,6 @@ Optional Features: --disable-deprecated exclude deprecated methods in MagickCore and MagickWand APIs --disable-installed Formally install ImageMagick under PREFIX - --disable-cipher disable enciphering and deciphering image pixels --enable-zero-configuration enable self-contained, embeddable, zero-configuration ImageMagick @@ -2009,6 +2016,8 @@ Optional Features: --enable-legacy-support install legacy command-line utilities (default disabled) --disable-assert turn off assertions --disable-docs disable building of documentation + --disable-cipher disable enciphering and deciphering image pixels + --enable-year2038 support timestamps after 2038 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -2087,7 +2096,9 @@ Optional Packages: --with-rsvg enable RSVG support --without-tiff disable TIFF support --with-urw-base35-font-dir=DIR - URW-base35 font directory + URW-base35 OTF font directory + --with-urw-base35-type1-font-dir=DIR + URW-base35 Type1 font directory --without-webp disable WEBP support --with-windows-font-dir=DIR Windows font directory @@ -2113,6 +2124,9 @@ Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor + BZLIB_CFLAGS + C compiler flags for BZLIB, overriding pkg-config + BZLIB_LIBS linker flags for BZLIB, overriding pkg-config XMKMF Path to xmkmf, Makefile generator for X Window System ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config ZLIB_LIBS linker flags for ZLIB, overriding pkg-config @@ -2145,6 +2159,8 @@ Some influential environment variables: GVC_LIBS linker flags for GVC, overriding pkg-config HEIF_CFLAGS C compiler flags for HEIF, overriding pkg-config HEIF_LIBS linker flags for HEIF, overriding pkg-config + JPEG_CFLAGS C compiler flags for JPEG, overriding pkg-config + JPEG_LIBS linker flags for JPEG, overriding pkg-config LCMS2_CFLAGS C compiler flags for LCMS2, overriding pkg-config LCMS2_LIBS linker flags for LCMS2, overriding pkg-config @@ -2174,6 +2190,8 @@ Some influential environment variables: C compiler flags for CAIRO_SVG, overriding pkg-config CAIRO_SVG_LIBS linker flags for CAIRO_SVG, overriding pkg-config + TIFF_CFLAGS C compiler flags for TIFF, overriding pkg-config + TIFF_LIBS linker flags for TIFF, overriding pkg-config WEBP_CFLAGS C compiler flags for WEBP, overriding pkg-config WEBP_LIBS linker flags for WEBP, overriding pkg-config WEBPMUX_CFLAGS @@ -2183,7 +2201,7 @@ Some influential environment variables: XML_CFLAGS C compiler flags for XML, overriding pkg-config XML_LIBS linker flags for XML, overriding pkg-config -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . @@ -2251,10 +2269,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ImageMagick configure 6.9.12-98 -generated by GNU Autoconf 2.71 +ImageMagick configure 6.9.13-25 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -2293,11 +2311,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -2316,8 +2335,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -2325,10 +2344,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2364,11 +2385,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -2405,12 +2427,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -2449,11 +2472,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -2465,6 +2489,60 @@ fi } # ac_fn_c_try_link +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in #( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + ;; +esac +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_check_decl + # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -2476,15 +2554,15 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ + which can conflict with char $2 (void); below. */ #include #undef $2 @@ -2495,7 +2573,7 @@ else $as_nop #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -2514,11 +2592,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2555,11 +2635,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -2593,11 +2674,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -2635,11 +2717,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -2663,8 +2746,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -2694,12 +2777,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - eval "$3=yes" +else case e in #( + e) eval "$3=yes" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2720,8 +2805,8 @@ printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int @@ -2737,8 +2822,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int @@ -2754,12 +2839,15 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" -else $as_nop - eval "$4=no" +else case e in #( + e) eval "$4=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2768,58 +2856,6 @@ printf "%s\n" "$ac_res" >&6; } } # ac_fn_c_check_member -# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR -# ------------------------------------------------------------------ -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. -ac_fn_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -printf %s "checking whether $as_decl_name is declared... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - eval ac_save_FLAGS=\$$6 - as_fn_append $6 " $5" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main (void) -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - eval $6=\$ac_save_FLAGS - -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_check_decl - # ac_fn_c_find_intX_t LINENO BITS VAR # ----------------------------------- # Finds a signed integer type with width BITS, setting cache variable VAR @@ -2832,8 +2868,8 @@ printf %s "checking for int$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ @@ -2874,12 +2910,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - case $ac_type in #( +else case e in #( + e) case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; +esac ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -2888,10 +2925,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : -else $as_nop - break +else case e in #( + e) break ;; +esac fi - done + done ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2912,8 +2951,8 @@ printf %s "checking for uint$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ @@ -2945,10 +2984,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : -else $as_nop - break +else case e in #( + e) break ;; +esac fi - done + done ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -3002,18 +3043,19 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid; break -else $as_nop - as_fn_arith $ac_mid + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -3048,20 +3090,23 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=$ac_mid; break -else $as_nop - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else $as_nop - ac_lo= ac_hi= +else case e in #( + e) ac_lo= ac_hi= ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. @@ -3084,8 +3129,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid -else $as_nop - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done @@ -3133,8 +3179,9 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : echo >>conftest.val; read $3 &6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -3167,10 +3214,12 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -3202,8 +3251,8 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ImageMagick $as_me 6.9.12-98, which was -generated by GNU Autoconf 2.71. Invocation command line was +It was created by ImageMagick $as_me 6.9.13-25, which was +generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -3449,10 +3498,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -3489,9 +3538,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -3505,6 +3552,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -3532,16 +3594,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -3591,7 +3656,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -3657,6 +3721,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -3678,7 +3744,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -4089,8 +4155,9 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac fi @@ -4118,12 +4185,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -4132,18 +4199,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -4159,11 +4226,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -4200,15 +4267,16 @@ printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias +else case e in #( + e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } @@ -4235,14 +4303,15 @@ printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then +else case e in #( + e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } @@ -4269,14 +4338,15 @@ printf %s "checking target system type... " >&6; } if test ${ac_cv_target+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$target_alias" = x; then +else case e in #( + e) if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 printf "%s\n" "$ac_cv_target" >&6; } @@ -4328,8 +4398,8 @@ if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -4383,7 +4453,8 @@ esac IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir - + ;; +esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install @@ -4479,7 +4550,7 @@ test "$program_prefix" != NONE && test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. -# By default was `s,x,x', remove it if useless. +# By default was 's,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` @@ -4522,8 +4593,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then +else case e in #( + e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4545,7 +4616,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then @@ -4567,8 +4639,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_STRIP"; then +else case e in #( + e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4590,7 +4662,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then @@ -4626,8 +4699,8 @@ if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS @@ -4641,7 +4714,7 @@ do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ - 'BusyBox '* | \ + *'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; @@ -4650,18 +4723,17 @@ do done done IFS=$as_save_IFS - + ;; +esac fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" + # As a last resort, use plain mkdir -p, + # in the hope it doesn't have the bugs of ancient mkdir. + MKDIR_P='mkdir -p' fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 @@ -4676,8 +4748,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AWK"; then +else case e in #( + e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4699,7 +4771,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then @@ -4721,8 +4794,8 @@ ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 -else $as_nop - cat >conftest.make <<\_ACEOF +else case e in #( + e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' @@ -4734,7 +4807,8 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make +rm -f conftest.make ;; +esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -4772,8 +4846,8 @@ printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 -else $as_nop - if printf "%s\n" 'TRUE=$(BAR$(V)) +else case e in #( + e) if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -4783,7 +4857,8 @@ am__doit: am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } @@ -4818,7 +4893,7 @@ fi # Define the identity of the package. PACKAGE='ImageMagick' - VERSION='6.9.12-98' + VERSION='6.9.13-25' # Some tools Automake needs. @@ -4965,8 +5040,9 @@ printf %s "checking how to create a ustar tar archive... " >&6; } if test ${am_cv_prog_tar_ustar+y} then : printf %s "(cached) " >&6 -else $as_nop - am_cv_prog_tar_ustar=$_am_tool +else case e in #( + e) am_cv_prog_tar_ustar=$_am_tool ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 @@ -5051,8 +5127,8 @@ printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 -else $as_nop - if printf "%s\n" 'TRUE=$(BAR$(V)) +else case e in #( + e) if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -5062,7 +5138,8 @@ am__doit: am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } @@ -5120,13 +5197,13 @@ MAGICK_MAJOR_VERSION=6 MAGICK_MINOR_VERSION=9 -MAGICK_MICRO_VERSION=12 +MAGICK_MICRO_VERSION=13 -MAGICK_PATCHLEVEL_VERSION=98 +MAGICK_PATCHLEVEL_VERSION=25 -MAGICK_VERSION=6.9.12-98 +MAGICK_VERSION=6.9.13-25 -MAGICK_GIT_REVISION=20231008 +MAGICK_GIT_REVISION=20250329 # Substitute library versioning @@ -5146,21 +5223,21 @@ MAGICKPP_LIBRARY_CURRENT_MIN=`expr $MAGICKPP_LIBRARY_CURRENT - $MAGICKPP_LIBRARY MAGICKPP_LIBRARY_VERSION_INFO=$MAGICKPP_LIBRARY_CURRENT:$MAGICKPP_LIBRARY_REVISION:$MAGICKPP_LIBRARY_AGE -PACKAGE_BASE_VERSION=6.9.12 +PACKAGE_BASE_VERSION=6.9.13 -PACKAGE_PATCHLEVEL_VERSION=98 +PACKAGE_PATCHLEVEL_VERSION=25 if test "n" = 'y'; then - PACKAGE_VERSION_ADDENDUM='-98 (Beta)' + PACKAGE_VERSION_ADDENDUM='-25 (Beta)' else - PACKAGE_VERSION_ADDENDUM=-98 + PACKAGE_VERSION_ADDENDUM=-25 fi -PACKAGE_LIB_VERSION=0x69C +PACKAGE_LIB_VERSION=0x69D -PACKAGE_LIB_VERSION_NUMBER=6,9,12,98 +PACKAGE_LIB_VERSION_NUMBER=6,9,13,25 -PACKAGE_RELEASE_DATE=2023-10-08 +PACKAGE_RELEASE_DATE=2025-03-29 # Ensure that make can run correctly @@ -5453,8 +5530,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5476,7 +5553,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -5498,8 +5576,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5521,7 +5599,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -5556,8 +5635,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5579,7 +5658,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -5601,8 +5681,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -5641,7 +5721,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -5665,8 +5746,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5688,7 +5769,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -5714,8 +5796,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5737,7 +5819,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -5775,8 +5858,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5798,7 +5881,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -5820,8 +5904,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5843,7 +5927,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -5872,10 +5957,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -5947,8 +6032,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -5968,7 +6053,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -5979,8 +6064,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -5989,13 +6075,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -6019,10 +6106,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -6032,11 +6119,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -6052,6 +6140,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -6091,26 +6181,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6142,16 +6233,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -6162,8 +6255,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6180,12 +6273,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -6203,8 +6298,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -6222,8 +6317,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6238,8 +6333,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6256,12 +6351,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -6288,8 +6386,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6306,25 +6404,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -6334,8 +6435,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6352,25 +6453,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -6380,8 +6484,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6398,25 +6502,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -6437,8 +6544,8 @@ printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6468,7 +6575,8 @@ _ACEOF fi done rm -f core conftest* - unset am_i + unset am_i ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } @@ -6494,8 +6602,8 @@ printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up @@ -6599,7 +6707,8 @@ else $as_nop else am_cv_CC_dependencies_compiler_type=none fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } @@ -6657,8 +6766,8 @@ printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test ${ac_cv_safe_to_define___extensions__+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 @@ -6674,10 +6783,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_safe_to_define___extensions__=yes -else $as_nop - ac_cv_safe_to_define___extensions__=no +else case e in #( + e) ac_cv_safe_to_define___extensions__=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } @@ -6687,8 +6798,8 @@ printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } if test ${ac_cv_should_define__xopen_source+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_should_define__xopen_source=no +else case e in #( + e) ac_cv_should_define__xopen_source=no if test $ac_cv_header_wchar_h = yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6707,8 +6818,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE 500 @@ -6726,10 +6837,12 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_should_define__xopen_source=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } @@ -6754,6 +6867,8 @@ printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + printf "%s\n" "#define __STDC_WANT_IEC_60559_EXT__ 1" >>confdefs.h + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h @@ -6773,8 +6888,9 @@ then : printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h -else $as_nop - MINIX= +else case e in #( + e) MINIX= ;; +esac fi if test $ac_cv_safe_to_define___extensions__ = yes then : @@ -6802,8 +6918,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then +else case e in #( + e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6825,7 +6941,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then @@ -6851,8 +6968,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then +else case e in #( + e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6874,7 +6991,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then @@ -6909,8 +7027,8 @@ printf %s "checking the archiver ($AR) interface... " >&6; } if test ${am_cv_ar_interface+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_ext=c +else case e in #( + e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -6953,7 +7071,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 printf "%s\n" "$am_cv_ar_interface" >&6; } @@ -6988,8 +7107,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7011,7 +7130,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -7033,8 +7153,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7056,7 +7176,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -7091,8 +7212,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7114,7 +7235,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -7136,8 +7258,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -7176,7 +7298,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -7200,8 +7323,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7223,7 +7346,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -7249,8 +7373,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7272,7 +7396,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -7310,8 +7435,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7333,7 +7458,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -7355,8 +7481,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7378,7 +7504,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -7407,10 +7534,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -7442,8 +7569,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -7460,12 +7587,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -7483,8 +7612,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -7502,8 +7631,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7518,8 +7647,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7536,12 +7665,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -7568,8 +7700,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7586,25 +7718,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -7614,8 +7749,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7632,25 +7767,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -7660,8 +7798,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7678,25 +7816,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -7717,8 +7858,8 @@ printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -7748,7 +7889,8 @@ _ACEOF fi done rm -f core conftest* - unset am_i + unset am_i ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } @@ -7774,8 +7916,8 @@ printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up @@ -7879,7 +8021,8 @@ else $as_nop else am_cv_CC_dependencies_compiler_type=none fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } @@ -7911,8 +8054,8 @@ if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded +else case e in #( + e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false @@ -7930,9 +8073,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -7946,15 +8090,16 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : @@ -7963,7 +8108,8 @@ fi done ac_cv_prog_CPP=$CPP - + ;; +esac fi CPP=$ac_cv_prog_CPP else @@ -7986,9 +8132,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -8002,24 +8149,26 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi ac_ext=c @@ -8033,8 +8182,8 @@ printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ +else case e in #( + e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done @@ -8059,9 +8208,10 @@ do as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in +case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -8096,7 +8246,8 @@ IFS=$as_save_IFS else ac_cv_path_SED=$SED fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } @@ -8121,8 +8272,8 @@ printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$GREP"; then +else case e in #( + e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8141,9 +8292,10 @@ do as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in +case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -8178,7 +8330,8 @@ IFS=$as_save_IFS else ac_cv_path_GREP=$GREP fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } @@ -8190,8 +8343,8 @@ printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 +else case e in #( + e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then @@ -8213,9 +8366,10 @@ do as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in +case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -8251,20 +8405,23 @@ else ac_cv_path_EGREP=$EGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" + EGREP_TRADITIONAL=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 +else case e in #( + e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then @@ -8286,9 +8443,10 @@ do as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in +case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -8324,7 +8482,8 @@ else ac_cv_path_FGREP=$FGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } @@ -8407,8 +8566,9 @@ esac if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else $as_nop - with_gnu_ld=no +else case e in #( + e) with_gnu_ld=no ;; +esac fi ac_prog=ld @@ -8453,8 +8613,8 @@ fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$LD"; then +else case e in #( + e) if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs @@ -8477,7 +8637,8 @@ else $as_nop IFS=$lt_save_ifs else lt_cv_path_LD=$LD # Let the user override the test with a path. -fi +fi ;; +esac fi LD=$lt_cv_path_LD @@ -8494,8 +8655,8 @@ printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 -else $as_nop - # I'd rather use --version here, but apparently some GNU lds only accept -v. +else case e in #( + e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 @@ -8524,8 +8686,8 @@ printf %s "checking for C compiler vendor... " >&6; } if test ${ax_cv_c_compiler_vendor+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) vendors=" intel: __ICC,__ECC,__INTEL_COMPILER ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ @@ -8586,7 +8748,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1` - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 printf "%s\n" "$ax_cv_c_compiler_vendor" >&6; } @@ -8606,8 +8769,8 @@ printf %s "checking CFLAGS for most reasonable warnings... " >&6; } if test ${ac_cv_cflags_warn_all+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ac_cv_cflags_warn_all="" ac_save_cflags_warn_all_found="yes" case "$ax_cv_c_compiler_vendor" in #( @@ -8696,23 +8859,26 @@ then : ;; esac -else $as_nop - +else case e in #( + e) CFLAGS=$ac_cv_cflags_warn_all { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - + ;; +esac fi fi -else $as_nop - true - -fi +else case e in #( + e) true + ;; +esac +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 printf "%s\n" "$ac_cv_cflags_warn_all" >&6; } @@ -8732,8 +8898,8 @@ ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 -else $as_nop - cat >conftest.make <<\_ACEOF +else case e in #( + e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' @@ -8745,7 +8911,8 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make +rm -f conftest.make ;; +esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -8773,8 +8940,8 @@ printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ +else case e in #( + e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done @@ -8799,9 +8966,10 @@ do as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in +case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -8836,7 +9004,8 @@ IFS=$as_save_IFS else ac_cv_path_SED=$SED fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } @@ -8852,8 +9021,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AWK"; then +else case e in #( + e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8875,7 +9044,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then @@ -8909,9 +9079,10 @@ else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi @@ -8921,8 +9092,8 @@ printf %s "checking for __attribute__... " >&6; } if test ${ax_cv___attribute__+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include static void foo(void) __attribute__ ((unused)); @@ -8942,12 +9113,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ax_cv___attribute__=yes -else $as_nop - ax_cv___attribute__=no - +else case e in #( + e) ax_cv___attribute__=no + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv___attribute__" >&5 printf "%s\n" "$ax_cv___attribute__" >&6; } @@ -8967,8 +9140,9 @@ printf "%s\n" "#define HAVE___ATTRIBUTE__ 1" >>confdefs.h if test ${with_gcc_arch+y} then : withval=$with_gcc_arch; ax_gcc_arch=$withval -else $as_nop - ax_gcc_arch=yes +else case e in #( + e) ax_gcc_arch=yes ;; +esac fi @@ -8979,8 +9153,8 @@ printf "%s\n" "" >&6; } if test ${ax_cv_gcc_archflag+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_cv_gcc_archflag="unknown" if test "$GCC" = yes; then @@ -9002,12 +9176,12 @@ printf %s "checking for x86 cpuid 0 output... " >&6; } if test ${ax_cv_gcc_x86_cpuid_0+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ax_cv_gcc_x86_cpuid_0=unknown -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -9034,13 +9208,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid -else $as_nop - ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid +else case e in #( + e) ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 printf "%s\n" "$ax_cv_gcc_x86_cpuid_0" >&6; } @@ -9064,12 +9241,12 @@ printf %s "checking for x86 cpuid 1 output... " >&6; } if test ${ax_cv_gcc_x86_cpuid_1+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ax_cv_gcc_x86_cpuid_1=unknown -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -9096,13 +9273,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid -else $as_nop - ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid +else case e in #( + e) ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_1" >&5 printf "%s\n" "$ax_cv_gcc_x86_cpuid_1" >&6; } @@ -9193,8 +9373,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PRTDIAG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $PRTDIAG in +else case e in #( + e) case $PRTDIAG in [\\/]* | ?:[\\/]*) ac_cv_path_PRTDIAG="$PRTDIAG" # Let the user override the test with a path. ;; @@ -9221,6 +9401,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_PRTDIAG" && ac_cv_path_PRTDIAG="prtdiag" ;; +esac ;; esac fi PRTDIAG=$ac_cv_path_PRTDIAG @@ -9314,14 +9495,14 @@ fi for flag_prefix in $flag_prefixes; do for arch in $ax_gcc_arch; do flag="$flag_prefix$arch" - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 printf %s "checking whether C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9338,11 +9519,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9354,8 +9537,9 @@ then : if test "x$flag" = "x-march=$arch"; then flag=-mtune=$arch; fi fi fi; ax_cv_gcc_archflag=$flag; break -else $as_nop - : +else case e in #( + e) : ;; +esac fi done @@ -9364,7 +9548,8 @@ done fi fi # $GCC=yes - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 @@ -9393,8 +9578,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKG_CONFIG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $PKG_CONFIG in +else case e in #( + e) case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; @@ -9419,6 +9604,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG @@ -9441,8 +9627,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_PKG_CONFIG in +else case e in #( + e) case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; @@ -9467,6 +9653,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG @@ -9515,8 +9702,8 @@ printf %s "checking for C compiler vendor... " >&6; } if test ${ax_cv_c_compiler_vendor+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) vendors=" intel: __ICC,__ECC,__INTEL_COMPILER ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ @@ -9577,7 +9764,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1` - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 printf "%s\n" "$ax_cv_c_compiler_vendor" >&6; } @@ -9598,14 +9786,14 @@ fi if test ${enable_ld_version_script+y} then : enableval=$enable_ld_version_script; have_ld_version_script=$enableval -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if LD -Wl,--version-script works" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if LD -Wl,--version-script works" >&5 printf %s "checking if LD -Wl,--version-script works... " >&6; } if test ${gl_cv_sys_ld_version_script+y} then : printf %s "(cached) " >&6 -else $as_nop - gl_cv_sys_ld_version_script=no +else case e in #( + e) gl_cv_sys_ld_version_script=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" echo foo >conftest.map @@ -9623,8 +9811,8 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : -else $as_nop - cat > conftest.map < conftest.map <&5 printf "%s\n" "$gl_cv_sys_ld_version_script" >&6; } - have_ld_version_script=$gl_cv_sys_ld_version_script + have_ld_version_script=$gl_cv_sys_ld_version_script ;; +esac fi if test "$have_ld_version_script" = yes; then @@ -9678,8 +9869,9 @@ fi if test ${enable_bounds_checking+y} then : enableval=$enable_bounds_checking; enable_bounds_checking=$enableval -else $as_nop - enable_bounds_checking='no' +else case e in #( + e) enable_bounds_checking='no' ;; +esac fi @@ -9755,8 +9947,8 @@ printf %s "checking for linker lazyload option... " >&6; } if test ${im_cv_ld_lazyload+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) im_cv_ld_lazyload='none' case "${host}" in *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? ) @@ -9765,7 +9957,8 @@ case "${host}" in fi ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $im_cv_ld_lazyload" >&5 printf "%s\n" "$im_cv_ld_lazyload" >&6; } @@ -9784,8 +9977,9 @@ case "$host" in if test ${enable_osx_universal_binary+y} then : enableval=$enable_osx_universal_binary; build_osxuniversal="${enableval}" -else $as_nop - build_osxuniversal=no +else case e in #( + e) build_osxuniversal=no ;; +esac fi @@ -9811,8 +10005,9 @@ esac if test ${with_includearch_dir+y} then : withval=$with_includearch_dir; includearch_dir=$withval -else $as_nop - includearch_dir=$INCLUDE_DIR +else case e in #( + e) includearch_dir=$INCLUDE_DIR ;; +esac fi @@ -9827,8 +10022,9 @@ eval "eval INCLUDEARCH_DIR=$includearch_dir" if test ${with_sharearch_dir+y} then : withval=$with_sharearch_dir; sharearch_dir=$withval -else $as_nop - sharearch_dir="${LIB_DIR}" +else case e in #( + e) sharearch_dir="${LIB_DIR}" ;; +esac fi @@ -9841,8 +10037,9 @@ eval "eval SHAREARCH_DIR=$sharearch_dir" if test ${with_pkgconfigdir+y} then : withval=$with_pkgconfigdir; pkgconfigdir="$withval" -else $as_nop - pkgconfigdir='${libdir}/pkgconfig' +else case e in #( + e) pkgconfigdir='${libdir}/pkgconfig' ;; +esac fi @@ -9855,8 +10052,9 @@ fi if test ${with_threads+y} then : withval=$with_threads; with_threads=$withval -else $as_nop - with_threads='yes' +else case e in #( + e) with_threads='yes' ;; +esac fi @@ -9864,6 +10062,140 @@ THREAD_LIBS='' have_threads=no if test "$with_threads" != 'no'; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 +printf %s "checking for egrep -e... " >&6; } +if test ${ac_cv_path_EGREP_TRADITIONAL+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + : + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + + if test "$ac_cv_path_EGREP_TRADITIONAL" +then : + ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 +printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } + EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL + @@ -9904,8 +10236,14 @@ printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char pthread_join (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (void); int main (void) { @@ -9999,7 +10337,7 @@ case $host_os in _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 + $EGREP_TRADITIONAL "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} @@ -10029,8 +10367,8 @@ printf %s "checking whether $CC is Clang... " >&6; } if test ${ax_cv_PTHREAD_CLANG+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_CLANG=no +else case e in #( + e) ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10042,14 +10380,15 @@ else $as_nop _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 + $EGREP_TRADITIONAL "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 then : ax_cv_PTHREAD_CLANG=yes fi rm -rf conftest* fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; } @@ -10079,7 +10418,7 @@ then : fi -# The presence of a feature test macro requesting reentrant function +# The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled @@ -10099,8 +10438,9 @@ esac if test "x$ax_pthread_check_macro" = "x--" then : ax_pthread_check_cond=0 -else $as_nop - ax_pthread_check_cond="!defined($ax_pthread_check_macro)" +else case e in #( + e) ax_pthread_check_cond="!defined($ax_pthread_check_macro)" ;; +esac fi @@ -10134,8 +10474,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ax_pthread_config+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ax_pthread_config"; then +else case e in #( + e) if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -10158,7 +10498,8 @@ done IFS=$as_save_IFS test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" -fi +fi ;; +esac fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then @@ -10291,8 +10632,8 @@ printf %s "checking whether Clang needs flag to prevent \"argument unused\" warn if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown +else case e in #( + e) ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second @@ -10338,7 +10679,8 @@ then : ax_pthread_try=no fi ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } @@ -10365,8 +10707,8 @@ printf %s "checking for joinable pthread attribute... " >&6; } if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_JOINABLE_ATTR=unknown +else case e in #( + e) ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10386,7 +10728,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } @@ -10406,14 +10749,15 @@ printf %s "checking whether more special flags are required for pthreads... " >& if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_SPECIAL_FLAGS=no +else case e in #( + e) ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } @@ -10429,8 +10773,8 @@ printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; } if test ${ax_cv_PTHREAD_PRIO_INHERIT+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -10445,12 +10789,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_PTHREAD_PRIO_INHERIT=yes -else $as_nop - ax_cv_PTHREAD_PRIO_INHERIT=no +else case e in #( + e) ax_cv_PTHREAD_PRIO_INHERIT=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } @@ -10500,8 +10846,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PTHREAD_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$PTHREAD_CC"; then +else case e in #( + e) if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -10523,7 +10869,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then @@ -10550,8 +10897,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PTHREAD_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$PTHREAD_CXX"; then +else case e in #( + e) if test -n "$PTHREAD_CXX"; then ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -10573,7 +10920,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX if test -n "$PTHREAD_CXX"; then @@ -10666,8 +11014,8 @@ printf %s "checking for $CC option to support OpenMP... " >&6; } if test ${ac_cv_prog_c_openmp+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_c_openmp='not found' +else case e in #( + e) ac_cv_prog_c_openmp='not found' for ac_option in '' -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \ -Popenmp --openmp; do @@ -10698,8 +11046,9 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_prog_c_openmp=$ac_option -else $as_nop - ac_cv_prog_c_openmp='unsupported' +else case e in #( + e) ac_cv_prog_c_openmp='unsupported' ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -10716,7 +11065,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext elif test "$ac_cv_prog_c_openmp" = ''; then ac_cv_prog_c_openmp='none needed' fi - rm -f penmp mp + rm -f penmp mp ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_c_openmp" >&5 printf "%s\n" "$ac_cv_prog_c_openmp" >&6; } @@ -10730,10 +11080,100 @@ printf "%s\n" "$ac_cv_prog_c_openmp" >&6; } CFLAGS="$OPENMP_CFLAGS $CFLAGS" MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS" -if test "$enable_openmp" != no; then - if test "$ac_cv_prog_c_openmp" != 'unsupported'; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in #( + e) # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else case e in #( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See 'config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +ac_fn_check_decl "$LINENO" "_OPENMP" "ac_cv_have_decl__OPENMP" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl__OPENMP" = xyes +then : + OPENMP_ENABLED='yes' +else case e in #( + e) OPENMP_ENABLED='no' ;; +esac +fi +if test "${OPENMP_ENABLED}" = 'yes' && \ + test "$ac_cv_prog_c_openmp" != 'unsupported'; then MAGICK_FEATURES="OpenMP $MAGICK_FEATURES" - fi fi # Enable support for OpenCL @@ -10742,24 +11182,26 @@ no_cl=yes if test ${enable_opencl+y} then : enableval=$enable_opencl; enable_opencl=$enableval -else $as_nop - enable_opencl='no' +else case e in #( + e) enable_opencl='no' ;; +esac fi if test x"$enable_opencl" != xno ; then CL_CPPFLAGS="" for ac_header in CL/cl.h OpenCL/cl.h do : - as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 _ACEOF HAVE_CL_H="yes"; break -else $as_nop - HAVE_CL_H="no" +else case e in #( + e) HAVE_CL_H="no" ;; +esac fi done @@ -10828,8 +11270,8 @@ printf %s "checking for framework OpenCL... " >&6; } if test ${ax_cv_check_OpenCL+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -10852,8 +11294,9 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_OpenCL="yes" -else $as_nop - ax_cv_check_OpenCL="no" +else case e in #( + e) ax_cv_check_OpenCL="no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -10862,7 +11305,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_OpenCL" >&5 printf "%s\n" "$ax_cv_check_OpenCL" >&6; } @@ -10925,14 +11369,15 @@ printf "%s\n" "yes" >&6; } CL_VERSION=1 CL_LIBS="-L/usr/lib64/nvidia -L/usr/lib/nvidia -lOpenCL" -else $as_nop - +else case e in #( + e) no_cl=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CL_ENABLED=false CL_VERSION=0 - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -10967,31 +11412,34 @@ if test ${enable_largefile+y} then : enableval=$enable_largefile; fi - -if test "$enable_largefile" != no; then - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -printf %s "checking for special C compiler options needed for large files... " >&6; } -if test ${ac_cv_sys_largefile_CC+y} +if test "$enable_largefile,$enable_year2038" != no,no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 +printf %s "checking for $CC option to enable large file support... " >&6; } +if test ${ac_cv_sys_largefile_opts+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) ac_save_CC="$CC" + ac_opt_found=no + for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do + if test x"$ac_opt" != x"none needed" +then : + CC="$ac_save_CC $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, +#ifndef FTYPE +# define FTYPE off_t +#endif + /* Check that FTYPE can represent 2**63 - 1 correctly. + We can't simply define LARGE_FTYPE to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) +#define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) + int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 + && LARGE_FTYPE % 2147483647 == 1) ? 1 : -1]; int main (void) @@ -11001,142 +11449,88 @@ main (void) return 0; } _ACEOF - if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - CC="$CC -n32" + if test x"$ac_opt" = x"none needed" +then : + # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. + CC="$CC -DFTYPE=ino_t" if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_largefile_CC=' -n32'; break + +else case e in #( + e) CC="$CC -D_FILE_OFFSET_BITS=64" + if ac_fn_c_try_compile "$LINENO" +then : + ac_opt='-D_FILE_OFFSET_BITS=64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test ${ac_cv_sys_file_offset_bits+y} -then : - printf %s "(cached) " >&6 -else $as_nop - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_file_offset_bits=no; break + ac_cv_sys_largefile_opts=$ac_opt + ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ + test $ac_opt_found = no || break + done + CC="$ac_save_CC" - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_file_offset_bits=64; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done + test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h -;; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 +printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } + +ac_have_largefile=yes +case $ac_cv_sys_largefile_opts in #( + "none needed") : + ;; #( + "supported through gnulib") : + ;; #( + "support not detected") : + ac_have_largefile=no ;; #( + "-D_FILE_OFFSET_BITS=64") : + +printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h + ;; #( + "-D_LARGE_FILES=1") : + +printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h + ;; #( + "-n32") : + CC="$CC -n32" ;; #( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } -if test ${ac_cv_sys_large_files+y} + +if test "$enable_year2038" != no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 +printf %s "checking for $CC option for timestamps after 2038... " >&6; } +if test ${ac_cv_sys_year2038_opts+y} then : printf %s "(cached) " >&6 -else $as_nop - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" +else case e in #( + e) ac_save_CPPFLAGS="$CPPFLAGS" + ac_opt_found=no + for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do + if test x"$ac_opt" != x"none needed" then : - ac_cv_sys_large_files=no; break + CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; + + #include + /* Check that time_t can represent 2**32 - 1 correctly. */ + #define LARGE_TIME_T \\ + ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) + int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 + && LARGE_TIME_T % 65537 == 0) + ? 1 : -1]; + int main (void) { @@ -11147,92 +11541,139 @@ main (void) _ACEOF if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_large_files=1; break + ac_cv_sys_year2038_opts="$ac_opt" + ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done + test $ac_opt_found = no || break + done + CPPFLAGS="$ac_save_CPPFLAGS" + test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -printf "%s\n" "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h -;; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 +printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } + +ac_have_year2038=yes +case $ac_cv_sys_year2038_opts in #( + "none needed") : + ;; #( + "support not detected") : + ac_have_year2038=no ;; #( + "-D_TIME_BITS=64") : + +printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h + ;; #( + "-D__MINGW_USE_VC2005_COMPAT") : + +printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h + ;; #( + "-U_USE_32_BIT_TIME_T"*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It +will stop working after mid-January 2038. Remove +_USE_32BIT_TIME_T from the compiler flags. +See 'config.log' for more details" "$LINENO" 5; } ;; #( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; esac -rm -rf conftest* - fi + fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -printf %s "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } -if test ${ac_cv_sys_largefile_source+y} +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declarations of fseeko and ftello" >&5 +printf %s "checking for declarations of fseeko and ftello... " >&6; } +if test ${ac_cv_func_fseeko_ftello+y} then : printf %s "(cached) " >&6 -else $as_nop - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + +#if defined __hpux && !defined _LARGEFILE_SOURCE +# include +# if LONG_MAX >> 31 == 0 +# error "32-bit HP-UX 11/ia64 needs _LARGEFILE_SOURCE for fseeko in C++" +# endif +#endif #include /* for off_t */ - #include +#include + int main (void) { -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + + int (*fp1) (FILE *, off_t, int) = fseeko; + off_t (*fp2) (FILE *) = ftello; + return fseeko (stdin, 0, 0) + && fp1 (stdin, 0, 0) + && ftello (stdin) >= 0 + && fp2 (stdin) >= 0; + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_largefile_source=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_func_fseeko_ftello=yes +else case e in #( + e) ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE=1" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _LARGEFILE_SOURCE 1 + +#if defined __hpux && !defined _LARGEFILE_SOURCE +# include +# if LONG_MAX >> 31 == 0 +# error "32-bit HP-UX 11/ia64 needs _LARGEFILE_SOURCE for fseeko in C++" +# endif +#endif #include /* for off_t */ - #include +#include + int main (void) { -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + + int (*fp1) (FILE *, off_t, int) = fseeko; + off_t (*fp2) (FILE *) = ftello; + return fseeko (stdin, 0, 0) + && fp1 (stdin, 0, 0) + && ftello (stdin) >= 0 + && fp2 (stdin) >= 0; + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_largefile_source=1; break + ac_cv_func_fseeko_ftello="need _LARGEFILE_SOURCE" +else case e in #( + e) ac_cv_func_fseeko_ftello=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - ac_cv_sys_largefile_source=unknown - break -done +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 -printf "%s\n" "$ac_cv_sys_largefile_source" >&6; } -case $ac_cv_sys_largefile_source in #( - no | unknown) ;; - *) -printf "%s\n" "#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source" >>confdefs.h -;; +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac -rm -rf conftest* - -# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug -# in glibc 2.1.3, but that breaks too many other things. -# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. -if test $ac_cv_sys_largefile_source != unknown; then +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fseeko_ftello" >&5 +printf "%s\n" "$ac_cv_func_fseeko_ftello" >&6; } +if test "$ac_cv_func_fseeko_ftello" != no +then : printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h +fi +if test "$ac_cv_func_fseeko_ftello" = "need _LARGEFILE_SOURCE" +then : + +printf "%s\n" "#define _LARGEFILE_SOURCE 1" >>confdefs.h + fi LFS_CPPFLAGS='' @@ -11246,15 +11687,16 @@ if test "$enable_largefile" != no; then printf %s "checking for native large file support... " >&6; } if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - main () { + #include + int main () { exit(!(sizeof(off_t) == 8)); } int @@ -11271,16 +11713,21 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi ;; *) + if test "$ac_cv_sys_file_offset_bits" = ''; then + ac_cv_sys_file_offset_bits=64; + fi LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" ;; esac @@ -11302,8 +11749,8 @@ printf %s "checking Linux compatible sendfile()... " >&6; } if test ${ac_cv_have_linux_sendfile+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11327,12 +11774,14 @@ then : ac_cv_have_linux_sendfile=yes -else $as_nop - +else case e in #( + e) ac_cv_have_linux_sendfile=no - + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_linux_sendfile" >&5 printf "%s\n" "$ac_cv_have_linux_sendfile" >&6; } @@ -11402,8 +11851,8 @@ printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$NM"; then +else case e in #( + e) if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else @@ -11450,7 +11899,8 @@ else IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } @@ -11471,8 +11921,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DUMPBIN"; then +else case e in #( + e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11494,7 +11944,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then @@ -11520,8 +11971,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DUMPBIN"; then +else case e in #( + e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11543,7 +11994,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then @@ -11597,8 +12049,8 @@ printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_nm_interface="BSD nm" +else case e in #( + e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) @@ -11611,7 +12063,8 @@ else $as_nop if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi - rm -f conftest* + rm -f conftest* ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } @@ -11622,8 +12075,8 @@ printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 -else $as_nop - i=0 +else case e in #( + e) i=0 teststring=ABCD case $build_os in @@ -11745,7 +12198,8 @@ else $as_nop fi ;; esac - + ;; +esac fi if test -n "$lt_cv_sys_max_cmd_len"; then @@ -11802,8 +12256,8 @@ printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - case $host in +else case e in #( + e) case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys @@ -11834,7 +12288,8 @@ else $as_nop lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac - + ;; +esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd @@ -11850,8 +12305,8 @@ printf %s "checking how to convert $build file names to toolchain format... " >& if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - #assume ordinary cross tools, or native build. +else case e in #( + e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) @@ -11862,7 +12317,8 @@ case $host in esac ;; esac - + ;; +esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd @@ -11878,8 +12334,9 @@ printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_reload_flag='-r' +else case e in #( + e) lt_cv_ld_reload_flag='-r' ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } @@ -11920,8 +12377,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$FILECMD"; then +else case e in #( + e) if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11943,7 +12400,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then @@ -11965,8 +12423,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_FILECMD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_FILECMD"; then +else case e in #( + e) if test -n "$ac_ct_FILECMD"; then ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11988,7 +12446,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD if test -n "$ac_ct_FILECMD"; then @@ -12028,8 +12487,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OBJDUMP"; then +else case e in #( + e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12051,7 +12510,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then @@ -12073,8 +12533,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OBJDUMP"; then +else case e in #( + e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12096,7 +12556,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then @@ -12134,8 +12595,8 @@ printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_file_magic_cmd='$MAGIC_CMD' +else case e in #( + e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support @@ -12328,7 +12789,8 @@ os2*) lt_cv_deplibs_check_method=pass_all ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } @@ -12380,8 +12842,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DLLTOOL"; then +else case e in #( + e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12403,7 +12865,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then @@ -12425,8 +12888,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DLLTOOL"; then +else case e in #( + e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12448,7 +12911,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then @@ -12487,8 +12951,8 @@ printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_sharedlib_from_linklib_cmd='unknown' +else case e in #( + e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) @@ -12508,7 +12972,8 @@ cygwin* | mingw* | pw32* | cegcc*) lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } @@ -12531,8 +12996,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then +else case e in #( + e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12554,7 +13019,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then @@ -12580,8 +13046,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then +else case e in #( + e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12603,7 +13069,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then @@ -12665,8 +13132,8 @@ printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ar_at_file=no +else case e in #( + e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12703,7 +13170,8 @@ then : fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } @@ -12728,8 +13196,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then +else case e in #( + e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12751,7 +13219,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then @@ -12773,8 +13242,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_STRIP"; then +else case e in #( + e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12796,7 +13265,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then @@ -12837,8 +13307,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RANLIB"; then +else case e in #( + e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12860,7 +13330,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then @@ -12882,8 +13353,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_RANLIB"; then +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12905,7 +13376,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then @@ -13016,8 +13488,8 @@ printf %s "checking command to parse $NM output from $compiler object... " >&6; if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -13272,7 +13744,8 @@ _LT_EOF lt_cv_sys_global_symbol_pipe= fi done - + ;; +esac fi if test -z "$lt_cv_sys_global_symbol_pipe"; then @@ -13336,8 +13809,9 @@ printf %s "checking for sysroot... " >&6; } if test ${with_sysroot+y} then : withval=$with_sysroot; -else $as_nop - with_sysroot=no +else case e in #( + e) with_sysroot=no ;; +esac fi @@ -13372,8 +13846,8 @@ printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i +else case e in #( + e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then @@ -13409,7 +13883,8 @@ else ac_cv_path_lt_DD=$lt_DD fi -rm -f conftest.i conftest2.i conftest.out +rm -f conftest.i conftest2.i conftest.out ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } @@ -13420,8 +13895,8 @@ printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i +else case e in #( + e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then @@ -13429,7 +13904,8 @@ if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; the && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } @@ -13639,8 +14115,8 @@ printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_ext=c +else case e in #( + e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -13660,8 +14136,9 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes -else $as_nop - lt_cv_cc_needs_belf=no +else case e in #( + e) lt_cv_cc_needs_belf=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13670,7 +14147,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } @@ -13728,8 +14206,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$MANIFEST_TOOL"; then +else case e in #( + e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13751,7 +14229,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then @@ -13773,8 +14252,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_MANIFEST_TOOL"; then +else case e in #( + e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13796,7 +14275,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then @@ -13828,15 +14308,16 @@ printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_mainfest_tool+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_path_mainfest_tool=no +else case e in #( + e) lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi - rm -f conftest* + rm -f conftest* ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } @@ -13859,8 +14340,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DSYMUTIL"; then +else case e in #( + e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13882,7 +14363,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then @@ -13904,8 +14386,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DSYMUTIL"; then +else case e in #( + e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13927,7 +14409,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then @@ -13961,8 +14444,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$NMEDIT"; then +else case e in #( + e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13984,7 +14467,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then @@ -14006,8 +14490,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_NMEDIT"; then +else case e in #( + e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14029,7 +14513,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then @@ -14063,8 +14548,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$LIPO"; then +else case e in #( + e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14086,7 +14571,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then @@ -14108,8 +14594,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_LIPO"; then +else case e in #( + e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14131,7 +14617,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then @@ -14165,8 +14652,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OTOOL"; then +else case e in #( + e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14188,7 +14675,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then @@ -14210,8 +14698,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OTOOL"; then +else case e in #( + e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14233,7 +14721,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then @@ -14267,8 +14756,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OTOOL64"; then +else case e in #( + e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14290,7 +14779,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then @@ -14312,8 +14802,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OTOOL64"; then +else case e in #( + e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14335,7 +14825,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then @@ -14392,8 +14883,8 @@ printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_apple_cc_single_mod=no +else case e in #( + e) lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE @@ -14419,7 +14910,8 @@ else $as_nop fi rm -rf libconftest.dylib* rm -f conftest.* - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } @@ -14429,8 +14921,8 @@ printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_exported_symbols_list=no +else case e in #( + e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" @@ -14448,13 +14940,15 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes -else $as_nop - lt_cv_ld_exported_symbols_list=no +else case e in #( + e) lt_cv_ld_exported_symbols_list=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } @@ -14464,8 +14958,8 @@ printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_force_load=no +else case e in #( + e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF @@ -14490,7 +14984,8 @@ _LT_EOF fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } @@ -14584,8 +15079,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AS+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AS"; then +else case e in #( + e) if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14607,7 +15102,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AS=$ac_cv_prog_AS if test -n "$AS"; then @@ -14629,8 +15125,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AS+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AS"; then +else case e in #( + e) if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14652,7 +15148,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then @@ -14686,8 +15183,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DLLTOOL"; then +else case e in #( + e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14709,7 +15206,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then @@ -14731,8 +15229,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DLLTOOL"; then +else case e in #( + e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14754,7 +15252,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then @@ -14788,8 +15287,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OBJDUMP"; then +else case e in #( + e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14811,7 +15310,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then @@ -14833,8 +15333,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OBJDUMP"; then +else case e in #( + e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14856,7 +15356,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then @@ -14928,8 +15429,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_shared=yes +else case e in #( + e) enable_shared=yes ;; +esac fi @@ -14960,8 +15462,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_static=yes +else case e in #( + e) enable_static=yes ;; +esac fi @@ -14992,8 +15495,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - pic_mode=default +else case e in #( + e) pic_mode=default ;; +esac fi @@ -15023,8 +15527,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_fast_install=yes +else case e in #( + e) enable_fast_install=yes ;; +esac fi @@ -15051,15 +15556,17 @@ then : ;; esac lt_cv_with_aix_soname=$with_aix_soname -else $as_nop - if test ${lt_cv_with_aix_soname+y} +else case e in #( + e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_with_aix_soname=aix +else case e in #( + e) lt_cv_with_aix_soname=aix ;; +esac fi - with_aix_soname=$lt_cv_with_aix_soname + with_aix_soname=$lt_cv_with_aix_soname ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 @@ -15150,8 +15657,8 @@ printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 -else $as_nop - rm -f .libs 2>/dev/null +else case e in #( + e) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs @@ -15159,7 +15666,8 @@ else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi -rmdir .libs 2>/dev/null +rmdir .libs 2>/dev/null ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } @@ -15220,8 +15728,8 @@ printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MAGIC_CMD in +else case e in #( + e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; @@ -15264,6 +15772,7 @@ _LT_EOF IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; +esac ;; esac fi @@ -15287,8 +15796,8 @@ printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MAGIC_CMD in +else case e in #( + e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; @@ -15331,6 +15840,7 @@ _LT_EOF IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; +esac ;; esac fi @@ -15430,8 +15940,8 @@ printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_rtti_exceptions=no +else case e in #( + e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment @@ -15459,7 +15969,8 @@ else $as_nop fi fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } @@ -15824,8 +16335,9 @@ printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +else case e in #( + e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } @@ -15840,8 +16352,8 @@ printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_works=no +else case e in #( + e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment @@ -15869,7 +16381,8 @@ else $as_nop fi fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } @@ -15905,8 +16418,8 @@ printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_static_works=no +else case e in #( + e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext @@ -15927,7 +16440,8 @@ else $as_nop fi $RM -r conftest* LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } @@ -15949,8 +16463,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o=no +else case e in #( + e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -15990,7 +16504,8 @@ else $as_nop cd .. $RM -r conftest $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -16005,8 +16520,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o=no +else case e in #( + e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -16046,7 +16561,8 @@ else $as_nop cd .. $RM -r conftest $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -16641,8 +17157,8 @@ else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -16674,7 +17190,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi - + ;; +esac fi aix_libpath=$lt_cv_aix_libpath_ @@ -16696,8 +17213,8 @@ else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -16729,7 +17246,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi - + ;; +esac fi aix_libpath=$lt_cv_aix_libpath_ @@ -16980,8 +17498,8 @@ printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler__b=no +else case e in #( + e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext @@ -17002,7 +17520,8 @@ else $as_nop fi $RM -r conftest* LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } @@ -17050,8 +17569,8 @@ printf %s "checking whether the $host_os linker accepts -exported_symbol... " >& if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 -else $as_nop - save_LDFLAGS=$LDFLAGS +else case e in #( + e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17060,12 +17579,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes -else $as_nop - lt_cv_irix_exported_symbol=no +else case e in #( + e) lt_cv_irix_exported_symbol=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS + LDFLAGS=$save_LDFLAGS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } @@ -17391,8 +17912,8 @@ printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 -else $as_nop - $RM conftest* +else case e in #( + e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -17428,7 +17949,8 @@ else $as_nop cat conftest.err 1>&5 fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } @@ -18155,8 +18677,8 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_shlibpath_overrides_runpath=no +else case e in #( + e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ @@ -18183,7 +18705,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir - + ;; +esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath @@ -18611,16 +19134,22 @@ printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -18632,24 +19161,27 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - +else case e in #( + e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes - + ;; +esac fi ;; @@ -18667,22 +19199,28 @@ fi if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char shl_load (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (void); int main (void) { @@ -18694,39 +19232,47 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes -else $as_nop - ac_cv_lib_dld_shl_load=no +else case e in #( + e) ac_cv_lib_dld_shl_load=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else $as_nop - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +else case e in #( + e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -18738,34 +19284,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -18777,34 +19331,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes -else $as_nop - ac_cv_lib_svld_dlopen=no +else case e in #( + e) ac_cv_lib_svld_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dld_link (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (void); int main (void) { @@ -18816,12 +19378,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes -else $as_nop - ac_cv_lib_dld_dld_link=no +else case e in #( + e) ac_cv_lib_dld_dld_link=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } @@ -18830,19 +19394,24 @@ then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi ;; @@ -18870,8 +19439,8 @@ printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : +else case e in #( + e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -18965,7 +19534,8 @@ _LT_EOF fi rm -fr conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } @@ -18977,8 +19547,8 @@ printf %s "checking whether a statically linked program can dlopen itself... " > if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : +else case e in #( + e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -19072,7 +19642,8 @@ _LT_EOF fi rm -fr conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } @@ -19263,8 +19834,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CXX"; then +else case e in #( + e) if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -19286,7 +19857,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then @@ -19312,8 +19884,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CXX"; then +else case e in #( + e) if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -19335,7 +19907,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then @@ -19395,8 +19968,8 @@ printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -19413,12 +19986,14 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } @@ -19436,8 +20011,8 @@ printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_cxx_werror_flag=$ac_cxx_werror_flag +else case e in #( + e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" @@ -19455,8 +20030,8 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes -else $as_nop - CXXFLAGS="" +else case e in #( + e) CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19471,8 +20046,8 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : -else $as_nop - ac_cxx_werror_flag=$ac_save_cxx_werror_flag +else case e in #( + e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19489,12 +20064,15 @@ if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag + ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } @@ -19521,8 +20099,8 @@ printf %s "checking for $CXX option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx11=no +else case e in #( + e) ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19539,25 +20117,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext -CXX=$ac_save_CXX +CXX=$ac_save_CXX ;; +esac fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx11" = x +else case e in #( + e) if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" + CXX="$CXX $ac_cv_prog_cxx_cxx11" ;; +esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 + ac_prog_cxx_stdcxx=cxx11 ;; +esac fi fi if test x$ac_prog_cxx_stdcxx = xno @@ -19567,8 +20148,8 @@ printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx98=no +else case e in #( + e) ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19585,25 +20166,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext -CXX=$ac_save_CXX +CXX=$ac_save_CXX ;; +esac fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx98" = x +else case e in #( + e) if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" + CXX="$CXX $ac_cv_prog_cxx_cxx98" ;; +esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 + ac_prog_cxx_stdcxx=cxx98 ;; +esac fi fi @@ -19620,8 +20204,8 @@ printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CXX_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up @@ -19725,7 +20309,8 @@ else $as_nop else am_cv_CXX_dependencies_compiler_type=none fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } @@ -19767,8 +20352,8 @@ if test -z "$CXXCPP"; then if test ${ac_cv_prog_CXXCPP+y} then : printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CXX needs to be expanded +else case e in #( + e) # Double quotes because $CXX needs to be expanded for CXXCPP in "$CXX -E" cpp /lib/cpp do ac_preproc_ok=false @@ -19786,9 +20371,10 @@ _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -19802,15 +20388,16 @@ if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : @@ -19819,7 +20406,8 @@ fi done ac_cv_prog_CXXCPP=$CXXCPP - + ;; +esac fi CXXCPP=$ac_cv_prog_CXXCPP else @@ -19842,9 +20430,10 @@ _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -19858,24 +20447,26 @@ if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi ac_ext=c @@ -20012,8 +20603,9 @@ cc_basename=$func_cc_basename_result if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else $as_nop - with_gnu_ld=no +else case e in #( + e) with_gnu_ld=no ;; +esac fi ac_prog=ld @@ -20058,8 +20650,8 @@ fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$LD"; then +else case e in #( + e) if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs @@ -20082,7 +20674,8 @@ else $as_nop IFS=$lt_save_ifs else lt_cv_path_LD=$LD # Let the user override the test with a path. -fi +fi ;; +esac fi LD=$lt_cv_path_LD @@ -20099,8 +20692,8 @@ printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 -else $as_nop - # I'd rather use --version here, but apparently some GNU lds only accept -v. +else case e in #( + e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 @@ -20307,8 +20901,8 @@ else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -20340,7 +20934,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi - + ;; +esac fi aix_libpath=$lt_cv_aix_libpath__CXX @@ -20363,8 +20958,8 @@ else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -20396,7 +20991,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi - + ;; +esac fi aix_libpath=$lt_cv_aix_libpath__CXX @@ -21768,8 +22364,9 @@ printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +else case e in #( + e) lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } @@ -21784,8 +22381,8 @@ printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " > if test ${lt_cv_prog_compiler_pic_works_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_works_CXX=no +else case e in #( + e) lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment @@ -21813,7 +22410,8 @@ else $as_nop fi fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } @@ -21843,8 +22441,8 @@ printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; if test ${lt_cv_prog_compiler_static_works_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_static_works_CXX=no +else case e in #( + e) lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext @@ -21865,7 +22463,8 @@ else $as_nop fi $RM -r conftest* LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } @@ -21884,8 +22483,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o_CXX=no +else case e in #( + e) lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -21925,7 +22524,8 @@ else $as_nop cd .. $RM -r conftest $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } @@ -21937,8 +22537,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o_CXX=no +else case e in #( + e) lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -21978,7 +22578,8 @@ else $as_nop cd .. $RM -r conftest $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } @@ -22083,8 +22684,8 @@ printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - $RM conftest* +else case e in #( + e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -22120,7 +22721,8 @@ else $as_nop cat conftest.err 1>&5 fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } @@ -22684,8 +23286,8 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_shlibpath_overrides_runpath=no +else case e in #( + e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ @@ -22712,7 +23314,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir - + ;; +esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath @@ -23104,8 +23707,9 @@ build_modules='no' if test ${with_modules+y} then : withval=$with_modules; with_modules=$withval -else $as_nop - with_modules='no' +else case e in #( + e) with_modules='no' ;; +esac fi @@ -23140,8 +23744,9 @@ fi if test ${enable_delegate_build+y} then : enableval=$enable_delegate_build; enable_delegate_build=$enableval -else $as_nop - enable_delegate_build='no' +else case e in #( + e) enable_delegate_build='no' ;; +esac fi @@ -23149,8 +23754,9 @@ fi if test ${enable_deprecated+y} then : enableval=$enable_deprecated; enable_deprecated=$enableval -else $as_nop - enable_deprecated='no' +else case e in #( + e) enable_deprecated='no' ;; +esac fi @@ -23168,8 +23774,9 @@ fi if test ${enable_installed+y} then : enableval=$enable_installed; enable_installed=$enableval -else $as_nop - enable_installed='yes' +else case e in #( + e) enable_installed='yes' ;; +esac fi @@ -23181,30 +23788,14 @@ else DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed " fi -# Permit enciphering and deciphering image pixels. -# Check whether --enable-cipher was given. -if test ${enable_cipher+y} -then : - enableval=$enable_cipher; enable_cipher=$enableval -else $as_nop - enable_cipher='yes' -fi - - -if test "$enable_cipher" = 'yes'; then - -printf "%s\n" "#define CIPHER_SUPPORT 1" >>confdefs.h - - MAGICK_FEATURES="Cipher $MAGICK_FEATURES" -fi - # Build a zero-configuration version of ImageMagick. # Check whether --enable-zero-configuration was given. if test ${enable_zero_configuration+y} then : enableval=$enable_zero_configuration; enable_zero_configuration=$enableval -else $as_nop - enable_zero_configuration='no' +else case e in #( + e) enable_zero_configuration='no' ;; +esac fi @@ -23228,8 +23819,9 @@ fi if test ${enable_hdri+y} then : enableval=$enable_hdri; enable_hdri=$enableval -else $as_nop - enable_hdri='no' +else case e in #( + e) enable_hdri='no' ;; +esac fi @@ -23253,8 +23845,9 @@ CPPFLAGS="$CPPFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable" if test ${enable_pipes+y} then : enableval=$enable_pipes; enable_pipes=$enableval -else $as_nop - enable_pipes='no' +else case e in #( + e) enable_pipes='no' ;; +esac fi @@ -23273,8 +23866,9 @@ printf %s "checking whether to enable maintainer-specific portions of Makefiles. if test ${enable_maintainer_mode+y} then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else $as_nop - USE_MAINTAINER_MODE=no +else case e in #( + e) USE_MAINTAINER_MODE=no ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 @@ -23296,8 +23890,9 @@ fi if test ${enable_hugepages+y} then : enableval=$enable_hugepages; enable_hugepages=$enableval -else $as_nop - enable_hugepages='no' +else case e in #( + e) enable_hugepages='no' ;; +esac fi @@ -23306,8 +23901,9 @@ fi if test ${enable_ccmalloc+y} then : enableval=$enable_ccmalloc; enable_ccmalloc=$enableval -else $as_nop - enable_ccmalloc='no' +else case e in #( + e) enable_ccmalloc='no' ;; +esac fi @@ -23316,8 +23912,9 @@ fi if test ${enable_efence+y} then : enableval=$enable_efence; enable_efence=$enableval -else $as_nop - enable_efence='no' +else case e in #( + e) enable_efence='no' ;; +esac fi @@ -23326,8 +23923,9 @@ fi if test ${enable_prof+y} then : enableval=$enable_prof; enable_prof=$enableval -else $as_nop - enable_prof='no' +else case e in #( + e) enable_prof='no' ;; +esac fi @@ -23336,8 +23934,9 @@ fi if test ${enable_gprof+y} then : enableval=$enable_gprof; enable_gprof=$enableval -else $as_nop - enable_gprof='no' +else case e in #( + e) enable_gprof='no' ;; +esac fi @@ -23346,8 +23945,9 @@ fi if test ${enable_gcov+y} then : enableval=$enable_gcov; enable_gcov=$enableval -else $as_nop - enable_gcov='no' +else case e in #( + e) enable_gcov='no' ;; +esac fi @@ -23365,8 +23965,9 @@ fi if test ${with_method_prefix+y} then : withval=$with_method_prefix; with_method_prefix=$withval -else $as_nop - with_method_prefix='no' +else case e in #( + e) with_method_prefix='no' ;; +esac fi @@ -23385,8 +23986,9 @@ fi if test ${enable_legacy_support+y} then : enableval=$enable_legacy_support; with_legacy_support=$enableval -else $as_nop - with_legacy_support='no' +else case e in #( + e) with_legacy_support='no' ;; +esac fi if test "$with_legacy_support" != 'no'; then @@ -23404,8 +24006,9 @@ fi if test ${with_quantum_depth+y} then : withval=$with_quantum_depth; with_quantum_depth=$withval -else $as_nop - with_quantum_depth=16 +else case e in #( + e) with_quantum_depth=16 ;; +esac fi @@ -23441,8 +24044,9 @@ fi if test ${with_cache+y} then : withval=$with_cache; with_cache=$withval -else $as_nop - with_cache='' +else case e in #( + e) with_cache='' ;; +esac fi @@ -23454,6 +24058,7 @@ printf "%s\n" "#define PixelCacheThreshold \"$with_cache\"" >>confdefs.h fi # Set security policy +security_policy="open" # MAGICK_SECURITY_POLICY { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of security policy to enforce" >&5 @@ -23464,25 +24069,28 @@ if test ${with_security_policy+y} then : withval=$with_security_policy; case $withval in open|limited|secure|websafe) + security_policy=$withval ;; *) as_fn_error $? "Unknown argument to --with-security-policy" "$LINENO" 5 ;; esac - magick_cv_with_security_policy=$with_security_policy -else $as_nop - if test ${magick_cv_with_security_policy+y} + magick_cv_with_security_policy=$security_policy +else case e in #( + e) if test ${magick_cv_with_security_policy+y} then : printf %s "(cached) " >&6 -else $as_nop - magick_cv_with_security_policy=open +else case e in #( + e) magick_cv_with_security_policy=open ;; +esac fi - MAGICK_SECURITY_POLICY=$magick_cv_with_security_policy + MAGICK_SECURITY_POLICY=$magick_cv_with_security_policy ;; +esac fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_security_policy" >&5 -printf "%s\n" "$with_security_policy" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $security_policy" >&5 +printf "%s\n" "$security_policy" >&6; } @@ -23492,8 +24100,9 @@ printf "%s\n" "$with_security_policy" >&6; } if test ${with_frozenpaths+y} then : withval=$with_frozenpaths; with_frozenpaths=$withval -else $as_nop - with_frozenpaths='no' +else case e in #( + e) with_frozenpaths='no' ;; +esac fi @@ -23503,8 +24112,9 @@ fi if test ${with_magick_plus_plus+y} then : withval=$with_magick_plus_plus; with_magick_plus_plus=$withval -else $as_nop - with_magick_plus_plus='yes' +else case e in #( + e) with_magick_plus_plus='yes' ;; +esac fi @@ -23524,8 +24134,9 @@ fi if test ${with_perl+y} then : withval=$with_perl; with_perl=$withval -else $as_nop - with_perl='no' +else case e in #( + e) with_perl='no' ;; +esac fi @@ -23545,8 +24156,9 @@ fi if test ${with_jemalloc+y} then : withval=$with_jemalloc; with_jemalloc=$withval -else $as_nop - with_jemalloc='no' +else case e in #( + e) with_jemalloc='no' ;; +esac fi if test "$with_jemalloc" != 'yes' ; then @@ -23559,8 +24171,9 @@ fi if test ${with_mtmalloc+y} then : withval=$with_mtmalloc; with_mtmalloc=$withval -else $as_nop - with_mtmalloc='no' +else case e in #( + e) with_mtmalloc='no' ;; +esac fi if test "$with_mtmalloc" != 'no' ; then @@ -23573,8 +24186,9 @@ fi if test ${with_tcmalloc+y} then : withval=$with_tcmalloc; with_tcmalloc=$withval -else $as_nop - with_tcmalloc='no' +else case e in #( + e) with_tcmalloc='no' ;; +esac fi if test "$with_tcmalloc" != 'no' ; then @@ -23587,8 +24201,9 @@ fi if test ${with_umem+y} then : withval=$with_umem; with_umem=$withval -else $as_nop - with_umem='no' +else case e in #( + e) with_umem='no' ;; +esac fi if test "$with_umem" != 'yes' ; then @@ -23603,8 +24218,9 @@ fi if test ${with_libstdc+y} then : withval=$with_libstdc; with_libstdc=$withval -else $as_nop - with_libstdc='' +else case e in #( + e) with_libstdc='' ;; +esac fi @@ -23615,53 +24231,6 @@ if test "$with_libstdc" != ''; then fi -# Does gcc required -traditional? -if test $ac_cv_c_compiler_gnu = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -printf %s "checking whether $CC needs -traditional... " >&6; } -if test ${ac_cv_prog_gcc_traditional+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_pattern="Autoconf.*'x'" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1 -then : - ac_cv_prog_gcc_traditional=yes -else $as_nop - ac_cv_prog_gcc_traditional=no -fi -rm -rf conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1 -then : - ac_cv_prog_gcc_traditional=yes -fi -rm -rf conftest* - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -printf "%s\n" "$ac_cv_prog_gcc_traditional" >&6; } - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - - ######## # # Set defines required to build DLLs and modules using MinGW @@ -23718,8 +24287,9 @@ then : printf "%s\n" "$as_me: WARNING: invalid argument supplied to --enable-assert" >&2;} ac_enable_assert=yes fi -else $as_nop - ac_enable_assert=yes +else case e in #( + e) ac_enable_assert=yes ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_enable_assert" >&5 @@ -23727,14 +24297,14 @@ printf "%s\n" "$ac_enable_assert" >&6; } ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 printf %s "checking for $ac_hdr that defines DIR... " >&6; } if eval test \${$as_ac_Header+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> @@ -23751,10 +24321,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_ac_Header=yes" -else $as_nop - eval "$as_ac_Header=no" +else case e in #( + e) eval "$as_ac_Header=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$as_ac_Header { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -23762,7 +24334,7 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_hdr" | sed "$as_sed_cpp"` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -23776,15 +24348,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -23815,11 +24393,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -23836,15 +24416,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -23875,11 +24461,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -24127,25 +24715,25 @@ printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -printf %s "checking for stdbool.h that conforms to C99... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99 or later" >&5 +printf %s "checking for stdbool.h that conforms to C99 or later... " >&6; } if test ${ac_cv_header_stdbool_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #ifndef __bool_true_false_are_defined - #error "__bool_true_false_are_defined is not defined" - #endif - char a[__bool_true_false_are_defined == 1 ? 1 : -1]; + /* "true" and "false" should be usable in #if expressions and + integer constant expressions, and "bool" should be a valid + type name. - /* Regardless of whether this is C++ or "_Bool" is a - valid type name, "true" and "false" should be usable - in #if expressions and integer constant expressions, - and "bool" should be a valid type name. */ + Although C99 requires bool, true, and false to be macros, + C23 and C++11 overrule that, so do not test for that. + Although C99 requires __bool_true_false_are_defined and + _Bool, C23 says they are obsolescent, so do not require + them. */ #if !true #error "'true' is not true" @@ -24179,43 +24767,12 @@ else $as_nop char n[sizeof m == h * sizeof m[0] ? 1 : -1]; char o[-1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See - https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html */ bool p = true; bool *pp = &p; - /* C 1999 specifies that bool, true, and false are to be - macros, but C++ 2011 and later overrule this. */ - #if __cplusplus < 201103 - #ifndef bool - #error "bool is not defined" - #endif - #ifndef false - #error "false is not defined" - #endif - #ifndef true - #error "true is not defined" - #endif - #endif - - /* If _Bool is available, repeat with it all the tests - above that used bool. */ - #ifdef HAVE__BOOL - struct sB { _Bool s: 1; _Bool t; } t; - - char q[(_Bool) 0.5 == true ? 1 : -1]; - char r[(_Bool) 0.0 == false ? 1 : -1]; - char u[sizeof (_Bool) > 0 ? 1 : -1]; - char v[sizeof t.t > 0 ? 1 : -1]; - - _Bool w[h]; - char x[sizeof m == h * sizeof m[0] ? 1 : -1]; - char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; - _Bool z = true; - _Bool *pz = &p; - #endif - int main (void) { @@ -24224,20 +24781,10 @@ main (void) *pp |= p; *pp |= ! p; - #ifdef HAVE__BOOL - _Bool pt = &t; - *pz |= z; - *pz |= ! z; - #endif - /* Refer to every declared value, so they cannot be discarded as unused. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k - + !l + !m + !n + !o + !p + !pp + !ps - #ifdef HAVE__BOOL - + !q + !r + !u + !v + !w + !x + !y + !z + !pt - #endif - ); + return (!b + !c + !d + !e + !f + !g + !h + !i + !j + !k + + !l + !m + !n + !o + !p + !pp + !ps); ; return 0; @@ -24246,10 +24793,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_stdbool_h=yes -else $as_nop - ac_cv_header_stdbool_h=no +else case e in #( + e) ac_cv_header_stdbool_h=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } @@ -24265,8 +24814,8 @@ printf %s "checking for working volatile... " >&6; } if test ${ac_cv_c_volatile+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -24283,10 +24832,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_volatile=yes -else $as_nop - ac_cv_c_volatile=no +else case e in #( + e) ac_cv_c_volatile=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 printf "%s\n" "$ac_cv_c_volatile" >&6; } @@ -24296,31 +24847,8 @@ printf "%s\n" "#define volatile /**/" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for preprocessor stringizing operator" >&5 -printf %s "checking for preprocessor stringizing operator... " >&6; } -if test ${ac_cv_c_stringize+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define x(y) #y - -char *s = x(teststring); -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "#teststring" >/dev/null 2>&1 -then : - ac_cv_c_stringize=no -else $as_nop - ac_cv_c_stringize=yes -fi -rm -rf conftest* -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stringize" >&5 -printf "%s\n" "$ac_cv_c_stringize" >&6; } -if test $ac_cv_c_stringize = yes; then +if test "$ac_prog_cc_stdc" != no; then printf "%s\n" "#define HAVE_STRINGIZE 1" >>confdefs.h @@ -24331,8 +24859,8 @@ printf %s "checking whether stat file-mode macros are broken... " >&6; } if test ${ac_cv_header_stat_broken+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -24357,10 +24885,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_stat_broken=no -else $as_nop - ac_cv_header_stat_broken=yes +else case e in #( + e) ac_cv_header_stat_broken=yes ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 printf "%s\n" "$ac_cv_header_stat_broken" >&6; } @@ -24375,8 +24905,8 @@ printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test ${ac_cv_struct_tm+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -24394,10 +24924,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_struct_tm=time.h -else $as_nop - ac_cv_struct_tm=sys/time.h +else case e in #( + e) ac_cv_struct_tm=sys/time.h ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 printf "%s\n" "$ac_cv_struct_tm" >&6; } @@ -24407,86 +24939,6 @@ printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 -printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } -if test ${ac_cv_c_undeclared_builtin_options+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS - ac_cv_c_undeclared_builtin_options='cannot detect' - for ac_arg in '' -fno-builtin; do - CFLAGS="$ac_save_CFLAGS $ac_arg" - # This test program should *not* compile successfully. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -(void) strchr; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - # This test program should compile successfully. - # No library function is consistently available on - # freestanding implementations, so test against a dummy - # declaration. Include always-available headers on the - # off chance that they somehow elicit warnings. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -extern void ac_decl (int, char *); - -int -main (void) -{ -(void) ac_decl (0, (char *) 0); - (void) ac_decl; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - if test x"$ac_arg" = x -then : - ac_cv_c_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_c_undeclared_builtin_options=$ac_arg -fi - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - done - CFLAGS=$ac_save_CFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 -printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } - case $ac_cv_c_undeclared_builtin_options in #( - 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot make $CC report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( - 'none needed') : - ac_c_undeclared_builtin_options='' ;; #( - *) : - ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; -esac - ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include #include <$ac_cv_struct_tm> @@ -24509,8 +24961,9 @@ else if test "x$ac_cv_have_decl_tzname" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_TZNAME $ac_have_decl" >>confdefs.h @@ -24519,8 +24972,8 @@ printf %s "checking for tzname... " >&6; } if test ${ac_cv_var_tzname+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if !HAVE_DECL_TZNAME @@ -24538,11 +24991,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_var_tzname=yes -else $as_nop - ac_cv_var_tzname=no +else case e in #( + e) ac_cv_var_tzname=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 printf "%s\n" "$ac_cv_var_tzname" >&6; } @@ -24558,8 +25013,8 @@ printf %s "checking whether #! works in shell scripts... " >&6; } if test ${ac_cv_sys_interpreter+y} then : printf %s "(cached) " >&6 -else $as_nop - echo '#! /bin/cat +else case e in #( + e) echo '#! /bin/cat exit 69 ' >conftest chmod u+x conftest @@ -24569,7 +25024,8 @@ if test $? -ne 69; then else ac_cv_sys_interpreter=no fi -rm -f conftest +rm -f conftest ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_interpreter" >&5 printf "%s\n" "$ac_cv_sys_interpreter" >&6; } @@ -24584,8 +25040,8 @@ printf %s "checking whether char is unsigned... " >&6; } if test ${ac_cv_c_char_unsigned+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -24602,10 +25058,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_char_unsigned=no -else $as_nop - ac_cv_c_char_unsigned=yes +else case e in #( + e) ac_cv_c_char_unsigned=yes ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 printf "%s\n" "$ac_cv_c_char_unsigned" >&6; } @@ -24619,8 +25077,8 @@ printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -24684,10 +25142,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes -else $as_nop - ac_cv_c_const=no +else case e in #( + e) ac_cv_c_const=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } @@ -24702,8 +25162,8 @@ printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_inline=no +else case e in #( + e) ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24721,7 +25181,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } @@ -24746,8 +25207,8 @@ printf %s "checking for C/C++ restrict keyword... " >&6; } if test ${ac_cv_c_restrict+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_restrict=no +else case e in #( + e) ac_cv_c_restrict=no # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see: # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html # Put 'restrict' last, because C++ lacks it. @@ -24778,7 +25239,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_restrict" != no && break done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 printf "%s\n" "$ac_cv_c_restrict" >&6; } @@ -24796,8 +25258,8 @@ printf %s "checking for working volatile... " >&6; } if test ${ac_cv_c_volatile+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -24814,10 +25276,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_volatile=yes -else $as_nop - ac_cv_c_volatile=no +else case e in #( + e) ac_cv_c_volatile=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 printf "%s\n" "$ac_cv_c_volatile" >&6; } @@ -24835,8 +25299,8 @@ printf %s "checking whether byte ordering is bigendian... " >&6; } if test ${ac_cv_c_bigendian+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_bigendian=unknown +else case e in #( + e) ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24882,8 +25346,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext int main (void) { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ && LITTLE_ENDIAN) bogus endian macros #endif @@ -24914,8 +25378,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -24959,8 +25424,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -24987,22 +25453,23 @@ unsigned short int ascii_mm[] = int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } - extern int foo; - -int -main (void) -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -25011,9 +25478,10 @@ then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -25036,14 +25504,17 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_bigendian=no -else $as_nop - ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=yes ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 printf "%s\n" "$ac_cv_c_bigendian" >&6; } @@ -25107,8 +25578,8 @@ printf %s "checking for unsigned long long int... " >&6; } if test ${ac_cv_type_unsigned_long_long_int+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_type_unsigned_long_long_int=yes +else case e in #( + e) ac_cv_type_unsigned_long_long_int=yes case $ac_prog_cc_stdc in no | c89) ;; *) @@ -25147,12 +25618,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : -else $as_nop - ac_cv_type_unsigned_long_long_int=no +else case e in #( + e) ac_cv_type_unsigned_long_long_int=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext;; - esac + esac ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } @@ -25169,8 +25642,8 @@ printf %s "checking for long long int... " >&6; } if test ${ac_cv_type_long_long_int+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_type_long_long_int=yes +else case e in #( + e) ac_cv_type_long_long_int=yes case $ac_prog_cc_stdc in no | c89) ;; *) @@ -25179,12 +25652,12 @@ else $as_nop if test "$cross_compiling" = yes then : : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef LLONG_MAX - # define HALF \ + # define HALF \\ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) # define LLONG_MAX (HALF - 1 + HALF) #endif @@ -25209,15 +25682,18 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : -else $as_nop - ac_cv_type_long_long_int=no +else case e in #( + e) ac_cv_type_long_long_int=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi fi;; - esac + esac ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 printf "%s\n" "$ac_cv_type_long_long_int" >&6; } @@ -25235,13 +25711,14 @@ then : printf "%s\n" "#define HAVE_INTMAX_T 1" >>confdefs.h -else $as_nop - test $ac_cv_type_long_long_int = yes \ +else case e in #( + e) test $ac_cv_type_long_long_int = yes \ && ac_type='long long int' \ || ac_type='long int' printf "%s\n" "#define intmax_t $ac_type" >>confdefs.h - + ;; +esac fi @@ -25252,8 +25729,8 @@ then : printf "%s\n" "#define HAVE_INTPTR_T 1" >>confdefs.h -else $as_nop - for ac_type in 'int' 'long int' 'long long int'; do +else case e in #( + e) for ac_type in 'int' 'long int' 'long long int'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -25277,7 +25754,8 @@ printf "%s\n" "#define intptr_t $ac_type" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test -z "$ac_type" && break - done + done ;; +esac fi @@ -25286,8 +25764,8 @@ printf %s "checking for mbstate_t... " >&6; } if test ${ac_cv_type_mbstate_t+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default # include @@ -25302,10 +25780,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_type_mbstate_t=yes -else $as_nop - ac_cv_type_mbstate_t=no +else case e in #( + e) ac_cv_type_mbstate_t=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 printf "%s\n" "$ac_cv_type_mbstate_t" >&6; } @@ -25322,20 +25802,22 @@ ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define mode_t int" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define off_t long int" >>confdefs.h - + ;; +esac fi @@ -25344,8 +25826,8 @@ fi if test "x$ac_cv_type_pid_t" = xyes then : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ @@ -25364,14 +25846,16 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' +else case e in #( + e) ac_pid_type='__int64' ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - + ;; +esac fi @@ -25379,52 +25863,44 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define ssize_t int" >>confdefs.h - + ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -printf %s "checking for uid_t in sys/types.h... " >&6; } -if test ${ac_cv_type_uid_t+y} +ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" +if test "x$ac_cv_type_uid_t" = xyes then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1 -then : - ac_cv_type_uid_t=yes -else $as_nop - ac_cv_type_uid_t=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -printf "%s\n" "$ac_cv_type_uid_t" >&6; } -if test $ac_cv_type_uid_t = no; then +else case e in #( + e) printf "%s\n" "#define uid_t int" >>confdefs.h + ;; +esac +fi +ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" +if test "x$ac_cv_type_gid_t" = xyes +then : +else case e in #( + e) printf "%s\n" "#define gid_t int" >>confdefs.h - + ;; +esac fi ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" @@ -25481,13 +25957,14 @@ then : printf "%s\n" "#define HAVE_UINTMAX_T 1" >>confdefs.h -else $as_nop - test $ac_cv_type_unsigned_long_long_int = yes \ +else case e in #( + e) test $ac_cv_type_unsigned_long_long_int = yes \ && ac_type='unsigned long long int' \ || ac_type='unsigned long int' printf "%s\n" "#define uintmax_t $ac_type" >>confdefs.h - + ;; +esac fi @@ -25498,8 +25975,8 @@ then : printf "%s\n" "#define HAVE_UINTPTR_T 1" >>confdefs.h -else $as_nop - for ac_type in 'unsigned int' 'unsigned long int' \ +else case e in #( + e) for ac_type in 'unsigned int' 'unsigned long int' \ 'unsigned long long int'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25524,7 +26001,8 @@ printf "%s\n" "#define uintptr_t $ac_type" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test -z "$ac_type" && break - done + done ;; +esac fi @@ -25532,29 +26010,31 @@ fi # Float_t and double_t are intended to be the most efficient type. # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of float_t" >&5 printf %s "checking size of float_t... " >&6; } if test ${ac_cv_sizeof_float_t+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float_t))" "ac_cv_sizeof_float_t" "#include +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float_t))" "ac_cv_sizeof_float_t" "#include " then : -else $as_nop - if test "$ac_cv_type_float_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_float_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (float_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_float_t=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float_t" >&5 printf "%s\n" "$ac_cv_sizeof_float_t" >&6; } @@ -25566,29 +26046,31 @@ printf "%s\n" "#define SIZEOF_FLOAT_T $ac_cv_sizeof_float_t" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of double_t" >&5 printf %s "checking size of double_t... " >&6; } if test ${ac_cv_sizeof_double_t+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double_t))" "ac_cv_sizeof_double_t" "#include +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double_t))" "ac_cv_sizeof_double_t" "#include " then : -else $as_nop - if test "$ac_cv_type_double_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_double_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (double_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_double_t=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double_t" >&5 printf "%s\n" "$ac_cv_sizeof_double_t" >&6; } @@ -25602,28 +26084,30 @@ printf "%s\n" "#define SIZEOF_DOUBLE_T $ac_cv_sizeof_double_t" >>confdefs.h # Get size of float, double and long double for comparison. # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 printf %s "checking size of float... " >&6; } if test ${ac_cv_sizeof_float+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_float" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_float" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (float) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_float=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 printf "%s\n" "$ac_cv_sizeof_float" >&6; } @@ -25635,28 +26119,30 @@ printf "%s\n" "#define SIZEOF_FLOAT $ac_cv_sizeof_float" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 printf %s "checking size of double... " >&6; } if test ${ac_cv_sizeof_double+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_double" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_double" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (double) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_double=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 printf "%s\n" "$ac_cv_sizeof_double" >&6; } @@ -25668,28 +26154,30 @@ printf "%s\n" "#define SIZEOF_DOUBLE $ac_cv_sizeof_double" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 printf %s "checking size of long double... " >&6; } if test ${ac_cv_sizeof_long_double+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_long_double" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_long_double" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long double) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_double=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5 printf "%s\n" "$ac_cv_sizeof_long_double" >&6; } @@ -25705,28 +26193,30 @@ printf "%s\n" "#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double" >>confdefs. # supported then the value defined is zero. # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long" >&5 printf %s "checking size of unsigned long long... " >&6; } if test ${ac_cv_sizeof_unsigned_long_long+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_unsigned_long_long" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_unsigned_long_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (unsigned long long) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_long_long=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long" >&5 printf "%s\n" "$ac_cv_sizeof_unsigned_long_long" >&6; } @@ -25736,31 +26226,68 @@ printf "%s\n" "$ac_cv_sizeof_unsigned_long_long" >&6; } printf "%s\n" "#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long" >>confdefs.h +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +printf %s "checking size of size_t... " >&6; } +if test ${ac_cv_sizeof_size_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default" +then : + +else case e in #( + e) if test "$ac_cv_type_size_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (size_t) +See 'config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_size_t=0 + fi ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +printf "%s\n" "$ac_cv_sizeof_size_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t" >>confdefs.h + + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 printf %s "checking size of void *... " >&6; } if test ${ac_cv_sizeof_void_p+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_void_p" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_void_p" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (void *) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_void_p=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 printf "%s\n" "$ac_cv_sizeof_void_p" >&6; } @@ -25820,8 +26347,8 @@ printf %s "checking for working mmap... " >&6; } if test ${ac_cv_func_mmap_fixed_mapped+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : case "$host_os" in # (( # Guess yes on platforms where we know the result. @@ -25829,8 +26356,8 @@ then : # If we don't know, assume the worst. *) ac_cv_func_mmap_fixed_mapped=no ;; esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ @@ -25851,21 +26378,21 @@ $ac_includes_default VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get - propagated back to all the places they're supposed to be. - - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ + propagated back to all the places they're supposed to be. */ #include #include -/* This mess was copied from the GNU getpagesize.h. */ -#ifndef HAVE_GETPAGESIZE +#ifndef getpagesize +/* Prefer sysconf to the legacy getpagesize function, as getpagesize has + been removed from POSIX and is limited to page sizes that fit in 'int'. */ # ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ +# define getpagesize() sysconf (_SC_PAGESIZE) +# elif defined _SC_PAGE_SIZE +# define getpagesize() sysconf (_SC_PAGE_SIZE) +# elif HAVE_GETPAGESIZE +int getpagesize (); +# else # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE @@ -25889,16 +26416,15 @@ $ac_includes_default # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ +# endif +#endif int main (void) { char *data, *data2, *data3; const char *cdata2; - int i, pagesize; + long i, pagesize; int fd, fd2; pagesize = getpagesize (); @@ -25932,8 +26458,7 @@ main (void) if (*(data2 + i)) return 7; close (fd2); - if (munmap (data2, pagesize)) - return 8; + /* 'return 8;' not currently used. */ /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that @@ -25970,13 +26495,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_mmap_fixed_mapped=yes -else $as_nop - ac_cv_func_mmap_fixed_mapped=no +else case e in #( + e) ac_cv_func_mmap_fixed_mapped=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 printf "%s\n" "$ac_cv_func_mmap_fixed_mapped" >&6; } @@ -25992,18 +26520,15 @@ printf %s "checking for working strtod... " >&6; } if test ${ac_cv_func_strtod+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_func_strtod=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default -#ifndef strtod -double strtod (); -#endif int main (void) { @@ -26033,13 +26558,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_strtod=yes -else $as_nop - ac_cv_func_strtod=no +else case e in #( + e) ac_cv_func_strtod=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 printf "%s\n" "$ac_cv_func_strtod" >&6; } @@ -26062,16 +26590,22 @@ printf %s "checking for pow in -lm... " >&6; } if test ${ac_cv_lib_m_pow+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char pow (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char pow (void); int main (void) { @@ -26083,21 +26617,24 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_m_pow=yes -else $as_nop - ac_cv_lib_m_pow=no +else case e in #( + e) ac_cv_lib_m_pow=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 printf "%s\n" "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = xyes then : POW_LIB=-lm -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 -printf "%s\n" "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +printf "%s\n" "$as_me: WARNING: cannot find library containing definition of pow" >&2;} ;; +esac fi fi @@ -26108,8 +26645,9 @@ ac_fn_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includ if test "x$ac_cv_have_decl_strerror_r" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_STRERROR_R $ac_have_decl" >>confdefs.h @@ -26128,8 +26666,8 @@ printf %s "checking whether strerror_r returns char *... " >&6; } if test ${ac_cv_func_strerror_r_char_p+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26155,7 +26693,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; } @@ -26175,16 +26714,22 @@ printf %s "checking for sqrt in -lm... " >&6; } if test ${ac_cv_lib_m_sqrt+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char sqrt (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char sqrt (void); int main (void) { @@ -26196,12 +26741,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_m_sqrt=yes -else $as_nop - ac_cv_lib_m_sqrt=no +else case e in #( + e) ac_cv_lib_m_sqrt=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5 printf "%s\n" "$ac_cv_lib_m_sqrt" >&6; } @@ -26221,15 +26768,21 @@ printf %s "checking for library containing gethostbyname... " >&6; } if test ${ac_cv_search_gethostbyname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (void); int main (void) { @@ -26260,11 +26813,13 @@ done if test ${ac_cv_search_gethostbyname+y} then : -else $as_nop - ac_cv_search_gethostbyname=no +else case e in #( + e) ac_cv_search_gethostbyname=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 printf "%s\n" "$ac_cv_search_gethostbyname" >&6; } @@ -26280,15 +26835,21 @@ printf %s "checking for library containing socket... " >&6; } if test ${ac_cv_search_socket+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char socket (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char socket (void); int main (void) { @@ -26319,11 +26880,13 @@ done if test ${ac_cv_search_socket+y} then : -else $as_nop - ac_cv_search_socket=no +else case e in #( + e) ac_cv_search_socket=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 printf "%s\n" "$ac_cv_search_socket" >&6; } @@ -26348,15 +26911,21 @@ printf %s "checking for library containing clock_gettime... " >&6; } if test ${ac_cv_search_clock_gettime+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char clock_gettime (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (void); int main (void) { @@ -26387,11 +26956,13 @@ done if test ${ac_cv_search_clock_gettime+y} then : -else $as_nop - ac_cv_search_clock_gettime=no +else case e in #( + e) ac_cv_search_clock_gettime=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } @@ -26426,31 +26997,33 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_CLOCK_REALTIME 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop - +else case e in #( + e) for ac_func in gettimeofday ftime do : - as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` + as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | sed "$as_sed_sh"` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_func" | sed "$as_sed_cpp"` 1 _ACEOF break fi done - + ;; +esac fi @@ -26466,8 +27039,9 @@ ac_fn_check_decl "$LINENO" "pread" "ac_cv_have_decl_pread" " if test "x$ac_cv_have_decl_pread" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_PREAD $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "pwrite" "ac_cv_have_decl_pwrite" " @@ -26476,8 +27050,9 @@ ac_fn_check_decl "$LINENO" "pwrite" "ac_cv_have_decl_pwrite" " if test "x$ac_cv_have_decl_pwrite" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_PWRITE $ac_have_decl" >>confdefs.h @@ -26488,8 +27063,9 @@ ac_fn_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" " if test "x$ac_cv_have_decl_strlcpy" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_STRLCPY $ac_have_decl" >>confdefs.h @@ -26501,8 +27077,9 @@ ac_fn_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" " if test "x$ac_cv_have_decl_vsnprintf" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_VSNPRINTF $ac_have_decl" >>confdefs.h @@ -26551,8 +27128,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CXX"; then +else case e in #( + e) if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -26574,7 +27151,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then @@ -26600,8 +27178,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CXX"; then +else case e in #( + e) if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -26623,7 +27201,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then @@ -26683,8 +27262,8 @@ printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -26701,12 +27280,14 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } @@ -26724,8 +27305,8 @@ printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_cxx_werror_flag=$ac_cxx_werror_flag +else case e in #( + e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" @@ -26743,8 +27324,8 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes -else $as_nop - CXXFLAGS="" +else case e in #( + e) CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26759,8 +27340,8 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : -else $as_nop - ac_cxx_werror_flag=$ac_save_cxx_werror_flag +else case e in #( + e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26777,12 +27358,15 @@ if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag + ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } @@ -26809,8 +27393,8 @@ printf %s "checking for $CXX option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx11=no +else case e in #( + e) ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26827,25 +27411,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext -CXX=$ac_save_CXX +CXX=$ac_save_CXX ;; +esac fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx11" = x +else case e in #( + e) if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" + CXX="$CXX $ac_cv_prog_cxx_cxx11" ;; +esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 + ac_prog_cxx_stdcxx=cxx11 ;; +esac fi fi if test x$ac_prog_cxx_stdcxx = xno @@ -26855,8 +27442,8 @@ printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx98=no +else case e in #( + e) ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26873,25 +27460,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext -CXX=$ac_save_CXX +CXX=$ac_save_CXX ;; +esac fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx98" = x +else case e in #( + e) if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" + CXX="$CXX $ac_cv_prog_cxx_cxx98" ;; +esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 + ac_prog_cxx_stdcxx=cxx98 ;; +esac fi fi @@ -26908,8 +27498,8 @@ printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CXX_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up @@ -27013,7 +27603,8 @@ else $as_nop else am_cv_CXX_dependencies_compiler_type=none fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } @@ -27035,8 +27626,8 @@ printf %s "checking whether the compiler recognizes bool as a built-in type... " if test ${ax_cv_cxx_bool+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_ext=cpp +else case e in #( + e) ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -27058,8 +27649,9 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ax_cv_cxx_bool=yes -else $as_nop - ax_cv_cxx_bool=no +else case e in #( + e) ax_cv_cxx_bool=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=cpp @@ -27068,7 +27660,8 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_bool" >&5 printf "%s\n" "$ax_cv_cxx_bool" >&6; } @@ -27084,8 +27677,8 @@ printf %s "checking whether the compiler implements namespaces... " >&6; } if test ${ax_cv_cxx_namespaces+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_ext=cpp +else case e in #( + e) ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -27099,8 +27692,9 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ax_cv_cxx_namespaces=yes -else $as_nop - ax_cv_cxx_namespaces=no +else case e in #( + e) ax_cv_cxx_namespaces=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=cpp @@ -27109,7 +27703,8 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_namespaces" >&5 printf "%s\n" "$ax_cv_cxx_namespaces" >&6; } @@ -27125,8 +27720,8 @@ printf %s "checking if g++ supports namespace std... " >&6; } if test ${ax_cv_cxx_have_std_namespace+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_ext=cpp +else case e in #( + e) ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -27147,8 +27742,9 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ax_cv_cxx_have_std_namespace=yes -else $as_nop - ax_cv_cxx_have_std_namespace=no +else case e in #( + e) ax_cv_cxx_have_std_namespace=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=cpp @@ -27157,7 +27753,8 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_have_std_namespace" >&5 printf "%s\n" "$ax_cv_cxx_have_std_namespace" >&6; } @@ -27180,8 +27777,8 @@ printf %s "checking for $CXX option to support OpenMP... " >&6; } if test ${ac_cv_prog_cxx_openmp+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_openmp='not found' +else case e in #( + e) ac_cv_prog_cxx_openmp='not found' for ac_option in '' -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \ -Popenmp --openmp; do @@ -27212,8 +27809,9 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO" then : ac_cv_prog_cxx_openmp=$ac_option -else $as_nop - ac_cv_prog_cxx_openmp='unsupported' +else case e in #( + e) ac_cv_prog_cxx_openmp='unsupported' ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -27230,7 +27828,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext elif test "$ac_cv_prog_cxx_openmp" = ''; then ac_cv_prog_cxx_openmp='none needed' fi - rm -f penmp mp + rm -f penmp mp ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_openmp" >&5 printf "%s\n" "$ac_cv_prog_cxx_openmp" >&6; } @@ -27324,8 +27923,8 @@ printf %s "checking for X11 configure files... " >&6; } if test ${im_cv_x_configure+y} then : printf %s "(cached) " >&6 -else $as_nop - # Look for the header file in a standard set of common directories. +else case e in #( + e) # Look for the header file in a standard set of common directories. # Check X11 before X11Rn because it is often a symlink to the current release. for ac_dir in \ /lib/usr/lib/X11 \ @@ -27368,7 +27967,8 @@ else $as_nop break fi - done + done ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $im_cv_x_configure" >&5 printf "%s\n" "$im_cv_x_configure" >&6; } @@ -27386,273 +27986,154 @@ printf "%s\n" "#define X11_CONFIGURE_PATH \"$X11ConfigurePath\"" >>confdefs.h # Find OpenMP library # GOMP_LIBS='' -if test "$enable_openmp" != 'no'; then +if test "${OPENMP_ENABLED}" = 'yes' && \ + test "$ac_cv_prog_c_openmp" != 'unsupported'; then + ac_fn_c_check_header_compile "$LINENO" "omp.h" "ac_cv_header_omp_h" "$ac_includes_default" +if test "x$ac_cv_header_omp_h" = xyes +then : + +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OpenMP header file not found" >&5 +printf "%s\n" "OpenMP header file not found" >&6; } ;; +esac +fi + if test "${GCC}" = "yes"; then # Open64 (passes for GCC but uses different OpenMP implementation) if test "x$GOMP_LIBS" = x ; then if $CC --version 2>&1 | grep Open64 > /dev/null ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for omp_get_num_procs in -lopenmp" >&5 -printf %s "checking for omp_get_num_procs in -lopenmp... " >&6; } -if test ${ac_cv_lib_openmp_omp_get_num_procs+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lopenmp $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char omp_get_num_procs (); + #include int main (void) { -return omp_get_num_procs (); + + omp_set_num_threads(1); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_openmp_omp_get_num_procs=yes -else $as_nop - ac_cv_lib_openmp_omp_get_num_procs=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openmp_omp_get_num_procs" >&5 -printf "%s\n" "$ac_cv_lib_openmp_omp_get_num_procs" >&6; } -if test "x$ac_cv_lib_openmp_omp_get_num_procs" = xyes +if ac_fn_c_try_compile "$LINENO" then : GOMP_LIBS="-lopenmp" fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # Clang (passes for GCC but uses different OpenMP implementation) - if test "x$LIB_OMP" = x ; then + if test "x$GOMP_LIBS" = x ; then if $CC --version 2>&1 | grep clang > /dev/null ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GOMP_parallel_start in -lomp" >&5 -printf %s "checking for GOMP_parallel_start in -lomp... " >&6; } -if test ${ac_cv_lib_omp_GOMP_parallel_start+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lomp $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char GOMP_parallel_start (); + #include int main (void) { -return GOMP_parallel_start (); + + omp_set_num_threads(1); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_omp_GOMP_parallel_start=yes -else $as_nop - ac_cv_lib_omp_GOMP_parallel_start=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_omp_GOMP_parallel_start" >&5 -printf "%s\n" "$ac_cv_lib_omp_GOMP_parallel_start" >&6; } -if test "x$ac_cv_lib_omp_GOMP_parallel_start" = xyes +if ac_fn_c_try_compile "$LINENO" then : - LIB_OMP="-lomp" + GOMP_LIBS="-lomp" fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # GCC if test "x$GOMP_LIBS" = x ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GOMP_parallel_start in -lgomp" >&5 -printf %s "checking for GOMP_parallel_start in -lgomp... " >&6; } -if test ${ac_cv_lib_gomp_GOMP_parallel_start+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgomp $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char GOMP_parallel_start (); + #include int main (void) { -return GOMP_parallel_start (); + + omp_set_num_threads(1); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_gomp_GOMP_parallel_start=yes -else $as_nop - ac_cv_lib_gomp_GOMP_parallel_start=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gomp_GOMP_parallel_start" >&5 -printf "%s\n" "$ac_cv_lib_gomp_GOMP_parallel_start" >&6; } -if test "x$ac_cv_lib_gomp_GOMP_parallel_start" = xyes +if ac_fn_c_try_compile "$LINENO" then : GOMP_LIBS="-lgomp" fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi else # Sun CC if test "x$GOMP_LIBS" = x ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sunw_mp_register_warn in -lmtsk" >&5 -printf %s "checking for sunw_mp_register_warn in -lmtsk... " >&6; } -if test ${ac_cv_lib_mtsk_sunw_mp_register_warn+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmtsk $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char sunw_mp_register_warn (); + #include int main (void) { -return sunw_mp_register_warn (); + + omp_set_num_threads(1); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_mtsk_sunw_mp_register_warn=yes -else $as_nop - ac_cv_lib_mtsk_sunw_mp_register_warn=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mtsk_sunw_mp_register_warn" >&5 -printf "%s\n" "$ac_cv_lib_mtsk_sunw_mp_register_warn" >&6; } -if test "x$ac_cv_lib_mtsk_sunw_mp_register_warn" = xyes +if ac_fn_c_try_compile "$LINENO" then : GOMP_LIBS="-lmtsk" fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # AIX xlc if test "x$GOMP_LIBS" = x ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _xlsmpFlush in -lxlsmp" >&5 -printf %s "checking for _xlsmpFlush in -lxlsmp... " >&6; } -if test ${ac_cv_lib_xlsmp__xlsmpFlush+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lxlsmp $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char _xlsmpFlush (); + #include int main (void) { -return _xlsmpFlush (); + + omp_set_num_threads(1); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_xlsmp__xlsmpFlush=yes -else $as_nop - ac_cv_lib_xlsmp__xlsmpFlush=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xlsmp__xlsmpFlush" >&5 -printf "%s\n" "$ac_cv_lib_xlsmp__xlsmpFlush" >&6; } -if test "x$ac_cv_lib_xlsmp__xlsmpFlush" = xyes +if ac_fn_c_try_compile "$LINENO" then : - GOMP_LIBS="-lxlsmp" + GOMP_LIBS="-lxmlsmp" fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # SGI IRIX 6.5 MIPSpro C/C++ if test "x$GOMP_LIBS" = x ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mp_destroy in -lmp" >&5 -printf %s "checking for mp_destroy in -lmp... " >&6; } -if test ${ac_cv_lib_mp_mp_destroy+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmp $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char mp_destroy (); + #include int main (void) { -return mp_destroy (); + + omp_set_num_threads(1); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_mp_mp_destroy=yes -else $as_nop - ac_cv_lib_mp_mp_destroy=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mp_mp_destroy" >&5 -printf "%s\n" "$ac_cv_lib_mp_mp_destroy" >&6; } -if test "x$ac_cv_lib_mp_mp_destroy" = xyes +if ac_fn_c_try_compile "$LINENO" then : GOMP_LIBS="-lmp" fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi - LIBS="$GOMP_LIBS $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenMP library " >&5 +printf %s "checking for OpenMP library ... " >&6; } + if test "x$GOMP_LIBS" = x ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found!" >&5 +printf "%s\n" "not found!" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${GOMP_LIBS}" >&5 +printf "%s\n" "${GOMP_LIBS}" >&6; } + fi fi @@ -27672,8 +28153,9 @@ printf "%s\n" "" >&6; } if test "x$ac_cv_header_jemalloc_jemalloc_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for malloc_stats_print in -ljemalloc" >&5 @@ -27681,16 +28163,22 @@ printf %s "checking for malloc_stats_print in -ljemalloc... " >&6; } if test ${ac_cv_lib_jemalloc_malloc_stats_print+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ljemalloc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char malloc_stats_print (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char malloc_stats_print (void); int main (void) { @@ -27702,20 +28190,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_jemalloc_malloc_stats_print=yes -else $as_nop - ac_cv_lib_jemalloc_malloc_stats_print=no +else case e in #( + e) ac_cv_lib_jemalloc_malloc_stats_print=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jemalloc_malloc_stats_print" >&5 printf "%s\n" "$ac_cv_lib_jemalloc_malloc_stats_print" >&6; } if test "x$ac_cv_lib_jemalloc_malloc_stats_print" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if jemalloc memory allocation library is complete" >&5 @@ -27768,8 +28259,9 @@ printf "%s\n" "" >&6; } if test "x$ac_cv_header_mtmalloc_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mallocctl in -lmtalloc" >&5 @@ -27777,16 +28269,22 @@ printf %s "checking for mallocctl in -lmtalloc... " >&6; } if test ${ac_cv_lib_mtalloc_mallocctl+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lmtalloc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char mallocctl (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char mallocctl (void); int main (void) { @@ -27798,20 +28296,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_mtalloc_mallocctl=yes -else $as_nop - ac_cv_lib_mtalloc_mallocctl=no +else case e in #( + e) ac_cv_lib_mtalloc_mallocctl=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mtalloc_mallocctl" >&5 printf "%s\n" "$ac_cv_lib_mtalloc_mallocctl" >&6; } if test "x$ac_cv_lib_mtalloc_mallocctl" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi @@ -27862,16 +28363,22 @@ printf %s "checking for mallinfo in -ltcmalloc_minimal... " >&6; } if test ${ac_cv_lib_tcmalloc_minimal_mallinfo+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ltcmalloc_minimal $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char mallinfo (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char mallinfo (void); int main (void) { @@ -27883,20 +28390,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_tcmalloc_minimal_mallinfo=yes -else $as_nop - ac_cv_lib_tcmalloc_minimal_mallinfo=no +else case e in #( + e) ac_cv_lib_tcmalloc_minimal_mallinfo=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tcmalloc_minimal_mallinfo" >&5 printf "%s\n" "$ac_cv_lib_tcmalloc_minimal_mallinfo" >&6; } if test "x$ac_cv_lib_tcmalloc_minimal_mallinfo" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi @@ -27944,8 +28454,9 @@ printf "%s\n" "" >&6; } if test "x$ac_cv_header_umem_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for umem_alloc in -lumem" >&5 @@ -27953,16 +28464,22 @@ printf %s "checking for umem_alloc in -lumem... " >&6; } if test ${ac_cv_lib_umem_umem_alloc+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lumem $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char umem_alloc (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char umem_alloc (void); int main (void) { @@ -27974,20 +28491,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_umem_umem_alloc=yes -else $as_nop - ac_cv_lib_umem_umem_alloc=no +else case e in #( + e) ac_cv_lib_umem_umem_alloc=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_umem_umem_alloc" >&5 printf "%s\n" "$ac_cv_lib_umem_umem_alloc" >&6; } if test "x$ac_cv_lib_umem_umem_alloc" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for umem_free in -lumem" >&5 @@ -27995,16 +28515,22 @@ printf %s "checking for umem_free in -lumem... " >&6; } if test ${ac_cv_lib_umem_umem_free+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lumem $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char umem_free (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char umem_free (void); int main (void) { @@ -28016,20 +28542,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_umem_umem_free=yes -else $as_nop - ac_cv_lib_umem_umem_free=no +else case e in #( + e) ac_cv_lib_umem_umem_free=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_umem_umem_free" >&5 printf "%s\n" "$ac_cv_lib_umem_umem_free" >&6; } if test "x$ac_cv_lib_umem_umem_free" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if umem memory allocation library is complete" >&5 @@ -28077,8 +28606,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_CCMALLOCDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $CCMALLOCDelegate in +else case e in #( + e) case $CCMALLOCDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_CCMALLOCDelegate="$CCMALLOCDelegate" # Let the user override the test with a path. ;; @@ -28103,6 +28632,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi CCMALLOCDelegate=$ac_cv_path_CCMALLOCDelegate @@ -28125,16 +28655,22 @@ printf %s "checking for ccmalloc_malloc in -lccmalloc... " >&6; } if test ${ac_cv_lib_ccmalloc_ccmalloc_malloc+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lccmalloc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char ccmalloc_malloc (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char ccmalloc_malloc (void); int main (void) { @@ -28146,20 +28682,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ccmalloc_ccmalloc_malloc=yes -else $as_nop - ac_cv_lib_ccmalloc_ccmalloc_malloc=no +else case e in #( + e) ac_cv_lib_ccmalloc_ccmalloc_malloc=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ccmalloc_ccmalloc_malloc" >&5 printf "%s\n" "$ac_cv_lib_ccmalloc_ccmalloc_malloc" >&6; } if test "x$ac_cv_lib_ccmalloc_ccmalloc_malloc" = xyes then : CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl" -else $as_nop - ,-ldl +else case e in #( + e) ,-ldl ;; +esac fi if test -n "$CCMALLOC_LIBS"; then @@ -28202,8 +28741,9 @@ fi if test ${with_bzlib+y} then : withval=$with_bzlib; with_bzlib=$withval -else $as_nop - with_bzlib='yes' +else case e in #( + e) with_bzlib='yes' ;; +esac fi @@ -28221,12 +28761,86 @@ printf "%s\n" "" >&6; } failed=0 passed=0 found_libbz=0 + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bzip2 >= 1.0.0" >&5 +printf %s "checking for bzip2 >= 1.0.0... " >&6; } + +if test -n "$BZLIB_CFLAGS"; then + pkg_cv_BZLIB_CFLAGS="$BZLIB_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bzip2 >= 1.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "bzip2 >= 1.0.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_BZLIB_CFLAGS=`$PKG_CONFIG --cflags "bzip2 >= 1.0.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$BZLIB_LIBS"; then + pkg_cv_BZLIB_LIBS="$BZLIB_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bzip2 >= 1.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "bzip2 >= 1.0.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_BZLIB_LIBS=`$PKG_CONFIG --libs "bzip2 >= 1.0.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + BZLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bzip2 >= 1.0.0" 2>&1` + else + BZLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bzip2 >= 1.0.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$BZLIB_PKG_ERRORS" >&5 + + have_bzlib=no +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + have_bzlib=no +else + BZLIB_CFLAGS=$pkg_cv_BZLIB_CFLAGS + BZLIB_LIBS=$pkg_cv_BZLIB_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_bzlib=yes +fi + CFLAGS="$CFLAGS $BZLIB_CFLAGS" + LIBS="$LIBS $BZLIB_LIBS" ac_fn_c_check_header_compile "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" if test "x$ac_cv_header_bzlib_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompress in -lbz2" >&5 @@ -28234,16 +28848,22 @@ printf %s "checking for BZ2_bzDecompress in -lbz2... " >&6; } if test ${ac_cv_lib_bz2_BZ2_bzDecompress+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char BZ2_bzDecompress (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char BZ2_bzDecompress (void); int main (void) { @@ -28255,12 +28875,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bz2_BZ2_bzDecompress=yes -else $as_nop - ac_cv_lib_bz2_BZ2_bzDecompress=no +else case e in #( + e) ac_cv_lib_bz2_BZ2_bzDecompress=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompress" >&5 printf "%s\n" "$ac_cv_lib_bz2_BZ2_bzDecompress" >&6; } @@ -28275,16 +28897,22 @@ printf %s "checking for _imp__BZ2_decompress in -lbz2... " >&6; } if test ${ac_cv_lib_bz2__imp__BZ2_decompress+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char _imp__BZ2_decompress (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char _imp__BZ2_decompress (void); int main (void) { @@ -28296,12 +28924,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bz2__imp__BZ2_decompress=yes -else $as_nop - ac_cv_lib_bz2__imp__BZ2_decompress=no +else case e in #( + e) ac_cv_lib_bz2__imp__BZ2_decompress=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2__imp__BZ2_decompress" >&5 printf "%s\n" "$ac_cv_lib_bz2__imp__BZ2_decompress" >&6; } @@ -28348,6 +28978,7 @@ fi + # # Find the X11 include and library directories. # @@ -28365,7 +28996,7 @@ then : withval=$with_x; fi -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +# $have_x is 'yes', 'no', 'disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled @@ -28375,8 +29006,8 @@ else *,NONE | NONE,*) if test ${ac_cv_have_x+y} then : printf %s "(cached) " >&6 -else $as_nop - # One or both of the vars are not set, and there is no cached value. +else case e in #( + e) # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no # Do we need to do anything special at all? @@ -28499,13 +29130,14 @@ if ac_fn_c_try_cpp "$LINENO" then : # We can compile using X headers with no special include directory. ac_x_includes= -else $as_nop - for ac_dir in $ac_x_header_dirs; do +else case e in #( + e) for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi -done +done ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no @@ -28532,8 +29164,8 @@ then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= -else $as_nop - LIBS=$ac_save_LIBS +else case e in #( + e) LIBS=$ac_save_LIBS for ac_dir in `printf "%s\n" "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! @@ -28543,7 +29175,8 @@ do break 2 fi done -done +done ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -28560,6 +29193,7 @@ case $ac_x_includes,$ac_x_libraries in #( ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" ;; +esac ;; esac fi ;; #( @@ -28621,8 +29255,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" -else $as_nop - LIBS="$ac_xsave_LIBS -R $x_libraries" +else case e in #( + e) LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -28639,12 +29273,14 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 -printf "%s\n" "neither works" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 +printf "%s\n" "neither works" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -28668,8 +29304,14 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XOpenDisplay (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XOpenDisplay (void); int main (void) { @@ -28681,22 +29323,28 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 printf %s "checking for dnet_ntoa in -ldnet... " >&6; } if test ${ac_cv_lib_dnet_dnet_ntoa+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dnet_ntoa (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (void); int main (void) { @@ -28708,12 +29356,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_dnet_ntoa=yes -else $as_nop - ac_cv_lib_dnet_dnet_ntoa=no +else case e in #( + e) ac_cv_lib_dnet_dnet_ntoa=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_dnet_ntoa" >&6; } @@ -28728,16 +29378,22 @@ printf %s "checking for dnet_ntoa in -ldnet_stub... " >&6; } if test ${ac_cv_lib_dnet_stub_dnet_ntoa+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dnet_ntoa (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (void); int main (void) { @@ -28749,12 +29405,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_stub_dnet_ntoa=yes -else $as_nop - ac_cv_lib_dnet_stub_dnet_ntoa=no +else case e in #( + e) ac_cv_lib_dnet_stub_dnet_ntoa=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } @@ -28763,7 +29421,8 @@ then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi - fi + fi ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -28789,16 +29448,22 @@ printf %s "checking for gethostbyname in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_gethostbyname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (void); int main (void) { @@ -28810,12 +29475,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_gethostbyname=yes -else $as_nop - ac_cv_lib_nsl_gethostbyname=no +else case e in #( + e) ac_cv_lib_nsl_gethostbyname=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } @@ -28830,16 +29497,22 @@ printf %s "checking for gethostbyname in -lbsd... " >&6; } if test ${ac_cv_lib_bsd_gethostbyname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (void); int main (void) { @@ -28851,12 +29524,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bsd_gethostbyname=yes -else $as_nop - ac_cv_lib_bsd_gethostbyname=no +else case e in #( + e) ac_cv_lib_bsd_gethostbyname=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_bsd_gethostbyname" >&6; } @@ -28887,16 +29562,22 @@ printf %s "checking for connect in -lsocket... " >&6; } if test ${ac_cv_lib_socket_connect+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char connect (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char connect (void); int main (void) { @@ -28908,12 +29589,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_connect=yes -else $as_nop - ac_cv_lib_socket_connect=no +else case e in #( + e) ac_cv_lib_socket_connect=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 printf "%s\n" "$ac_cv_lib_socket_connect" >&6; } @@ -28937,16 +29620,22 @@ printf %s "checking for remove in -lposix... " >&6; } if test ${ac_cv_lib_posix_remove+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char remove (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char remove (void); int main (void) { @@ -28958,12 +29647,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_posix_remove=yes -else $as_nop - ac_cv_lib_posix_remove=no +else case e in #( + e) ac_cv_lib_posix_remove=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 printf "%s\n" "$ac_cv_lib_posix_remove" >&6; } @@ -28987,16 +29678,22 @@ printf %s "checking for shmat in -lipc... " >&6; } if test ${ac_cv_lib_ipc_shmat+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char shmat (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char shmat (void); int main (void) { @@ -29008,12 +29705,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ipc_shmat=yes -else $as_nop - ac_cv_lib_ipc_shmat=no +else case e in #( + e) ac_cv_lib_ipc_shmat=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 printf "%s\n" "$ac_cv_lib_ipc_shmat" >&6; } @@ -29039,16 +29738,22 @@ printf %s "checking for IceConnectionNumber in -lICE... " >&6; } if test ${ac_cv_lib_ICE_IceConnectionNumber+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char IceConnectionNumber (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char IceConnectionNumber (void); int main (void) { @@ -29060,12 +29765,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ICE_IceConnectionNumber=yes -else $as_nop - ac_cv_lib_ICE_IceConnectionNumber=no +else case e in #( + e) ac_cv_lib_ICE_IceConnectionNumber=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 printf "%s\n" "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } @@ -29111,8 +29818,14 @@ fi /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char shmctl (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char shmctl (void); int main (void) { @@ -29136,16 +29849,22 @@ printf %s "checking for XShmAttach in -lXext... " >&6; } if test ${ac_cv_lib_Xext_XShmAttach+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XShmAttach (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XShmAttach (void); int main (void) { @@ -29157,12 +29876,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xext_XShmAttach=yes -else $as_nop - ac_cv_lib_Xext_XShmAttach=no +else case e in #( + e) ac_cv_lib_Xext_XShmAttach=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShmAttach" >&5 printf "%s\n" "$ac_cv_lib_Xext_XShmAttach" >&6; } @@ -29183,16 +29904,22 @@ printf %s "checking for XShapeCombineMask in -lXext... " >&6; } if test ${ac_cv_lib_Xext_XShapeCombineMask+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XShapeCombineMask (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XShapeCombineMask (void); int main (void) { @@ -29204,12 +29931,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xext_XShapeCombineMask=yes -else $as_nop - ac_cv_lib_Xext_XShapeCombineMask=no +else case e in #( + e) ac_cv_lib_Xext_XShapeCombineMask=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShapeCombineMask" >&5 printf "%s\n" "$ac_cv_lib_Xext_XShapeCombineMask" >&6; } @@ -29225,16 +29954,22 @@ printf %s "checking for XtSetEventDispatcher in -lXt... " >&6; } if test ${ac_cv_lib_Xt_XtSetEventDispatcher+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XtSetEventDispatcher (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XtSetEventDispatcher (void); int main (void) { @@ -29246,12 +29981,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xt_XtSetEventDispatcher=yes -else $as_nop - ac_cv_lib_Xt_XtSetEventDispatcher=no +else case e in #( + e) ac_cv_lib_Xt_XtSetEventDispatcher=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xt_XtSetEventDispatcher" >&5 printf "%s\n" "$ac_cv_lib_Xt_XtSetEventDispatcher" >&6; } @@ -29287,8 +30024,9 @@ fi if test ${with_zlib+y} then : withval=$with_zlib; with_zlib=$withval -else $as_nop - with_zlib='yes' +else case e in #( + e) with_zlib='yes' ;; +esac fi @@ -29406,8 +30144,9 @@ fi if test ${with_zstd+y} then : withval=$with_zstd; with_zstd=$withval -else $as_nop - with_zstd='yes' +else case e in #( + e) with_zstd='yes' ;; +esac fi @@ -29538,8 +30277,9 @@ printf "%s\n" "" >&6; } if test "x$ac_cv_header_ltdl_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29562,8 +30302,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libltdl package is complete" >&5 @@ -29591,10 +30332,10 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "no" >&6; } fi if test "$have_ltdl" != 'yes' ; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 1 "libltdl is required for modules and OpenCL builds -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi fi if test "$have_ltdl" != 'no'; then @@ -29616,16 +30357,22 @@ printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -29637,12 +30384,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } @@ -29664,8 +30413,9 @@ fi if test ${with_apple_font_dir+y} then : withval=$with_apple_font_dir; with_apple_font_dir=$withval -else $as_nop - with_apple_font_dir='default' +else case e in #( + e) with_apple_font_dir='default' ;; +esac fi @@ -29682,8 +30432,9 @@ fi if test ${with_autotrace+y} then : withval=$with_autotrace; with_autotrace=$withval -else $as_nop - with_autotrace='no' +else case e in #( + e) with_autotrace='no' ;; +esac fi @@ -29800,8 +30551,9 @@ fi if test ${with_dps+y} then : withval=$with_dps; with_dps=$withval -else $as_nop - with_dps='no' +else case e in #( + e) with_dps='no' ;; +esac fi @@ -29826,8 +30578,9 @@ printf "%s\n" "" >&6; } if test "x$ac_cv_header_DPS_dpsXclient_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi # DPS issues: @@ -29842,16 +30595,22 @@ printf %s "checking for DPSInitialize in -ldps... " >&6; } if test ${ac_cv_lib_dps_DPSInitialize+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldps $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char DPSInitialize (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char DPSInitialize (void); int main (void) { @@ -29863,20 +30622,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dps_DPSInitialize=yes -else $as_nop - ac_cv_lib_dps_DPSInitialize=no +else case e in #( + e) ac_cv_lib_dps_DPSInitialize=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dps_DPSInitialize" >&5 printf "%s\n" "$ac_cv_lib_dps_DPSInitialize" >&6; } if test "x$ac_cv_lib_dps_DPSInitialize" = xyes then : have_libdps='yes' -else $as_nop - have_libdps='no', +else case e in #( + e) have_libdps='no', ;; +esac fi if test "$have_libdps" != 'yes'; then @@ -29887,16 +30649,22 @@ printf %s "checking for DPSInitialize in -ldps... " >&6; } if test ${ac_cv_lib_dps_DPSInitialize+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldps $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char DPSInitialize (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char DPSInitialize (void); int main (void) { @@ -29908,20 +30676,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dps_DPSInitialize=yes -else $as_nop - ac_cv_lib_dps_DPSInitialize=no +else case e in #( + e) ac_cv_lib_dps_DPSInitialize=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dps_DPSInitialize" >&5 printf "%s\n" "$ac_cv_lib_dps_DPSInitialize" >&6; } if test "x$ac_cv_lib_dps_DPSInitialize" = xyes then : have_libdps='yes' -else $as_nop - have_libdps='no',-lXt +else case e in #( + e) have_libdps='no',-lXt ;; +esac fi if test "$have_libdps" = 'yes'; then @@ -29938,16 +30709,22 @@ printf %s "checking for XDPSPixelsPerPoint in -ldpstk... " >&6; } if test ${ac_cv_lib_dpstk_XDPSPixelsPerPoint+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldpstk $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XDPSPixelsPerPoint (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XDPSPixelsPerPoint (void); int main (void) { @@ -29959,20 +30736,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dpstk_XDPSPixelsPerPoint=yes -else $as_nop - ac_cv_lib_dpstk_XDPSPixelsPerPoint=no +else case e in #( + e) ac_cv_lib_dpstk_XDPSPixelsPerPoint=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dpstk_XDPSPixelsPerPoint" >&5 printf "%s\n" "$ac_cv_lib_dpstk_XDPSPixelsPerPoint" >&6; } if test "x$ac_cv_lib_dpstk_XDPSPixelsPerPoint" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1`,-ldps $LIBDPS_XT +else case e in #( + e) failed=`expr $failed + 1`,-ldps $LIBDPS_XT ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if DPS package is complete" >&5 @@ -30018,8 +30798,9 @@ fi if test ${with_dejavu_font_dir+y} then : withval=$with_dejavu_font_dir; with_dejavu_font_dir=$withval -else $as_nop - with_dejavu_font_dir='default' +else case e in #( + e) with_dejavu_font_dir='default' ;; +esac fi @@ -30036,8 +30817,9 @@ fi if test ${with_fftw+y} then : withval=$with_fftw; with_fftw=$withval -else $as_nop - with_fftw='no' +else case e in #( + e) with_fftw='no' ;; +esac fi @@ -30156,8 +30938,9 @@ fi if test ${with_flif+y} then : withval=$with_flif; with_flif=$withval -else $as_nop - with_flif='yes' +else case e in #( + e) with_flif='yes' ;; +esac fi @@ -30180,8 +30963,9 @@ printf "%s\n" "" >&6; } if test "x$ac_cv_header_flif_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flif_create_decoder in -lflif" >&5 @@ -30189,16 +30973,22 @@ printf %s "checking for flif_create_decoder in -lflif... " >&6; } if test ${ac_cv_lib_flif_flif_create_decoder+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lflif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char flif_create_decoder (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char flif_create_decoder (void); int main (void) { @@ -30210,20 +31000,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_flif_flif_create_decoder=yes -else $as_nop - ac_cv_lib_flif_flif_create_decoder=no +else case e in #( + e) ac_cv_lib_flif_flif_create_decoder=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_flif_flif_create_decoder" >&5 printf "%s\n" "$ac_cv_lib_flif_flif_create_decoder" >&6; } if test "x$ac_cv_lib_flif_flif_create_decoder" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if FLIF package is complete" >&5 @@ -30267,8 +31060,9 @@ fi if test ${with_fpx+y} then : withval=$with_fpx; with_fpx=$withval -else $as_nop - with_fpx='no' +else case e in #( + e) with_fpx='no' ;; +esac fi @@ -30297,8 +31091,9 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "x$ac_cv_header_fpxlib_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FPX_OpenImageByFilename in -lfpx" >&5 @@ -30306,8 +31101,8 @@ printf %s "checking for FPX_OpenImageByFilename in -lfpx... " >&6; } if test ${ac_cv_lib_fpx_FPX_OpenImageByFilename+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lfpx $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -30326,20 +31121,23 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO" then : ac_cv_lib_fpx_FPX_OpenImageByFilename=yes -else $as_nop - ac_cv_lib_fpx_FPX_OpenImageByFilename=no +else case e in #( + e) ac_cv_lib_fpx_FPX_OpenImageByFilename=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fpx_FPX_OpenImageByFilename" >&5 printf "%s\n" "$ac_cv_lib_fpx_FPX_OpenImageByFilename" >&6; } if test "x$ac_cv_lib_fpx_FPX_OpenImageByFilename" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi ac_ext=c @@ -30389,8 +31187,9 @@ fi if test ${with_djvu+y} then : withval=$with_djvu; with_djvu=$withval -else $as_nop - with_djvu='yes' +else case e in #( + e) with_djvu='yes' ;; +esac fi @@ -30509,8 +31308,9 @@ fi if test ${with_fontconfig+y} then : withval=$with_fontconfig; with_fontconfig=$withval -else $as_nop - with_fontconfig='yes' +else case e in #( + e) with_fontconfig='yes' ;; +esac fi @@ -30627,8 +31427,9 @@ fi if test ${with_freetype+y} then : withval=$with_freetype; with_freetype=$withval -else $as_nop - with_freetype='yes' +else case e in #( + e) with_freetype='yes' ;; +esac fi @@ -30741,8 +31542,9 @@ fi if test ${with_raqm+y} then : withval=$with_raqm; with_raqm=$withval -else $as_nop - with_raqm='yes' +else case e in #( + e) with_raqm='yes' ;; +esac fi @@ -30859,8 +31661,9 @@ fi if test ${with_gdi32+y} then : withval=$with_gdi32; with_gdi32=$withval -else $as_nop - with_gdi32='yes' +else case e in #( + e) with_gdi32='yes' ;; +esac fi if test "$with_gdi32" != 'yes' ; then @@ -30883,8 +31686,9 @@ printf "%s\n" "" >&6; } if test "x$ac_cv_header_windows_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi ac_fn_c_check_header_compile "$LINENO" "winuser.h" "ac_cv_header_winuser_h" "#include @@ -30892,8 +31696,9 @@ fi if test "x$ac_cv_header_winuser_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi ac_fn_c_check_header_compile "$LINENO" "wingdi.h" "ac_cv_header_wingdi_h" "#include @@ -30901,8 +31706,9 @@ fi if test "x$ac_cv_header_wingdi_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if Windows GDI32 support is complete" >&5 @@ -30952,8 +31758,9 @@ fi if test ${with_gslib+y} then : withval=$with_gslib; with_gslib=$withval -else $as_nop - with_gslib='no' +else case e in #( + e) with_gslib='no' ;; +esac fi @@ -30978,16 +31785,18 @@ printf "%s\n" "" >&6; } if test "x$ac_cv_header_ghostscript_iapi_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi ac_fn_c_check_header_compile "$LINENO" "ghostscript/ierrors.h" "ac_cv_header_ghostscript_ierrors_h" "$ac_includes_default" if test "x$ac_cv_header_ghostscript_ierrors_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gsapi_new_instance in Ghostscript framework" >&5 @@ -30995,16 +31804,22 @@ printf %s "checking for gsapi_new_instance in Ghostscript framework... " >&6; } if test ${ac_cv_framework_Ghostscript_gsapi_new_instance+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_framework_save_LIBS=$LIBS +else case e in #( + e) ac_check_framework_save_LIBS=$LIBS LIBS="-framework Ghostscript $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gsapi_new_instance (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gsapi_new_instance (void); int main (void) { @@ -31016,34 +31831,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_framework_Ghostscript_gsapi_new_instance=yes -else $as_nop - ac_cv_framework_Ghostscript_gsapi_new_instance=no +else case e in #( + e) ac_cv_framework_Ghostscript_gsapi_new_instance=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_framework_save_LIBS +LIBS=$ac_check_framework_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_framework_Ghostscript_gsapi_new_instance" >&5 printf "%s\n" "$ac_cv_framework_Ghostscript_gsapi_new_instance" >&6; } if test $ac_cv_framework_Ghostscript_gsapi_new_instance = yes then : framework=`expr $framework + 1` -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gsapi_new_instance in -lgs" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gsapi_new_instance in -lgs" >&5 printf %s "checking for gsapi_new_instance in -lgs... " >&6; } if test ${ac_cv_lib_gs_gsapi_new_instance+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lgs $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gsapi_new_instance (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gsapi_new_instance (void); int main (void) { @@ -31055,22 +31878,26 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_gs_gsapi_new_instance=yes -else $as_nop - ac_cv_lib_gs_gsapi_new_instance=no +else case e in #( + e) ac_cv_lib_gs_gsapi_new_instance=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gs_gsapi_new_instance" >&5 printf "%s\n" "$ac_cv_lib_gs_gsapi_new_instance" >&6; } if test "x$ac_cv_lib_gs_gsapi_new_instance" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if Ghostscript package is complete" >&5 printf %s "checking if Ghostscript package is complete... " >&6; } @@ -31117,8 +31944,9 @@ fi if test ${with_fontpath+y} then : withval=$with_fontpath; with_fontpath=$withval -else $as_nop - with_fontpath='' +else case e in #( + e) with_fontpath='' ;; +esac fi @@ -31139,8 +31967,9 @@ fi if test ${with_gs_font_dir+y} then : withval=$with_gs_font_dir; with_gs_font_dir=$withval -else $as_nop - with_gs_font_dir='default' +else case e in #( + e) with_gs_font_dir='default' ;; +esac fi @@ -31157,8 +31986,9 @@ fi if test ${with_gvc+y} then : withval=$with_gvc; with_gvc=$withval -else $as_nop - with_gvc='yes' +else case e in #( + e) with_gvc='yes' ;; +esac fi @@ -31272,8 +32102,9 @@ fi if test ${with_heic+y} then : withval=$with_heic; with_heic=$withval -else $as_nop - with_heic='yes' +else case e in #( + e) with_heic='yes' ;; +esac fi @@ -31392,8 +32223,9 @@ fi if test ${with_jbig+y} then : withval=$with_jbig; with_jbig=$withval -else $as_nop - with_jbig='yes' +else case e in #( + e) with_jbig='yes' ;; +esac fi @@ -31412,8 +32244,9 @@ printf "%s\n" "" >&6; } if test "x$ac_cv_header_jbig_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for jbg_dec_init in -ljbig" >&5 @@ -31421,16 +32254,22 @@ printf %s "checking for jbg_dec_init in -ljbig... " >&6; } if test ${ac_cv_lib_jbig_jbg_dec_init+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ljbig $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char jbg_dec_init (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char jbg_dec_init (void); int main (void) { @@ -31442,20 +32281,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_jbig_jbg_dec_init=yes -else $as_nop - ac_cv_lib_jbig_jbg_dec_init=no +else case e in #( + e) ac_cv_lib_jbig_jbg_dec_init=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jbig_jbg_dec_init" >&5 printf "%s\n" "$ac_cv_lib_jbig_jbg_dec_init" >&6; } if test "x$ac_cv_lib_jbig_jbg_dec_init" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if JBIG package is complete" >&5 @@ -31499,8 +32341,9 @@ fi if test ${with_jpeg+y} then : withval=$with_jpeg; with_jpeg=$withval -else $as_nop - with_jpeg='yes' +else case e in #( + e) with_jpeg='yes' ;; +esac fi @@ -31519,36 +32362,115 @@ printf %s "checking for JPEG... " >&6; } printf "%s\n" "" >&6; } failed=0 passed=0 + + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libjpeg >= 2.0.0" >&5 +printf %s "checking for libjpeg >= 2.0.0... " >&6; } + +if test -n "$JPEG_CFLAGS"; then + pkg_cv_JPEG_CFLAGS="$JPEG_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libjpeg >= 2.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libjpeg >= 2.0.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_JPEG_CFLAGS=`$PKG_CONFIG --cflags "libjpeg >= 2.0.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$JPEG_LIBS"; then + pkg_cv_JPEG_LIBS="$JPEG_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libjpeg >= 2.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libjpeg >= 2.0.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_JPEG_LIBS=`$PKG_CONFIG --libs "libjpeg >= 2.0.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + JPEG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libjpeg >= 2.0.0" 2>&1` + else + JPEG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libjpeg >= 2.0.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$JPEG_PKG_ERRORS" >&5 + + have_jpeg=no +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + have_jpeg=no +else + JPEG_CFLAGS=$pkg_cv_JPEG_CFLAGS + JPEG_LIBS=$pkg_cv_JPEG_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_jpeg=yes +fi + CFLAGS="$CFLAGS $JPEG_CFLAGS" + LIBS="$LIBS $JPEG_LIBS" + ac_fn_c_check_header_compile "$LINENO" "jconfig.h" "ac_cv_header_jconfig_h" "$ac_includes_default" if test "x$ac_cv_header_jconfig_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi ac_fn_c_check_header_compile "$LINENO" "jerror.h" "ac_cv_header_jerror_h" "$ac_includes_default" if test "x$ac_cv_header_jerror_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi ac_fn_c_check_header_compile "$LINENO" "jmorecfg.h" "ac_cv_header_jmorecfg_h" "$ac_includes_default" if test "x$ac_cv_header_jmorecfg_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi ac_fn_c_check_header_compile "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" if test "x$ac_cv_header_jpeglib_h" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for jpeg_read_header in -ljpeg" >&5 @@ -31556,16 +32478,22 @@ printf %s "checking for jpeg_read_header in -ljpeg... " >&6; } if test ${ac_cv_lib_jpeg_jpeg_read_header+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char jpeg_read_header (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char jpeg_read_header (void); int main (void) { @@ -31577,20 +32505,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_jpeg_jpeg_read_header=yes -else $as_nop - ac_cv_lib_jpeg_jpeg_read_header=no +else case e in #( + e) ac_cv_lib_jpeg_jpeg_read_header=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_read_header" >&5 printf "%s\n" "$ac_cv_lib_jpeg_jpeg_read_header" >&6; } if test "x$ac_cv_lib_jpeg_jpeg_read_header" = xyes then : passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +else case e in #( + e) failed=`expr $failed + 1` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if JPEG package is complete" >&5 @@ -31626,6 +32557,7 @@ fi + # # Check for LCMS delegate library. # @@ -31634,8 +32566,9 @@ fi if test ${with_lcms+y} then : withval=$with_lcms; with_lcms=$withval -else $as_nop - with_lcms='yes' +else case e in #( + e) with_lcms='yes' ;; +esac fi if test "$with_lcms" != 'yes' ; then @@ -31768,8 +32701,9 @@ fi if test ${with_openjp2+y} then : withval=$with_openjp2; with_openjp2=$withval -else $as_nop - with_openjp2='yes' +else case e in #( + e) with_openjp2='yes' ;; +esac fi @@ -31887,8 +32821,9 @@ fi if test ${with_lqr+y} then : withval=$with_lqr; with_lqr=$withval -else $as_nop - with_lqr='yes' +else case e in #( + e) with_lqr='yes' ;; +esac fi @@ -32003,8 +32938,9 @@ fi if test ${with_lzma+y} then : withval=$with_lzma; with_lzma=$withval -else $as_nop - with_lzma='yes' +else case e in #( + e) with_lzma='yes' ;; +esac fi if test "$with_lzma" != 'yes' ; then @@ -32119,8 +33055,9 @@ fi if test ${with_openexr+y} then : withval=$with_openexr; with_openexr=$withval -else $as_nop - with_openexr='yes' +else case e in #( + e) with_openexr='yes' ;; +esac fi @@ -32237,8 +33174,9 @@ fi if test ${with_pango+y} then : withval=$with_pango; with_pango=$withval -else $as_nop - with_pango='yes' +else case e in #( + e) with_pango='yes' ;; +esac fi @@ -32444,8 +33382,9 @@ fi if test ${with_png+y} then : withval=$with_png; with_png=$withval -else $as_nop - with_png='yes' +else case e in #( + e) with_png='yes' ;; +esac fi @@ -32562,8 +33501,9 @@ fi if test ${with_raw+y} then : withval=$with_raw; with_raw=$withval -else $as_nop - with_raw='yes' +else case e in #( + e) with_raw='yes' ;; +esac fi @@ -32680,8 +33620,9 @@ fi if test ${with_rsvg+y} then : withval=$with_rsvg; with_rsvg=$withval -else $as_nop - with_rsvg='no' +else case e in #( + e) with_rsvg='no' ;; +esac fi @@ -32887,8 +33828,9 @@ fi if test ${with_tiff+y} then : withval=$with_tiff; with_tiff=$withval -else $as_nop - with_tiff='yes' +else case e in #( + e) with_tiff='yes' ;; +esac fi @@ -32897,326 +33839,94 @@ if test "$with_tiff" != 'yes'; then fi have_tiff='no' -TIFF_LIBS='' -if test "$with_tiff" != 'no'; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: -------------------------------------------------------------" >&5 +TIFF_CFLAGS="" +TIFF_LIBS="" +TIFF_PKG="" +if test "x$with_tiff" = "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: -------------------------------------------------------------" >&5 printf "%s\n" "-------------------------------------------------------------" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFF" >&5 -printf %s "checking for TIFF... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 -printf "%s\n" "" >&6; } - failed=0 - passed=0 - ac_fn_c_check_header_compile "$LINENO" "tiff.h" "ac_cv_header_tiff_h" "$ac_includes_default" -if test "x$ac_cv_header_tiff_h" = xyes -then : - passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` -fi - - ac_fn_c_check_header_compile "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" -if test "x$ac_cv_header_tiffio_h" = xyes -then : - passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 -printf %s "checking for TIFFOpen in -ltiff... " >&6; } -if test ${ac_cv_lib_tiff_TIFFOpen+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ltiff $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char TIFFOpen (); -int -main (void) -{ -return TIFFOpen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_tiff_TIFFOpen=yes -else $as_nop - ac_cv_lib_tiff_TIFFOpen=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 -printf "%s\n" "$ac_cv_lib_tiff_TIFFOpen" >&6; } -if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes -then : - passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFClientOpen in -ltiff" >&5 -printf %s "checking for TIFFClientOpen in -ltiff... " >&6; } -if test ${ac_cv_lib_tiff_TIFFClientOpen+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ltiff $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libtiff-4 >= 4.0.0" >&5 +printf %s "checking for libtiff-4 >= 4.0.0... " >&6; } -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char TIFFClientOpen (); -int -main (void) -{ -return TIFFClientOpen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_tiff_TIFFClientOpen=yes -else $as_nop - ac_cv_lib_tiff_TIFFClientOpen=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFClientOpen" >&5 -printf "%s\n" "$ac_cv_lib_tiff_TIFFClientOpen" >&6; } -if test "x$ac_cv_lib_tiff_TIFFClientOpen" = xyes -then : - passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +if test -n "$TIFF_CFLAGS"; then + pkg_cv_TIFF_CFLAGS="$TIFF_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtiff-4 >= 4.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libtiff-4 >= 4.0.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_TIFF_CFLAGS=`$PKG_CONFIG --cflags "libtiff-4 >= 4.0.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFIsByteSwapped in -ltiff" >&5 -printf %s "checking for TIFFIsByteSwapped in -ltiff... " >&6; } -if test ${ac_cv_lib_tiff_TIFFIsByteSwapped+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ltiff $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char TIFFIsByteSwapped (); -int -main (void) -{ -return TIFFIsByteSwapped (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_tiff_TIFFIsByteSwapped=yes -else $as_nop - ac_cv_lib_tiff_TIFFIsByteSwapped=no + else + pkg_failed=untried fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +if test -n "$TIFF_LIBS"; then + pkg_cv_TIFF_LIBS="$TIFF_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtiff-4 >= 4.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libtiff-4 >= 4.0.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_TIFF_LIBS=`$PKG_CONFIG --libs "libtiff-4 >= 4.0.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFIsByteSwapped" >&5 -printf "%s\n" "$ac_cv_lib_tiff_TIFFIsByteSwapped" >&6; } -if test "x$ac_cv_lib_tiff_TIFFIsByteSwapped" = xyes -then : - passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` + else + pkg_failed=untried fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFReadRGBATile in -ltiff" >&5 -printf %s "checking for TIFFReadRGBATile in -ltiff... " >&6; } -if test ${ac_cv_lib_tiff_TIFFReadRGBATile+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ltiff $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char TIFFReadRGBATile (); -int -main (void) -{ -return TIFFReadRGBATile (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_tiff_TIFFReadRGBATile=yes -else $as_nop - ac_cv_lib_tiff_TIFFReadRGBATile=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFReadRGBATile" >&5 -printf "%s\n" "$ac_cv_lib_tiff_TIFFReadRGBATile" >&6; } -if test "x$ac_cv_lib_tiff_TIFFReadRGBATile" = xyes -then : - passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFReadRGBAStrip in -ltiff" >&5 -printf %s "checking for TIFFReadRGBAStrip in -ltiff... " >&6; } -if test ${ac_cv_lib_tiff_TIFFReadRGBAStrip+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ltiff $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char TIFFReadRGBAStrip (); -int -main (void) -{ -return TIFFReadRGBAStrip (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_tiff_TIFFReadRGBAStrip=yes -else $as_nop - ac_cv_lib_tiff_TIFFReadRGBAStrip=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFReadRGBAStrip" >&5 -printf "%s\n" "$ac_cv_lib_tiff_TIFFReadRGBAStrip" >&6; } -if test "x$ac_cv_lib_tiff_TIFFReadRGBAStrip" = xyes -then : - passed=`expr $passed + 1` -else $as_nop - failed=`expr $failed + 1` +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if TIFF package is complete" >&5 -printf %s "checking if TIFF package is complete... " >&6; } - if test $passed -gt 0; then - if test $failed -gt 0; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no -- some components failed test" >&5 -printf "%s\n" "no -- some components failed test" >&6; } - have_tiff='no (failed tests)' + if test $_pkg_short_errors_supported = yes; then + TIFF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtiff-4 >= 4.0.0" 2>&1` else - TIFF_LIBS='-ltiff' - LIBS="$TIFF_LIBS $LIBS" - -printf "%s\n" "#define TIFF_DELEGATE 1" >>confdefs.h + TIFF_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtiff-4 >= 4.0.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$TIFF_PKG_ERRORS" >&5 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + have_tiff=no +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + have_tiff=no +else + TIFF_CFLAGS=$pkg_cv_TIFF_CFLAGS + TIFF_LIBS=$pkg_cv_TIFF_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - have_tiff='yes' - ac_fn_c_check_header_compile "$LINENO" "tiffconf.h" "ac_cv_header_tiffconf_h" "$ac_includes_default" -if test "x$ac_cv_header_tiffconf_h" = xyes -then : - printf "%s\n" "#define HAVE_TIFFCONF_H 1" >>confdefs.h - -fi - - ac_fn_c_check_func "$LINENO" "TIFFIsCODECConfigured" "ac_cv_func_TIFFIsCODECConfigured" -if test "x$ac_cv_func_TIFFIsCODECConfigured" = xyes -then : - printf "%s\n" "#define HAVE_TIFFISCODECCONFIGURED 1" >>confdefs.h - + have_tiff=yes fi -ac_fn_c_check_func "$LINENO" "TIFFMergeFieldInfo" "ac_cv_func_TIFFMergeFieldInfo" -if test "x$ac_cv_func_TIFFMergeFieldInfo" = xyes -then : - printf "%s\n" "#define HAVE_TIFFMERGEFIELDINFO 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "TIFFIsBigEndian" "ac_cv_func_TIFFIsBigEndian" -if test "x$ac_cv_func_TIFFIsBigEndian" = xyes -then : - printf "%s\n" "#define HAVE_TIFFISBIGENDIAN 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "TIFFSetErrorHandlerExt" "ac_cv_func_TIFFSetErrorHandlerExt" -if test "x$ac_cv_func_TIFFSetErrorHandlerExt" = xyes -then : - printf "%s\n" "#define HAVE_TIFFSETERRORHANDLEREXT 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "TIFFSetTagExtender" "ac_cv_func_TIFFSetTagExtender" -if test "x$ac_cv_func_TIFFSetTagExtender" = xyes -then : - printf "%s\n" "#define HAVE_TIFFSETTAGEXTENDER 1" >>confdefs.h - -fi -ac_fn_c_check_func "$LINENO" "TIFFReadEXIFDirectory" "ac_cv_func_TIFFReadEXIFDirectory" -if test "x$ac_cv_func_TIFFReadEXIFDirectory" = xyes -then : - printf "%s\n" "#define HAVE_TIFFREADEXIFDIRECTORY 1" >>confdefs.h - + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } fi -ac_fn_c_check_func "$LINENO" "TIFFReadGPSDirectory" "ac_cv_func_TIFFReadGPSDirectory" -if test "x$ac_cv_func_TIFFReadGPSDirectory" = xyes -then : - printf "%s\n" "#define HAVE_TIFFREADGPSDIRECTORY 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "TIFFSetWarningHandlerExt" "ac_cv_func_TIFFSetWarningHandlerExt" -if test "x$ac_cv_func_TIFFSetWarningHandlerExt" = xyes -then : - printf "%s\n" "#define HAVE_TIFFSETWARNINGHANDLEREXT 1" >>confdefs.h +if test "$have_tiff" = 'yes'; then -fi -ac_fn_c_check_func "$LINENO" "TIFFSwabArrayOfTriples" "ac_cv_func_TIFFSwabArrayOfTriples" -if test "x$ac_cv_func_TIFFSwabArrayOfTriples" = xyes -then : - printf "%s\n" "#define HAVE_TIFFSWABARRAYOFTRIPLES 1" >>confdefs.h +printf "%s\n" "#define TIFF_DELEGATE 1" >>confdefs.h + CFLAGS="$TIFF_CFLAGS $CFLAGS" fi - fi - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - fi -fi if test "$have_tiff" = 'yes'; then TIFF_DELEGATE_TRUE= TIFF_DELEGATE_FALSE='#' @@ -33228,6 +33938,7 @@ fi + # # Set URW Base35 font directory. # @@ -33236,8 +33947,9 @@ fi if test ${with_urw_base35_font_dir+y} then : withval=$with_urw_base35_font_dir; with_urw_base35_font_dir=$withval -else $as_nop - with_urw_base35_font_dir='default' +else case e in #( + e) with_urw_base35_font_dir='default' ;; +esac fi @@ -33246,6 +33958,25 @@ if test "$with_urw_base35_font_dir" != 'default'; then fi +# +# Set URW Base35 Type1 font directory. +# + +# Check whether --with-urw-base35-type1-font-dir was given. +if test ${with_urw_base35_type1_font_dir+y} +then : + withval=$with_urw_base35_type1_font_dir; with_urw_base35_type1_font_dir=$withval +else case e in #( + e) with_urw_base35_type1_font_dir='default' ;; +esac +fi + + +if test "$with_urw_base35_type1_font_dir" != 'default'; then + DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-urw-base35-type1-font-dir=$with_urw_base35_type1_font_dir " +fi + + # # Check for the WEBP delegate library. # @@ -33254,8 +33985,9 @@ fi if test ${with_webp+y} then : withval=$with_webp; with_webp=$withval -else $as_nop - with_webp='yes' +else case e in #( + e) with_webp='yes' ;; +esac fi @@ -33464,8 +34196,9 @@ fi if test ${with_windows_font_dir+y} then : withval=$with_windows_font_dir; with_windows_font_dir=$withval -else $as_nop - with_windows_font_dir='default' +else case e in #( + e) with_windows_font_dir='default' ;; +esac fi @@ -33482,8 +34215,9 @@ fi if test ${with_wmf+y} then : withval=$with_wmf; with_wmf=$withval -else $as_nop - with_wmf=$build_modules +else case e in #( + e) with_wmf=$build_modules ;; +esac fi @@ -33517,16 +34251,22 @@ printf %s "checking for wmf_lite_create in -lwmflite... " >&6; } if test ${ac_cv_lib_wmflite_wmf_lite_create+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lwmflite $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char wmf_lite_create (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char wmf_lite_create (void); int main (void) { @@ -33538,12 +34278,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_wmflite_wmf_lite_create=yes -else $as_nop - ac_cv_lib_wmflite_wmf_lite_create=no +else case e in #( + e) ac_cv_lib_wmflite_wmf_lite_create=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wmflite_wmf_lite_create" >&5 printf "%s\n" "$ac_cv_lib_wmflite_wmf_lite_create" >&6; } @@ -33598,8 +34340,9 @@ fi if test ${with_xml+y} then : withval=$with_xml; with_xml=$withval -else $as_nop - with_xml='yes' +else case e in #( + e) with_xml='yes' ;; +esac fi @@ -34457,15 +35200,15 @@ printf "%s\n" "#define EXECUTABLE_PATH \"$DEFINE_EXECUTABLE_PATH\"" >>confdefs.h # Path to ImageMagick lib -LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}" -DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/" +LIBRARY_ABSOLUTE_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}" +DEFINE_LIBRARY_ABSOLUTE_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/" case "${build_os}" in mingw* ) - DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1` + DEFINE_LIBRARY_ABSOLUTE_PATH=`$WinPathScript "$DEFINE_LIBRARY_ABSOLUTE_PATH" 1` ;; esac -printf "%s\n" "#define LIBRARY_PATH \"$DEFINE_LIBRARY_PATH\"" >>confdefs.h +printf "%s\n" "#define LIBRARY_ABSOLUTE_PATH \"$DEFINE_LIBRARY_ABSOLUTE_PATH\"" >>confdefs.h @@ -34486,7 +35229,7 @@ fi LIB_BIN_DIR_RELATIVE_PATH=$LIB_BIN_DIR -LIB_BIN_DIR_PATH="${LIBRARY_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}" +LIB_BIN_DIR_PATH="${LIBRARY_ABSOLUTE_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}" # @@ -34510,7 +35253,7 @@ fi MODULES_RELATIVE_PATH="${MODULES_DIRNAME}" -MODULES_PATH="${LIBRARY_PATH}/${MODULES_RELATIVE_PATH}" +MODULES_PATH="${LIBRARY_ABSOLUTE_PATH}/${MODULES_RELATIVE_PATH}" # @@ -34564,8 +35307,9 @@ printf "%s\n" "#define DOCUMENTATION_PATH \"$DEFINE_DOCUMENTATION_PATH\"" >>conf if test ${enable_docs+y} then : enableval=$enable_docs; wantdocs=$enableval -else $as_nop - wantdocs=yes +else case e in #( + e) wantdocs=yes ;; +esac fi if test "$wantdocs" = "yes"; then @@ -34632,7 +35376,7 @@ fi SHAREARCH_RELATIVE_PATH="${SHAREARCH_DIRNAME}" -SHAREARCH_PATH="${LIBRARY_PATH}/${SHAREARCH_RELATIVE_PATH}" +SHAREARCH_PATH="${LIBRARY_ABSOLUTE_PATH}/${SHAREARCH_RELATIVE_PATH}" # @@ -34651,7 +35395,8 @@ BPGDecodeDelegateDefault='bpgdec' BPGEncodeDelegateDefault='bpgenc' BlenderDecodeDelegateDefault='blender' BrowseDelegateDefault='xdg-open' -DNGDecodeDelegateDefault='ufraw-batch' +ClipboardDelegateDefault='xclip' +DNGDecodeDelegateDefault='darktable-cli' DOCDecodeDelegateDefault='libreoffice' GVCDecodeDelegateDefault='dot' DVIDecodeDelegateDefault='dvips' @@ -34669,6 +35414,7 @@ LEPDelegateDefault='lepton' LPDelegateDefault='lp' LPRDelegateDefault='lpr' LaunchDelegateDefault='gimp' +MKDIRDelegateDefault='mkdir' MrSIDDecodeDelegateDefault='mrsidgeodecode' MVDelegateDefault='mv' PCLDelegateDefault='pcl6' @@ -34699,8 +35445,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_BPGDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $BPGDecodeDelegate in +else case e in #( + e) case $BPGDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_BPGDecodeDelegate="$BPGDecodeDelegate" # Let the user override the test with a path. ;; @@ -34726,6 +35472,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_BPGDecodeDelegate" && ac_cv_path_BPGDecodeDelegate=""$BPGDecodeDelegateDefault"" ;; +esac ;; esac fi BPGDecodeDelegate=$ac_cv_path_BPGDecodeDelegate @@ -34745,8 +35492,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_BPGEncodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $BPGEncodeDelegate in +else case e in #( + e) case $BPGEncodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_BPGEncodeDelegate="$BPGEncodeDelegate" # Let the user override the test with a path. ;; @@ -34772,6 +35519,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_BPGEncodeDelegate" && ac_cv_path_BPGEncodeDelegate=""$BPGEncodeDelegateDefault"" ;; +esac ;; esac fi BPGEncodeDelegate=$ac_cv_path_BPGEncodeDelegate @@ -34791,8 +35539,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_BlenderDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $BlenderDecodeDelegate in +else case e in #( + e) case $BlenderDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_BlenderDecodeDelegate="$BlenderDecodeDelegate" # Let the user override the test with a path. ;; @@ -34818,6 +35566,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_BlenderDecodeDelegate" && ac_cv_path_BlenderDecodeDelegate=""$BlenderDecodeDelegateDefault"" ;; +esac ;; esac fi BlenderDecodeDelegate=$ac_cv_path_BlenderDecodeDelegate @@ -34830,7 +35579,7 @@ printf "%s\n" "no" >&6; } fi -for ac_prog in "$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx +for ac_prog in "$BrowseDelegateDefault" brave-browser microsoft-edge google-chrome firefox konqueror lynx do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -34839,8 +35588,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_BrowseDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $BrowseDelegate in +else case e in #( + e) case $BrowseDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_BrowseDelegate="$BrowseDelegate" # Let the user override the test with a path. ;; @@ -34865,6 +35614,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi BrowseDelegate=$ac_cv_path_BrowseDelegate @@ -34881,6 +35631,58 @@ fi done test -n "$BrowseDelegate" || BrowseDelegate=""$BrowseDelegateDefault"" +for ac_prog in "$ClipboardDelegateDefault" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ClipboardDelegate+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $ClipboardDelegate in + [\\/]* | ?:[\\/]*) + ac_cv_path_ClipboardDelegate="$ClipboardDelegate" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ClipboardDelegate="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +ClipboardDelegate=$ac_cv_path_ClipboardDelegate +if test -n "$ClipboardDelegate"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ClipboardDelegate" >&5 +printf "%s\n" "$ClipboardDelegate" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ClipboardDelegate" && break +done +test -n "$ClipboardDelegate" || ClipboardDelegate=""$ClipboardDelegateDefault"" + # Extract the first word of ""$DNGDecodeDelegateDefault"", so it can be a program name with args. set dummy "$DNGDecodeDelegateDefault"; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -34888,8 +35690,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DNGDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $DNGDecodeDelegate in +else case e in #( + e) case $DNGDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_DNGDecodeDelegate="$DNGDecodeDelegate" # Let the user override the test with a path. ;; @@ -34915,6 +35717,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_DNGDecodeDelegate" && ac_cv_path_DNGDecodeDelegate=""$DNGDecodeDelegateDefault"" ;; +esac ;; esac fi DNGDecodeDelegate=$ac_cv_path_DNGDecodeDelegate @@ -34934,8 +35737,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DOCDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $DOCDecodeDelegate in +else case e in #( + e) case $DOCDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_DOCDecodeDelegate="$DOCDecodeDelegate" # Let the user override the test with a path. ;; @@ -34961,6 +35764,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_DOCDecodeDelegate" && ac_cv_path_DOCDecodeDelegate=""$DOCDecodeDelegateDefault"" ;; +esac ;; esac fi DOCDecodeDelegate=$ac_cv_path_DOCDecodeDelegate @@ -34980,8 +35784,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DVIDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $DVIDecodeDelegate in +else case e in #( + e) case $DVIDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_DVIDecodeDelegate="$DVIDecodeDelegate" # Let the user override the test with a path. ;; @@ -35007,6 +35811,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_DVIDecodeDelegate" && ac_cv_path_DVIDecodeDelegate=""$DVIDecodeDelegateDefault"" ;; +esac ;; esac fi DVIDecodeDelegate=$ac_cv_path_DVIDecodeDelegate @@ -35026,8 +35831,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ConvertDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $ConvertDelegate in +else case e in #( + e) case $ConvertDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_ConvertDelegate="$ConvertDelegate" # Let the user override the test with a path. ;; @@ -35053,6 +35858,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_ConvertDelegate" && ac_cv_path_ConvertDelegate=""$ConvertDelegateDefault"" ;; +esac ;; esac fi ConvertDelegate=$ac_cv_path_ConvertDelegate @@ -35072,8 +35878,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DisplayDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $DisplayDelegate in +else case e in #( + e) case $DisplayDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_DisplayDelegate="$DisplayDelegate" # Let the user override the test with a path. ;; @@ -35099,6 +35905,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_DisplayDelegate" && ac_cv_path_DisplayDelegate=""$DisplayDelegateDefault"" ;; +esac ;; esac fi DisplayDelegate=$ac_cv_path_DisplayDelegate @@ -35118,8 +35925,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_EditorDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $EditorDelegate in +else case e in #( + e) case $EditorDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_EditorDelegate="$EditorDelegate" # Let the user override the test with a path. ;; @@ -35145,6 +35952,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_EditorDelegate" && ac_cv_path_EditorDelegate=""$EditorDelegateDefault"" ;; +esac ;; esac fi EditorDelegate=$ac_cv_path_EditorDelegate @@ -35164,8 +35972,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GVCDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $GVCDecodeDelegate in +else case e in #( + e) case $GVCDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_GVCDecodeDelegate="$GVCDecodeDelegate" # Let the user override the test with a path. ;; @@ -35191,6 +35999,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_GVCDecodeDelegate" && ac_cv_path_GVCDecodeDelegate=""$GVCDecodeDelegateDefault"" ;; +esac ;; esac fi GVCDecodeDelegate=$ac_cv_path_GVCDecodeDelegate @@ -35210,8 +36019,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_HPGLDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $HPGLDecodeDelegate in +else case e in #( + e) case $HPGLDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_HPGLDecodeDelegate="$HPGLDecodeDelegate" # Let the user override the test with a path. ;; @@ -35237,6 +36046,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_HPGLDecodeDelegate" && ac_cv_path_HPGLDecodeDelegate=""$HPGLDecodeDelegateDefault"" ;; +esac ;; esac fi HPGLDecodeDelegate=$ac_cv_path_HPGLDecodeDelegate @@ -35256,8 +36066,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_HTMLDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $HTMLDecodeDelegate in +else case e in #( + e) case $HTMLDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_HTMLDecodeDelegate="$HTMLDecodeDelegate" # Let the user override the test with a path. ;; @@ -35283,6 +36093,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_HTMLDecodeDelegate" && ac_cv_path_HTMLDecodeDelegate=""$HTMLDecodeDelegateDefault"" ;; +esac ;; esac fi HTMLDecodeDelegate=$ac_cv_path_HTMLDecodeDelegate @@ -35302,8 +36113,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ILBMDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $ILBMDecodeDelegate in +else case e in #( + e) case $ILBMDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_ILBMDecodeDelegate="$ILBMDecodeDelegate" # Let the user override the test with a path. ;; @@ -35329,6 +36140,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_ILBMDecodeDelegate" && ac_cv_path_ILBMDecodeDelegate=""$ILBMDecodeDelegateDefault"" ;; +esac ;; esac fi ILBMDecodeDelegate=$ac_cv_path_ILBMDecodeDelegate @@ -35348,8 +36160,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ILBMEncodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $ILBMEncodeDelegate in +else case e in #( + e) case $ILBMEncodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_ILBMEncodeDelegate="$ILBMEncodeDelegate" # Let the user override the test with a path. ;; @@ -35375,6 +36187,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_ILBMEncodeDelegate" && ac_cv_path_ILBMEncodeDelegate=""$ILBMEncodeDelegateDefault"" ;; +esac ;; esac fi ILBMEncodeDelegate=$ac_cv_path_ILBMEncodeDelegate @@ -35394,8 +36207,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_JXRDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $JXRDecodeDelegate in +else case e in #( + e) case $JXRDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_JXRDecodeDelegate="$JXRDecodeDelegate" # Let the user override the test with a path. ;; @@ -35421,6 +36234,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_JXRDecodeDelegate" && ac_cv_path_JXRDecodeDelegate=""$JXRDecodeDelegateDefault"" ;; +esac ;; esac fi JXRDecodeDelegate=$ac_cv_path_JXRDecodeDelegate @@ -35440,8 +36254,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_JXREncodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $JXREncodeDelegate in +else case e in #( + e) case $JXREncodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_JXREncodeDelegate="$JXREncodeDelegate" # Let the user override the test with a path. ;; @@ -35467,6 +36281,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_JXREncodeDelegate" && ac_cv_path_JXREncodeDelegate=""$JXREncodeDelegateDefault"" ;; +esac ;; esac fi JXREncodeDelegate=$ac_cv_path_JXREncodeDelegate @@ -35486,8 +36301,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_LEPDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $LEPDelegate in +else case e in #( + e) case $LEPDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_LEPDelegate="$LEPDelegate" # Let the user override the test with a path. ;; @@ -35513,6 +36328,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_LEPDelegate" && ac_cv_path_LEPDelegate=""$LEPDelegateDefault"" ;; +esac ;; esac fi LEPDelegate=$ac_cv_path_LEPDelegate @@ -35532,8 +36348,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_LPDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $LPDelegate in +else case e in #( + e) case $LPDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_LPDelegate="$LPDelegate" # Let the user override the test with a path. ;; @@ -35559,6 +36375,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_LPDelegate" && ac_cv_path_LPDelegate="no" ;; +esac ;; esac fi LPDelegate=$ac_cv_path_LPDelegate @@ -35578,8 +36395,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_LPRDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $LPRDelegate in +else case e in #( + e) case $LPRDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_LPRDelegate="$LPRDelegate" # Let the user override the test with a path. ;; @@ -35605,6 +36422,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_LPRDelegate" && ac_cv_path_LPRDelegate=""$LPRDelegateDefault"" ;; +esac ;; esac fi LPRDelegate=$ac_cv_path_LPRDelegate @@ -35624,8 +36442,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_LaunchDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $LaunchDelegate in +else case e in #( + e) case $LaunchDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_LaunchDelegate="$LaunchDelegate" # Let the user override the test with a path. ;; @@ -35651,6 +36469,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_LaunchDelegate" && ac_cv_path_LaunchDelegate=""$LaunchDelegateDefault"" ;; +esac ;; esac fi LaunchDelegate=$ac_cv_path_LaunchDelegate @@ -35663,17 +36482,17 @@ printf "%s\n" "no" >&6; } fi -# Extract the first word of ""$MogrifyDelegateDefault"", so it can be a program name with args. -set dummy "$MogrifyDelegateDefault"; ac_word=$2 +# Extract the first word of ""$MKDIRDelegateDefault"", so it can be a program name with args. +set dummy "$MKDIRDelegateDefault"; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_MogrifyDelegate+y} +if test ${ac_cv_path_MKDIRDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MogrifyDelegate in +else case e in #( + e) case $MKDIRDelegate in [\\/]* | ?:[\\/]*) - ac_cv_path_MogrifyDelegate="$MogrifyDelegate" # Let the user override the test with a path. + ac_cv_path_MKDIRDelegate="$MKDIRDelegate" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -35687,7 +36506,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_MogrifyDelegate="$as_dir$ac_word$ac_exec_ext" + ac_cv_path_MKDIRDelegate="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -35695,77 +36514,32 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_MogrifyDelegate" && ac_cv_path_MogrifyDelegate=""$MogrifyDelegateDefault"" + test -z "$ac_cv_path_MKDIRDelegate" && ac_cv_path_MKDIRDelegate=""$MKDIRDelegateDefault"" ;; +esac ;; esac fi -MogrifyDelegate=$ac_cv_path_MogrifyDelegate -if test -n "$MogrifyDelegate"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MogrifyDelegate" >&5 -printf "%s\n" "$MogrifyDelegate" >&6; } +MKDIRDelegate=$ac_cv_path_MKDIRDelegate +if test -n "$MKDIRDelegate"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIRDelegate" >&5 +printf "%s\n" "$MKDIRDelegate" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi -# Extract the first word of ""$VIDEODecodeDelegateDefault"", so it can be a program name with args. -set dummy "$VIDEODecodeDelegateDefault"; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_VIDEODecodeDelegate+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $VIDEODecodeDelegate in - [\\/]* | ?:[\\/]*) - ac_cv_path_VIDEODecodeDelegate="$VIDEODecodeDelegate" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_VIDEODecodeDelegate="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_VIDEODecodeDelegate" && ac_cv_path_VIDEODecodeDelegate=""$VIDEODecodeDelegateDefault"" - ;; -esac -fi -VIDEODecodeDelegate=$ac_cv_path_VIDEODecodeDelegate -if test -n "$VIDEODecodeDelegate"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $VIDEODecodeDelegate" >&5 -printf "%s\n" "$VIDEODecodeDelegate" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -# Extract the first word of ""$VIDEOEncodeDelegateDefault"", so it can be a program name with args. -set dummy "$VIDEOEncodeDelegateDefault"; ac_word=$2 +# Extract the first word of ""$MogrifyDelegateDefault"", so it can be a program name with args. +set dummy "$MogrifyDelegateDefault"; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_VIDEOEncodeDelegate+y} +if test ${ac_cv_path_MogrifyDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $VIDEOEncodeDelegate in +else case e in #( + e) case $MogrifyDelegate in [\\/]* | ?:[\\/]*) - ac_cv_path_VIDEOEncodeDelegate="$VIDEOEncodeDelegate" # Let the user override the test with a path. + ac_cv_path_MogrifyDelegate="$MogrifyDelegate" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -35779,7 +36553,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_VIDEOEncodeDelegate="$as_dir$ac_word$ac_exec_ext" + ac_cv_path_MogrifyDelegate="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -35787,14 +36561,15 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_VIDEOEncodeDelegate" && ac_cv_path_VIDEOEncodeDelegate=""$VIDEOEncodeDelegateDefault"" + test -z "$ac_cv_path_MogrifyDelegate" && ac_cv_path_MogrifyDelegate=""$MogrifyDelegateDefault"" ;; +esac ;; esac fi -VIDEOEncodeDelegate=$ac_cv_path_VIDEOEncodeDelegate -if test -n "$VIDEOEncodeDelegate"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $VIDEOEncodeDelegate" >&5 -printf "%s\n" "$VIDEOEncodeDelegate" >&6; } +MogrifyDelegate=$ac_cv_path_MogrifyDelegate +if test -n "$MogrifyDelegate"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MogrifyDelegate" >&5 +printf "%s\n" "$MogrifyDelegate" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } @@ -35808,8 +36583,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MrSIDDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MrSIDDecodeDelegate in +else case e in #( + e) case $MrSIDDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_MrSIDDecodeDelegate="$MrSIDDecodeDelegate" # Let the user override the test with a path. ;; @@ -35835,6 +36610,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_MrSIDDecodeDelegate" && ac_cv_path_MrSIDDecodeDelegate=""$MrSIDDecodeDelegateDefault"" ;; +esac ;; esac fi MrSIDDecodeDelegate=$ac_cv_path_MrSIDDecodeDelegate @@ -35854,8 +36630,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MVDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MVDelegate in +else case e in #( + e) case $MVDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_MVDelegate="$MVDelegate" # Let the user override the test with a path. ;; @@ -35881,6 +36657,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_MVDelegate" && ac_cv_path_MVDelegate=""$MVDelegateDefault"" ;; +esac ;; esac fi MVDelegate=$ac_cv_path_MVDelegate @@ -35900,8 +36677,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PCLDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $PCLDelegate in +else case e in #( + e) case $PCLDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_PCLDelegate="$PCLDelegate" # Let the user override the test with a path. ;; @@ -35927,6 +36704,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_PCLDelegate" && ac_cv_path_PCLDelegate=""$PCLDelegateDefault"" ;; +esac ;; esac fi PCLDelegate=$ac_cv_path_PCLDelegate @@ -35948,8 +36726,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PSDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $PSDelegate in +else case e in #( + e) case $PSDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_PSDelegate="$PSDelegate" # Let the user override the test with a path. ;; @@ -35974,6 +36752,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi PSDelegate=$ac_cv_path_PSDelegate @@ -35997,8 +36776,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_RMDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $RMDelegate in +else case e in #( + e) case $RMDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_RMDelegate="$RMDelegate" # Let the user override the test with a path. ;; @@ -36024,6 +36803,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_RMDelegate" && ac_cv_path_RMDelegate=""$RMDelegateDefault"" ;; +esac ;; esac fi RMDelegate=$ac_cv_path_RMDelegate @@ -36043,8 +36823,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_RSVGDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $RSVGDecodeDelegate in +else case e in #( + e) case $RSVGDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_RSVGDecodeDelegate="$RSVGDecodeDelegate" # Let the user override the test with a path. ;; @@ -36070,6 +36850,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_RSVGDecodeDelegate" && ac_cv_path_RSVGDecodeDelegate=""$RSVGDecodeDelegateDefault"" ;; +esac ;; esac fi RSVGDecodeDelegate=$ac_cv_path_RSVGDecodeDelegate @@ -36089,8 +36870,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_SVGDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $SVGDecodeDelegate in +else case e in #( + e) case $SVGDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_SVGDecodeDelegate="$SVGDecodeDelegate" # Let the user override the test with a path. ;; @@ -36116,6 +36897,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_SVGDecodeDelegate" && ac_cv_path_SVGDecodeDelegate=""$SVGDecodeDelegateDefault"" ;; +esac ;; esac fi SVGDecodeDelegate=$ac_cv_path_SVGDecodeDelegate @@ -36135,8 +36917,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_TextEncodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $TextEncodeDelegate in +else case e in #( + e) case $TextEncodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_TextEncodeDelegate="$TextEncodeDelegate" # Let the user override the test with a path. ;; @@ -36162,6 +36944,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_TextEncodeDelegate" && ac_cv_path_TextEncodeDelegate=""$TextEncodeDelegateDefault"" ;; +esac ;; esac fi TextEncodeDelegate=$ac_cv_path_TextEncodeDelegate @@ -36181,8 +36964,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_TraceEncodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $TraceEncodeDelegate in +else case e in #( + e) case $TraceEncodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_TraceEncodeDelegate="$TraceEncodeDelegate" # Let the user override the test with a path. ;; @@ -36208,6 +36991,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_TraceEncodeDelegate" && ac_cv_path_TraceEncodeDelegate=""$TraceEncodeDelegateDefault"" ;; +esac ;; esac fi TraceEncodeDelegate=$ac_cv_path_TraceEncodeDelegate @@ -36220,6 +37004,100 @@ printf "%s\n" "no" >&6; } fi +# Extract the first word of ""$VIDEODecodeDelegateDefault"", so it can be a program name with args. +set dummy "$VIDEODecodeDelegateDefault"; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_VIDEODecodeDelegate+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $VIDEODecodeDelegate in + [\\/]* | ?:[\\/]*) + ac_cv_path_VIDEODecodeDelegate="$VIDEODecodeDelegate" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_VIDEODecodeDelegate="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_VIDEODecodeDelegate" && ac_cv_path_VIDEODecodeDelegate=""$VIDEODecodeDelegateDefault"" + ;; +esac ;; +esac +fi +VIDEODecodeDelegate=$ac_cv_path_VIDEODecodeDelegate +if test -n "$VIDEODecodeDelegate"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $VIDEODecodeDelegate" >&5 +printf "%s\n" "$VIDEODecodeDelegate" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +# Extract the first word of ""$VIDEOEncodeDelegateDefault"", so it can be a program name with args. +set dummy "$VIDEOEncodeDelegateDefault"; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_VIDEOEncodeDelegate+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $VIDEOEncodeDelegate in + [\\/]* | ?:[\\/]*) + ac_cv_path_VIDEOEncodeDelegate="$VIDEOEncodeDelegate" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_VIDEOEncodeDelegate="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_VIDEOEncodeDelegate" && ac_cv_path_VIDEOEncodeDelegate=""$VIDEOEncodeDelegateDefault"" + ;; +esac ;; +esac +fi +VIDEOEncodeDelegate=$ac_cv_path_VIDEOEncodeDelegate +if test -n "$VIDEOEncodeDelegate"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $VIDEOEncodeDelegate" >&5 +printf "%s\n" "$VIDEOEncodeDelegate" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + # Extract the first word of ""$WebPDecodeDelegateDefault"", so it can be a program name with args. set dummy "$WebPDecodeDelegateDefault"; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -36227,8 +37105,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_WebPDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $WebPDecodeDelegate in +else case e in #( + e) case $WebPDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_WebPDecodeDelegate="$WebPDecodeDelegate" # Let the user override the test with a path. ;; @@ -36254,6 +37132,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_WebPDecodeDelegate" && ac_cv_path_WebPDecodeDelegate=""$WebPDecodeDelegateDefault"" ;; +esac ;; esac fi WebPDecodeDelegate=$ac_cv_path_WebPDecodeDelegate @@ -36273,8 +37152,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_WebPEncodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $WebPEncodeDelegate in +else case e in #( + e) case $WebPEncodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_WebPEncodeDelegate="$WebPEncodeDelegate" # Let the user override the test with a path. ;; @@ -36300,6 +37179,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_WebPEncodeDelegate" && ac_cv_path_WebPEncodeDelegate=""$WebPEncodeDelegateDefault"" ;; +esac ;; esac fi WebPEncodeDelegate=$ac_cv_path_WebPEncodeDelegate @@ -36319,8 +37199,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_WWWDecodeDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $WWWDecodeDelegate in +else case e in #( + e) case $WWWDecodeDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_WWWDecodeDelegate="$WWWDecodeDelegate" # Let the user override the test with a path. ;; @@ -36346,6 +37226,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_WWWDecodeDelegate" && ac_cv_path_WWWDecodeDelegate=""$WWWDecodeDelegateDelegateDefault"" ;; +esac ;; esac fi WWWDecodeDelegate=$ac_cv_path_WWWDecodeDelegate @@ -36365,8 +37246,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_XPSDelegate+y} then : printf %s "(cached) " >&6 -else $as_nop - case $XPSDelegate in +else case e in #( + e) case $XPSDelegate in [\\/]* | ?:[\\/]*) ac_cv_path_XPSDelegate="$XPSDelegate" # Let the user override the test with a path. ;; @@ -36392,6 +37273,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_XPSDelegate" && ac_cv_path_XPSDelegate=""$XPSDelegateDefault"" ;; +esac ;; esac fi XPSDelegate=$ac_cv_path_XPSDelegate @@ -36464,8 +37346,8 @@ dejavu_font_dir='' if test "${with_dejavu_font_dir}" != 'default'; then dejavu_font_dir="${with_dejavu_font_dir}/" else - for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do - if test -f "${font_dir}DejaVuSerif.ttf"; then + for font_dir in "${prefix}/share/fonts/dejavu" "${prefix}/share/dejavu-serif-fonts/fonts/" '/usr/share/fonts/dejavu-serif-fonts/' '/usr/share/fonts/truetype/dejavu/'; do + if test -f "${font_dir}URWGothic-Book.otf"; then dejavu_font_dir="${font_dir}" break 1 fi @@ -36529,15 +37411,15 @@ case "${build_os}" in ;; esac -# URW-base35 fonts. +# URW-base35 OTF fonts. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for URW-base35 fonts directory" >&5 printf %s "checking for URW-base35 fonts directory... " >&6; } urw_base35_font_dir='' if test "${with_urw_base35_font_dir}" != 'default'; then urw_base35_font_dir="${with_urw_base35_font_dir}/" else - for font_dir in "${prefix}/share/urw-base35/fonts/" '/usr/share/fonts/urw-base35/' '/usr/share/fonts/type1/urw-base35/'; do - if test -f "${font_dir}StandardSymbolsPS.t1"; then + for font_dir in "${prefix}/share/urw-base35/fonts/" "${prefix}/share/fonts/opentype/urw-base35" '/usr/share/fonts/urw-base35/' '/usr/share/fonts/opentype/urw-base35/'; do + if test -f "${font_dir}URWGothic-Book.otf"; then urw_base35_font_dir="${font_dir}" break 1 fi @@ -36553,12 +37435,43 @@ printf "%s\n" "not found!" >&6; }; fi +# URW-base35 Type1 fonts. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for URW-base35 Type1 fonts directory" >&5 +printf %s "checking for URW-base35 Type1 fonts directory... " >&6; } +urw_base35_type1_font_dir='' +if test "${with_urw_base35_type1_font_dir}" != 'default'; then + urw_base35_type1_font_dir="${with_urw_base35_type1_font_dir}/" +else + for font_dir in "${prefix}/share/urw-base35/fonts/" "${prefix}/share/fonts/type1/urw-base35" '/usr/share/fonts/urw-base35/' '/usr/share/fonts/type1/urw-base35/'; do + if test -f "${font_dir}URWGothic-Book.t1"; then + urw_base35_type1_font_dir="${font_dir}" + break 1 + fi + done +fi +if test "${urw_base35_type1_font_dir}x" != 'x'; then + type_include_files="${type_include_files} "'' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $urw_base35_type1_font_dir" >&5 +printf "%s\n" "$urw_base35_type1_font_dir" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found!" >&5 +printf "%s\n" "not found!" >&6; }; +fi + + # Windows fonts. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Windows fonts directory" >&5 printf %s "checking for Windows fonts directory... " >&6; } windows_font_dir='' if test "${with_windows_font_dir}" != 'default'; then windows_font_dir="${with_windows_font_dir}/" +else + for font_dir in '/usr/share/wine/fonts/' '/usr/share/fonts/msttcore/' '/usr/share/fonts/microsoft/' '/usr/share/fonts/truetype/msttcorefonts/'; do + if test -f "${font_dir}arial.ttf"; then + windows_font_dir="${font_dir}" + break 1 + fi + done fi if test "${windows_font_dir}x" != 'x'; then type_include_files="${type_include_files} "'' @@ -36572,6 +37485,24 @@ fi +# Permit enciphering and deciphering image pixels. +# Check whether --enable-cipher was given. +if test ${enable_cipher+y} +then : + enableval=$enable_cipher; enable_cipher=$enableval +else case e in #( + e) enable_cipher='yes' ;; +esac +fi + + +if test "$enable_cipher" = 'yes'; then + +printf "%s\n" "#define CIPHER_SUPPORT 1" >>confdefs.h + + MAGICK_FEATURES="Cipher $MAGICK_FEATURES" +fi + # # Handle case where user doesn't want frozen paths # @@ -36581,6 +37512,7 @@ if test "$with_frozenpaths" != 'yes'; then BPGEncodeDelegate="$BPGEncodeDelegateDefault" BlenderDecodeDelegate="$BlenderDecodeDelegateDefault" BrowseDelegate="$BrowseDelegateDefault" + ClipboardDelegate="$ClipboardDelegateDefault" ConvertDelegate="$ConvertDelegateDefault" DisplayDelegate="$DisplayDelegateDefault" DNGDecodeDelegate="$DNGDecodeDelegateDefault" @@ -36644,6 +37576,7 @@ fi + # @@ -36659,8 +37592,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_TAR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$TAR"; then +else case e in #( + e) if test -n "$TAR"; then ac_cv_prog_TAR="$TAR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -36682,7 +37615,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi TAR=$ac_cv_prog_TAR if test -n "$TAR"; then @@ -36706,8 +37640,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PERL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$PERL"; then +else case e in #( + e) if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -36729,7 +37663,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then @@ -36753,8 +37688,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RPM+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RPM"; then +else case e in #( + e) if test -n "$RPM"; then ac_cv_prog_RPM="$RPM" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -36776,7 +37711,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RPM=$ac_cv_prog_RPM if test -n "$RPM"; then @@ -36826,8 +37762,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_P7ZIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$P7ZIP"; then +else case e in #( + e) if test -n "$P7ZIP"; then ac_cv_prog_P7ZIP="$P7ZIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -36849,7 +37785,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi P7ZIP=$ac_cv_prog_P7ZIP if test -n "$P7ZIP"; then @@ -36887,8 +37824,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ZIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ZIP"; then +else case e in #( + e) if test -n "$ZIP"; then ac_cv_prog_ZIP="$ZIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -36910,7 +37847,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ZIP=$ac_cv_prog_ZIP if test -n "$ZIP"; then @@ -36938,7 +37876,7 @@ fi # # GhostPCL related configuration. # -PCLColorDevice=ppmraw +PCLColorDevice=png16malpha PCLCMYKDevice=pamcmyk32 PCLMonoDevice=pbmraw if test -z "$PCLVersion"; then @@ -36993,8 +37931,8 @@ fi # # GhostXPS related configuration. # -XPSColorDevice=ppmraw -XPSCMYKDevice=bmpsep8 +XPSColorDevice=png16malpha +XPSCMYKDevice=pamcmyk32 XPSMonoDevice=pbmraw if test -z "$XPSVersion"; then XPSVersion='unknown' @@ -37048,7 +37986,7 @@ fi # # Ghostscript related configuration. # -GSAlphaDevice=pngalpha +GSAlphaDevice=png16malpha GSColorDevice=png16m GSCMYKDevice=pamcmyk32 GSMonoDevice=pbmraw @@ -37089,6 +38027,8 @@ printf "%s\n" "$GSColorDevice" >&6; } printf %s "checking for gs alpha device... " >&6; } if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 1>&5 2>&5; then : + elif $PSDelegate -q -dBATCH -sDEVICE=pngalpha -sOutputFile=/dev/null < /dev/null 1>&5 2>&5; then + GSAlphaDevice=pngalpha else GSAlphaDevice=$GSColorDevice fi @@ -37180,8 +38120,9 @@ printf %s "checking for perl... " >&6; } if test ${ac_cv_path_PERL+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_path_PERL="$with_perl" +else case e in #( + e) ac_cv_path_PERL="$with_perl" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_PERL" >&5 printf "%s\n" "$ac_cv_path_PERL" >&6; }; @@ -37197,8 +38138,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PERL+y} then : printf %s "(cached) " >&6 -else $as_nop - case $PERL in +else case e in #( + e) case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; @@ -37223,6 +38164,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi PERL=$ac_cv_path_PERL @@ -37326,12 +38268,13 @@ x$ax_compare_version_B" | sed 's/^ *//' | sort | sed "s/x${ax_compare_version_A} fi -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: could not find the perl interpreter" >&5 printf "%s\n" "$as_me: WARNING: could not find the perl interpreter" >&2;} PERL_SUPPORTS_DESTDIR='no' - + ;; +esac fi fi @@ -37416,9 +38359,6 @@ fi if test "$have_jpeg" = 'yes' ; then MAGICK_DELEGATES="$MAGICK_DELEGATES jpeg" fi -if test "$have_jxl" = 'yes' ; then - MAGICK_DELEGATES="$MAGICK_DELEGATES jxl" -fi if test "$have_lcms" = 'yes' || test "$have_lcms2" = 'yes' ; then MAGICK_DELEGATES="$MAGICK_DELEGATES lcms" fi @@ -37437,6 +38377,9 @@ fi if test "$have_pango" = 'yes' ; then MAGICK_DELEGATES="$MAGICK_DELEGATES pango" fi +if test "$have_pcl" = 'yes' ; then + MAGICK_DELEGATES="$MAGICK_DELEGATES pcl" +fi if test "$have_png" = 'yes' ; then MAGICK_DELEGATES="$MAGICK_DELEGATES png" fi @@ -37521,16 +38464,22 @@ printf %s "checking for _gcov_init in -lgcov... " >&6; } if test ${ac_cv_lib_gcov__gcov_init+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lgcov $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char _gcov_init (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char _gcov_init (void); int main (void) { @@ -37542,12 +38491,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_gcov__gcov_init=yes -else $as_nop - ac_cv_lib_gcov__gcov_init=no +else case e in #( + e) ac_cv_lib_gcov__gcov_init=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcov__gcov_init" >&5 printf "%s\n" "$ac_cv_lib_gcov__gcov_init" >&6; } @@ -37564,16 +38515,22 @@ printf %s "checking for __gcov_init in -lgcov... " >&6; } if test ${ac_cv_lib_gcov___gcov_init+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lgcov $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char __gcov_init (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char __gcov_init (void); int main (void) { @@ -37585,12 +38542,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_gcov___gcov_init=yes -else $as_nop - ac_cv_lib_gcov___gcov_init=no +else case e in #( + e) ac_cv_lib_gcov___gcov_init=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcov___gcov_init" >&5 printf "%s\n" "$ac_cv_lib_gcov___gcov_init" >&6; } @@ -37623,7 +38582,7 @@ fi if test "$build_modules" != 'no'; then MAGICK_DEP_LIBS="$USER_LIBS $LCMS_LIBS $FREETYPE_LIBS $RAQM_LIBS $LQR_LIBS $FFTW_LIBS $XML_LIBS $FLIF_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $BZLIB_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS $MTMALLOC_LIBS" else - MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $RAQM_LIBS $JPEG_LIBS $JXL_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FLIF_LIBS $FPX_LIBS $FONTCONFIG_LIBS $HEIF_LIBS $WEBPMUX_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIBS $PANGO_LIBS $RAW_R_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS $MTMALLOC_LIBS" + MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $RAQM_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FLIF_LIBS $FPX_LIBS $FONTCONFIG_LIBS $HEIF_LIBS $WEBPMUX_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIBS $PANGO_LIBS $RAW_R_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS $MTMALLOC_LIBS" fi MAGICK_EXTRA_DEP_LIBS="$GOMP_LIBS" @@ -37639,12 +38598,21 @@ LIBS=$USER_LIBS #AC_SUBST([X_LIBS]) #AC_SUBST([X_EXTRA_LIBS]) +CC=`echo $CC | sed -e 's/ */ /g'` +CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'` +CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'` +CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'` +LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'` +LIBS=`echo $LIBS | sed -e 's/ */ /g'` + MAGICK_CFLAGS=$CFLAGS -MAGICK_CXXFLAGS="$CXXFLAGS" +MAGICK_CXXFLAGS=$CXXFLAGS MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'` MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'` MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS" MAGICK_LIBS="$MAGICK_DEP_LIBS $MAGICK_EXTRA_DEP_LIBS" +MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'` +MAGICK_EXTRA_DEP_LIBS=`echo $MAGICK_EXTRA_DEP_LIBS | sed -e 's/ */ /g'` @@ -37693,6 +38661,11 @@ if test "${urw_base35_font_dir}x" != 'x'; then result_urw_base35_font_dir=$urw_base35_font_dir fi +result_urw_base35_type1_font_dir='none' +if test "${urw_base35_type1_font_dir}x" != 'x'; then + result_urw_base35_type1_font_dir=$urw_base35_type1_font_dir +fi + result_windows_font_dir='none' if test "${windows_font_dir}x" != 'x'; then result_windows_font_dir=${windows_font_dir} @@ -37701,7 +38674,7 @@ fi # ============================================================================== # Generate build environment # ============================================================================== -ac_config_files="$ac_config_files common.shi config/configure.xml config/delegates.xml config/ImageMagick.rdf config/MagickCore.dox config/MagickWand.dox config/Magick++.dox config/policy.xml:config/policy-"$magick_cv_with_security_policy".xml config/type-apple.xml config/type-dejavu.xml config/type-ghostscript.xml config/type-urw-base35.xml config/type-windows.xml config/type.xml ImageMagick.spec Magick++/bin/Magick++-config magick/ImageMagick.pc Magick++/lib/ImageMagick++.pc Magick++/lib/Magick++.pc magick/Magick-config magick/MagickCore-config magick/MagickCore.pc magick/version.h Makefile magick.sh PerlMagick/check.sh PerlMagick/default/Magick.pm PerlMagick/Makefile.PL PerlMagick/default/Makefile.PL PerlMagick/quantum/Makefile.PL PerlMagick/quantum/quantum.pm PerlMagick/quantum/quantum.xs PerlMagick/quantum/typemap utilities/animate.1 utilities/compare.1 utilities/composite.1 utilities/conjure.1 utilities/convert.1 utilities/display.1 utilities/identify.1 utilities/ImageMagick.1 utilities/import.1 utilities/mogrify.1 utilities/montage.1 utilities/stream.1 wand/MagickWand-config wand/MagickWand.pc wand/Wand-config wand/Wand.pc" +ac_config_files="$ac_config_files common.shi config/configure.xml config/delegates.xml config/ImageMagick.rdf config/MagickCore.dox config/MagickWand.dox config/Magick++.dox config/policy.xml:config/policy-"$magick_cv_with_security_policy".xml config/type-apple.xml config/type-dejavu.xml config/type-ghostscript.xml config/type-urw-base35.xml config/type-urw-base35-type1.xml config/type-windows.xml config/type.xml ImageMagick.spec Magick++/bin/Magick++-config magick/ImageMagick.pc Magick++/lib/ImageMagick++.pc Magick++/lib/Magick++.pc magick/Magick-config magick/MagickCore-config magick/MagickCore.pc magick/version.h Makefile magick.sh PerlMagick/check.sh PerlMagick/default/Magick.pm PerlMagick/Makefile.PL PerlMagick/default/Makefile.PL PerlMagick/quantum/Makefile.PL PerlMagick/quantum/quantum.pm PerlMagick/quantum/quantum.xs PerlMagick/quantum/typemap utilities/animate.1 utilities/compare.1 utilities/composite.1 utilities/conjure.1 utilities/convert.1 utilities/display.1 utilities/identify.1 utilities/ImageMagick.1 utilities/import.1 utilities/mogrify.1 utilities/montage.1 utilities/stream.1 wand/MagickWand-config wand/MagickWand.pc wand/Wand-config wand/Wand.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -37713,8 +38686,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -37744,14 +38717,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -37860,6 +38833,12 @@ if test -z "${CYGWIN_BUILD_TRUE}" && test -z "${CYGWIN_BUILD_FALSE}"; then as_fn_error $? "conditional \"CYGWIN_BUILD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +# Check whether --enable-year2038 was given. +if test ${enable_year2038+y} +then : + enableval=$enable_year2038; +fi + if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -38106,7 +39085,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -38115,12 +39093,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -38192,7 +39171,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -38221,7 +39200,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -38261,11 +39239,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -38279,11 +39258,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -38366,9 +39346,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -38449,10 +39429,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -38467,8 +39449,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ImageMagick $as_me 6.9.12-98, which was -generated by GNU Autoconf 2.71. Invocation command line was +This file was extended by ImageMagick $as_me 6.9.13-25, which was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -38500,7 +39482,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -38536,11 +39518,11 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -ImageMagick config.status 6.9.12-98 -configured by $0, generated by GNU Autoconf 2.71, +ImageMagick config.status 6.9.13-25 +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -38602,8 +39584,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -38611,8 +39593,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -39075,6 +40057,7 @@ do "config/type-dejavu.xml") CONFIG_FILES="$CONFIG_FILES config/type-dejavu.xml" ;; "config/type-ghostscript.xml") CONFIG_FILES="$CONFIG_FILES config/type-ghostscript.xml" ;; "config/type-urw-base35.xml") CONFIG_FILES="$CONFIG_FILES config/type-urw-base35.xml" ;; + "config/type-urw-base35-type1.xml") CONFIG_FILES="$CONFIG_FILES config/type-urw-base35-type1.xml" ;; "config/type-windows.xml") CONFIG_FILES="$CONFIG_FILES config/type-windows.xml" ;; "config/type.xml") CONFIG_FILES="$CONFIG_FILES config/type.xml" ;; "ImageMagick.spec") CONFIG_FILES="$CONFIG_FILES ImageMagick.spec" ;; @@ -39113,7 +40096,7 @@ do "wand/Wand-config") CONFIG_FILES="$CONFIG_FILES wand/Wand-config" ;; "wand/Wand.pc") CONFIG_FILES="$CONFIG_FILES wand/Wand.pc" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -39133,7 +40116,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -39157,7 +40140,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -39315,13 +40298,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -39431,7 +40414,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -39453,19 +40436,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -39598,7 +40581,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -39629,9 +40612,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -39875,15 +40858,15 @@ printf "%s\n" X/"$am_mf" | (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} @@ -40669,95 +41652,96 @@ matches your expectations. Host system type: $host Build system type: $build - Option Value + Option Value ------------------------------------------------------------------------------ -Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs -Static libraries --enable-static=$enable_static $libtool_build_static_libs -Module support --with-modules=$build_modules $build_modules -GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld -Security policy --with-security-policy=$with_security_policy $with_security_policy -Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth +Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs +Static libraries --enable-static=$enable_static $libtool_build_static_libs +Module support --with-modules=$build_modules $build_modules +GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld +OpenMP --enable-openmp=$enable_openmp ${OPENMP_ENABLED} +Security policy --with-security-policy=$security_policy $security_policy +Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth High Dynamic Range Imagery - --enable-hdri=$enable_hdri $enable_hdri + --enable-hdri=$enable_hdri $enable_hdri -Install documentation: $wantdocs +Install documentation: $wantdocs Memory allocation library: - JEMalloc --with-jemalloc=$with_jemalloc $have_jemalloc - MTMalloc --with-mtmalloc=$with_mtmalloc $have_mtmalloc - TCMalloc --with-tcmalloc=$with_tcmalloc $have_tcmalloc - UMem --with-umem=$with_umem $have_umem + JEMalloc --with-jemalloc=$with_jemalloc $have_jemalloc + MTMalloc --with-mtmalloc=$with_mtmalloc $have_mtmalloc + TCMalloc --with-tcmalloc=$with_tcmalloc $have_tcmalloc + UMem --with-umem=$with_umem $have_umem Delegate library configuration: - BZLIB --with-bzlib=$with_bzlib $have_bzlib - Autotrace --with-autotrace=$with_autotrace $have_autotrace - DJVU --with-djvu=$with_djvu $have_djvu - DPS --with-dps=$with_dps $have_dps - FFTW --with-fftw=$with_fftw $have_fftw - FLIF --with-flif=$with_flif $have_flif - FlashPIX --with-fpx=$with_fpx $have_fpx - FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig - FreeType --with-freetype=$with_freetype $have_freetype - Ghostscript lib --with-gslib=$with_gslib $have_gslib - Graphviz --with-gvc=$with_gvc $have_gvc - HEIC --with-heic=$with_heic $have_heic - JBIG --with-jbig=$with_jbig $have_jbig - JPEG v1 --with-jpeg=$with_jpeg $have_jpeg - JPEG XL --with-jxl=$with_jxl $have_jxl - LCMS --with-lcms=$with_lcms $have_lcms - LQR --with-lqr=$with_lqr $have_lqr - LTDL --with-ltdl=$with_ltdl $have_ltdl - LZMA --with-lzma=$with_lzma $have_lzma - Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus - OpenEXR --with-openexr=$with_openexr $have_openexr - OpenJP2 --with-openjp2=$with_openjp2 $have_openjp2 - PANGO --with-pango=$with_pango $have_pango - PERL --with-perl=$with_perl $have_perl - PNG --with-png=$with_png $have_png - RAQM --with-raqm=$with_raqm $have_raqm - RAW --with-raw=$with_raw $have_raw - RSVG --with-rsvg=$with_rsvg $have_rsvg - TIFF --with-tiff=$with_tiff $have_tiff - WEBP --with-webp=$with_webp $have_webp - WMF --with-wmf=$with_wmf $have_wmf - X11 --with-x=$with_x $have_x - XML --with-xml=$with_xml $have_xml - ZLIB --with-zlib=$with_zlib $have_zlib - ZSTD --with-zstd=$with_zstd $have_zstd + BZLIB --with-bzlib=$with_bzlib $have_bzlib + Autotrace --with-autotrace=$with_autotrace $have_autotrace + DJVU --with-djvu=$with_djvu $have_djvu + DPS --with-dps=$with_dps $have_dps + FFTW --with-fftw=$with_fftw $have_fftw + FLIF --with-flif=$with_flif $have_flif + FlashPIX --with-fpx=$with_fpx $have_fpx + FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig + FreeType --with-freetype=$with_freetype $have_freetype + Ghostscript lib --with-gslib=$with_gslib $have_gslib + Graphviz --with-gvc=$with_gvc $have_gvc + HEIC --with-heic=$with_heic $have_heic + JBIG --with-jbig=$with_jbig $have_jbig + JPEG v1 --with-jpeg=$with_jpeg $have_jpeg + LCMS --with-lcms=$with_lcms $have_lcms + LQR --with-lqr=$with_lqr $have_lqr + LTDL --with-ltdl=$with_ltdl $have_ltdl + LZMA --with-lzma=$with_lzma $have_lzma + Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus + OpenEXR --with-openexr=$with_openexr $have_openexr + OpenJP2 --with-openjp2=$with_openjp2 $have_openjp2 + PANGO --with-pango=$with_pango $have_pango + PERL --with-perl=$with_perl $have_perl + PNG --with-png=$with_png $have_png + RAQM --with-raqm=$with_raqm $have_raqm + RAW --with-raw=$with_raw $have_raw + RSVG --with-rsvg=$with_rsvg $have_rsvg + TIFF --with-tiff=$with_tiff $have_tiff + WEBP --with-webp=$with_webp $have_webp + WMF --with-wmf=$with_wmf $have_wmf + X11 --with-x=$with_x $have_x + XML --with-xml=$with_xml $have_xml + ZLIB --with-zlib=$with_zlib $have_zlib + ZSTD --with-zstd=$with_zstd $have_zstd Delegate program configuration: - GhostPCL None $PCLDelegate ($PCLVersion) - GhostXPS None $XPSDelegate ($XPSVersion) - Ghostscript None $PSDelegate ($GSVersion) + GhostPCL None $PCLDelegate ($PCLVersion) + GhostXPS None $XPSDelegate ($XPSVersion) + Ghostscript None $PSDelegate ($GSVersion) Font configuration: Apple fonts --with-apple-font-dir=$with_apple_font_dir $result_apple_font_dir Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir - URW-base35 fonts --with-urw-base35-font-dir=$with_urw_base35_font_dir $result_urw_base35_font_dir + URW OTF fonts --with-urw-base35-font-dir=$with_urw_base35_font_dir $result_urw_base35_font_dir + URW Type1 fonts --with-urw-base35-type1-font-dir=$with_urw_base35_type1_font_dir $result_urw_base35_type1_font_dir Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir X11 configuration: - X_CFLAGS = $X_CFLAGS - X_PRE_LIBS = $X_PRE_LIBS - X_LIBS = $X_LIBS - X_EXTRA_LIBS = $X_EXTRA_LIBS + X_CFLAGS = $X_CFLAGS + X_PRE_LIBS = $X_PRE_LIBS + X_LIBS = $X_LIBS + X_EXTRA_LIBS = $X_EXTRA_LIBS Options used to compile and link: - PREFIX = $PREFIX_DIR - EXEC-PREFIX = $EXEC_PREFIX_DIR - VERSION = $PACKAGE_VERSION - CC = $CC - CFLAGS = $CFLAGS - CPPFLAGS = $CPPFLAGS - PCFLAGS = $PCFLAGS - DEFS = $DEFS - LDFLAGS = $LDFLAGS - LIBS = $MAGICK_DEP_LIBS - CXX = $CXX - CXXFLAGS = $CXXFLAGS - FEATURES = $MAGICK_FEATURES - DELEGATES = $MAGICK_DELEGATES + PREFIX = $PREFIX_DIR + EXEC-PREFIX = $EXEC_PREFIX_DIR + VERSION = $PACKAGE_VERSION + CC = $CC + CFLAGS = $CFLAGS + CPPFLAGS = $CPPFLAGS + PCFLAGS = $PCFLAGS + DEFS = $DEFS + LDFLAGS = $LDFLAGS + LIBS = $MAGICK_DEP_LIBS $MAGICK_EXTRA_DEP_LIBS + CXX = $CXX + CXXFLAGS = $CXXFLAGS + FEATURES = $MAGICK_FEATURES + DELEGATES = $MAGICK_DELEGATES ============================================================================== " >&5 printf "%s\n" "$as_me: @@ -40768,95 +41752,96 @@ matches your expectations. Host system type: $host Build system type: $build - Option Value + Option Value ------------------------------------------------------------------------------ -Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs -Static libraries --enable-static=$enable_static $libtool_build_static_libs -Module support --with-modules=$build_modules $build_modules -GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld -Security policy --with-security-policy=$with_security_policy $with_security_policy -Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth +Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs +Static libraries --enable-static=$enable_static $libtool_build_static_libs +Module support --with-modules=$build_modules $build_modules +GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld +OpenMP --enable-openmp=$enable_openmp ${OPENMP_ENABLED} +Security policy --with-security-policy=$security_policy $security_policy +Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth High Dynamic Range Imagery - --enable-hdri=$enable_hdri $enable_hdri + --enable-hdri=$enable_hdri $enable_hdri -Install documentation: $wantdocs +Install documentation: $wantdocs Memory allocation library: - JEMalloc --with-jemalloc=$with_jemalloc $have_jemalloc - MTMalloc --with-mtmalloc=$with_mtmalloc $have_mtmalloc - TCMalloc --with-tcmalloc=$with_tcmalloc $have_tcmalloc - UMem --with-umem=$with_umem $have_umem + JEMalloc --with-jemalloc=$with_jemalloc $have_jemalloc + MTMalloc --with-mtmalloc=$with_mtmalloc $have_mtmalloc + TCMalloc --with-tcmalloc=$with_tcmalloc $have_tcmalloc + UMem --with-umem=$with_umem $have_umem Delegate library configuration: - BZLIB --with-bzlib=$with_bzlib $have_bzlib - Autotrace --with-autotrace=$with_autotrace $have_autotrace - DJVU --with-djvu=$with_djvu $have_djvu - DPS --with-dps=$with_dps $have_dps - FFTW --with-fftw=$with_fftw $have_fftw - FLIF --with-flif=$with_flif $have_flif - FlashPIX --with-fpx=$with_fpx $have_fpx - FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig - FreeType --with-freetype=$with_freetype $have_freetype - Ghostscript lib --with-gslib=$with_gslib $have_gslib - Graphviz --with-gvc=$with_gvc $have_gvc - HEIC --with-heic=$with_heic $have_heic - JBIG --with-jbig=$with_jbig $have_jbig - JPEG v1 --with-jpeg=$with_jpeg $have_jpeg - JPEG XL --with-jxl=$with_jxl $have_jxl - LCMS --with-lcms=$with_lcms $have_lcms - LQR --with-lqr=$with_lqr $have_lqr - LTDL --with-ltdl=$with_ltdl $have_ltdl - LZMA --with-lzma=$with_lzma $have_lzma - Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus - OpenEXR --with-openexr=$with_openexr $have_openexr - OpenJP2 --with-openjp2=$with_openjp2 $have_openjp2 - PANGO --with-pango=$with_pango $have_pango - PERL --with-perl=$with_perl $have_perl - PNG --with-png=$with_png $have_png - RAQM --with-raqm=$with_raqm $have_raqm - RAW --with-raw=$with_raw $have_raw - RSVG --with-rsvg=$with_rsvg $have_rsvg - TIFF --with-tiff=$with_tiff $have_tiff - WEBP --with-webp=$with_webp $have_webp - WMF --with-wmf=$with_wmf $have_wmf - X11 --with-x=$with_x $have_x - XML --with-xml=$with_xml $have_xml - ZLIB --with-zlib=$with_zlib $have_zlib - ZSTD --with-zstd=$with_zstd $have_zstd + BZLIB --with-bzlib=$with_bzlib $have_bzlib + Autotrace --with-autotrace=$with_autotrace $have_autotrace + DJVU --with-djvu=$with_djvu $have_djvu + DPS --with-dps=$with_dps $have_dps + FFTW --with-fftw=$with_fftw $have_fftw + FLIF --with-flif=$with_flif $have_flif + FlashPIX --with-fpx=$with_fpx $have_fpx + FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig + FreeType --with-freetype=$with_freetype $have_freetype + Ghostscript lib --with-gslib=$with_gslib $have_gslib + Graphviz --with-gvc=$with_gvc $have_gvc + HEIC --with-heic=$with_heic $have_heic + JBIG --with-jbig=$with_jbig $have_jbig + JPEG v1 --with-jpeg=$with_jpeg $have_jpeg + LCMS --with-lcms=$with_lcms $have_lcms + LQR --with-lqr=$with_lqr $have_lqr + LTDL --with-ltdl=$with_ltdl $have_ltdl + LZMA --with-lzma=$with_lzma $have_lzma + Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus + OpenEXR --with-openexr=$with_openexr $have_openexr + OpenJP2 --with-openjp2=$with_openjp2 $have_openjp2 + PANGO --with-pango=$with_pango $have_pango + PERL --with-perl=$with_perl $have_perl + PNG --with-png=$with_png $have_png + RAQM --with-raqm=$with_raqm $have_raqm + RAW --with-raw=$with_raw $have_raw + RSVG --with-rsvg=$with_rsvg $have_rsvg + TIFF --with-tiff=$with_tiff $have_tiff + WEBP --with-webp=$with_webp $have_webp + WMF --with-wmf=$with_wmf $have_wmf + X11 --with-x=$with_x $have_x + XML --with-xml=$with_xml $have_xml + ZLIB --with-zlib=$with_zlib $have_zlib + ZSTD --with-zstd=$with_zstd $have_zstd Delegate program configuration: - GhostPCL None $PCLDelegate ($PCLVersion) - GhostXPS None $XPSDelegate ($XPSVersion) - Ghostscript None $PSDelegate ($GSVersion) + GhostPCL None $PCLDelegate ($PCLVersion) + GhostXPS None $XPSDelegate ($XPSVersion) + Ghostscript None $PSDelegate ($GSVersion) Font configuration: Apple fonts --with-apple-font-dir=$with_apple_font_dir $result_apple_font_dir Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir - URW-base35 fonts --with-urw-base35-font-dir=$with_urw_base35_font_dir $result_urw_base35_font_dir + URW OTF fonts --with-urw-base35-font-dir=$with_urw_base35_font_dir $result_urw_base35_font_dir + URW Type1 fonts --with-urw-base35-type1-font-dir=$with_urw_base35_type1_font_dir $result_urw_base35_type1_font_dir Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir X11 configuration: - X_CFLAGS = $X_CFLAGS - X_PRE_LIBS = $X_PRE_LIBS - X_LIBS = $X_LIBS - X_EXTRA_LIBS = $X_EXTRA_LIBS + X_CFLAGS = $X_CFLAGS + X_PRE_LIBS = $X_PRE_LIBS + X_LIBS = $X_LIBS + X_EXTRA_LIBS = $X_EXTRA_LIBS Options used to compile and link: - PREFIX = $PREFIX_DIR - EXEC-PREFIX = $EXEC_PREFIX_DIR - VERSION = $PACKAGE_VERSION - CC = $CC - CFLAGS = $CFLAGS - CPPFLAGS = $CPPFLAGS - PCFLAGS = $PCFLAGS - DEFS = $DEFS - LDFLAGS = $LDFLAGS - LIBS = $MAGICK_DEP_LIBS - CXX = $CXX - CXXFLAGS = $CXXFLAGS - FEATURES = $MAGICK_FEATURES - DELEGATES = $MAGICK_DELEGATES + PREFIX = $PREFIX_DIR + EXEC-PREFIX = $EXEC_PREFIX_DIR + VERSION = $PACKAGE_VERSION + CC = $CC + CFLAGS = $CFLAGS + CPPFLAGS = $CPPFLAGS + PCFLAGS = $PCFLAGS + DEFS = $DEFS + LDFLAGS = $LDFLAGS + LIBS = $MAGICK_DEP_LIBS $MAGICK_EXTRA_DEP_LIBS + CXX = $CXX + CXXFLAGS = $CXXFLAGS + FEATURES = $MAGICK_FEATURES + DELEGATES = $MAGICK_DELEGATES ============================================================================== " >&6;} diff --git a/configure.ac b/configure.ac index a3879a97a625f594f306eedb9296dd58889d19bc..909ce57ae1b4df7885c3e2e8206512e51365d05e 100644 --- a/configure.ac +++ b/configure.ac @@ -473,10 +473,10 @@ AC_OPENMP([C]) CFLAGS="$OPENMP_CFLAGS $CFLAGS" MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS" AC_SUBST([OPENMP_CFLAGS]) -if test "$enable_openmp" != no; then - if test "$ac_cv_prog_c_openmp" != 'unsupported'; then +AC_CHECK_DECL([_OPENMP],[OPENMP_ENABLED='yes'],[OPENMP_ENABLED='no'],[]) +if test "${OPENMP_ENABLED}" = 'yes' && \ + test "$ac_cv_prog_c_openmp" != 'unsupported'; then MAGICK_FEATURES="OpenMP $MAGICK_FEATURES" - fi fi # Enable support for OpenCL @@ -503,7 +503,8 @@ if test "$enable_largefile" != no; then unknown) AC_MSG_CHECKING([for native large file support]) AC_RUN_IFELSE([AC_LANG_PROGRAM([#include - main () { + #include + int main () { exit(!(sizeof(off_t) == 8)); }])], [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64) @@ -511,6 +512,9 @@ if test "$enable_largefile" != no; then [AC_MSG_RESULT([no])]) ;; *) + if test "$ac_cv_sys_file_offset_bits" = ''; then + ac_cv_sys_file_offset_bits=64; + fi LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" ;; esac @@ -630,18 +634,6 @@ else DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed " fi -# Permit enciphering and deciphering image pixels. -AC_ARG_ENABLE([cipher], - [AS_HELP_STRING([--disable-cipher], - [disable enciphering and deciphering image pixels])], - [enable_cipher=$enableval], - [enable_cipher='yes']) - -if test "$enable_cipher" = 'yes'; then - AC_DEFINE([CIPHER_SUPPORT],[1],[permit enciphering and deciphering image pixels]) - MAGICK_FEATURES="Cipher $MAGICK_FEATURES" -fi - # Build a zero-configuration version of ImageMagick. AC_ARG_ENABLE([zero-configuration], [AS_HELP_STRING([--enable-zero-configuration], @@ -806,6 +798,7 @@ if test "$with_cache" != ''; then fi # Set security policy +security_policy="open" m4_define([_MAGICK_SECURITY_POLICY], [m4_define([MAGICK_SECURITY_POLICY_DEFAULT], [m4_if($1, limited, limited, m4_if($1, secure, secure, open))])dnl AC_MSG_CHECKING([which variant of security policy to enforce]) @@ -814,16 +807,17 @@ m4_define([_MAGICK_SECURITY_POLICY], [security policy variant to enforce, @<:@default=]MAGICK_SECURITY_POLICY_DEFAULT[@:>@.])], [case $withval in open|limited|secure|websafe) + security_policy=$withval ;; *) AC_MSG_ERROR([Unknown argument to --with-security-policy]) ;; esac - magick_cv_with_security_policy=$with_security_policy], + magick_cv_with_security_policy=$security_policy], [AC_CACHE_VAL([magick_cv_with_security_policy], [magick_cv_with_security_policy=]MAGICK_SECURITY_POLICY_DEFAULT) MAGICK_SECURITY_POLICY=$magick_cv_with_security_policy]) - AC_MSG_RESULT([$with_security_policy]) + AC_MSG_RESULT([$security_policy]) ]) # MAGICK_SECURITY_POLICY _MAGICK_SECURITY_POLICY([open]) @@ -918,9 +912,6 @@ if test "$with_libstdc" != ''; then fi AC_SUBST([LIBSTDCLDFLAGS]) -# Does gcc required -traditional? -AC_PROG_GCC_TRADITIONAL - ######## # # Set defines required to build DLLs and modules using MinGW @@ -1026,6 +1017,7 @@ AC_CHECK_SIZEOF([long double]) # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not # supported then the value defined is zero. AC_CHECK_SIZEOF([unsigned long long]) +AC_CHECK_SIZEOF([size_t]) AC_CHECK_SIZEOF([void *]) @@ -1256,39 +1248,52 @@ AC_DEFINE_UNQUOTED([X11_CONFIGURE_PATH],["$X11ConfigurePath"],[Location of X11 c # Find OpenMP library # GOMP_LIBS='' -if test "$enable_openmp" != 'no'; then +if test "${OPENMP_ENABLED}" = 'yes' && \ + test "$ac_cv_prog_c_openmp" != 'unsupported'; then + AC_CHECK_HEADER([omp.h], [], [AC_MSG_RESULT([OpenMP header file not found])]) if test "${GCC}" = "yes"; then # Open64 (passes for GCC but uses different OpenMP implementation) if test "x$GOMP_LIBS" = x ; then if $CC --version 2>&1 | grep Open64 > /dev/null ; then - AC_CHECK_LIB([openmp],[omp_get_num_procs],[GOMP_LIBS="-lopenmp"],[],[]) + AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([#include ], [ + omp_set_num_threads(1);])],[GOMP_LIBS="-lopenmp"],[]) fi fi # Clang (passes for GCC but uses different OpenMP implementation) - if test "x$LIB_OMP" = x ; then + if test "x$GOMP_LIBS" = x ; then if $CC --version 2>&1 | grep clang > /dev/null ; then - AC_CHECK_LIB([omp],[GOMP_parallel_start],[LIB_OMP="-lomp"],[],[]) + AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([#include ], [ + omp_set_num_threads(1);])],[GOMP_LIBS="-lomp"],[]) fi fi # GCC if test "x$GOMP_LIBS" = x ; then - AC_CHECK_LIB([gomp],[GOMP_parallel_start],[GOMP_LIBS="-lgomp"],[],[]) + AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([#include ], [ + omp_set_num_threads(1);])],[GOMP_LIBS="-lgomp"],[]) fi else # Sun CC if test "x$GOMP_LIBS" = x ; then - AC_CHECK_LIB([mtsk],[sunw_mp_register_warn],[GOMP_LIBS="-lmtsk"],[],[]) + AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([#include ], [ + omp_set_num_threads(1);])],[GOMP_LIBS="-lmtsk"],[]) fi # AIX xlc if test "x$GOMP_LIBS" = x ; then - AC_CHECK_LIB([xlsmp],[_xlsmpFlush],[GOMP_LIBS="-lxlsmp"],[],[]) + AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([#include ], [ + omp_set_num_threads(1);])],[GOMP_LIBS="-lxmlsmp"],[]) fi # SGI IRIX 6.5 MIPSpro C/C++ if test "x$GOMP_LIBS" = x ; then - AC_CHECK_LIB([mp],[mp_destroy],[GOMP_LIBS="-lmp"],[],[]) + AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([#include ], [ + omp_set_num_threads(1);])],[GOMP_LIBS="-lmp"],[]) fi fi - LIBS="$GOMP_LIBS $LIBS" + AC_MSG_CHECKING([for OpenMP library ]) + if test "x$GOMP_LIBS" = x ; then + AC_MSG_RESULT([not found!]) + else + AC_MSG_RESULT([${GOMP_LIBS}]) + fi fi AC_SUBST([GOMP_LIBS]) @@ -1480,6 +1485,9 @@ if test "$with_bzlib" != 'no'; then failed=0 passed=0 found_libbz=0 + PKG_CHECK_MODULES([BZLIB],[bzip2 >= 1.0.0],[have_bzlib=yes],[have_bzlib=no]) + CFLAGS="$CFLAGS $BZLIB_CFLAGS" + LIBS="$LIBS $BZLIB_LIBS" AC_CHECK_HEADER([bzlib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) AC_CHECK_LIB([bz2],[BZ2_bzDecompress],[found_libbz=`expr $found_libbz + 1`],,) if test "$native_win32_build" = 'yes'; then @@ -1507,6 +1515,7 @@ if test "$with_bzlib" != 'no'; then fi fi AM_CONDITIONAL([BZLIB_DELEGATE],[test "$have_bzlib" = 'yes']) +AC_SUBST([BZLIB_CFLAGS]) AC_SUBST([BZLIB_LIBS]) # @@ -2351,6 +2360,11 @@ if test "$with_jpeg" != 'no'; then AC_MSG_RESULT([]) failed=0 passed=0 + + PKG_CHECK_MODULES([JPEG],[libjpeg >= 2.0.0],[have_jpeg=yes],[have_jpeg=no]) + CFLAGS="$CFLAGS $JPEG_CFLAGS" + LIBS="$LIBS $JPEG_LIBS" + AC_CHECK_HEADER([jconfig.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) AC_CHECK_HEADER([jerror.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) AC_CHECK_HEADER([jmorecfg.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) @@ -2373,6 +2387,7 @@ if test "$with_jpeg" != 'no'; then fi fi AM_CONDITIONAL([JPEG_DELEGATE],[test "$have_jpeg" = 'yes']) +AC_SUBST([JPEG_CFLAGS]) AC_SUBST([JPEG_LIBS]) dnl =========================================================================== @@ -2716,42 +2731,22 @@ if test "$with_tiff" != 'yes'; then fi have_tiff='no' -TIFF_LIBS='' -if test "$with_tiff" != 'no'; then - AC_MSG_RESULT([-------------------------------------------------------------]) - AC_MSG_CHECKING([for TIFF]) - AC_MSG_RESULT([]) - failed=0 - passed=0 - AC_CHECK_HEADER([tiff.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) - AC_CHECK_HEADER([tiffio.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) - AC_CHECK_LIB([tiff],[TIFFOpen],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[]) - AC_CHECK_LIB([tiff],[TIFFClientOpen],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[]) - AC_CHECK_LIB([tiff],[TIFFIsByteSwapped],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[]) - AC_CHECK_LIB([tiff],[TIFFReadRGBATile],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[]) - AC_CHECK_LIB([tiff],[TIFFReadRGBAStrip],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[]) - AC_MSG_CHECKING([if TIFF package is complete]) - if test $passed -gt 0; then - if test $failed -gt 0; then - AC_MSG_RESULT([no -- some components failed test]) - have_tiff='no (failed tests)' - else - TIFF_LIBS='-ltiff' - LIBS="$TIFF_LIBS $LIBS" - AC_DEFINE([TIFF_DELEGATE],[1],[Define if you have TIFF library]) - AC_MSG_RESULT([yes]) - have_tiff='yes' - AC_CHECK_HEADERS(tiffconf.h) - AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \ - TIFFIsBigEndian TIFFSetErrorHandlerExt TIFFSetTagExtender \ - TIFFReadEXIFDirectory TIFFReadGPSDirectory \ - TIFFSetWarningHandlerExt TIFFSwabArrayOfTriples]) - fi - else - AC_MSG_RESULT([no]) - fi +TIFF_CFLAGS="" +TIFF_LIBS="" +TIFF_PKG="" +if test "x$with_tiff" = "xyes"; then + AC_MSG_RESULT([-------------------------------------------------------------]) + PKG_CHECK_MODULES([TIFF],[libtiff-4 >= 4.0.0],[have_tiff=yes],[have_tiff=no]) + AC_MSG_RESULT([]) fi + +if test "$have_tiff" = 'yes'; then + AC_DEFINE([TIFF_DELEGATE],[1],[Define if you have TIFF library]) + CFLAGS="$TIFF_CFLAGS $CFLAGS" +fi + AM_CONDITIONAL([TIFF_DELEGATE],[test "$have_tiff" = 'yes']) +AC_SUBST([TIFF_CFLAGS]) AC_SUBST([TIFF_LIBS]) dnl =========================================================================== @@ -2761,7 +2756,7 @@ dnl =========================================================================== # AC_ARG_WITH([urw-base35-font-dir], [AS_HELP_STRING([--with-urw-base35-font-dir=DIR], - [URW-base35 font directory])], + [URW-base35 OTF font directory])], [with_urw_base35_font_dir=$withval], [with_urw_base35_font_dir='default']) @@ -2771,6 +2766,21 @@ fi dnl =========================================================================== +# +# Set URW Base35 Type1 font directory. +# +AC_ARG_WITH([urw-base35-type1-font-dir], + [AS_HELP_STRING([--with-urw-base35-type1-font-dir=DIR], + [URW-base35 Type1 font directory])], + [with_urw_base35_type1_font_dir=$withval], + [with_urw_base35_type1_font_dir='default']) + +if test "$with_urw_base35_type1_font_dir" != 'default'; then + DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-urw-base35-type1-font-dir=$with_urw_base35_type1_font_dir " +fi + +dnl =========================================================================== + # # Check for the WEBP delegate library. # @@ -2971,15 +2981,15 @@ AC_DEFINE_UNQUOTED([EXECUTABLE_PATH],["$DEFINE_EXECUTABLE_PATH"],[Directory wher AC_SUBST([EXECUTABLE_PATH]) # Path to ImageMagick lib -LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}" -DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/" +LIBRARY_ABSOLUTE_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}" +DEFINE_LIBRARY_ABSOLUTE_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/" case "${build_os}" in mingw* ) - DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1` + DEFINE_LIBRARY_ABSOLUTE_PATH=`$WinPathScript "$DEFINE_LIBRARY_ABSOLUTE_PATH" 1` ;; esac -AC_DEFINE_UNQUOTED([LIBRARY_PATH],["$DEFINE_LIBRARY_PATH"],[Directory where architecture-dependent files live.]) -AC_SUBST([LIBRARY_PATH]) +AC_DEFINE_UNQUOTED([LIBRARY_ABSOLUTE_PATH],["$DEFINE_LIBRARY_ABSOLUTE_PATH"],[Directory where architecture-dependent files live.]) +AC_SUBST([LIBRARY_ABSOLUTE_PATH]) # # path to local binaries @@ -2996,7 +3006,7 @@ AC_SUBST([LIB_BIN_DIR]) LIB_BIN_DIR_RELATIVE_PATH=$LIB_BIN_DIR AC_SUBST([LIB_BIN_DIR_RELATIVE_PATH]) -LIB_BIN_DIR_PATH="${LIBRARY_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}" +LIB_BIN_DIR_PATH="${LIBRARY_ABSOLUTE_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}" AC_SUBST([LIB_BIN_DIR_PATH]) # @@ -3016,7 +3026,7 @@ AC_SUBST([MODULES_DIRNAME]) MODULES_RELATIVE_PATH="${MODULES_DIRNAME}" AC_SUBST([MODULES_RELATIVE_PATH]) -MODULES_PATH="${LIBRARY_PATH}/${MODULES_RELATIVE_PATH}" +MODULES_PATH="${LIBRARY_ABSOLUTE_PATH}/${MODULES_RELATIVE_PATH}" AC_SUBST([MODULES_PATH]) # @@ -3109,7 +3119,7 @@ AC_SUBST([SHAREARCH_DIRNAME]) SHAREARCH_RELATIVE_PATH="${SHAREARCH_DIRNAME}" AC_SUBST([SHAREARCH_RELATIVE_PATH]) -SHAREARCH_PATH="${LIBRARY_PATH}/${SHAREARCH_RELATIVE_PATH}" +SHAREARCH_PATH="${LIBRARY_ABSOLUTE_PATH}/${SHAREARCH_RELATIVE_PATH}" AC_SUBST([SHAREARCH_PATH]) # @@ -3125,7 +3135,8 @@ BPGDecodeDelegateDefault='bpgdec' BPGEncodeDelegateDefault='bpgenc' BlenderDecodeDelegateDefault='blender' BrowseDelegateDefault='xdg-open' -DNGDecodeDelegateDefault='ufraw-batch' +ClipboardDelegateDefault='xclip' +DNGDecodeDelegateDefault='darktable-cli' DOCDecodeDelegateDefault='libreoffice' GVCDecodeDelegateDefault='dot' DVIDecodeDelegateDefault='dvips' @@ -3143,6 +3154,7 @@ LEPDelegateDefault='lepton' LPDelegateDefault='lp' LPRDelegateDefault='lpr' LaunchDelegateDefault='gimp' +MKDIRDelegateDefault='mkdir' MrSIDDecodeDelegateDefault='mrsidgeodecode' MVDelegateDefault='mv' PCLDelegateDefault='pcl6' @@ -3169,7 +3181,8 @@ XPSDelegateDefault='gxps' AC_PATH_PROG([BPGDecodeDelegate],["$BPGDecodeDelegateDefault"],["$BPGDecodeDelegateDefault"]) AC_PATH_PROG([BPGEncodeDelegate],["$BPGEncodeDelegateDefault"],["$BPGEncodeDelegateDefault"]) AC_PATH_PROG([BlenderDecodeDelegate],["$BlenderDecodeDelegateDefault"],["$BlenderDecodeDelegateDefault"]) -AC_PATH_PROGS([BrowseDelegate],["$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx],["$BrowseDelegateDefault"]) +AC_PATH_PROGS([BrowseDelegate],["$BrowseDelegateDefault" brave-browser microsoft-edge google-chrome firefox konqueror lynx],["$BrowseDelegateDefault"]) +AC_PATH_PROGS([ClipboardDelegate],["$ClipboardDelegateDefault"],["$ClipboardDelegateDefault"]) AC_PATH_PROG([DNGDecodeDelegate],["$DNGDecodeDelegateDefault"],["$DNGDecodeDelegateDefault"]) AC_PATH_PROG([DOCDecodeDelegate],["$DOCDecodeDelegateDefault"],["$DOCDecodeDelegateDefault"]) AC_PATH_PROG([DVIDecodeDelegate],["$DVIDecodeDelegateDefault"],["$DVIDecodeDelegateDefault"]) @@ -3187,9 +3200,8 @@ AC_PATH_PROG([LEPDelegate],["$LEPDelegateDefault"],["$LEPDelegateDefault"]) AC_PATH_PROG([LPDelegate],["$LPDelegateDefault"],[no]) AC_PATH_PROG([LPRDelegate],["$LPRDelegateDefault"],["$LPRDelegateDefault"]) AC_PATH_PROG([LaunchDelegate],["$LaunchDelegateDefault"],["$LaunchDelegateDefault"]) +AC_PATH_PROG([MKDIRDelegate],["$MKDIRDelegateDefault"],["$MKDIRDelegateDefault"]) AC_PATH_PROG([MogrifyDelegate],["$MogrifyDelegateDefault"],["$MogrifyDelegateDefault"]) -AC_PATH_PROG([VIDEODecodeDelegate],["$VIDEODecodeDelegateDefault"],["$VIDEODecodeDelegateDefault"]) -AC_PATH_PROG([VIDEOEncodeDelegate],["$VIDEOEncodeDelegateDefault"],["$VIDEOEncodeDelegateDefault"]) AC_PATH_PROG([MrSIDDecodeDelegate],["$MrSIDDecodeDelegateDefault"],["$MrSIDDecodeDelegateDefault"]) AC_PATH_PROG([MVDelegate],["$MVDelegateDefault"],["$MVDelegateDefault"]) AC_PATH_PROG([PCLDelegate],["$PCLDelegateDefault"],["$PCLDelegateDefault"]) @@ -3199,6 +3211,8 @@ AC_PATH_PROG([RSVGDecodeDelegate],["$RSVGDecodeDelegateDefault"],["$RSVGDecodeDe AC_PATH_PROG([SVGDecodeDelegate],["$SVGDecodeDelegateDefault"],["$SVGDecodeDelegateDefault"]) AC_PATH_PROG([TextEncodeDelegate],["$TextEncodeDelegateDefault"],["$TextEncodeDelegateDefault"]) AC_PATH_PROG([TraceEncodeDelegate],["$TraceEncodeDelegateDefault"],["$TraceEncodeDelegateDefault"]) +AC_PATH_PROG([VIDEODecodeDelegate],["$VIDEODecodeDelegateDefault"],["$VIDEODecodeDelegateDefault"]) +AC_PATH_PROG([VIDEOEncodeDelegate],["$VIDEOEncodeDelegateDefault"],["$VIDEOEncodeDelegateDefault"]) AC_PATH_PROG([WebPDecodeDelegate],["$WebPDecodeDelegateDefault"],["$WebPDecodeDelegateDefault"]) AC_PATH_PROG([WebPEncodeDelegate],["$WebPEncodeDelegateDefault"],["$WebPEncodeDelegateDefault"]) AC_PATH_PROG([WWWDecodeDelegate],["$WWWDecodeDelegateDefault"],["$WWWDecodeDelegateDelegateDefault"]) @@ -3259,8 +3273,8 @@ dejavu_font_dir='' if test "${with_dejavu_font_dir}" != 'default'; then dejavu_font_dir="${with_dejavu_font_dir}/" else - for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do - if test -f "${font_dir}DejaVuSerif.ttf"; then + for font_dir in "${prefix}/share/fonts/dejavu" "${prefix}/share/dejavu-serif-fonts/fonts/" '/usr/share/fonts/dejavu-serif-fonts/' '/usr/share/fonts/truetype/dejavu/'; do + if test -f "${font_dir}URWGothic-Book.otf"; then dejavu_font_dir="${font_dir}" break 1 fi @@ -3319,14 +3333,14 @@ case "${build_os}" in ;; esac -# URW-base35 fonts. +# URW-base35 OTF fonts. AC_MSG_CHECKING([for URW-base35 fonts directory]) urw_base35_font_dir='' if test "${with_urw_base35_font_dir}" != 'default'; then urw_base35_font_dir="${with_urw_base35_font_dir}/" else - for font_dir in "${prefix}/share/urw-base35/fonts/" '/usr/share/fonts/urw-base35/' '/usr/share/fonts/type1/urw-base35/'; do - if test -f "${font_dir}StandardSymbolsPS.t1"; then + for font_dir in "${prefix}/share/urw-base35/fonts/" "${prefix}/share/fonts/opentype/urw-base35" '/usr/share/fonts/urw-base35/' '/usr/share/fonts/opentype/urw-base35/'; do + if test -f "${font_dir}URWGothic-Book.otf"; then urw_base35_font_dir="${font_dir}" break 1 fi @@ -3340,11 +3354,39 @@ else fi AC_SUBST([urw_base35_font_dir]) +# URW-base35 Type1 fonts. +AC_MSG_CHECKING([for URW-base35 Type1 fonts directory]) +urw_base35_type1_font_dir='' +if test "${with_urw_base35_type1_font_dir}" != 'default'; then + urw_base35_type1_font_dir="${with_urw_base35_type1_font_dir}/" +else + for font_dir in "${prefix}/share/urw-base35/fonts/" "${prefix}/share/fonts/type1/urw-base35" '/usr/share/fonts/urw-base35/' '/usr/share/fonts/type1/urw-base35/'; do + if test -f "${font_dir}URWGothic-Book.t1"; then + urw_base35_type1_font_dir="${font_dir}" + break 1 + fi + done +fi +if test "${urw_base35_type1_font_dir}x" != 'x'; then + type_include_files="${type_include_files} "'' + AC_MSG_RESULT([$urw_base35_type1_font_dir]) +else + AC_MSG_RESULT([not found!]); +fi +AC_SUBST([urw_base35_type1_font_dir]) + # Windows fonts. AC_MSG_CHECKING([for Windows fonts directory]) windows_font_dir='' if test "${with_windows_font_dir}" != 'default'; then windows_font_dir="${with_windows_font_dir}/" +else + for font_dir in '/usr/share/wine/fonts/' '/usr/share/fonts/msttcore/' '/usr/share/fonts/microsoft/' '/usr/share/fonts/truetype/msttcorefonts/'; do + if test -f "${font_dir}arial.ttf"; then + windows_font_dir="${font_dir}" + break 1 + fi + done fi if test "${windows_font_dir}x" != 'x'; then type_include_files="${type_include_files} "'' @@ -3356,6 +3398,18 @@ AC_SUBST([windows_font_dir]) AC_SUBST([type_include_files]) +# Permit enciphering and deciphering image pixels. +AC_ARG_ENABLE([cipher], + [AS_HELP_STRING([--disable-cipher], + [disable enciphering and deciphering image pixels])], + [enable_cipher=$enableval], + [enable_cipher='yes']) + +if test "$enable_cipher" = 'yes'; then + AC_DEFINE([CIPHER_SUPPORT],[1],[permit enciphering and deciphering image pixels]) + MAGICK_FEATURES="Cipher $MAGICK_FEATURES" +fi + # # Handle case where user doesn't want frozen paths # @@ -3365,6 +3419,7 @@ if test "$with_frozenpaths" != 'yes'; then BPGEncodeDelegate="$BPGEncodeDelegateDefault" BlenderDecodeDelegate="$BlenderDecodeDelegateDefault" BrowseDelegate="$BrowseDelegateDefault" + ClipboardDelegate="$ClipboardDelegateDefault" ConvertDelegate="$ConvertDelegateDefault" DisplayDelegate="$DisplayDelegateDefault" DNGDecodeDelegate="$DNGDecodeDelegateDefault" @@ -3403,6 +3458,7 @@ AC_SUBST([BPGDecodeDelegate]) AC_SUBST([BPGEncodeDelegate]) AC_SUBST([BlenderDecodeDelegate]) AC_SUBST([BrowseDelegate]) +AC_SUBST([ClipboardDelegate]) AC_SUBST([ConvertDelegate]) AC_SUBST([GVCDecodeDelegate]) AC_SUBST([DVIDecodeDelegate]) @@ -3463,7 +3519,7 @@ AM_CONDITIONAL([ZIP_DELEGATE],[test "x$ZIP" != "x"]) # # GhostPCL related configuration. # -PCLColorDevice=ppmraw +PCLColorDevice=png16malpha PCLCMYKDevice=pamcmyk32 PCLMonoDevice=pbmraw if test -z "$PCLVersion"; then @@ -3509,8 +3565,8 @@ AC_SUBST([PCLVersion]) # # GhostXPS related configuration. # -XPSColorDevice=ppmraw -XPSCMYKDevice=bmpsep8 +XPSColorDevice=png16malpha +XPSCMYKDevice=pamcmyk32 XPSMonoDevice=pbmraw if test -z "$XPSVersion"; then XPSVersion='unknown' @@ -3555,7 +3611,7 @@ AC_SUBST([XPSVersion]) # # Ghostscript related configuration. # -GSAlphaDevice=pngalpha +GSAlphaDevice=png16malpha GSColorDevice=png16m GSCMYKDevice=pamcmyk32 GSMonoDevice=pbmraw @@ -3588,6 +3644,8 @@ if test $have_gs = 'yes'; then AC_MSG_CHECKING([for gs alpha device]) if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then : + elif $PSDelegate -q -dBATCH -sDEVICE=pngalpha -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then + GSAlphaDevice=pngalpha else GSAlphaDevice=$GSColorDevice fi @@ -3750,9 +3808,6 @@ fi if test "$have_jpeg" = 'yes' ; then MAGICK_DELEGATES="$MAGICK_DELEGATES jpeg" fi -if test "$have_jxl" = 'yes' ; then - MAGICK_DELEGATES="$MAGICK_DELEGATES jxl" -fi if test "$have_lcms" = 'yes' || test "$have_lcms2" = 'yes' ; then MAGICK_DELEGATES="$MAGICK_DELEGATES lcms" fi @@ -3771,6 +3826,9 @@ fi if test "$have_pango" = 'yes' ; then MAGICK_DELEGATES="$MAGICK_DELEGATES pango" fi +if test "$have_pcl" = 'yes' ; then + MAGICK_DELEGATES="$MAGICK_DELEGATES pcl" +fi if test "$have_png" = 'yes' ; then MAGICK_DELEGATES="$MAGICK_DELEGATES png" fi @@ -3873,7 +3931,7 @@ fi if test "$build_modules" != 'no'; then MAGICK_DEP_LIBS="$USER_LIBS $LCMS_LIBS $FREETYPE_LIBS $RAQM_LIBS $LQR_LIBS $FFTW_LIBS $XML_LIBS $FLIF_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $BZLIB_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS $MTMALLOC_LIBS" else - MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $RAQM_LIBS $JPEG_LIBS $JXL_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FLIF_LIBS $FPX_LIBS $FONTCONFIG_LIBS $HEIF_LIBS $WEBPMUX_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIBS $PANGO_LIBS $RAW_R_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS $MTMALLOC_LIBS" + MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $RAQM_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FLIF_LIBS $FPX_LIBS $FONTCONFIG_LIBS $HEIF_LIBS $WEBPMUX_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIBS $PANGO_LIBS $RAW_R_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS $MTMALLOC_LIBS" fi MAGICK_EXTRA_DEP_LIBS="$GOMP_LIBS" AC_SUBST([MAGICK_DEP_LIBS]) @@ -3889,12 +3947,21 @@ AC_SUBST([X_CFLAGS]) #AC_SUBST([X_LIBS]) #AC_SUBST([X_EXTRA_LIBS]) +CC=`echo $CC | sed -e 's/ */ /g'` +CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'` +CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'` +CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'` +LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'` +LIBS=`echo $LIBS | sed -e 's/ */ /g'` + MAGICK_CFLAGS=$CFLAGS -MAGICK_CXXFLAGS="$CXXFLAGS" +MAGICK_CXXFLAGS=$CXXFLAGS MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'` MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'` MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS" MAGICK_LIBS="$MAGICK_DEP_LIBS $MAGICK_EXTRA_DEP_LIBS" +MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'` +MAGICK_EXTRA_DEP_LIBS=`echo $MAGICK_EXTRA_DEP_LIBS | sed -e 's/ */ /g'` AC_SUBST([MAGICK_CFLAGS]) AC_SUBST([MAGICK_CXXFLAGS]) @@ -3933,6 +4000,11 @@ if test "${urw_base35_font_dir}x" != 'x'; then result_urw_base35_font_dir=$urw_base35_font_dir fi +result_urw_base35_type1_font_dir='none' +if test "${urw_base35_type1_font_dir}x" != 'x'; then + result_urw_base35_type1_font_dir=$urw_base35_type1_font_dir +fi + result_windows_font_dir='none' if test "${windows_font_dir}x" != 'x'; then result_windows_font_dir=${windows_font_dir} @@ -3954,6 +4026,7 @@ AC_CONFIG_FILES([\ config/type-dejavu.xml \ config/type-ghostscript.xml \ config/type-urw-base35.xml \ + config/type-urw-base35-type1.xml \ config/type-windows.xml \ config/type.xml \ ImageMagick.spec \ @@ -4004,94 +4077,95 @@ matches your expectations. Host system type: $host Build system type: $build - Option Value + Option Value ------------------------------------------------------------------------------ -Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs -Static libraries --enable-static=$enable_static $libtool_build_static_libs -Module support --with-modules=$build_modules $build_modules -GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld -Security policy --with-security-policy=$with_security_policy $with_security_policy -Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth +Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs +Static libraries --enable-static=$enable_static $libtool_build_static_libs +Module support --with-modules=$build_modules $build_modules +GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld +OpenMP --enable-openmp=$enable_openmp ${OPENMP_ENABLED} +Security policy --with-security-policy=$security_policy $security_policy +Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth High Dynamic Range Imagery - --enable-hdri=$enable_hdri $enable_hdri + --enable-hdri=$enable_hdri $enable_hdri -Install documentation: $wantdocs +Install documentation: $wantdocs Memory allocation library: - JEMalloc --with-jemalloc=$with_jemalloc $have_jemalloc - MTMalloc --with-mtmalloc=$with_mtmalloc $have_mtmalloc - TCMalloc --with-tcmalloc=$with_tcmalloc $have_tcmalloc - UMem --with-umem=$with_umem $have_umem + JEMalloc --with-jemalloc=$with_jemalloc $have_jemalloc + MTMalloc --with-mtmalloc=$with_mtmalloc $have_mtmalloc + TCMalloc --with-tcmalloc=$with_tcmalloc $have_tcmalloc + UMem --with-umem=$with_umem $have_umem Delegate library configuration: - BZLIB --with-bzlib=$with_bzlib $have_bzlib - Autotrace --with-autotrace=$with_autotrace $have_autotrace - DJVU --with-djvu=$with_djvu $have_djvu - DPS --with-dps=$with_dps $have_dps - FFTW --with-fftw=$with_fftw $have_fftw - FLIF --with-flif=$with_flif $have_flif - FlashPIX --with-fpx=$with_fpx $have_fpx - FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig - FreeType --with-freetype=$with_freetype $have_freetype - Ghostscript lib --with-gslib=$with_gslib $have_gslib - Graphviz --with-gvc=$with_gvc $have_gvc - HEIC --with-heic=$with_heic $have_heic - JBIG --with-jbig=$with_jbig $have_jbig - JPEG v1 --with-jpeg=$with_jpeg $have_jpeg - JPEG XL --with-jxl=$with_jxl $have_jxl - LCMS --with-lcms=$with_lcms $have_lcms - LQR --with-lqr=$with_lqr $have_lqr - LTDL --with-ltdl=$with_ltdl $have_ltdl - LZMA --with-lzma=$with_lzma $have_lzma - Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus - OpenEXR --with-openexr=$with_openexr $have_openexr - OpenJP2 --with-openjp2=$with_openjp2 $have_openjp2 - PANGO --with-pango=$with_pango $have_pango - PERL --with-perl=$with_perl $have_perl - PNG --with-png=$with_png $have_png - RAQM --with-raqm=$with_raqm $have_raqm - RAW --with-raw=$with_raw $have_raw - RSVG --with-rsvg=$with_rsvg $have_rsvg - TIFF --with-tiff=$with_tiff $have_tiff - WEBP --with-webp=$with_webp $have_webp - WMF --with-wmf=$with_wmf $have_wmf - X11 --with-x=$with_x $have_x - XML --with-xml=$with_xml $have_xml - ZLIB --with-zlib=$with_zlib $have_zlib - ZSTD --with-zstd=$with_zstd $have_zstd + BZLIB --with-bzlib=$with_bzlib $have_bzlib + Autotrace --with-autotrace=$with_autotrace $have_autotrace + DJVU --with-djvu=$with_djvu $have_djvu + DPS --with-dps=$with_dps $have_dps + FFTW --with-fftw=$with_fftw $have_fftw + FLIF --with-flif=$with_flif $have_flif + FlashPIX --with-fpx=$with_fpx $have_fpx + FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig + FreeType --with-freetype=$with_freetype $have_freetype + Ghostscript lib --with-gslib=$with_gslib $have_gslib + Graphviz --with-gvc=$with_gvc $have_gvc + HEIC --with-heic=$with_heic $have_heic + JBIG --with-jbig=$with_jbig $have_jbig + JPEG v1 --with-jpeg=$with_jpeg $have_jpeg + LCMS --with-lcms=$with_lcms $have_lcms + LQR --with-lqr=$with_lqr $have_lqr + LTDL --with-ltdl=$with_ltdl $have_ltdl + LZMA --with-lzma=$with_lzma $have_lzma + Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus + OpenEXR --with-openexr=$with_openexr $have_openexr + OpenJP2 --with-openjp2=$with_openjp2 $have_openjp2 + PANGO --with-pango=$with_pango $have_pango + PERL --with-perl=$with_perl $have_perl + PNG --with-png=$with_png $have_png + RAQM --with-raqm=$with_raqm $have_raqm + RAW --with-raw=$with_raw $have_raw + RSVG --with-rsvg=$with_rsvg $have_rsvg + TIFF --with-tiff=$with_tiff $have_tiff + WEBP --with-webp=$with_webp $have_webp + WMF --with-wmf=$with_wmf $have_wmf + X11 --with-x=$with_x $have_x + XML --with-xml=$with_xml $have_xml + ZLIB --with-zlib=$with_zlib $have_zlib + ZSTD --with-zstd=$with_zstd $have_zstd Delegate program configuration: - GhostPCL None $PCLDelegate ($PCLVersion) - GhostXPS None $XPSDelegate ($XPSVersion) - Ghostscript None $PSDelegate ($GSVersion) + GhostPCL None $PCLDelegate ($PCLVersion) + GhostXPS None $XPSDelegate ($XPSVersion) + Ghostscript None $PSDelegate ($GSVersion) Font configuration: Apple fonts --with-apple-font-dir=$with_apple_font_dir $result_apple_font_dir Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir - URW-base35 fonts --with-urw-base35-font-dir=$with_urw_base35_font_dir $result_urw_base35_font_dir + URW OTF fonts --with-urw-base35-font-dir=$with_urw_base35_font_dir $result_urw_base35_font_dir + URW Type1 fonts --with-urw-base35-type1-font-dir=$with_urw_base35_type1_font_dir $result_urw_base35_type1_font_dir Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir X11 configuration: - X_CFLAGS = $X_CFLAGS - X_PRE_LIBS = $X_PRE_LIBS - X_LIBS = $X_LIBS - X_EXTRA_LIBS = $X_EXTRA_LIBS + X_CFLAGS = $X_CFLAGS + X_PRE_LIBS = $X_PRE_LIBS + X_LIBS = $X_LIBS + X_EXTRA_LIBS = $X_EXTRA_LIBS Options used to compile and link: - PREFIX = $PREFIX_DIR - EXEC-PREFIX = $EXEC_PREFIX_DIR - VERSION = $PACKAGE_VERSION - CC = $CC - CFLAGS = $CFLAGS - CPPFLAGS = $CPPFLAGS - PCFLAGS = $PCFLAGS - DEFS = $DEFS - LDFLAGS = $LDFLAGS - LIBS = $MAGICK_DEP_LIBS - CXX = $CXX - CXXFLAGS = $CXXFLAGS - FEATURES = $MAGICK_FEATURES - DELEGATES = $MAGICK_DELEGATES + PREFIX = $PREFIX_DIR + EXEC-PREFIX = $EXEC_PREFIX_DIR + VERSION = $PACKAGE_VERSION + CC = $CC + CFLAGS = $CFLAGS + CPPFLAGS = $CPPFLAGS + PCFLAGS = $PCFLAGS + DEFS = $DEFS + LDFLAGS = $LDFLAGS + LIBS = $MAGICK_DEP_LIBS $MAGICK_EXTRA_DEP_LIBS + CXX = $CXX + CXXFLAGS = $CXXFLAGS + FEATURES = $MAGICK_FEATURES + DELEGATES = $MAGICK_DELEGATES ============================================================================== ]) diff --git a/filters/analyze.c b/filters/analyze.c index d01a27cef1cf1c1db53202823e279dab72ca752e..4545a8f66a58a6b08552f80bbec66bce64965dea 100644 --- a/filters/analyze.c +++ b/filters/analyze.c @@ -36,12 +36,6 @@ /* Include declarations. */ -#include -#include -#include -#include -#include -#include #include "magick/studio.h" #include "magick/MagickCore.h" diff --git a/images/donate.png b/images/donate.png new file mode 100644 index 0000000000000000000000000000000000000000..c3cadc8374fe419b32ed2ea9bb79f41d9b826360 Binary files /dev/null and b/images/donate.png differ diff --git a/images/examples.jpg b/images/examples.jpg index bf7de6b8b40a92fb536db978228dac6f7c7a0378..17c1bd72245cb96d80391f85c76bcae3d2250af6 100644 Binary files a/images/examples.jpg and b/images/examples.jpg differ diff --git a/images/networkredux.png b/images/networkredux.png new file mode 100644 index 0000000000000000000000000000000000000000..b2e4f39424a20ad0567a16ab5cda060936294102 Binary files /dev/null and b/images/networkredux.png differ diff --git a/index.html b/index.html index 6956fc0e1c811d8fd87201bb34ed8fd276e8411d..a144159b8ee6af5ea26e101d38ac73a6c4fca789 100644 --- a/index.html +++ b/index.html @@ -1,18 +1,17 @@ - - - + + - ImageMagick (legacy) – Convert, Edit, or Compose Digital Images + ImageMagick – Mastering Digital Image Alchemy (legacy) - + - - + + @@ -22,19 +21,82 @@ - - - + + + + + + - - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

Mastering Digital Image Alchemy (legacy)

+
+
-
-
-

ImageMagick (legacy)

+
-

ImageMagick® is a free, open-source software suite, used for editing and manipulating digital images. It can be used to create, edit, compose, or convert bitmap images, and supports a wide range of file formats, including JPEG, PNG, GIF, TIFF, and PDF.

+

ImageMagick® is a free, open-source software suite, used for editing and manipulating digital images. It can be used to create, edit, compose, or convert bitmap images, and supports a wide range of file formats, including JPEG, PNG, GIF, TIFF, and Ultra HDR.

ImageMagick is widely used in industries such as web development, graphic design, and video editing, as well as in scientific research, medical imaging, and astronomy. Its versatile and customizable nature, along with its robust image processing capabilities, make it a popular choice for a wide range of image-related tasks.

ImageMagick includes a command-line interface for executing complex image processing tasks, as well as APIs for integrating its features into software applications. It is written in C and can be used on a variety of operating systems, including Linux, Windows, and macOS.

-

The main website for legacy ImageMagick can be found at https://legacy.imagemagick.org. The most recent version available is ImageMagick 6.9.12-93. The source code for this software can be accessed through the repository. We recommend upgrading your legacy version of ImageMagick to version 7.

+

The main website for legacy ImageMagick can be found at https://legacy.imagemagick.org. The most recent version available is ImageMagick 6.9.13-22. The source code for this software can be accessed through the repository. We recommend upgrading your legacy version of ImageMagick to version 7.

-

Creating a security policy that fits your specific local environment before making use of ImageMagick is highly advised. You can find guidance on setting up this policy. Also, it's important to verify your policy using the validation tool.

+

Creating a security policy that fits your specific local environment before making use of ImageMagick is highly advised. You can find guidance on setting up this policy. Also, it's important to verify your policy using the validation tool.

-

Features and Capabilities

+

Features and Capabilities

One of the key features of ImageMagick is its support for scripting and automation. This allows users to create complex image manipulation pipelines that can be run automatically, without the need for manual intervention. This can be especially useful for tasks that require the processing of large numbers of images, or for tasks that need to be performed on a regular basis.

@@ -112,7 +165,7 @@
- + @@ -124,7 +177,7 @@ - + @@ -144,19 +197,19 @@ - + - + - - + + - + @@ -164,7 +217,7 @@ - + @@ -176,7 +229,7 @@ - + @@ -188,11 +241,11 @@ - + - + @@ -220,7 +273,7 @@ - + @@ -232,19 +285,19 @@ - - + + - + - + @@ -252,11 +305,11 @@ - + - + @@ -266,19 +319,19 @@
AnimationAnimation create a GIF animation sequence from a group of images.
accurate color management with color profiles or in lieu of-- built-in gamma compression or expansion as demanded by the colorspace.
Color thresholdingColor thresholding force all pixels in the color range to white otherwise black.
uniquely label connected regions in an image.
Convex hullConvex hull smallest area convex polygon containing the image foreground objects. In addition, the minimum bounding box and unrotate angle are also generated.
DecorateDecorate add a border or frame to an image.
Delineate image featuresCanny edge detection, Hough lines.Delineate image featuresCanny edge detection, Hough lines.
Discrete Fourier transformDiscrete Fourier transform implements the forward and inverse DFT.
offload intermediate pixel storage to one or more remote servers.
DrawDraw add shapes or text to an image.
convert an image from one format to another (e.g. PNG to JPEG).
Generalized pixel distortionGeneralized pixel distortion correct for, or induce image distortions including perspective.
accurately represent the wide range of intensity levels found in real scenes ranging from the brightest direct sunlight to the deepest darkest shadows.
Histogram equalizationHistogram equalization use adaptive histogram equalization to improve contrast in images.
Image cacheImage cache secure methods and tools to cache images, image sequences, video, audio or metadata in a local folder..
juxtapose image thumbnails on an image canvas.
Morphology of shapesMorphology of shapes extract features, describe shapes, and recognize patterns in images.
support multispectral imagery up to 64 bands.
Noise and color reductionKuwahara Filter, mean-shift.Noise and color reductionKuwahara Filter, mean-shift.
Perceptual hash map visually identical images to the same or similar hash-- useful in image retrieval, authentication, indexing, or copy detection as well as digital watermarking.
Special effectsSpecial effects blur, sharpen, threshold, or tint an image.
Text & commentsText & comments insert descriptive or artistic text in an image.
ImageMagick is thread safe and most internal algorithms execute in parallel to take advantage of speed-ups offered by multicore processor chips.
TransformTransform resize, rotate, deskew, crop, flip or trim an image.
TransparencyTransparency render portions of an image invisible.

-

Examples of ImageMagick Usage demonstrates how to use the software from the command line to achieve various effects. There are also several scripts available on the website called Fred's ImageMagick Scripts, which can be used to apply geometric transforms, blur and sharpen images, remove noise, and perform other operations. Additionally, there is a tool called Magick.NET that allows users to access the functionality of ImageMagick without having to install the software on their own systems. Finally, the website also includes a Cookbook with tips and examples for using ImageMagick on Windows systems.

+

Examples of ImageMagick Usage demonstrates how to use the software from the command line to achieve various effects. There are also several scripts available on the website called Fred's ImageMagick Scripts, which can be used to apply geometric transforms, blur and sharpen images, remove noise, and perform other operations. Additionally, there is a tool called Magick.NET that allows users to access the functionality of ImageMagick without having to install the software on their own systems. Finally, the website also includes a Cookbook with tips and examples for using ImageMagick on Windows systems.

-

Community

-

Join the ImageMagick community by participating in the discussion service. Here, you can find answers to questions asked by other ImageMagick users or ask your own questions. If you have a technical question, a suggestion for an improvement, or a fix for a bug, you can also open an issue to get help from the community.

+

Community

+

Join the ImageMagick community by participating in the discussion service. Here, you can find answers to questions asked by other ImageMagick users or ask your own questions. If you have a technical question, a suggestion for an improvement, or a fix for a bug, you can also open an issue to get help from the community.

-
- + - \ No newline at end of file + \ No newline at end of file diff --git a/m4/Makefile.am b/m4/Makefile.am index 3c39efd5b6a3617fee54f2e7a267d660dac0a178..f7c0a96f6f2b95440383859a71cef722656766dc 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -15,7 +15,6 @@ # Makefile for building ImageMagick m4 macros. M4_EXTRA_DIST = \ - ac_func_fseeko.m4 \ ax_append_flag.m4 \ ax_c___attribute__.m4 \ ax_cflags_warn_all.m4 \ diff --git a/m4/ac_func_fseeko.m4 b/m4/ac_func_fseeko.m4 deleted file mode 100644 index eaeabb978b433d34ed01cef11b7abe0d893b560f..0000000000000000000000000000000000000000 --- a/m4/ac_func_fseeko.m4 +++ /dev/null @@ -1,72 +0,0 @@ -# This file is part of Autoconf. -*- Autoconf -*- -# Checking for functions. -# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software -# Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception, the Free Software Foundation gives unlimited -# permission to copy, distribute and modify the configure scripts that -# are the output of Autoconf. You need not follow the terms of the GNU -# General Public License when using or distributing such scripts, even -# though portions of the text of Autoconf appear in them. The GNU -# General Public License (GPL) does govern all other use of the material -# that constitutes the Autoconf program. -# -# Certain portions of the Autoconf source text are designed to be copied -# (in certain cases, depending on the input) into the output of -# Autoconf. We call these the "data" portions. The rest of the Autoconf -# source text consists of comments plus executable code that decides which -# of the data portions to output in any given case. We call these -# comments and executable code the "non-data" portions. Autoconf never -# copies any of the non-data portions into its output. -# -# This special exception to the GPL applies to versions of Autoconf -# released by the Free Software Foundation. When you make and -# distribute a modified version of Autoconf, you may extend this special -# exception to the GPL to apply to your modified version as well, *unless* -# your modified version has the potential to copy into its output some -# of the text that was the non-data portion of the version that you started -# with. (In other words, unless your change moves or copies text from -# the non-data portions to the data portions.) If your modification has -# such potential, you must delete any notice of this special exception -# to the GPL from your modified version. -# -# Written by David MacKenzie, with help from -# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, -# Roland McGrath, Noah Friedman, david d zuhn, and many others. - -# AC_FUNC_FSEEKO -# -------------- -AN_FUNCTION([ftello], [AC_FUNC_FSEEKO]) -AN_FUNCTION([fseeko], [AC_FUNC_FSEEKO]) -AC_DEFUN([AC_FUNC_FSEEKO], -[_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, - [ac_cv_sys_largefile_source], - [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).], - [[#include /* for off_t */ - #include ]], - [[int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);]]) - -# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug -# in glibc 2.1.3, but that breaks too many other things. -# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. -if test $ac_cv_sys_largefile_source != unknown; then - AC_DEFINE(HAVE_FSEEKO, 1, - [Define to 1 if fseeko (and presumably ftello) exists and is declared.]) -fi -])# AC_FUNC_FSEEKO diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 index 39a7a5ed4b98e5315e861a84c77996778a84c2f4..9f35d139149f8d9bda17cddb730cd13bcf775465 100644 --- a/m4/ax_pthread.m4 +++ b/m4/ax_pthread.m4 @@ -244,7 +244,7 @@ AS_IF([test "x$ax_pthread_clang" = "xyes"], [ax_pthread_flags="-pthread,-lpthread -pthread"]) -# The presence of a feature test macro requesting reentrant function +# The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled diff --git a/m4/version.m4 b/m4/version.m4 index 48ce8d2a757e456cdb74fddf4c6c67f80890b0d2..1221b85ffcd8afffd81d16a874d848a12036d612 100644 --- a/m4/version.m4 +++ b/m4/version.m4 @@ -26,8 +26,8 @@ m4_define([magick_name], [ImageMagick]) m4_define([magick_major_version], [6]) m4_define([magick_minor_version], [9]) -m4_define([magick_micro_version], [12]) -m4_define([magick_patchlevel_version], [98]) +m4_define([magick_micro_version], [13]) +m4_define([magick_patchlevel_version], [25]) m4_define([magick_is_beta], [n]) m4_define([magick_base_version], [magick_major_version.magick_minor_version.magick_micro_version]) @@ -36,8 +36,8 @@ m4_define([magick_version], m4_define([magick_bugreport], [https://github.com/ImageMagick/ImageMagick6/issues]) m4_define([magick_url], [https://legacy.imagemagick.org]) -m4_define([magick_lib_version], [0x69C]) -m4_define([magick_tarname],[ImageMagick]) +m4_define([magick_lib_version], [0x69D]) +m4_define([magick_tarname], [ImageMagick]) # # If the library source code has changed at all since the last update, diff --git a/magick/MagickCore-config.in b/magick/MagickCore-config.in index b4b36ead90a29f91031854366d79be22198ce640..5b7f492d5c8cadd0b7d50d534f4eea0b78d3d09b 100644 --- a/magick/MagickCore-config.in +++ b/magick/MagickCore-config.in @@ -6,13 +6,16 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ +libdir=@libdir@ +pkgconfigdir=@pkgconfigdir@ +export PKG_CONFIG_LIBDIR="${pkgconfigdir}" usage="\ Usage: MagickCore-config [--cflags] [--cppflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version]" if test $# -eq 0; then echo "${usage}" 1>&2 - echo "Example: gcc \`MagickCore-config --cflags --cppflags\` -o core core.c \`Magick-config --ldflags --libs\`" 1>&2 + echo "Example: gcc \`MagickCore-config --cflags --cppflags\` -o core core.c \`MagickCore-config --ldflags --libs\`" 1>&2 exit 1 fi diff --git a/magick/Makefile.am b/magick/Makefile.am index 10cdb8231d000f4cbbe87282b8772f27815340e9..20dbf407d98dfdc283596122c88746c7121877bc 100644 --- a/magick/Makefile.am +++ b/magick/Makefile.am @@ -194,6 +194,7 @@ MAGICK_BASE_SRCS = \ magick/magick-config.h \ magick/magick-type.h \ magick/magick.h \ + magick/magick-private.h \ magick/matrix.c \ magick/matrix.h \ magick/memory.c \ @@ -453,6 +454,7 @@ MAGICK_NOINST_HDRS = \ magick/image-private.h \ magick/locale-private.h \ magick/mac.h \ + magick/magick-private.h \ magick/memory-private.h \ magick/mime-private.h \ magick/monitor-private.h \ diff --git a/magick/accelerate.c b/magick/accelerate.c index becdece77dbf56edeaa05737e587918a61d70c62..51c4cabd7d911974fc77a6fe09d79d1c0221c87a 100644 --- a/magick/accelerate.c +++ b/magick/accelerate.c @@ -43,7 +43,6 @@ Include declarations. */ #include "magick/studio.h" #include "magick/accelerate-private.h" -#include "magick/accelerate-kernels-private.h" #include "magick/artifact.h" #include "magick/cache.h" #include "magick/cache-private.h" @@ -2739,7 +2738,7 @@ static MagickBooleanType ComputeFunctionImage(Image *image, parametersBufferPtr[i] = (float)parameters[i]; parametersBuffer = clEnv->library->clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, number_parameters * sizeof(float), parametersBufferPtr, &clStatus); - parametersBufferPtr=RelinquishMagickMemory(parametersBufferPtr); + parametersBufferPtr=(float *) RelinquishMagickMemory(parametersBufferPtr); } clkernel = AcquireOpenCLKernel(clEnv, MAGICK_OPENCL_ACCELERATE, "ComputeFunction"); @@ -4688,7 +4687,7 @@ static Image *ComputeUnsharpMaskImage(const Image *image, goto cleanup; } - kernelBufferPtr=AcquireQuantumMemory(kernel->width,sizeof(float)); + kernelBufferPtr=(float *) AcquireQuantumMemory(kernel->width,sizeof(float)); if (kernelBufferPtr == (float *) NULL) { (void) OpenCLThrowMagickException(exception, GetMagickModule(), ResourceLimitWarning, "Memory allocation failed.","."); @@ -4698,7 +4697,7 @@ static Image *ComputeUnsharpMaskImage(const Image *image, kernelBufferPtr[i]=(float) kernel->values[i]; imageKernelBuffer = clEnv->library->clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, kernel->width * sizeof(float), kernelBufferPtr, &clStatus); - kernelBufferPtr=RelinquishMagickMemory(kernelBufferPtr); + kernelBufferPtr=(float *) RelinquishMagickMemory(kernelBufferPtr); if (clStatus != CL_SUCCESS) { (void) OpenCLThrowMagickException(exception, GetMagickModule(), ResourceLimitWarning, "clEnv->library->clCreateBuffer failed.","."); diff --git a/magick/animate.c b/magick/animate.c index 2914eff95f1eb8ab7765971d220657699056bb31..81094b7e4e5850424bae4c375714cf4f71ca81cb 100644 --- a/magick/animate.c +++ b/magick/animate.c @@ -225,7 +225,7 @@ typedef enum StepBackwardCommand, StepForwardCommand, NullCommand -} CommandType; +} AnimateCommand; /* Stipples. @@ -239,7 +239,7 @@ typedef enum Forward declarations. */ static Image - *XMagickCommand(Display *,XResourceInfo *,XWindows *,const CommandType, + *XMagickCommand(Display *,XResourceInfo *,XWindows *,const AnimateCommand, Image **,MagickStatusType *); static MagickBooleanType @@ -342,7 +342,7 @@ MagickExport MagickBooleanType AnimateImages(const ImageInfo *image_info, % The format of the XMagickCommand method is: % % Image *XMagickCommand(Display *display,XResourceInfo *resource_info, -% XWindows *windows,const CommandType command_type,Image **image, +% XWindows *windows,const AnimateCommand animate_command,Image **image, % MagickStatusType *state) % % A description of each parameter follows: @@ -363,7 +363,7 @@ MagickExport MagickBooleanType AnimateImages(const ImageInfo *image_info, % */ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, - XWindows *windows,const CommandType command_type,Image **image, + XWindows *windows,const AnimateCommand animate_command,Image **image, MagickStatusType *state) { Image @@ -382,7 +382,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, Process user command. */ nexus=NewImageList(); - switch (command_type) + switch (animate_command) { case OpenCommand: { @@ -518,9 +518,9 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, { *state|=StepAnimationState; *state&=(~PlayAnimationState); - if (command_type == StepBackwardCommand) + if (animate_command == StepBackwardCommand) *state&=(~ForwardAnimationState); - if (command_type == StepForwardCommand) + if (animate_command == StepForwardCommand) *state|=ForwardAnimationState; if (resource_info->title != (char *) NULL) break; @@ -1257,7 +1257,7 @@ MagickExport Image *XAnimateImages(Display *display, HelpMenu }; - static const CommandType + static const AnimateCommand CommandMenus[]= { NullCommand, @@ -1267,7 +1267,7 @@ MagickExport Image *XAnimateImages(Display *display, InfoCommand, QuitCommand }, - CommandTypes[]= + AnimateCommands[]= { OpenCommand, PlayCommand, @@ -1293,24 +1293,24 @@ MagickExport Image *XAnimateImages(Display *display, VersionCommand }; - static const CommandType + static const AnimateCommand *Commands[MagickMenus]= { - CommandTypes, + AnimateCommands, SpeedCommands, DirectionCommands, HelpCommands }; + AnimateCommand + animate_command; + char command[MaxTextExtent], *directory, geometry[MaxTextExtent], resource_name[MaxTextExtent]; - CommandType - command_type; - Image *coalesce_image, *display_image, @@ -2195,7 +2195,7 @@ MagickExport Image *XAnimateImages(Display *display, if (id < 0) continue; (void) CopyMagickString(command,CommandMenu[id],MaxTextExtent); - command_type=CommandMenus[id]; + animate_command=CommandMenus[id]; if (id < MagickMenus) { int @@ -2209,11 +2209,11 @@ MagickExport Image *XAnimateImages(Display *display, if (entry < 0) continue; (void) CopyMagickString(command,Menus[id][entry],MaxTextExtent); - command_type=Commands[id][entry]; + animate_command=Commands[id][entry]; } - if (command_type != NullCommand) + if (animate_command != NullCommand) nexus=XMagickCommand(display,resource_info,windows, - command_type,&image,&state); + animate_command,&image,&state); continue; } switch (event.type) @@ -2525,63 +2525,63 @@ MagickExport Image *XAnimateImages(Display *display, if (resource_info->debug != MagickFalse) (void) LogMagickEvent(X11Event,GetMagickModule(), "Key press: 0x%lx (%c)",(unsigned long) key_symbol,*command); - command_type=NullCommand; + animate_command=NullCommand; switch (key_symbol) { case XK_o: { if ((event.xkey.state & ControlMask) == MagickFalse) break; - command_type=OpenCommand; + animate_command=OpenCommand; break; } case XK_BackSpace: { - command_type=StepBackwardCommand; + animate_command=StepBackwardCommand; break; } case XK_space: { - command_type=StepForwardCommand; + animate_command=StepForwardCommand; break; } case XK_less: { - command_type=FasterCommand; + animate_command=FasterCommand; break; } case XK_greater: { - command_type=SlowerCommand; + animate_command=SlowerCommand; break; } case XK_F1: { - command_type=HelpCommand; + animate_command=HelpCommand; break; } case XK_Find: { - command_type=BrowseDocumentationCommand; + animate_command=BrowseDocumentationCommand; break; } case XK_question: { - command_type=InfoCommand; + animate_command=InfoCommand; break; } case XK_q: case XK_Escape: { - command_type=QuitCommand; + animate_command=QuitCommand; break; } default: break; } - if (command_type != NullCommand) - nexus=XMagickCommand(display,resource_info,windows, - command_type,&image,&state); + if (animate_command != NullCommand) + nexus=XMagickCommand(display,resource_info,windows,animate_command, + &image,&state); break; } case KeyRelease: diff --git a/magick/annotate.c b/magick/annotate.c index 2b9959eabd5a78794d70ece473543b1c92d52a2b..5e306489dcd0d7445a71f2c1c9cfe773c5301d00 100644 --- a/magick/annotate.c +++ b/magick/annotate.c @@ -636,7 +636,7 @@ MagickExport ssize_t FormatMagickCaption(Image *image,DrawInfo *draw_info, q=draw_info->text; s=(char *) NULL; width=0; - for (p=(*caption); GetUTFCode(p) != 0; p+=GetUTFOctets(p)) + for (p=(*caption); GetUTFCode(p) != 0; p+=(ptrdiff_t) GetUTFOctets(p)) { int code; @@ -690,7 +690,7 @@ MagickExport ssize_t FormatMagickCaption(Image *image,DrawInfo *draw_info, s=(char *) NULL; } n=0; - for (p=(*caption); GetUTFCode(p) != 0; p+=GetUTFOctets(p)) + for (p=(*caption); GetUTFCode(p) != 0; p+=(ptrdiff_t) GetUTFOctets(p)) if (GetUTFCode(p) == '\n') n++; return(n); @@ -1057,12 +1057,6 @@ static MagickBooleanType RenderType(Image *image,const DrawInfo *draw_info, font=DestroyString(font); } sans_exception=AcquireExceptionInfo(); - if (type_info == (const TypeInfo *) NULL) - type_info=GetTypeInfoByFamily("Noto Sans",draw_info->style, - draw_info->stretch,draw_info->weight,sans_exception); - if (type_info == (const TypeInfo *) NULL) - type_info=GetTypeInfoByFamily("Nimbus Sans",draw_info->style, - draw_info->stretch,draw_info->weight,sans_exception); if (type_info == (const TypeInfo *) NULL) type_info=GetTypeInfoByFamily((const char *) NULL,draw_info->style, draw_info->stretch,draw_info->weight,sans_exception); @@ -1229,7 +1223,7 @@ static size_t ComplexTextLayout(const DrawInfo *draw_info,const char *text, return(0); last_glyph=0; p=text; - for (i=0; GetUTFCode(p) != 0; p+=GetUTFOctets(p), i++) + for (i=0; GetUTFCode(p) != 0; p+=(ptrdiff_t) GetUTFOctets(p), i++) { (*grapheme)[i].index=(ssize_t) FT_Get_Char_Index(face,GetUTFCode(p)); (*grapheme)[i].x_offset=0; @@ -1724,7 +1718,7 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, if (image->matte == MagickFalse) (void) SetImageAlphaChannel(image,OpaqueAlphaChannel); } - for (p=draw_info->text; GetUTFCode(p) != 0; p+=GetUTFOctets(p)) + for (p=draw_info->text; GetUTFCode(p) != 0; p+=(ptrdiff_t) GetUTFOctets(p)) if (GetUTFCode(p) < 0) break; utf8=(unsigned char *) NULL; @@ -1839,6 +1833,10 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, MagickFalse; p=bitmap->bitmap.buffer; image_view=AcquireAuthenticCacheView(image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(status) \ + magick_number_threads(image,image,bitmap->bitmap.rows,4) +#endif for (y=0; y < (ssize_t) bitmap->bitmap.rows; y++) { MagickBooleanType @@ -2105,7 +2103,8 @@ static MagickBooleanType RenderPostscript(Image *image, unique_file; MagickBooleanType - identity; + identity, + status; PointInfo extent, @@ -2281,8 +2280,13 @@ static MagickBooleanType RenderPostscript(Image *image, if (annotate_image->matte == MagickFalse) (void) SetImageAlphaChannel(annotate_image,OpaqueAlphaChannel); fill_color=draw_info->fill; + status=MagickTrue; exception=(&image->exception); annotate_view=AcquireAuthenticCacheView(annotate_image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(status) \ + magick_number_threads(annotate_image,annotate_image,annotate_image->rows,4) +#endif for (y=0; y < (ssize_t) annotate_image->rows; y++) { PixelPacket @@ -2291,10 +2295,15 @@ static MagickBooleanType RenderPostscript(Image *image, ssize_t x; + if (status == MagickFalse) + continue; q=GetCacheViewAuthenticPixels(annotate_view,0,y,annotate_image->columns, 1,exception); if (q == (PixelPacket *) NULL) - break; + { + status=MagickFalse; + continue; + } for (x=0; x < (ssize_t) annotate_image->columns; x++) { (void) GetFillColor(draw_info,x,y,&fill_color); @@ -2308,7 +2317,7 @@ static MagickBooleanType RenderPostscript(Image *image, } sync=SyncCacheViewAuthenticPixels(annotate_view,exception); if (sync == MagickFalse) - break; + status=MagickFalse; } annotate_view=DestroyCacheView(annotate_view); (void) CompositeImage(image,OverCompositeOp,annotate_image, diff --git a/magick/attribute.c b/magick/attribute.c index 5f4abe4030f8f4e476d1008ecbd0743368a0ba87..a6958191f331f1ee6ad24e82c4a4cf54b6e8d439 100644 --- a/magick/attribute.c +++ b/magick/attribute.c @@ -124,14 +124,14 @@ % */ -typedef struct _EdgeInfo +typedef struct _CensusInfo { double left, right, top, bottom; -} EdgeInfo; +} CensusInfo; static double GetEdgeBackgroundCensus(const Image *image, const CacheView *image_view,const GravityType gravity,const size_t width, @@ -240,7 +240,7 @@ static double GetEdgeBackgroundCensus(const Image *image, return(census); } -static inline double GetMinEdgeBackgroundCensus(const EdgeInfo *edge) +static inline double GetMinEdgeBackgroundCensus(const CensusInfo *edge) { double census; @@ -256,6 +256,10 @@ static RectangleInfo GetEdgeBoundingBox(const Image *image, CacheView *edge_view; + CensusInfo + edge, + vertex; + const char *artifact; @@ -263,10 +267,6 @@ static RectangleInfo GetEdgeBoundingBox(const Image *image, background_census, percent_background; - EdgeInfo - edge, - vertex; - Image *edge_image; @@ -458,7 +458,7 @@ MagickExport RectangleInfo GetImageBoundingBox(const Image *image, GetMagickPixelPacket(image,&zero); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -978,13 +978,10 @@ MagickExport ImageType IdentifyImageGray(const Image *image, *image_view; ImageType - type; - - const PixelPacket - *p; + type = BilevelType; - ssize_t - x; + MagickBooleanType + status = MagickTrue; ssize_t y; @@ -998,30 +995,44 @@ MagickExport ImageType IdentifyImageGray(const Image *image, return(image->type); if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse) return(UndefinedType); - type=BilevelType; image_view=AcquireVirtualCacheView(image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(status,type) \ + magick_number_threads(image,image,image->rows,2) +#endif for (y=0; y < (ssize_t) image->rows; y++) { + const PixelPacket + *p; + + ssize_t + x; + + if (status == MagickFalse) + continue; p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); if (p == (const PixelPacket *) NULL) - break; + { + status=MagickFalse; + continue; + } for (x=0; x < (ssize_t) image->columns; x++) { if (IsPixelGray(p) == MagickFalse) { - type=UndefinedType; + status=MagickFalse; break; } if ((type == BilevelType) && (IsPixelMonochrome(p) == MagickFalse)) type=GrayscaleType; p++; } - if (type == UndefinedType) - break; } image_view=DestroyCacheView(image_view); if ((type == GrayscaleType) && (image->matte != MagickFalse)) type=GrayscaleMatteType; + if (status == MagickFalse) + return(UndefinedType); return(type); } @@ -1059,13 +1070,7 @@ MagickExport MagickBooleanType IdentifyImageMonochrome(const Image *image, *image_view; ImageType - type; - - ssize_t - x; - - const PixelPacket - *p; + type = BilevelType; ssize_t y; @@ -1078,13 +1083,27 @@ MagickExport MagickBooleanType IdentifyImageMonochrome(const Image *image, return(MagickTrue); if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse) return(MagickFalse); - type=BilevelType; image_view=AcquireVirtualCacheView(image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(type) \ + magick_number_threads(image,image,image->rows,2) +#endif for (y=0; y < (ssize_t) image->rows; y++) { + const PixelPacket + *p; + + ssize_t + x; + + if (type == UndefinedType) + continue; p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); if (p == (const PixelPacket *) NULL) - break; + { + type=UndefinedType; + continue; + } for (x=0; x < (ssize_t) image->columns; x++) { if (IsPixelMonochrome(p) == MagickFalse) @@ -1094,13 +1113,9 @@ MagickExport MagickBooleanType IdentifyImageMonochrome(const Image *image, } p++; } - if (type == UndefinedType) - break; } image_view=DestroyCacheView(image_view); - if (type == BilevelType) - return(MagickTrue); - return(MagickFalse); + return(type == BilevelType ? MagickTrue : MagickFalse); } /* @@ -1273,11 +1288,8 @@ MagickExport MagickBooleanType IsOpaqueImage(const Image *image, CacheView *image_view; - const PixelPacket - *p; - - ssize_t - x; + MagickBooleanType + opaque = MagickTrue; ssize_t y; @@ -1292,22 +1304,38 @@ MagickExport MagickBooleanType IsOpaqueImage(const Image *image, if (image->matte == MagickFalse) return(MagickTrue); image_view=AcquireVirtualCacheView(image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(opaque) \ + magick_number_threads(image,image,image->rows,2) +#endif for (y=0; y < (ssize_t) image->rows; y++) { + const PixelPacket + *p; + + ssize_t + x; + + if (opaque == MagickFalse) + continue; p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); if (p == (const PixelPacket *) NULL) - break; + { + opaque=MagickFalse; + continue; + } for (x=0; x < (ssize_t) image->columns; x++) { if (GetPixelOpacity(p) != OpaqueOpacity) - break; + { + opaque=MagickFalse; + break; + } p++; } - if (x < (ssize_t) image->columns) - break; } image_view=DestroyCacheView(image_view); - return(y < (ssize_t) image->rows ? MagickFalse : MagickTrue); + return(opaque); } /* @@ -1424,7 +1452,7 @@ RestoreMSCWarning range); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -1474,7 +1502,7 @@ RestoreMSCWarning */ #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { diff --git a/magick/blob.c b/magick/blob.c index 339884a1e02468c96bdc51e802b0e5b00f1952e0..da0d15f1d93b4a509675b2f6b221efd022764545 100644 --- a/magick/blob.c +++ b/magick/blob.c @@ -139,9 +139,11 @@ struct _BlobInfo MagickBooleanType exempt, synchronize, - status, temporary; + int + status; + StreamType type; @@ -174,7 +176,7 @@ struct _BlobInfo Forward declarations. */ static int - SyncBlob(Image *); + SyncBlob(const Image *); /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -277,7 +279,7 @@ MagickExport MagickBooleanType BlobToFile(char *filename,const void *blob, for (i=0; i < length; i+=(size_t) count) { count=write(file,(const char *) blob+i,MagickMin(length-i,(size_t) - MAGICK_SSIZE_MAX)); + MagickMaxBufferExtent)); if (count <= 0) { count=0; @@ -497,9 +499,9 @@ MagickExport BlobInfo *CloneBlobInfo(const BlobInfo *blob_info) static inline void ThrowBlobException(BlobInfo *blob_info) { - if ((blob_info->status == MagickFalse) && (errno != 0)) + if ((blob_info->status == 0) && (errno != 0)) blob_info->error_number=errno; - blob_info->status=MagickTrue; + blob_info->status=(-1); } MagickExport MagickBooleanType CloseBlob(Image *image) @@ -520,12 +522,13 @@ MagickExport MagickBooleanType CloseBlob(Image *image) blob_info=image->blob; if ((blob_info == (BlobInfo *) NULL) || (blob_info->type == UndefinedStream)) return(MagickTrue); - status=SyncBlob(image); + (void) SyncBlob(image); + status=blob_info->status; switch (blob_info->type) { case UndefinedStream: - case StandardStream: break; + case StandardStream: case FileStream: case PipeStream: { @@ -591,7 +594,7 @@ MagickExport MagickBooleanType CloseBlob(Image *image) if (blob_info->exempt != MagickFalse) { blob_info->type=UndefinedStream; - return(blob_info->status); + return(blob_info->status != 0 ? MagickFalse : MagickTrue); } switch (blob_info->type) { @@ -647,7 +650,7 @@ MagickExport MagickBooleanType CloseBlob(Image *image) } } (void) DetachBlob(blob_info); - return(blob_info->status); + return(blob_info->status != 0 ? MagickFalse : MagickTrue); } /* @@ -750,6 +753,7 @@ MagickExport unsigned char *DetachBlob(BlobInfo *blob_info) blob_info->mapped=MagickFalse; blob_info->length=0; blob_info->offset=0; + blob_info->mode=UndefinedBlobMode; blob_info->eof=MagickFalse; blob_info->error=0; blob_info->exempt=MagickFalse; @@ -859,7 +863,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); @@ -870,7 +874,7 @@ MagickExport MagickBooleanType DiscardBlobBytes(Image *image, break; } } - return(i < (MagickOffsetType) length ? MagickFalse : MagickTrue); + return(i < (MagickSizeType) length ? MagickFalse : MagickTrue); } /* @@ -1231,7 +1235,7 @@ MagickExport unsigned char *FileToBlob(const char *filename,const size_t extent, for (i=0; i < *length; i+=count) { count=read(file,blob+i,(size_t) MagickMin(*length-i,(size_t) - MAGICK_SSIZE_MAX)); + MagickMaxBufferExtent)); if (count <= 0) { count=0; @@ -1426,9 +1430,9 @@ MagickExport MagickBooleanType GetBlobError(const Image *image) assert(image->signature == MagickCoreSignature); if (IsEventLogging() != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - if ((image->blob->status != MagickFalse) && (image->blob->error_number != 0)) + if ((image->blob->status != 0) && (image->blob->error_number != 0)) errno=image->blob->error_number; - return(image->blob->status); + return(image->blob->status == 0 ? MagickFalse : MagickTrue); } /* @@ -1806,7 +1810,6 @@ MagickExport unsigned char *ImageToBlob(const ImageInfo *image_info, (void) FormatLocaleString(image->filename,MagickPathExtent, "%s:%s",image->magick,unique); status=WriteImage(blob_info,image); - (void) CloseBlob(image); (void) fclose(blob_info->file); if (status == MagickFalse) InheritException(exception,&image->exception); @@ -2042,8 +2045,9 @@ MagickExport unsigned char *ImagesToBlob(const ImageInfo *image_info, blob=(unsigned char *) ResizeQuantumMemory(blob,*length+1, sizeof(unsigned char)); } - else if (status == MagickFalse) - blob_info->blob=RelinquishMagickMemory(blob_info->blob); + else + if (status == MagickFalse) + blob_info->blob=RelinquishMagickMemory(blob_info->blob); } } else @@ -2072,7 +2076,6 @@ MagickExport unsigned char *ImagesToBlob(const ImageInfo *image_info, (void) FormatLocaleString(filename,MagickPathExtent,"%s:%s", images->magick,unique); status=WriteImages(blob_info,images,filename,exception); - (void) CloseBlob(images); (void) fclose(blob_info->file); if (status == MagickFalse) InheritException(exception,&images->exception); @@ -2955,7 +2958,7 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info, (void) SetStreamBuffering(image_info,image); } } - blob_info->status=MagickFalse; + blob_info->status=0; blob_info->error_number=0; if (blob_info->type != UndefinedStream) blob_info->size=GetBlobSize(image); @@ -4501,8 +4504,6 @@ MagickExport MagickOffsetType SeekBlob(Image *image, blob_info->eof=MagickFalse; break; } - if (blob_info->offset >= (MagickOffsetType) ((off_t) blob_info->extent)) - return(-1); break; } } @@ -4706,18 +4707,19 @@ MagickExport MagickBooleanType SetBlobExtent(Image *image, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % SyncBlob() flushes the datastream if it is a file or synchronizes the data -% attributes if it is an blob. +% attributes if it is an blob. It returns 0 on success; otherwise, it returns +% -1 and set errno to indicate the error. % % The format of the SyncBlob method is: % -% int SyncBlob(Image *image) +% int SyncBlob(const Image *image) % % A description of each parameter follows: % % o image: the image. % */ -static int SyncBlob(Image *image) +static int SyncBlob(const Image *image) { BlobInfo *magick_restrict blob_info; @@ -4728,9 +4730,10 @@ static int SyncBlob(Image *image) assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); assert(image->blob != (BlobInfo *) NULL); - assert(image->blob->type != UndefinedStream); if (IsEventLogging() != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); + if (EOFBlob(image) != 0) + return(0); blob_info=image->blob; status=0; switch (blob_info->type) @@ -4747,7 +4750,7 @@ static int SyncBlob(Image *image) case ZipStream: { #if defined(MAGICKCORE_ZLIB_DELEGATE) - status=gzflush(blob_info->file_info.gzfile,Z_SYNC_FLUSH); + (void) gzflush(blob_info->file_info.gzfile,Z_SYNC_FLUSH); #endif break; } diff --git a/magick/blob.h b/magick/blob.h index fc8154a272c94d8f8be5d24ad24efb895fccf649..5b845d6bd49b1e99e1bb98a5108f5c931a46cb68 100644 --- a/magick/blob.h +++ b/magick/blob.h @@ -25,7 +25,7 @@ extern "C" { #endif -#define MagickMaxBufferExtent 81920 +#define MagickMaxBufferExtent 524288 #define MagickMinBufferExtent 16384 typedef enum diff --git a/magick/cache-private.h b/magick/cache-private.h index 8255877e5a19b9393e2c756f656ce89e4acaf6a8..cf4defe0c064f3786339f6aadd53be03185fc984 100644 --- a/magick/cache-private.h +++ b/magick/cache-private.h @@ -249,6 +249,17 @@ typedef struct _CacheInfo height_limit; } CacheInfo; +static inline MagickBooleanType IsValidPixelOffset(const ssize_t x, + const size_t extent) +{ + if (extent == 0) + return(MagickTrue); + if ((x >= (ssize_t) (MAGICK_SSIZE_MAX/(ssize_t) extent)) || + (x <= (ssize_t) (MAGICK_SSIZE_MIN/(ssize_t) extent))) + return(MagickFalse); + return(MagickTrue); +} + extern MagickExport Cache AcquirePixelCache(const size_t), ClonePixelCache(const Cache), @@ -302,6 +313,10 @@ extern MagickExport void GetPixelCacheMethods(CacheMethods *), SetPixelCacheMethods(Cache,CacheMethods *); +extern MagickPrivate void + ResetCacheAnonymousMemory(void), + ResetPixelCacheEpoch(void); + extern MagickPrivate MagickBooleanType SyncImagePixelCache(Image *,ExceptionInfo *); diff --git a/magick/cache.c b/magick/cache.c index dc6de89cff641d73af6ee1cfd7841580d1e3842f..c7e9d6fc8e2c0ae2504c435fca23e13d2253f9cf 100644 --- a/magick/cache.c +++ b/magick/cache.c @@ -251,7 +251,7 @@ static cl_event *CopyOpenCLEvents(OpenCLCacheInfo *opencl_info, *event_count=opencl_info->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 @@ -312,13 +312,14 @@ extern MagickPrivate void AddOpenCLEvent(const Image *image,cl_event event) LockSemaphoreInfo(cache_info->opencl->events_semaphore); if (cache_info->opencl->events == (cl_event *) NULL) { - cache_info->opencl->events=AcquireMagickMemory(sizeof( + cache_info->opencl->events=(cl_event *) AcquireMagickMemory(sizeof( *cache_info->opencl->events)); cache_info->opencl->event_count=1; } else - cache_info->opencl->events=ResizeQuantumMemory(cache_info->opencl->events, - ++cache_info->opencl->event_count,sizeof(*cache_info->opencl->events)); + cache_info->opencl->events=(cl_event *) ResizeQuantumMemory( + cache_info->opencl->events,++cache_info->opencl->event_count, + sizeof(*cache_info->opencl->events)); if (cache_info->opencl->events == (cl_event *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); cache_info->opencl->events[cache_info->opencl->event_count-1]=event; @@ -370,8 +371,6 @@ MagickExport Cache AcquirePixelCache(const size_t number_threads) cache_info->number_threads=number_threads; if (GetOpenMPMaximumThreads() > cache_info->number_threads) cache_info->number_threads=GetOpenMPMaximumThreads(); - if (GetMagickResourceLimit(ThreadResource) > cache_info->number_threads) - cache_info->number_threads=(size_t) GetMagickResourceLimit(ThreadResource); if (cache_info->number_threads == 0) cache_info->number_threads=1; cache_info->nexus_info=AcquirePixelCacheNexus(cache_info->number_threads); @@ -910,7 +909,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,cache_info->rows,4) #endif for (y=0; y < (ssize_t) cache_info->rows; y++) { @@ -949,7 +948,7 @@ static MagickBooleanType ClonePixelCacheRepository( sizeof(*cache_info->indexes); #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,cache_info->rows,4) #endif for (y=0; y < (ssize_t) cache_info->rows; y++) { @@ -1848,29 +1847,25 @@ static Cache GetImagePixelCache(Image *image,const MagickBooleanType clone, MagickBooleanType destroy, - status; + status = MagickTrue; static MagickSizeType cpu_throttle = MagickResourceInfinity, cycles = 0; - status=MagickTrue; - if (cpu_throttle == MagickResourceInfinity) - cpu_throttle=GetMagickResourceLimit(ThrottleResource); - if ((cycles++ % 4096) == 0) + if (IsImageTTLExpired(image) != MagickFalse) { - if (GetMagickTTL() < 0) - { - cache_info=(CacheInfo *) image->cache; - if (cache_info->file != -1) - (void) ClosePixelCacheOnDisk(cache_info); - (void) ThrowMagickException(exception,GetMagickModule(), - ResourceLimitFatalError,"TimeLimitExceeded","`%s'",image->filename); - return((Cache) NULL); - } - if (cpu_throttle != 0) - MagickDelay(cpu_throttle); +#if defined(ESTALE) + errno=ESTALE; +#endif + (void) ThrowMagickException(exception,GetMagickModule(), + ResourceLimitError,"TimeLimitExceeded","`%s'",image->filename); + return((Cache) NULL); } + if (cpu_throttle == MagickResourceInfinity) + cpu_throttle=GetMagickResourceLimit(ThrottleResource); + if ((cpu_throttle != 0) && ((cycles++ % 4096) == 0)) + MagickDelay(cpu_throttle); LockSemaphoreInfo(image->semaphore); assert(image->cache != (Cache) NULL); cache_info=(CacheInfo *) image->cache; @@ -2826,7 +2821,14 @@ MagickExport const IndexPacket *GetVirtualIndexQueue(const Image *image) assert(cache_info->signature == MagickCoreSignature); if (cache_info->methods.get_virtual_indexes_from_handler != (GetVirtualIndexesFromHandler) NULL) - return(cache_info->methods.get_virtual_indexes_from_handler(image)); + { + const IndexPacket + *indexes; + + indexes=cache_info->methods.get_virtual_indexes_from_handler(image); + if (indexes != (IndexPacket *) NULL) + return(indexes); + } assert(id < (int) cache_info->number_threads); return(GetVirtualIndexesFromNexus(cache_info,cache_info->nexus_info[id])); } @@ -2934,17 +2936,6 @@ static inline MagickBooleanType IsOffsetOverflow(const ssize_t x, return(MagickTrue); } -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)) || - (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))); @@ -3031,7 +3022,7 @@ MagickExport const PixelPacket *GetVirtualPixelCacheNexus(const Image *image, MagickTrue : MagickFalse,nexus_info,exception); if (pixels == (PixelPacket *) NULL) return((const PixelPacket *) NULL); - if (IsValidOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) + if (IsValidPixelOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) return((const PixelPacket *) NULL); offset=nexus_info->region.y*(MagickOffsetType) cache_info->columns; if (IsOffsetOverflow(offset,nexus_info->region.x) == MagickFalse) @@ -3305,7 +3296,7 @@ MagickExport const PixelPacket *GetVirtualPixelCacheNexus(const Image *image, break; virtual_indexes=GetVirtualIndexesFromNexus(cache_info,virtual_nexus); (void) memcpy(q,p,(size_t) length*sizeof(*p)); - q+=length; + q+=(ptrdiff_t) length; if ((indexes != (IndexPacket *) NULL) && (virtual_indexes != (const IndexPacket *) NULL)) { @@ -3807,10 +3798,10 @@ static inline MagickOffsetType WritePixelCacheRegion( { #if !defined(MAGICKCORE_HAVE_PWRITE) count=write(cache_info->file,buffer+i,(size_t) MagickMin(length- - (MagickSizeType) i,MAGICK_SSIZE_MAX)); + (MagickSizeType) i,MagickMaxBufferExtent)); #else count=pwrite(cache_info->file,buffer+i,(size_t) MagickMin(length- - (MagickSizeType) i,MAGICK_SSIZE_MAX),offset+i); + (MagickSizeType) i,MagickMaxBufferExtent),offset+i); #endif if (count <= 0) { @@ -4032,6 +4023,9 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, cache_info->storage_class=image->storage_class; if (status == 0) { + if ((source_info.storage_class != UndefinedClass) && + (mode != ReadMode)) + RelinquishPixelCachePixels(&source_info); cache_info->type=UndefinedCache; return(MagickFalse); } @@ -4099,12 +4093,17 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, } if (status == 0) { + if ((source_info.storage_class != UndefinedClass) && + (mode != ReadMode)) + RelinquishPixelCachePixels(&source_info); cache_info->type=UndefinedCache; return(MagickFalse); } return(MagickTrue); } } + if ((source_info.storage_class != UndefinedClass) && (mode != ReadMode)) + RelinquishPixelCachePixels(&source_info); cache_info->type=UndefinedCache; (void) ThrowMagickException(exception,GetMagickModule(),CacheError, "CacheResourcesExhausted","`%s'",image->filename); @@ -4115,6 +4114,8 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, */ if (status == MagickFalse) { + if ((source_info.storage_class != UndefinedClass) && (mode != ReadMode)) + RelinquishPixelCachePixels(&source_info); cache_info->type=UndefinedCache; (void) ThrowMagickException(exception,GetMagickModule(),CacheError, "CacheResourcesExhausted","`%s'",image->filename); @@ -4128,6 +4129,8 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, } if (OpenPixelCacheOnDisk(cache_info,mode) == MagickFalse) { + if ((source_info.storage_class != UndefinedClass) && (mode != ReadMode)) + RelinquishPixelCachePixels(&source_info); cache_info->type=UndefinedCache; ThrowFileException(exception,CacheError,"UnableToOpenPixelCache", image->filename); @@ -4137,6 +4140,8 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, cache_info->length); if (status == MagickFalse) { + if ((source_info.storage_class != UndefinedClass) && (mode != ReadMode)) + RelinquishPixelCachePixels(&source_info); cache_info->type=UndefinedCache; ThrowFileException(exception,CacheError,"UnableToExtendCache", image->filename); @@ -4193,6 +4198,9 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, } if (status == 0) { + if ((source_info.storage_class != UndefinedClass) && + (mode != ReadMode)) + RelinquishPixelCachePixels(&source_info); cache_info->type=UndefinedCache; return(MagickFalse); } @@ -4420,7 +4428,7 @@ MagickExport PixelPacket *QueueAuthenticPixelCacheNexus(Image *image, "PixelsAreNotAuthentic","`%s'",image->filename); return((PixelPacket *) NULL); } - if (IsValidOffset(y,cache_info->columns) == MagickFalse) + if (IsValidPixelOffset(y,cache_info->columns) == MagickFalse) return((PixelPacket *) NULL); offset=y*(MagickOffsetType) cache_info->columns+x; if (offset < 0) @@ -4619,10 +4627,10 @@ static inline MagickOffsetType ReadPixelCacheRegion( { #if !defined(MAGICKCORE_HAVE_PREAD) count=read(cache_info->file,buffer+i,(size_t) MagickMin(length- - (MagickSizeType) i,(size_t) MAGICK_SSIZE_MAX)); + (MagickSizeType) i,(size_t) MagickMaxBufferExtent)); #else count=pread(cache_info->file,buffer+i,(size_t) MagickMin(length- - (MagickSizeType) i,(size_t) MAGICK_SSIZE_MAX),offset+i); + (MagickSizeType) i,(size_t) MagickMaxBufferExtent),offset+i); #endif if (count <= 0) { @@ -4659,7 +4667,7 @@ static MagickBooleanType ReadPixelCacheIndexes( return(MagickFalse); if (nexus_info->authentic_pixel_cache != MagickFalse) return(MagickTrue); - if (IsValidOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) + if (IsValidPixelOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) return(MagickFalse); offset=nexus_info->region.y*(MagickOffsetType) cache_info->columns+ nexus_info->region.x; @@ -4689,8 +4697,8 @@ static MagickBooleanType ReadPixelCacheIndexes( for (y=0; y < (ssize_t) rows; y++) { (void) memcpy(q,p,(size_t) length); - p+=cache_info->columns; - q+=nexus_info->region.width; + p+=(ptrdiff_t) cache_info->columns; + q+=(ptrdiff_t) nexus_info->region.width; } break; } @@ -4722,7 +4730,7 @@ static MagickBooleanType ReadPixelCacheIndexes( if (count < (MagickOffsetType) length) break; offset+=(MagickOffsetType) cache_info->columns; - q+=nexus_info->region.width; + q+=(ptrdiff_t) nexus_info->region.width; } if (IsFileDescriptorLimitExceeded() != MagickFalse) (void) ClosePixelCacheOnDisk(cache_info); @@ -4753,7 +4761,7 @@ static MagickBooleanType ReadPixelCacheIndexes( cache_info->server_info,®ion,length,(unsigned char *) q); if (count != (MagickOffsetType) length) break; - q+=nexus_info->region.width; + q+=(ptrdiff_t) nexus_info->region.width; region.y++; } UnlockSemaphoreInfo(cache_info->file_semaphore); @@ -4828,7 +4836,7 @@ static MagickBooleanType ReadPixelCachePixels( if (nexus_info->authentic_pixel_cache != MagickFalse) return(MagickTrue); - if (IsValidOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) + if (IsValidPixelOffset(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) @@ -4864,8 +4872,8 @@ static MagickBooleanType ReadPixelCachePixels( for (y=0; y < (ssize_t) rows; y++) { (void) memcpy(q,p,(size_t) length); - p+=cache_info->columns; - q+=nexus_info->region.width; + p+=(ptrdiff_t) cache_info->columns; + q+=(ptrdiff_t) nexus_info->region.width; } break; } @@ -4895,7 +4903,7 @@ static MagickBooleanType ReadPixelCachePixels( if (count < (MagickOffsetType) length) break; offset+=(MagickOffsetType) cache_info->columns; - q+=nexus_info->region.width; + q+=(ptrdiff_t) nexus_info->region.width; } if (IsFileDescriptorLimitExceeded() != MagickFalse) (void) ClosePixelCacheOnDisk(cache_info); @@ -4926,7 +4934,7 @@ static MagickBooleanType ReadPixelCachePixels( cache_info->server_info,®ion,length,(unsigned char *) q); if (count != (MagickOffsetType) length) break; - q+=nexus_info->region.width; + q+=(ptrdiff_t) nexus_info->region.width; region.y++; } UnlockSemaphoreInfo(cache_info->file_semaphore); @@ -4992,6 +5000,29 @@ MagickExport Cache ReferencePixelCache(Cache cache) % % % % % % ++ R e s e t C a c h e A n o n y m o u s M e m o r y % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ResetCacheAnonymousMemory() resets the anonymous_memory value. +% +% The format of the ResetCacheAnonymousMemory method is: +% +% void ResetCacheAnonymousMemory(void) +% +*/ +MagickPrivate void ResetCacheAnonymousMemory(void) +{ + cache_anonymous_memory=0; +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % + S e t P i x e l C a c h e M e t h o d s % % % % % @@ -5201,14 +5232,19 @@ static PixelPacket *SetPixelCacheNexusPixels( return((PixelPacket *) NULL); } if (((MagickSizeType) width > cache_info->width_limit) || - ((MagickSizeType) height > cache_info->height_limit) || - (ValidatePixelOffset(x,width) == MagickFalse) || - (ValidatePixelOffset(y,height) == MagickFalse)) + ((MagickSizeType) height > cache_info->height_limit)) { (void) ThrowMagickException(exception,GetMagickModule(),ImageError, "WidthOrHeightExceedsLimit","`%s'",cache_info->filename); return((PixelPacket *) NULL); } + if ((ValidatePixelOffset(x,width) == MagickFalse) || + (ValidatePixelOffset(y,height) == MagickFalse)) + { + (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError, + "InvalidPixel","`%s'",cache_info->filename); + return((PixelPacket *) NULL); + } if (((cache_info->type == MemoryCache) || (cache_info->type == MapCache)) && (buffered == MagickFalse)) { @@ -5223,7 +5259,7 @@ static PixelPacket *SetPixelCacheNexusPixels( /* Pixels are accessed directly from memory. */ - if (IsValidOffset(y,cache_info->columns) == MagickFalse) + if (IsValidPixelOffset(y,cache_info->columns) == MagickFalse) return((PixelPacket *) NULL); offset=y*(MagickOffsetType) cache_info->columns+x; nexus_info->pixels=cache_info->pixels+offset; @@ -5325,7 +5361,7 @@ static MagickBooleanType SetCacheAlphaChannel(Image *image, image_view=AcquireVirtualCacheView(image,&image->exception); /* must be virtual */ #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -5753,7 +5789,7 @@ static MagickBooleanType WritePixelCacheIndexes(CacheInfo *cache_info, return(MagickTrue); if (nexus_info->indexes == (IndexPacket *) NULL) return(MagickFalse); - if (IsValidOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) + if (IsValidPixelOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) return(MagickFalse); offset=nexus_info->region.y*(MagickOffsetType) cache_info->columns+ nexus_info->region.x; @@ -5783,8 +5819,8 @@ static MagickBooleanType WritePixelCacheIndexes(CacheInfo *cache_info, for (y=0; y < (ssize_t) rows; y++) { (void) memcpy(q,p,(size_t) length); - p+=nexus_info->region.width; - q+=cache_info->columns; + p+=(ptrdiff_t) nexus_info->region.width; + q+=(ptrdiff_t) cache_info->columns; } break; } @@ -5816,7 +5852,7 @@ static MagickBooleanType WritePixelCacheIndexes(CacheInfo *cache_info, p); if (count < (MagickOffsetType) length) break; - p+=nexus_info->region.width; + p+=(ptrdiff_t) nexus_info->region.width; offset+=(MagickOffsetType) cache_info->columns; } if (IsFileDescriptorLimitExceeded() != MagickFalse) @@ -5848,7 +5884,7 @@ static MagickBooleanType WritePixelCacheIndexes(CacheInfo *cache_info, cache_info->server_info,®ion,length,(const unsigned char *) p); if (count != (MagickOffsetType) length) break; - p+=nexus_info->region.width; + p+=(ptrdiff_t) nexus_info->region.width; region.y++; } UnlockSemaphoreInfo(cache_info->file_semaphore); @@ -5922,7 +5958,7 @@ static MagickBooleanType WritePixelCachePixels(CacheInfo *cache_info, if (nexus_info->authentic_pixel_cache != MagickFalse) return(MagickTrue); - if (IsValidOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) + if (IsValidPixelOffset(nexus_info->region.y,cache_info->columns) == MagickFalse) return(MagickFalse); offset=nexus_info->region.y*(MagickOffsetType) cache_info->columns+ nexus_info->region.x; @@ -5952,8 +5988,8 @@ static MagickBooleanType WritePixelCachePixels(CacheInfo *cache_info, for (y=0; y < (ssize_t) rows; y++) { (void) memcpy(q,p,(size_t) length); - p+=nexus_info->region.width; - q+=cache_info->columns; + p+=(ptrdiff_t) nexus_info->region.width; + q+=(ptrdiff_t) cache_info->columns; } break; } @@ -5982,7 +6018,7 @@ static MagickBooleanType WritePixelCachePixels(CacheInfo *cache_info, (MagickOffsetType) sizeof(*p),length,(const unsigned char *) p); if (count < (MagickOffsetType) length) break; - p+=nexus_info->region.width; + p+=(ptrdiff_t) nexus_info->region.width; offset+=(MagickOffsetType) cache_info->columns; } if (IsFileDescriptorLimitExceeded() != MagickFalse) @@ -6014,7 +6050,7 @@ static MagickBooleanType WritePixelCachePixels(CacheInfo *cache_info, cache_info->server_info,®ion,length,(const unsigned char *) p); if (count != (MagickOffsetType) length) break; - p+=nexus_info->region.width; + p+=(ptrdiff_t) nexus_info->region.width; region.y++; } UnlockSemaphoreInfo(cache_info->file_semaphore); diff --git a/magick/channel.c b/magick/channel.c index 523d793309d74cee7423634176e9cd04804a87e5..49d15f424da84033537f25a723a73d4d6f504d7c 100644 --- a/magick/channel.c +++ b/magick/channel.c @@ -152,6 +152,10 @@ MagickExport Image *CombineImages(const Image *image,const ChannelType channel, status=MagickTrue; progress=0; combine_view=AcquireAuthenticCacheView(combine_image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(progress,status) \ + magick_number_threads(combine_image,combine_image,combine_image->rows,4) +#endif for (y=0; y < (ssize_t) combine_image->rows; y++) { CacheView @@ -417,7 +421,7 @@ MagickExport MagickBooleanType SeparateImageChannel(Image *image, image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -690,7 +694,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -761,7 +765,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -845,7 +849,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -890,6 +894,51 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, image->matte=MagickFalse; break; } + case OffIfOpaqueAlphaChannel: + { + MagickBooleanType + opaque = MagickTrue; + + /* + Remove opaque alpha channel. + */ + image_view=AcquireVirtualCacheView(image,exception); + #if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(opaque,status) \ + magick_number_threads(image,image,image->rows,2) + #endif + for (y=0; y < (ssize_t) image->rows; y++) + { + const PixelPacket + *magick_restrict p; + + ssize_t + x; + + if ((status == MagickFalse) || (opaque == MagickFalse)) + continue; + p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); + if (p == (const PixelPacket *) NULL) + { + status=MagickFalse; + continue; + } + for (x=0; x < (ssize_t) image->columns; x++) + { + if (GetPixelOpacity(p) != OpaqueOpacity) + { + opaque=MagickFalse; + break; + } + p++; + } + } + image_view=DestroyCacheView(image_view); + if (opaque != MagickFalse) + image->matte=MagickFalse; + break; + } + case ResetAlphaChannel: /* deprecated */ case RemoveAlphaChannel: case FlattenAlphaChannel: { @@ -920,7 +969,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -976,7 +1025,6 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, image_view=DestroyCacheView(image_view); return(status); } - case ResetAlphaChannel: /* deprecated */ case OpaqueAlphaChannel: { status=SetImageOpacity(image,OpaqueOpacity); diff --git a/magick/channel.h b/magick/channel.h index f101873193b3d957464cb83ca0e519a33fa28c82..d0c3a07a9c071e002395e6a0e559205ce415aa3a 100644 --- a/magick/channel.h +++ b/magick/channel.h @@ -24,6 +24,26 @@ extern "C" { #endif +typedef enum +{ + UndefinedAlphaChannel, + ActivateAlphaChannel, + BackgroundAlphaChannel, + CopyAlphaChannel, + DeactivateAlphaChannel, + ExtractAlphaChannel, + OpaqueAlphaChannel, + ResetAlphaChannel, /* deprecated */ + SetAlphaChannel, + ShapeAlphaChannel, + TransparentAlphaChannel, + FlattenAlphaChannel, + RemoveAlphaChannel, + AssociateAlphaChannel, + DisassociateAlphaChannel, + OffIfOpaqueAlphaChannel +} AlphaChannelType; + extern MagickExport Image *CombineImages(const Image *,const ChannelType,ExceptionInfo *), *SeparateImage(const Image *,const ChannelType,ExceptionInfo *), diff --git a/magick/cipher.c b/magick/cipher.c index 42f1484b61297d11baeb8536bf58a4474fd67528..913fa31f2a8453afddb4e8118f9496dc9bffce18 100644 --- a/magick/cipher.c +++ b/magick/cipher.c @@ -58,6 +58,7 @@ #include "magick/splay-tree.h" #include "magick/statistic.h" #include "magick/string_.h" +#include "magick/timer-private.h" #if defined(MAGICKCORE_CIPHER_SUPPORT) /* @@ -79,7 +80,9 @@ typedef struct _AESInfo *decipher_key; ssize_t - rounds, + rounds; + + time_t timestamp; size_t @@ -204,7 +207,7 @@ static AESInfo *AcquireAESInfo(void) (aes_info->encipher_key == (unsigned int *) NULL) || (aes_info->decipher_key == (unsigned int *) NULL)) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); - aes_info->timestamp=(ssize_t) time(0); + aes_info->timestamp=GetMagickTime(); aes_info->signature=MagickCoreSignature; return(aes_info); } @@ -681,7 +684,7 @@ MagickExport MagickBooleanType PasskeyDecipherImage(Image *image, EncipherAESBlock(aes_info,output_block,output_block); for (i=0; i < AESBlocksize; i++) p[i]^=output_block[i]; - p+=AESBlocksize; + p+=(ptrdiff_t) AESBlocksize; } (void) memmove(output_block,input_block,AESBlocksize*sizeof(*output_block)); EncipherAESBlock(aes_info,output_block,output_block); @@ -900,7 +903,7 @@ MagickExport MagickBooleanType PasskeyEncipherImage(Image *image, EncipherAESBlock(aes_info,output_block,output_block); for (i=0; i < AESBlocksize; i++) p[i]^=output_block[i]; - p+=AESBlocksize; + p+=(ptrdiff_t) AESBlocksize; } (void) memmove(output_block,input_block,AESBlocksize* sizeof(*output_block)); diff --git a/magick/color.c b/magick/color.c index 335df733024533a674a7f067cdb685e3788e738e..b5b6898b02ee426cd8375a0bd71cf979e38d6153 100644 --- a/magick/color.c +++ b/magick/color.c @@ -1174,8 +1174,11 @@ MagickExport void ConcatenateColorComponent(const MagickPixelPacket *pixel, color=pixel->red; if (IsHueCompatibleColorspace(pixel->colorspace) != MagickFalse) scale=360.0f; - if ((compliance != NoCompliance) && (pixel->colorspace == LabColorspace)) + if ((compliance != NoCompliance) && + (IsLabCompatibleColorspace(pixel->colorspace) != MagickFalse)) scale=100.0f; + if (pixel->colorspace == XYZColorspace) + color/=2.55f; break; } case GreenChannel: @@ -1183,8 +1186,11 @@ MagickExport void ConcatenateColorComponent(const MagickPixelPacket *pixel, color=pixel->green; if (IsHueCompatibleColorspace(pixel->colorspace) != MagickFalse) scale=100.0f; - if ((compliance != NoCompliance) && (pixel->colorspace == LabColorspace)) + if ((compliance != NoCompliance) && + (IsLabCompatibleColorspace(pixel->colorspace) != MagickFalse)) color-=QuantumRange/2.0f; + if (pixel->colorspace == XYZColorspace) + color/=2.55f; break; } case BlueChannel: @@ -1194,6 +1200,12 @@ MagickExport void ConcatenateColorComponent(const MagickPixelPacket *pixel, scale=100.0f; if (pixel->colorspace == LabColorspace) color-=QuantumRange/2.0f; + if ((pixel->colorspace == LCHColorspace) || + (pixel->colorspace == LCHabColorspace) || + (pixel->colorspace == LCHuvColorspace)) + color*=360.0f/255.0f; + if (pixel->colorspace == XYZColorspace) + color/=2.55f; break; } case AlphaChannel: @@ -1211,7 +1223,8 @@ MagickExport void ConcatenateColorComponent(const MagickPixelPacket *pixel, default: break; } - if ((scale != 100.0f) || (pixel->colorspace == LabColorspace)) + if ((scale != 100.0f) || + (IsLabCompatibleColorspace(pixel->colorspace) != MagickFalse)) (void) FormatLocaleString(component,MagickPathExtent,"%.*g", GetMagickPrecision(),(double) scale*QuantumScale*(double) color); else @@ -2605,7 +2618,7 @@ static MagickStatusType ParseCSSColor(const char *magick_restrict color, geometry_info->rho=intensity; flags|=RhoValue; if (LocaleNCompare(q,"deg",3) == 0) - q+=3; + q+=(ptrdiff_t) 3; break; } case 1: @@ -2906,7 +2919,7 @@ MagickExport MagickBooleanType QueryMagickColorCompliance(const char *name, if (((flags & ChiValue) != 0) && (color->matte != MagickFalse)) color->opacity=(MagickRealType) ClampToQuantum((MagickRealType) QuantumRange-(MagickRealType) QuantumRange*geometry_info.chi); - if (color->colorspace == LabColorspace) + if (IsLabCompatibleColorspace(color->colorspace) != MagickFalse) { color->red=(MagickRealType) ClampToQuantum((MagickRealType) QuantumRange*geometry_info.rho/100.0); diff --git a/magick/colormap.c b/magick/colormap.c index 670d66641044b83dfb9aa4ecc084fa0cb37b70b2..0e354dd2ffd5c670e9c452201447ea6b7708d8f8 100644 --- a/magick/colormap.c +++ b/magick/colormap.c @@ -201,7 +201,7 @@ MagickExport MagickBooleanType CycleColormapImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -302,9 +302,7 @@ MagickExport MagickBooleanType SortColormapByIntensity(Image *image) status; ssize_t - i; - - ssize_t + i, y; unsigned short @@ -342,20 +340,23 @@ MagickExport MagickBooleanType SortColormapByIntensity(Image *image) pixels[(ssize_t) image->colormap[i].opacity]=(unsigned short) i; status=MagickTrue; image_view=AcquireAuthenticCacheView(image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(status) \ + magick_number_threads(image,image,image->rows,2) +#endif for (y=0; y < (ssize_t) image->rows; y++) { - IndexPacket - index; - - ssize_t - x; - IndexPacket *magick_restrict indexes; PixelPacket *magick_restrict q; + ssize_t + x; + + if (status == MagickFalse) + continue; q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception); if (q == (PixelPacket *) NULL) { @@ -365,6 +366,12 @@ MagickExport MagickBooleanType SortColormapByIntensity(Image *image) indexes=GetCacheViewAuthenticIndexQueue(image_view); for (x=0; x < (ssize_t) image->columns; x++) { + IndexPacket + index; + + ssize_t + i; + i=ConstrainColormapIndex(image,GetPixelIndex(indexes+x)); index=(IndexPacket) pixels[i]; SetPixelIndex(indexes+x,index); @@ -373,8 +380,6 @@ MagickExport MagickBooleanType SortColormapByIntensity(Image *image) } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) status=MagickFalse; - if (status == MagickFalse) - break; } image_view=DestroyCacheView(image_view); pixels=(unsigned short *) RelinquishMagickMemory(pixels); diff --git a/magick/colorspace-private.h b/magick/colorspace-private.h index a8da9dbff12f85962a1315cbf574aadc9748ff07..8974f006488b8bb825c7f5bc154c2886cd368e85 100644 --- a/magick/colorspace-private.h +++ b/magick/colorspace-private.h @@ -113,6 +113,15 @@ static inline MagickBooleanType IsHueCompatibleColorspace( return(MagickFalse); } +static inline MagickBooleanType IsLabCompatibleColorspace( + const ColorspaceType colorspace) +{ + if ((colorspace == LabColorspace) || (colorspace == LCHColorspace) || + (colorspace == LCHabColorspace) || (colorspace == LCHuvColorspace)) + return(MagickTrue); + return(MagickFalse); +} + static inline MagickBooleanType IsRGBColorspace(const ColorspaceType colorspace) { if ((colorspace == RGBColorspace) || (colorspace == scRGBColorspace) || diff --git a/magick/colorspace.c b/magick/colorspace.c index a6e9222c1e419511eb85939043e7f7fc161ac001..4ae5623528a177571953acad5033dbc1a7efd8d3 100644 --- a/magick/colorspace.c +++ b/magick/colorspace.c @@ -341,7 +341,7 @@ MagickExport MagickBooleanType RGBTransformImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -407,7 +407,7 @@ MagickExport MagickBooleanType RGBTransformImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -465,7 +465,7 @@ MagickExport MagickBooleanType RGBTransformImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -542,7 +542,7 @@ MagickExport MagickBooleanType RGBTransformImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -762,7 +762,7 @@ MagickExport MagickBooleanType RGBTransformImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -828,7 +828,7 @@ MagickExport MagickBooleanType RGBTransformImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -917,8 +917,8 @@ MagickExport MagickBooleanType RGBTransformImage(Image *image, I and Q, normally -0.5 through 0.5, are normalized to the range 0 through QuantumRange. */ - primary_info.y=(double) (MaxMap+1.0)/2.0; - primary_info.z=(double) (MaxMap+1.0)/2.0; + primary_info.y=(MagickRealType) ((MaxMap+1)/2); + primary_info.z=(MagickRealType) ((MaxMap+1)/2); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) #endif @@ -972,8 +972,8 @@ MagickExport MagickBooleanType RGBTransformImage(Image *image, Cb and Cr, normally -0.5 through 0.5, are normalized to the range 0 through QuantumRange. */ - primary_info.y=(double) (MaxMap+1.0)/2.0; - primary_info.z=(double) (MaxMap+1.0)/2.0; + primary_info.y=(MagickRealType) ((MaxMap+1)/2); + primary_info.z=(MagickRealType) ((MaxMap+1)/2); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) #endif @@ -1027,8 +1027,8 @@ MagickExport MagickBooleanType RGBTransformImage(Image *image, Cb and Cr, normally -0.5 through 0.5, are normalized to the range 0 through QuantumRange. */ - primary_info.y=(double) (MaxMap+1.0)/2.0; - primary_info.z=(double) (MaxMap+1.0)/2.0; + primary_info.y=(MagickRealType) ((MaxMap+1)/2); + primary_info.z=(MagickRealType) ((MaxMap+1)/2); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) #endif @@ -1057,8 +1057,10 @@ MagickExport MagickBooleanType RGBTransformImage(Image *image, YCC is scaled by 1.3584. C1 zero is 156 and C2 is at 137. */ - primary_info.y=(double) ScaleQuantumToMap(ScaleCharToQuantum(156)); - primary_info.z=(double) ScaleQuantumToMap(ScaleCharToQuantum(137)); + primary_info.y=(MagickRealType) ScaleQuantumToMap( + ScaleCharToQuantum(156)); + primary_info.z=(MagickRealType) ScaleQuantumToMap( + ScaleCharToQuantum(137)); for (i=0; i <= (ssize_t) (0.018*MaxMap); i++) { x_map[i].x=0.005382*i; @@ -1122,7 +1124,7 @@ MagickExport MagickBooleanType RGBTransformImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -1341,20 +1343,14 @@ MagickExport MagickBooleanType SetImageColorspace(Image *image, MagickExport MagickBooleanType SetImageGray(Image *image, ExceptionInfo *exception) { - const char - *value; - CacheView *image_view; - ImageType - type; - - const PixelPacket - *p; + const char + *value; - ssize_t - x; + ImageType + type = BilevelType; ssize_t y; @@ -1372,13 +1368,27 @@ MagickExport MagickBooleanType SetImageGray(Image *image, value=GetImageProperty(image,"colorspace:auto-grayscale"); if (IsStringNotFalse(value) == MagickFalse) return(MagickFalse); - type=BilevelType; image_view=AcquireVirtualCacheView(image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(type) \ + magick_number_threads(image,image,image->rows,2) +#endif for (y=0; y < (ssize_t) image->rows; y++) { + const PixelPacket + *p; + + ssize_t + x; + + if (type == UndefinedType) + continue; p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); if (p == (const PixelPacket *) NULL) - break; + { + type=UndefinedType; + continue; + } for (x=0; x < (ssize_t) image->columns; x++) { if (IsGrayPixel(p) == MagickFalse) @@ -1390,8 +1400,6 @@ MagickExport MagickBooleanType SetImageGray(Image *image, type=GrayscaleType; p++; } - if (type == UndefinedType) - break; } image_view=DestroyCacheView(image_view); if (type == UndefinedType) @@ -1404,7 +1412,7 @@ MagickExport MagickBooleanType SetImageGray(Image *image, image->type=GrayscaleMatteType; return(MagickTrue); } - + /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -1442,13 +1450,7 @@ MagickExport MagickBooleanType SetImageMonochrome(Image *image, *image_view; ImageType - type; - - ssize_t - x; - - const PixelPacket - *p; + type = BilevelType; ssize_t y; @@ -1465,13 +1467,27 @@ MagickExport MagickBooleanType SetImageMonochrome(Image *image, value=GetImageProperty(image,"colorspace:auto-grayscale"); if (IsStringNotFalse(value) == MagickFalse) return(MagickFalse); - type=BilevelType; image_view=AcquireVirtualCacheView(image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(type) \ + magick_number_threads(image,image,image->rows,2) +#endif for (y=0; y < (ssize_t) image->rows; y++) { + const PixelPacket + *p; + + ssize_t + x; + + if (type == UndefinedType) + continue; p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); if (p == (const PixelPacket *) NULL) - break; + { + type=UndefinedType; + continue; + } for (x=0; x < (ssize_t) image->columns; x++) { if (IsMonochromePixel(p) == MagickFalse) @@ -1481,8 +1497,6 @@ MagickExport MagickBooleanType SetImageMonochrome(Image *image, } p++; } - if (type == UndefinedType) - break; } image_view=DestroyCacheView(image_view); if (type == UndefinedType) @@ -1493,7 +1507,7 @@ MagickExport MagickBooleanType SetImageMonochrome(Image *image, image->type=type; return(MagickTrue); } - + /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -2002,7 +2016,7 @@ MagickExport MagickBooleanType TransformRGBImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2066,7 +2080,7 @@ MagickExport MagickBooleanType TransformRGBImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2128,7 +2142,7 @@ MagickExport MagickBooleanType TransformRGBImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2206,7 +2220,7 @@ MagickExport MagickBooleanType TransformRGBImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2429,7 +2443,7 @@ MagickExport MagickBooleanType TransformRGBImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2495,7 +2509,7 @@ MagickExport MagickBooleanType TransformRGBImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2726,7 +2740,7 @@ MagickExport MagickBooleanType TransformRGBImage(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { diff --git a/magick/compare.c b/magick/compare.c index a7114236a844256d91c329286897f5612dbbcbb9..2bf3b112d90800aefd036b7ae399e19af0f0174a 100644 --- a/magick/compare.c +++ b/magick/compare.c @@ -42,6 +42,7 @@ */ #include "magick/studio.h" #include "magick/artifact.h" +#include "magick/attribute.h" #include "magick/cache-view.h" #include "magick/channel.h" #include "magick/client.h" @@ -1268,7 +1269,7 @@ static MagickBooleanType GetNormalizedCrossCorrelationDistortion( for (i=0; i < (ssize_t) CompositeChannels; i++) { distortion[i]/=sqrt(alpha_variance[i]*beta_variance[i]); - if (fabs(distortion[i]) > MagickEpsilon) + if (fabs(distortion[i]) >= MagickEpsilon) distortion[CompositeChannels]+=distortion[i]; } distortion[CompositeChannels]=distortion[CompositeChannels]/ @@ -1302,6 +1303,7 @@ static MagickBooleanType GetPeakAbsoluteDistortion(const Image *image, y; status=MagickTrue; + (void) memset(distortion,0,(CompositeChannels+1)*sizeof(*distortion)); rows=MagickMax(image->rows,reconstruct_image->rows); columns=MagickMax(image->columns,reconstruct_image->columns); image_view=AcquireVirtualCacheView(image,exception); @@ -1338,7 +1340,8 @@ static MagickBooleanType GetPeakAbsoluteDistortion(const Image *image, } indexes=GetCacheViewVirtualIndexQueue(image_view); reconstruct_indexes=GetCacheViewVirtualIndexQueue(reconstruct_view); - (void) memset(channel_distortion,0,sizeof(channel_distortion)); + (void) memset(channel_distortion,0,(CompositeChannels+1)* + sizeof(*channel_distortion)); for (x=0; x < (ssize_t) columns; x++) { MagickRealType @@ -1425,33 +1428,54 @@ static MagickBooleanType GetPeakSignalToNoiseRatio(const Image *image, exception); if ((channel & RedChannel) != 0) { - if (fabs(distortion[RedChannel]) >= MagickEpsilon) - distortion[RedChannel]=(-10.0*MagickLog10(distortion[RedChannel])); + if ((fabs(distortion[RedChannel]) < MagickEpsilon) || + (fabs(distortion[RedChannel]) >= 1.0)) + distortion[RedChannel]=fabs(distortion[RedChannel]) < MagickEpsilon ? + 0.0 : 1.0; + else + distortion[RedChannel]=fabs(-10.0*MagickLog10(PerceptibleReciprocal( + distortion[RedChannel])))/48.1647; } if ((channel & GreenChannel) != 0) { - if (fabs(distortion[GreenChannel]) >= MagickEpsilon) - distortion[GreenChannel]=(-10.0*MagickLog10(distortion[GreenChannel])); + if ((fabs(distortion[GreenChannel]) < MagickEpsilon) || + (fabs(distortion[GreenChannel]) >= 1.0)) + distortion[GreenChannel]=fabs(distortion[GreenChannel]) < + MagickEpsilon ? 0.0 : 1.0; + else + distortion[GreenChannel]=fabs(-10.0*MagickLog10(PerceptibleReciprocal( + distortion[GreenChannel])))/48.1647; } if ((channel & BlueChannel) != 0) { - if (fabs(distortion[BlueChannel]) >= MagickEpsilon) - distortion[BlueChannel]=(-10.0*MagickLog10(distortion[BlueChannel])); + if ((fabs(distortion[BlueChannel]) < MagickEpsilon) || + (fabs(distortion[BlueChannel]) >= 1.0)) + distortion[BlueChannel]=fabs(distortion[BlueChannel]) < MagickEpsilon ? + 0.0 : 1.0; + else + distortion[BlueChannel]=fabs(-10.0*MagickLog10(PerceptibleReciprocal( + distortion[BlueChannel])))/48.1647; } if (((channel & OpacityChannel) != 0) && (image->matte != MagickFalse)) { - if (fabs(distortion[OpacityChannel]) >= MagickEpsilon) - distortion[OpacityChannel]=(-10.0* - MagickLog10(distortion[OpacityChannel])); + if ((fabs(distortion[OpacityChannel]) < MagickEpsilon) || + (fabs(distortion[OpacityChannel]) >= 1.0)) + distortion[OpacityChannel]=fabs(distortion[OpacityChannel]) < + MagickEpsilon ? 0.0 : 1.0; + else + distortion[OpacityChannel]=fabs(-10.0*MagickLog10(PerceptibleReciprocal( + distortion[OpacityChannel])))/48.1647; } if (((channel & IndexChannel) != 0) && (image->colorspace == CMYKColorspace)) { - if (fabs(distortion[BlackChannel]) >= MagickEpsilon) - distortion[BlackChannel]=(-10.0*MagickLog10(distortion[BlackChannel])); + if ((fabs(distortion[BlackChannel]) < MagickEpsilon) || + (fabs(distortion[BlackChannel]) >= 1.0)) + distortion[BlackChannel]=fabs(distortion[BlackChannel]) < + MagickEpsilon ? 0.0 : 1.0; + else + distortion[BlackChannel]=fabs(-10.0*MagickLog10(PerceptibleReciprocal( + distortion[BlackChannel])))/48.1647; } - if (fabs(distortion[CompositeChannels]) >= MagickEpsilon) - distortion[CompositeChannels]=(-10.0* - MagickLog10(distortion[CompositeChannels])); return(status); } @@ -2109,7 +2133,7 @@ MagickExport Image *SimilarityMetricImage(Image *image,const Image *reference, similarity_threshold; Image - *similarity_image; + *similarity_image = (Image *) NULL; MagickBooleanType status; @@ -2117,6 +2141,9 @@ MagickExport Image *SimilarityMetricImage(Image *image,const Image *reference, MagickOffsetType progress; + size_t + rows; + ssize_t y; @@ -2131,17 +2158,24 @@ MagickExport Image *SimilarityMetricImage(Image *image,const Image *reference, *similarity_metric=MagickMaximumValue; if (ValidateImageMorphology(image,reference) == MagickFalse) ThrowImageException(ImageError,"ImageMorphologyDiffers"); - similarity_image=CloneImage(image,image->columns-reference->columns+1, - image->rows-reference->rows+1,MagickTrue,exception); + if ((image->columns < reference->columns) || (image->rows < reference->rows)) + { + (void) ThrowMagickException(&image->exception,GetMagickModule(), + OptionWarning,"GeometryDoesNotContainImage","`%s'",image->filename); + return((Image *) NULL); + } + similarity_image=CloneImage(image,image->columns,image->rows,MagickTrue, + exception); if (similarity_image == (Image *) NULL) return((Image *) NULL); - if (SetImageStorageClass(similarity_image,DirectClass) == MagickFalse) + similarity_image->depth=MAGICKCORE_QUANTUM_DEPTH; + similarity_image->matte=MagickFalse; + status=SetImageStorageClass(similarity_image,DirectClass); + if (status == MagickFalse) { InheritException(exception,&similarity_image->exception); - similarity_image=DestroyImage(similarity_image); - return((Image *) NULL); + return(DestroyImage(similarity_image)); } - (void) SetImageAlphaChannel(similarity_image,DeactivateAlphaChannel); /* Measure similarity of reference image against image. */ @@ -2152,12 +2186,13 @@ MagickExport Image *SimilarityMetricImage(Image *image,const Image *reference, status=MagickTrue; progress=0; similarity_view=AcquireVirtualCacheView(similarity_image,exception); + rows=similarity_image->rows; #if defined(MAGICKCORE_OPENMP_SUPPORT) - #pragma omp parallel for schedule(static) \ + #pragma omp parallel for schedule(static,1) \ shared(progress,status,similarity_metric) \ - magick_number_threads(image,image,image->rows-reference->rows+1,1) + magick_number_threads(similarity_image,similarity_image,rows << 3,1) #endif - for (y=0; y < (ssize_t) (image->rows-reference->rows+1); y++) + for (y=0; y < (ssize_t) rows; y++) { double similarity; @@ -2182,7 +2217,7 @@ MagickExport Image *SimilarityMetricImage(Image *image,const Image *reference, status=MagickFalse; continue; } - for (x=0; x < (ssize_t) (image->columns-reference->columns+1); x++) + for (x=0; x < (ssize_t) similarity_image->columns; x++) { #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp flush(similarity_metric) @@ -2190,8 +2225,6 @@ MagickExport Image *SimilarityMetricImage(Image *image,const Image *reference, if (*similarity_metric <= similarity_threshold) break; similarity=GetSimilarityMetric(image,reference,metric,x,y,exception); - if (metric == PeakSignalToNoiseRatioMetric) - similarity*=0.01; if ((metric == NormalizedCrossCorrelationErrorMetric) || (metric == UndefinedErrorMetric)) similarity=1.0-similarity; @@ -2206,8 +2239,28 @@ MagickExport Image *SimilarityMetricImage(Image *image,const Image *reference, } if (metric == PerceptualHashErrorMetric) similarity=MagickMin(0.01*similarity,1.0); - SetPixelRed(q,ClampToQuantum((double) QuantumRange-(double) QuantumRange* - similarity)); + switch (metric) + { + case AbsoluteErrorMetric: + case FuzzErrorMetric: + case MeanAbsoluteErrorMetric: + case MeanErrorPerPixelMetric: + case MeanSquaredErrorMetric: + case NormalizedCrossCorrelationErrorMetric: + case PeakAbsoluteErrorMetric: + case PerceptualHashErrorMetric: + case RootMeanSquaredErrorMetric: + { + SetPixelRed(q,ClampToQuantum((double) QuantumRange-QuantumRange* + similarity)); + break; + } + default: + { + SetPixelRed(q,ClampToQuantum((double) QuantumRange*similarity)); + break; + } + } SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); q++; @@ -2229,6 +2282,7 @@ MagickExport Image *SimilarityMetricImage(Image *image,const Image *reference, } } similarity_view=DestroyCacheView(similarity_view); + (void) SetImageType(similarity_image,GrayscaleType); if (status == MagickFalse) similarity_image=DestroyImage(similarity_image); return(similarity_image); diff --git a/magick/composite.c b/magick/composite.c index ef60a027ba0b09d3ee916460c218f705f4fa5008..d71e35f748e7edc0832e04b0aea8341fbc549dbd 100644 --- a/magick/composite.c +++ b/magick/composite.c @@ -1516,13 +1516,12 @@ static inline void CompositeThreshold(const MagickPixelPacket *p, composite->red=Threshold(p->red,q->red,threshold,amount); composite->green=Threshold(p->green,q->green,threshold,amount); composite->blue=Threshold(p->blue,q->blue,threshold,amount); - composite->opacity=(MagickRealType) QuantumRange-Threshold(p->opacity,q->opacity, - threshold,amount); + composite->opacity=(MagickRealType) QuantumRange-Threshold(p->opacity, + q->opacity,threshold,amount); if (q->colorspace == CMYKColorspace) composite->index=Threshold(p->index,q->index,threshold,amount); } - static MagickRealType VividLight(const MagickRealType Sca, const MagickRealType Sa, const MagickRealType Dca, const MagickRealType Da) { @@ -1717,7 +1716,7 @@ MagickExport MagickBooleanType CompositeImageChannel(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,image,source_image->rows,1) + magick_number_threads(source_image,image,source_image->rows,4) #endif for (y=0; y < (ssize_t) source_image->rows; y++) { @@ -2312,7 +2311,7 @@ MagickExport MagickBooleanType CompositeImageChannel(Image *image, { if (y < y_offset) continue; - if ((y-y_offset) >= (ssize_t) source_image->rows) + if ((y-(double) y_offset) >= (double) source_image->rows) continue; } /* @@ -2320,10 +2319,12 @@ MagickExport MagickBooleanType CompositeImageChannel(Image *image, */ pixels=(PixelPacket *) NULL; p=(PixelPacket *) NULL; - if ((y >= y_offset) && ((y-y_offset) < (ssize_t) source_image->rows)) + if ((y >= y_offset) && + ((y-(double) y_offset) < (double) source_image->rows)) { - p=GetCacheViewVirtualPixels(source_view,0,y-y_offset, - source_image->columns,1,exception); + p=GetCacheViewVirtualPixels(source_view,0, + CastDoubleToLong(y-(double) y_offset),source_image->columns,1, + exception); if (p == (const PixelPacket *) NULL) { status=MagickFalse; @@ -2331,7 +2332,7 @@ MagickExport MagickBooleanType CompositeImageChannel(Image *image, } pixels=p; if (x_offset < 0) - p-=x_offset; + p-=(ptrdiff_t)x_offset; } q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception); if (q == (PixelPacket *) NULL) @@ -2355,7 +2356,7 @@ MagickExport MagickBooleanType CompositeImageChannel(Image *image, q++; continue; } - if ((x-x_offset) >= (ssize_t) source_image->columns) + if ((x-(double) x_offset) >= (double) source_image->columns) break; } canvas.red=(MagickRealType) GetPixelRed(q); @@ -2377,7 +2378,7 @@ MagickExport MagickBooleanType CompositeImageChannel(Image *image, */ composite=canvas; if ((pixels == (PixelPacket *) NULL) || (x < x_offset) || - ((x-x_offset) >= (ssize_t) source_image->columns)) + ((x-(double) x_offset) >= (double) source_image->columns)) { switch (compose) { @@ -2409,8 +2410,9 @@ MagickExport MagickBooleanType CompositeImageChannel(Image *image, } default: { - (void) GetOneVirtualMagickPixel(source_image,x-x_offset, - y-y_offset,&composite,exception); + (void) GetOneVirtualMagickPixel(source_image, + CastDoubleToLong(x-(double) x_offset), + CastDoubleToLong(y-(double) y_offset),&composite,exception); break; } } @@ -2447,7 +2449,7 @@ MagickExport MagickBooleanType CompositeImageChannel(Image *image, source.opacity=(MagickRealType) GetPixelOpacity(p); if (source_image->colorspace == CMYKColorspace) source.index=(MagickRealType) GetPixelIndex(source_indexes+ - x-x_offset); + CastDoubleToLong(x-(double) x_offset)); if (source_image->colorspace == CMYKColorspace) { source.red=(MagickRealType) QuantumRange-source.red; @@ -3007,7 +3009,7 @@ MagickExport MagickBooleanType TextureImage(Image *image,const Image *texture) image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,texture_image,image->rows,1) + magick_number_threads(image,texture_image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -3059,7 +3061,7 @@ MagickExport MagickBooleanType TextureImage(Image *image,const Image *texture) sizeof(*indexes)); indexes+=width; } - q+=width; + q+=(ptrdiff_t) width; } sync=SyncCacheViewAuthenticPixels(image_view,exception); if (sync == MagickFalse) diff --git a/magick/compress.c b/magick/compress.c index 8aac44193193dfae545c3ee6a3091019c90cab13..c60ab8d4fb6eb961037da22af211f0f204e5a04f 100644 --- a/magick/compress.c +++ b/magick/compress.c @@ -330,10 +330,10 @@ MagickExport void Ascii85Encode(Image *image,const unsigned char code) } (void) WriteBlobByte(image,(unsigned char) *q); } - p+=8; + p+=(ptrdiff_t) 8; } image->ascii85->offset=n; - p-=4; + p-=(ptrdiff_t)4; for (n=0; n < 4; n++) image->ascii85->buffer[n]=(*p++); } diff --git a/magick/constitute.c b/magick/constitute.c index 32212a662d7ada7ebf98c8290348839e8d5f5912..e5457e8978a9bfc39c5f8093158a61272cf5e37b 100644 --- a/magick/constitute.c +++ b/magick/constitute.c @@ -660,10 +660,13 @@ MagickExport Image *ReadImage(const ImageInfo *image_info, *clones; clones=CloneImages(image,read_info->scenes,exception); + image=DestroyImageList(image); if (clones != (Image *) NULL) + image=GetFirstImageInList(clones); + if (image == (Image *) NULL) { - image=DestroyImageList(image); - image=GetFirstImageInList(clones); + read_info=DestroyImageInfo(read_info); + return(image); } } for (next=image; next != (Image *) NULL; next=GetNextImageInList(next)) @@ -1054,7 +1057,7 @@ MagickExport Image *ReadInlineImage(const ImageInfo *image_info, Extract media type. */ if (LocaleNCompare(++p,"x-",2) == 0) - p+=2; + p+=(ptrdiff_t) 2; (void) CopyMagickString(read_info->filename,"data.",MagickPathExtent); q=read_info->filename+5; for (i=0; (*p != ';') && (*p != '\0') && (i < (MagickPathExtent-6)); i++) @@ -1229,7 +1232,8 @@ MagickExport MagickBooleanType WriteImage(const ImageInfo *image_info, (void) AcquireUniqueFilename(image->filename); temporary=MagickTrue; } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; } } if ((magick_info != (const MagickInfo *) NULL) && @@ -1335,7 +1339,8 @@ MagickExport MagickBooleanType WriteImage(const ImageInfo *image_info, (void) RelinquishUniqueFileResource(write_info->filename); status=ImageToFile(image,write_info->filename,exception); } - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; (void) RelinquishUniqueFileResource(image->filename); (void) CopyMagickString(image->filename,write_info->filename, MaxTextExtent); @@ -1439,13 +1444,7 @@ MagickExport MagickBooleanType WriteImages(const ImageInfo *image_info, p=images; for ( ; GetNextImageInList(p) != (Image *) NULL; p=GetNextImageInList(p)) { - Image - *next; - - next=GetNextImageInList(p); - if (next == (Image *) NULL) - break; - if (p->scene >= next->scene) + if (p->scene >= GetNextImageInList(p)->scene) { ssize_t i; diff --git a/magick/delegate-private.h b/magick/delegate-private.h index 2971084da305c184ac904677124894d5222b2535..41ae353850e0ca64e530f702548d1b5d45a35316 100644 --- a/magick/delegate-private.h +++ b/magick/delegate-private.h @@ -103,7 +103,7 @@ static inline char *SanitizeDelegateString(const char *source) sanitize_source=AcquireString(source); p=sanitize_source; q=sanitize_source+strlen(sanitize_source); - for (p+=strspn(p,allowlist); p != q; p+=strspn(p,allowlist)) + for (p+=strspn(p,allowlist); p != q; p+=(ptrdiff_t) strspn(p,allowlist)) *p='_'; return(sanitize_source); } diff --git a/magick/delegate.c b/magick/delegate.c index 7d9ef57d96d9058425805cee6d481ba40cdf2348..b6a2599805cf08f270ee2dc33cbb1bfb8eda5b99 100644 --- a/magick/delegate.c +++ b/magick/delegate.c @@ -86,6 +86,11 @@ #define system(s) ((s)==NULL ? 0 : -1) #endif #define DelegateFilename "delegates.xml" +#if defined(MAGICKCORE_WINDOWS_SUPPORT) + #define DELEGATE_ESC """ +#else + #define DELEGATE_ESC "'" +#endif /* Declare delegate map. @@ -94,67 +99,71 @@ static const char *DelegateMap = (const char *) "" "" - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " #ifndef MAGICKCORE_RSVG_DELEGATE - " " + " " #endif - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " ""; + +#undef DELEGATE_ESC /* Global declarations. @@ -495,7 +504,7 @@ MagickExport int ExternalDelegateCommand(const MagickBooleanType asynchronous, p=strstr(sanitize_command,"cmd.exe /c"); if (p != (char*) NULL) { - p+=10; + p+=(ptrdiff_t) 10; for ( ; *p != '\0'; p++) if (*p == '/') *p=(*DirectorySeparator); @@ -1017,7 +1026,7 @@ static char *InterpretDelegateProperties(const ImageInfo *image_info, return((char *) NULL); \ q=interpret_text+strlen(interpret_text); \ } \ - q+=FormatLocaleString(q,extent,"%s=%s\n",(key),(value)); \ + q+=(ptrdiff_t) FormatLocaleString(q,extent,"%s=%s\n",(key),(value)); \ } #define AppendString2Text(string) \ @@ -1033,7 +1042,7 @@ static char *InterpretDelegateProperties(const ImageInfo *image_info, q=interpret_text+strlen(interpret_text); \ } \ (void) CopyMagickString(q,(string),extent); \ - q+=length; \ + q+=(ptrdiff_t) length; \ } char @@ -1122,19 +1131,19 @@ static char *InterpretDelegateProperties(const ImageInfo *image_info, if (LocaleNCompare("<",p,4) == 0) { *q++='<'; - p+=3; + p+=(ptrdiff_t) 3; } else if (LocaleNCompare(">",p,4) == 0) { *q++='>'; - p+=3; + p+=(ptrdiff_t) 3; } else if (LocaleNCompare("&",p,5) == 0) { *q++='&'; - p+=4; + p+=(ptrdiff_t) 4; } else *q++=(*p); @@ -1892,7 +1901,6 @@ MagickExport MagickBooleanType InvokeDelegate(ImageInfo *image_info, { (void) FormatLocaleString(p->filename,MaxTextExtent,"%s:%s", delegate_info->decode,clone_info->filename); - (void) SetImageOption(clone_info,"quantum:format","floating-point"); status=WriteImage(clone_info,p); if (status == MagickFalse) { @@ -2084,7 +2092,7 @@ MagickExport MagickBooleanType ListDelegateInfo(FILE *file, if (delegate_info[i]->encode != (char *) NULL) (void) CopyMagickString(delegate,delegate_info[i]->encode,MaxTextExtent); (void) ConcatenateMagickString(delegate," ",MaxTextExtent); - delegate[8]='\0'; + delegate[9]='\0'; commands=StringToList(delegate_info[i]->commands); if (commands == (char **) NULL) continue; @@ -2295,10 +2303,9 @@ static MagickBooleanType LoadDelegateCache(LinkedListInfo *cache, path); (void) SubstituteString((char **) &commands,"\\","/"); } - (void) SubstituteString((char **) &commands,""","\""); -#else - (void) SubstituteString((char **) &commands,""","'"); #endif + (void) SubstituteString((char **) &commands,""","\""); + (void) SubstituteString((char **) &commands,"'","'"); (void) SubstituteString((char **) &commands,"&","&"); (void) SubstituteString((char **) &commands,">",">"); (void) SubstituteString((char **) &commands,"<","<"); diff --git a/magick/deprecate.c b/magick/deprecate.c index 5da41e07cfc05992cf0b0ab6f8770ed6ad47a89c..6abb928130cabb3530190e0e6b3c063b94214fc4 100644 --- a/magick/deprecate.c +++ b/magick/deprecate.c @@ -1106,8 +1106,8 @@ MagickExport void *CloneMemory(void *destination,const void *source, /* Overlap, copy backwards. */ - p+=size; - q+=size; + p+=(ptrdiff_t) size; + q+=(ptrdiff_t) size; for (i=(ssize_t) (size-1); i >= 0; i--) *--q=(*--p); return(destination); @@ -1301,8 +1301,8 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image, &image->exception); if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL)) break; - p+=x1; - q+=x1; + p+=(ptrdiff_t) x1; + q+=(ptrdiff_t) x1; for (x=x1; x >= 0; x--) { if (q->opacity == (Quantum) TransparentOpacity) @@ -2590,14 +2590,14 @@ MagickExport void *GetConfigureBlob(const char *filename,char *path, blob=(void *) NULL; (void) CopyMagickString(path,filename,MaxTextExtent); #if defined(MAGICKCORE_INSTALLED_SUPPORT) -#if defined(MAGICKCORE_LIBRARY_PATH) +#if defined(MAGICKCORE_LIBRARY_ABSOLUTE_PATH) if (blob == (void *) NULL) { /* Search hard coded paths. */ (void) FormatLocaleString(path,MaxTextExtent,"%s%s", - MAGICKCORE_LIBRARY_PATH,filename); + MAGICKCORE_LIBRARY_ABSOLUTE_PATH,filename); if (IsPathAccessible(path) != MagickFalse) blob=FileToBlob(path,~0UL,length,exception); } @@ -4963,8 +4963,8 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image, &image->exception); if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL)) break; - p+=x1; - q+=x1; + p+=(ptrdiff_t) x1; + q+=(ptrdiff_t) x1; for (x=x1; x >= 0; x--) { if (q->opacity == (Quantum) TransparentOpacity) diff --git a/magick/display.c b/magick/display.c index bbf2f91a96e97f776f7196d32a812a66b6ea2fef..9747f0540eda9ca55ee12b4d9c1cfb185c4e8317 100644 --- a/magick/display.c +++ b/magick/display.c @@ -1403,7 +1403,7 @@ typedef enum SaveToUndoBufferCommand, FreeBuffersCommand, NullCommand -} CommandType; +} DisplayCommand; typedef enum { @@ -1532,12 +1532,12 @@ static const unsigned char /* Function prototypes. */ -static CommandType +static DisplayCommand XImageWindowCommand(Display *,XResourceInfo *,XWindows *, const MagickStatusType,KeySym,Image **); static Image - *XMagickCommand(Display *,XResourceInfo *,XWindows *,const CommandType, + *XMagickCommand(Display *,XResourceInfo *,XWindows *,const DisplayCommand, Image **), *XOpenImage(Display *,XResourceInfo *,XWindows *,const MagickBooleanType), *XTileImage(Display *,XResourceInfo *,XWindows *,Image *,XEvent *), @@ -1562,7 +1562,7 @@ static MagickBooleanType static void XDrawPanRectangle(Display *,XWindows *), - XImageCache(Display *,XResourceInfo *,XWindows *,const CommandType,Image **), + XImageCache(Display *,XResourceInfo *,XWindows *,const DisplayCommand,Image **), XMagnifyImage(Display *,XWindows *,XEvent *), XMakePanImage(Display *,XResourceInfo *,XWindows *,Image *), XPanImage(Display *,XWindows *,XEvent *), @@ -2400,7 +2400,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display, x=annotate_info->x+annotate_info->width; y=annotate_info->y; if (annotate_info->width != 0) - p+=strlen(annotate_info->text); + p+=(ptrdiff_t) strlen(annotate_info->text); break; } } @@ -6333,7 +6333,7 @@ static void XDrawPanRectangle(Display *display,XWindows *windows) % The format of the XImageCache method is: % % void XImageCache(Display *display,XResourceInfo *resource_info, -% XWindows *windows,const CommandType command,Image **image) +% XWindows *windows,const DisplayCommand command,Image **image) % % A description of each parameter follows: % @@ -6351,7 +6351,7 @@ static void XDrawPanRectangle(Display *display,XWindows *windows) % */ static void XImageCache(Display *display,XResourceInfo *resource_info, - XWindows *windows,const CommandType command,Image **image) + XWindows *windows,const DisplayCommand command,Image **image) { Image *cache_image; @@ -6391,6 +6391,8 @@ static void XImageCache(Display *display,XResourceInfo *resource_info, if (undo_image == (Image *) NULL) { (void) XBell(display,0); + ThrowXWindowException(ImageError,"NoImagesWereFound", + (*image)->filename); return; } cache_image=undo_image; @@ -6608,7 +6610,7 @@ static void XImageCache(Display *display,XResourceInfo *resource_info, % % The format of the XMagickCommand method is: % -% CommandType XImageWindowCommand(Display *display, +% DisplayCommand XImageWindowCommand(Display *display, % XResourceInfo *resource_info,XWindows *windows, % const MagickStatusType state,KeySym key_symbol,Image **image) % @@ -6633,7 +6635,7 @@ static void XImageCache(Display *display,XResourceInfo *resource_info, % may transform the image and return a new image pointer. % */ -static CommandType XImageWindowCommand(Display *display, +static DisplayCommand XImageWindowCommand(Display *display, XResourceInfo *resource_info,XWindows *windows,const MagickStatusType state, KeySym key_symbol,Image **image) { @@ -7002,7 +7004,7 @@ static CommandType XImageWindowCommand(Display *display, % The format of the XMagickCommand method is: % % Image *XMagickCommand(Display *display,XResourceInfo *resource_info, -% XWindows *windows,const CommandType command,Image **image) +% XWindows *windows,const DisplayCommand command,Image **image) % % A description of each parameter follows: % @@ -7024,7 +7026,7 @@ static CommandType XImageWindowCommand(Display *display, % */ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, - XWindows *windows,const CommandType command,Image **image) + XWindows *windows,const DisplayCommand command,Image **image) { char filename[MaxTextExtent], @@ -10165,8 +10167,8 @@ static Image *XOpenImage(Display *display,XResourceInfo *resource_info, if (filelist == (char **) NULL) { (void) XFreeStringList(files); - ThrowXWindowException(ResourceLimitError, - "MemoryAllocationFailed","..."); + ThrowXWindowException(ResourceLimitError,"MemoryAllocationFailed", + "..."); return((Image *) NULL); } j=0; @@ -11049,7 +11051,7 @@ static MagickBooleanType XROIImage(Display *display, MiscellanyMenu }; - static const CommandType + static const DisplayCommand ApplyCommands[] = { NullCommand, @@ -11104,6 +11106,7 @@ static MagickBooleanType XROIImage(Display *display, AddNoiseCommand, SharpenCommand, BlurCommand, + ThresholdCommand, EdgeDetectCommand, SpreadCommand, ShadeCommand, @@ -11135,7 +11138,7 @@ static MagickBooleanType XROIImage(Display *display, ROIDismissCommand }; - static const CommandType + static const DisplayCommand *Commands[ApplyMenus] = { FileCommands, @@ -11151,8 +11154,8 @@ static MagickBooleanType XROIImage(Display *display, command[MaxTextExtent], text[MaxTextExtent]; - CommandType - command_type; + DisplayCommand + display_command; Cursor cursor; @@ -11464,7 +11467,7 @@ static MagickBooleanType XROIImage(Display *display, Wait for user to grab a corner of the rectangle or press return. */ state=DefaultState; - command_type=NullCommand; + display_command=NullCommand; (void) XMapWindow(display,windows->info.id); do { @@ -11490,13 +11493,13 @@ static MagickBooleanType XROIImage(Display *display, if ((state & UpdateRegionState) != 0) { (void) XSetFunction(display,windows->image.highlight_context,GXcopy); - switch (command_type) + switch (display_command) { case UndoCommand: case RedoCommand: { - (void) XMagickCommand(display,resource_info,windows,command_type, - image); + (void) XMagickCommand(display,resource_info,windows, + display_command,image); break; } default: @@ -11533,8 +11536,8 @@ static MagickBooleanType XROIImage(Display *display, Apply image processing technique to the region of interest. */ windows->image.orphan=MagickTrue; - (void) XMagickCommand(display,resource_info,windows,command_type, - &roi_image); + (void) XMagickCommand(display,resource_info,windows, + display_command,&roi_image); progress_monitor=SetImageProgressMonitor(*image, (MagickProgressMonitor) NULL,(*image)->client_data); (void) XMagickCommand(display,resource_info,windows, @@ -11548,7 +11551,7 @@ static MagickBooleanType XROIImage(Display *display, break; } } - if (command_type != InfoCommand) + if (display_command != InfoCommand) { XConfigureImageColormap(display,resource_info,windows,*image); (void) XConfigureImage(display,resource_info,windows,*image); @@ -11568,12 +11571,12 @@ static MagickBooleanType XROIImage(Display *display, Select a command from the Command widget. */ (void) XSetFunction(display,windows->image.highlight_context,GXcopy); - command_type=NullCommand; + display_command=NullCommand; id=XCommandWidget(display,windows,ApplyMenu,&event); if (id >= 0) { (void) CopyMagickString(command,ApplyMenu[id],MaxTextExtent); - command_type=ApplyCommands[id]; + display_command=ApplyCommands[id]; if (id < ApplyMenus) { /* @@ -11585,7 +11588,7 @@ static MagickBooleanType XROIImage(Display *display, { (void) CopyMagickString(command,Menus[id][entry], MaxTextExtent); - command_type=Commands[id][entry]; + display_command=Commands[id][entry]; } } } @@ -11593,7 +11596,7 @@ static MagickBooleanType XROIImage(Display *display, GXinvert); XHighlightRectangle(display,windows->image.id, windows->image.highlight_context,&highlight_info); - if (command_type == HelpCommand) + if (display_command == HelpCommand) { (void) XSetFunction(display,windows->image.highlight_context, GXcopy); @@ -11603,7 +11606,7 @@ static MagickBooleanType XROIImage(Display *display, GXinvert); continue; } - if (command_type == QuitCommand) + if (display_command == QuitCommand) { /* exit. @@ -11612,7 +11615,7 @@ static MagickBooleanType XROIImage(Display *display, state|=ExitState; continue; } - if (command_type != NullCommand) + if (display_command != NullCommand) state|=UpdateRegionState; continue; } @@ -11770,9 +11773,9 @@ static MagickBooleanType XROIImage(Display *display, } default: { - command_type=XImageWindowCommand(display,resource_info,windows, + display_command=XImageWindowCommand(display,resource_info,windows, event.xkey.state,key_symbol,image); - if (command_type != NullCommand) + if (display_command != NullCommand) state|=UpdateRegionState; break; } @@ -14135,7 +14138,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, HelpMenu }; - static CommandType + static DisplayCommand CommandMenus[] = { NullCommand, @@ -14286,7 +14289,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, QuitCommand }; - static CommandType + static DisplayCommand *Commands[MagickMenus] = { FileCommands, @@ -14307,8 +14310,8 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, geometry[MaxTextExtent], resource_name[MaxTextExtent]; - CommandType - command_type; + DisplayCommand + display_command; Image *display_image, @@ -15028,7 +15031,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, if (id < 0) continue; (void) CopyMagickString(command,CommandMenu[id],MaxTextExtent); - command_type=CommandMenus[id]; + display_command=CommandMenus[id]; if (id < MagickMenus) { /* @@ -15039,10 +15042,10 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, if (entry < 0) continue; (void) CopyMagickString(command,Menus[id][entry],MaxTextExtent); - command_type=Commands[id][entry]; + display_command=Commands[id][entry]; } - if (command_type != NullCommand) - nexus=XMagickCommand(display,resource_info,windows,command_type, + if (display_command != NullCommand) + nexus=XMagickCommand(display,resource_info,windows,display_command, &display_image); continue; } @@ -15669,10 +15672,10 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, key_symbol,command); if (event.xkey.window == windows->image.id) { - command_type=XImageWindowCommand(display,resource_info,windows, + display_command=XImageWindowCommand(display,resource_info,windows, event.xkey.state,key_symbol,&display_image); - if (command_type != NullCommand) - nexus=XMagickCommand(display,resource_info,windows,command_type, + if (display_command != NullCommand) + nexus=XMagickCommand(display,resource_info,windows,display_command, &display_image); } if (event.xkey.window == windows->magnify.id) diff --git a/magick/distort.c b/magick/distort.c index 2c855578e21329f70485ecab7156fe8cbe71c1f3..1f7eeae8eee863b31669232da56bbec09f05697b 100644 --- a/magick/distort.c +++ b/magick/distort.c @@ -2287,7 +2287,7 @@ MagickExport Image *DistortImage(const Image *image,DistortImageMethod method, " jj=jj%s(%lf*rr*rr*rr %+lf*rr*rr %+lf*rr %+lf);\n", method == BarrelDistortion ? "*" : "/",coeff[4],coeff[5],coeff[6], coeff[7]); - (void) FormatLocaleFile(stderr," v.p{fx*ii+xc,fy*jj+yc}' \\\n"); + (void) FormatLocaleFile(stderr," p{ii+xc,jj+yc}' \\\n"); } default: break; @@ -2672,7 +2672,7 @@ if ( i == 0 && j == 0 ) { /* derivatives... (see Anthony Thyssen's personal notes) */ ScaleFilter( resample_filter[id], cx*cx, 0.0, s.y*cx/coeff[1], cx ); -#if 1 +#if 0 /*if ( i == 0 && j == 0 ) {*/ if ( d.x == 0.5 && d.y == 0.5 ) { fprintf(stderr, "x=%lf y=%lf u=%lf v=%lf\n", d.x*coeff[1], d.y, s.x, s.y); @@ -2779,14 +2779,19 @@ if ( d.x == 0.5 && d.y == 0.5 ) { } else { /* resample the source image to find its correct color */ - (void) ResamplePixelColor(resample_filter[id],s.x,s.y,&pixel); - /* if validity between 0.0 and 1.0 mix result with invalid pixel */ - if ( validity < 1.0 ) { - /* Do a blend of sample color and invalid pixel */ - /* should this be a 'Blend', or an 'Over' compose */ - MagickPixelCompositeBlend(&pixel,validity,&invalid,(1.0-validity), - &pixel); - } + status=ResamplePixelColor(resample_filter[id],s.x,s.y,&pixel); + if (status == MagickFalse) + SetPixelPacket(distort_image,&invalid,q,indexes); + else + { + /* if validity between 0.0 & 1.0 mix result with invalid pixel */ + if ( validity < 1.0 ) { + /* Do a blend of sample color and invalid pixel */ + /* should this be a 'Blend', or an 'Over' compose */ + MagickPixelCompositeBlend(&pixel,validity,&invalid,(1.0-validity), + &pixel); + } + } SetPixelPacket(distort_image,&pixel,q,indexes); } q++; diff --git a/magick/distribute-cache.c b/magick/distribute-cache.c index beda933d691e83a13650acd09d2c77bc558936d3..730fd8b737520dcf56f2699a131448ddcdc81cad 100755 --- a/magick/distribute-cache.c +++ b/magick/distribute-cache.c @@ -159,7 +159,7 @@ static inline MagickOffsetType dpc_read(int file,const MagickSizeType length, for (i=0; i < (MagickOffsetType) length; i+=count) { count=recv(file,(char *) message+i,(LENGTH_TYPE) MagickMin(length-i, - (MagickSizeType) MAGICK_SSIZE_MAX),0); + (MagickSizeType) MagickMaxBufferExtent),0); if (count <= 0) { count=0; @@ -455,7 +455,7 @@ 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-i,(MagickSizeType) MagickMaxBufferExtent),MSG_NOSIGNAL); if (count <= 0) { count=0; @@ -504,15 +504,15 @@ static MagickBooleanType OpenDistributeCache(SplayTreeInfo *registry,int file, */ p=message; (void) memcpy(&image->storage_class,p,sizeof(image->storage_class)); - p+=sizeof(image->storage_class); + p+=(ptrdiff_t) sizeof(image->storage_class); (void) memcpy(&image->colorspace,p,sizeof(image->colorspace)); - p+=sizeof(image->colorspace); + p+=(ptrdiff_t) sizeof(image->colorspace); (void) memcpy(&image->channels,p,sizeof(image->channels)); - p+=sizeof(image->channels); + p+=(ptrdiff_t) sizeof(image->channels); (void) memcpy(&image->columns,p,sizeof(image->columns)); - p+=sizeof(image->columns); + p+=(ptrdiff_t) sizeof(image->columns); (void) memcpy(&image->rows,p,sizeof(image->rows)); - p+=sizeof(image->rows); + p+=(ptrdiff_t) sizeof(image->rows); if (SyncImagePixelCache(image,exception) == MagickFalse) return(MagickFalse); status=AddValueToSplayTree(registry,(const void *) key,image); @@ -560,15 +560,15 @@ static MagickBooleanType ReadDistributeCacheIndexes(SplayTreeInfo *registry, return(MagickFalse); q=message; (void) memcpy(®ion.width,q,sizeof(region.width)); - q+=sizeof(region.width); + q+=(ptrdiff_t) sizeof(region.width); (void) memcpy(®ion.height,q,sizeof(region.height)); - q+=sizeof(region.height); + q+=(ptrdiff_t) sizeof(region.height); (void) memcpy(®ion.x,q,sizeof(region.x)); - q+=sizeof(region.x); + q+=(ptrdiff_t) sizeof(region.x); (void) memcpy(®ion.y,q,sizeof(region.y)); - q+=sizeof(region.y); + q+=(ptrdiff_t) sizeof(region.y); (void) memcpy(&length,q,sizeof(length)); - q+=sizeof(length); + q+=(ptrdiff_t) sizeof(length); p=GetVirtualPixels(image,region.x,region.y,region.width,region.height, exception); if (p == (const PixelPacket *) NULL) @@ -618,15 +618,15 @@ static MagickBooleanType ReadDistributeCachePixels(SplayTreeInfo *registry, return(MagickFalse); q=message; (void) memcpy(®ion.width,q,sizeof(region.width)); - q+=sizeof(region.width); + q+=(ptrdiff_t) sizeof(region.width); (void) memcpy(®ion.height,q,sizeof(region.height)); - q+=sizeof(region.height); + q+=(ptrdiff_t) sizeof(region.height); (void) memcpy(®ion.x,q,sizeof(region.x)); - q+=sizeof(region.x); + q+=(ptrdiff_t) sizeof(region.x); (void) memcpy(®ion.y,q,sizeof(region.y)); - q+=sizeof(region.y); + q+=(ptrdiff_t) sizeof(region.y); (void) memcpy(&length,q,sizeof(length)); - q+=sizeof(length); + q+=(ptrdiff_t) sizeof(length); p=GetVirtualPixels(image,region.x,region.y,region.width,region.height, exception); if (p == (const PixelPacket *) NULL) @@ -682,15 +682,15 @@ static MagickBooleanType WriteDistributeCacheIndexes(SplayTreeInfo *registry, return(MagickFalse); p=message; (void) memcpy(®ion.width,p,sizeof(region.width)); - p+=sizeof(region.width); + p+=(ptrdiff_t) sizeof(region.width); (void) memcpy(®ion.height,p,sizeof(region.height)); - p+=sizeof(region.height); + p+=(ptrdiff_t) sizeof(region.height); (void) memcpy(®ion.x,p,sizeof(region.x)); - p+=sizeof(region.x); + p+=(ptrdiff_t) sizeof(region.x); (void) memcpy(®ion.y,p,sizeof(region.y)); - p+=sizeof(region.y); + p+=(ptrdiff_t) sizeof(region.y); (void) memcpy(&length,p,sizeof(length)); - p+=sizeof(length); + p+=(ptrdiff_t) sizeof(length); q=GetAuthenticPixels(image,region.x,region.y,region.width,region.height, exception); if (q == (PixelPacket *) NULL) @@ -740,15 +740,15 @@ static MagickBooleanType WriteDistributeCachePixels(SplayTreeInfo *registry, return(MagickFalse); p=message; (void) memcpy(®ion.width,p,sizeof(region.width)); - p+=sizeof(region.width); + p+=(ptrdiff_t) sizeof(region.width); (void) memcpy(®ion.height,p,sizeof(region.height)); - p+=sizeof(region.height); + p+=(ptrdiff_t) sizeof(region.height); (void) memcpy(®ion.x,p,sizeof(region.x)); - p+=sizeof(region.x); + p+=(ptrdiff_t) sizeof(region.x); (void) memcpy(®ion.y,p,sizeof(region.y)); - p+=sizeof(region.y); + p+=(ptrdiff_t) sizeof(region.y); (void) memcpy(&length,p,sizeof(length)); - p+=sizeof(length); + p+=(ptrdiff_t) sizeof(length); q=GetAuthenticPixels(image,region.x,region.y,region.width,region.height, exception); if (q == (PixelPacket *) NULL) @@ -1129,17 +1129,17 @@ MagickPrivate MagickBooleanType OpenDistributePixelCache( Serialize image attributes (see ValidatePixelCacheMorphology()). */ (void) memcpy(p,&server_info->session_key,sizeof(server_info->session_key)); - p+=sizeof(server_info->session_key); + p+=(ptrdiff_t) sizeof(server_info->session_key); (void) memcpy(p,&image->storage_class,sizeof(image->storage_class)); - p+=sizeof(image->storage_class); + p+=(ptrdiff_t) sizeof(image->storage_class); (void) memcpy(p,&image->colorspace,sizeof(image->colorspace)); - p+=sizeof(image->colorspace); + p+=(ptrdiff_t) sizeof(image->colorspace); (void) memcpy(p,&image->channels,sizeof(image->channels)); - p+=sizeof(image->channels); + p+=(ptrdiff_t) sizeof(image->channels); (void) memcpy(p,&image->columns,sizeof(image->columns)); - p+=sizeof(image->columns); + p+=(ptrdiff_t) sizeof(image->columns); (void) memcpy(p,&image->rows,sizeof(image->rows)); - p+=sizeof(image->rows); + p+=(ptrdiff_t) sizeof(image->rows); count=dpc_send(server_info->file,p-message,message); if (count != (MagickOffsetType) (p-message)) return(MagickFalse); @@ -1206,17 +1206,17 @@ MagickPrivate MagickOffsetType ReadDistributePixelCacheIndexes( p=message; *p++='R'; (void) memcpy(p,&server_info->session_key,sizeof(server_info->session_key)); - p+=sizeof(server_info->session_key); + p+=(ptrdiff_t) sizeof(server_info->session_key); (void) memcpy(p,®ion->width,sizeof(region->width)); - p+=sizeof(region->width); + p+=(ptrdiff_t) sizeof(region->width); (void) memcpy(p,®ion->height,sizeof(region->height)); - p+=sizeof(region->height); + p+=(ptrdiff_t) sizeof(region->height); (void) memcpy(p,®ion->x,sizeof(region->x)); - p+=sizeof(region->x); + p+=(ptrdiff_t) sizeof(region->x); (void) memcpy(p,®ion->y,sizeof(region->y)); - p+=sizeof(region->y); + p+=(ptrdiff_t) sizeof(region->y); (void) memcpy(p,&length,sizeof(length)); - p+=sizeof(length); + p+=(ptrdiff_t) sizeof(length); count=dpc_send(server_info->file,p-message,message); if (count != (MagickOffsetType) (p-message)) return(-1); @@ -1279,17 +1279,17 @@ MagickPrivate MagickOffsetType ReadDistributePixelCachePixels( p=message; *p++='r'; (void) memcpy(p,&server_info->session_key,sizeof(server_info->session_key)); - p+=sizeof(server_info->session_key); + p+=(ptrdiff_t) sizeof(server_info->session_key); (void) memcpy(p,®ion->width,sizeof(region->width)); - p+=sizeof(region->width); + p+=(ptrdiff_t) sizeof(region->width); (void) memcpy(p,®ion->height,sizeof(region->height)); - p+=sizeof(region->height); + p+=(ptrdiff_t) sizeof(region->height); (void) memcpy(p,®ion->x,sizeof(region->x)); - p+=sizeof(region->x); + p+=(ptrdiff_t) sizeof(region->x); (void) memcpy(p,®ion->y,sizeof(region->y)); - p+=sizeof(region->y); + p+=(ptrdiff_t) sizeof(region->y); (void) memcpy(p,&length,sizeof(length)); - p+=sizeof(length); + p+=(ptrdiff_t) sizeof(length); count=dpc_send(server_info->file,p-message,message); if (count != (MagickOffsetType) (p-message)) return(-1); @@ -1341,7 +1341,7 @@ MagickPrivate MagickBooleanType RelinquishDistributePixelCache( p=message; *p++='d'; (void) memcpy(p,&server_info->session_key,sizeof(server_info->session_key)); - p+=sizeof(server_info->session_key); + p+=(ptrdiff_t) sizeof(server_info->session_key); count=dpc_send(server_info->file,p-message,message); if (count != (MagickOffsetType) (p-message)) return(MagickFalse); @@ -1408,17 +1408,17 @@ MagickPrivate MagickOffsetType WriteDistributePixelCacheIndexes( p=message; *p++='W'; (void) memcpy(p,&server_info->session_key,sizeof(server_info->session_key)); - p+=sizeof(server_info->session_key); + p+=(ptrdiff_t) sizeof(server_info->session_key); (void) memcpy(p,®ion->width,sizeof(region->width)); - p+=sizeof(region->width); + p+=(ptrdiff_t) sizeof(region->width); (void) memcpy(p,®ion->height,sizeof(region->height)); - p+=sizeof(region->height); + p+=(ptrdiff_t) sizeof(region->height); (void) memcpy(p,®ion->x,sizeof(region->x)); - p+=sizeof(region->x); + p+=(ptrdiff_t) sizeof(region->x); (void) memcpy(p,®ion->y,sizeof(region->y)); - p+=sizeof(region->y); + p+=(ptrdiff_t) sizeof(region->y); (void) memcpy(p,&length,sizeof(length)); - p+=sizeof(length); + p+=(ptrdiff_t) sizeof(length); count=dpc_send(server_info->file,p-message,message); if (count != (MagickOffsetType) (p-message)) return(-1); @@ -1482,17 +1482,17 @@ MagickPrivate MagickOffsetType WriteDistributePixelCachePixels( p=message; *p++='w'; (void) memcpy(p,&server_info->session_key,sizeof(server_info->session_key)); - p+=sizeof(server_info->session_key); + p+=(ptrdiff_t) sizeof(server_info->session_key); (void) memcpy(p,®ion->width,sizeof(region->width)); - p+=sizeof(region->width); + p+=(ptrdiff_t) sizeof(region->width); (void) memcpy(p,®ion->height,sizeof(region->height)); - p+=sizeof(region->height); + p+=(ptrdiff_t) sizeof(region->height); (void) memcpy(p,®ion->x,sizeof(region->x)); - p+=sizeof(region->x); + p+=(ptrdiff_t) sizeof(region->x); (void) memcpy(p,®ion->y,sizeof(region->y)); - p+=sizeof(region->y); + p+=(ptrdiff_t) sizeof(region->y); (void) memcpy(p,&length,sizeof(length)); - p+=sizeof(length); + p+=(ptrdiff_t) sizeof(length); count=dpc_send(server_info->file,p-message,message); if (count != (MagickOffsetType) (p-message)) return(-1); diff --git a/magick/draw.c b/magick/draw.c index 423d0aebd04846d9563ba54b2eb9fd63a7c91ca9..243644613217608ecc32c8b5f06884bbc1695042 100644 --- a/magick/draw.c +++ b/magick/draw.c @@ -761,7 +761,6 @@ static PolygonInfo *ConvertPathToPolygon(const PathInfo *path_info, } } polygon_info->number_edges=edge; - polygon_info->number_edges=edge; polygon_info->edges=(EdgeInfo *) ResizeQuantumMemory(polygon_info->edges, polygon_info->number_edges,sizeof(*polygon_info->edges)); if (polygon_info->edges == (EdgeInfo *) NULL) @@ -2005,6 +2004,7 @@ MagickExport MagickBooleanType DrawGradientImage(Image *image, bounding_box; ssize_t + height, y; /* @@ -2025,11 +2025,12 @@ MagickExport MagickBooleanType DrawGradientImage(Image *image, exception=(&image->exception); GetMagickPixelPacket(image,&zero); image_view=AcquireAuthenticCacheView(image,exception); + height=(size_t) (bounding_box.y+bounding_box.height); #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,height,1) #endif - for (y=bounding_box.y; y < (ssize_t) bounding_box.height; y++) + for (y=bounding_box.y; y < (ssize_t) height; y++) { double alpha, @@ -2042,19 +2043,19 @@ MagickExport MagickBooleanType DrawGradientImage(Image *image, IndexPacket *magick_restrict indexes; - ssize_t - i, - x; - PixelPacket *magick_restrict q; ssize_t - j; + i, + j, + width, + x; if (status == MagickFalse) continue; - q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception); + q=GetCacheViewAuthenticPixels(image_view,bounding_box.x,y,(size_t) + bounding_box.width,1,exception); if (q == (PixelPacket *) NULL) { status=MagickFalse; @@ -2066,7 +2067,8 @@ MagickExport MagickBooleanType DrawGradientImage(Image *image, offset=GetStopColorOffset(gradient,0,y); if (gradient->type != RadialGradient) offset*=PerceptibleReciprocal(length); - for (x=bounding_box.x; x < (ssize_t) bounding_box.width; x++) + width=(size_t) (bounding_box.x+bounding_box.width); + for (x=bounding_box.x; x < (ssize_t) width; x++) { SetMagickPixelPacket(image,q,indexes+x,&pixel); switch (gradient->spread) @@ -2405,15 +2407,21 @@ static SplayTreeInfo *GetMVGMacros(const char *primitive) } if (LocaleCompare(token,"push") == 0) n++; - if ((n == 0) && (end > start)) + if ((n == 0) && (end >= start)) { + size_t + length=(size_t) (end-start); + /* Extract macro. */ (void) GetNextToken(p,&p,extent,token); - (void) CopyMagickString(macro,start,(size_t) (end-start)); - (void) AddValueToSplayTree(macros,ConstantString(name), - ConstantString(macro)); + if (length > 0) + { + (void) CopyMagickString(macro,start,length); + (void) AddValueToSplayTree(macros,ConstantString(name), + ConstantString(macro)); + } break; } } @@ -2467,6 +2475,7 @@ static MagickBooleanType RenderMVGContent(Image *image, *token; const char + *p, *q; double @@ -2501,13 +2510,6 @@ static MagickBooleanType RenderMVGContent(Image *image, PrimitiveType primitive_type; - const char - *p; - - ssize_t - i, - x; - SegmentInfo bounds; @@ -2520,10 +2522,12 @@ static MagickBooleanType RenderMVGContent(Image *image, ssize_t defsDepth, + i, j, k, n, - symbolDepth; + symbolDepth, + x; TypeMetric metrics; @@ -2711,7 +2715,13 @@ static MagickBooleanType RenderMVGContent(Image *image, status=MagickFalse; break; } - if (LocaleCompare(token,graphic_context[n]->id) == 0) + /* + Identify recursion. + */ + for (i=0; i <= n; i++) + if (LocaleCompare(token,graphic_context[i]->id) == 0) + break; + if (i <= n) break; mvg_class=(const char *) GetValueFromSplayTree(macros,token); if ((graphic_context[n]->render != MagickFalse) && @@ -2726,6 +2736,7 @@ static MagickBooleanType RenderMVGContent(Image *image, /* Inject class elements in stream. */ + (void) CloneString(&graphic_context[n]->id,token); offset=(ssize_t) (p-primitive); elements=AcquireString(primitive); elements[offset]='\0'; @@ -3204,22 +3215,34 @@ static MagickBooleanType RenderMVGContent(Image *image, if (graphic_context[n]->clip_path != MagickFalse) break; factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0; - opacity=MagickMin(MagickMax(factor* + opacity=1.0-MagickMin(MagickMax(factor* GetDrawValue(token,&next_token),0.0),1.0); if (token == next_token) ThrowPointExpectedException(image,token); if (graphic_context[n]->compliance == SVGCompliance) { - graphic_context[n]->fill_opacity*=(1.0-opacity); - graphic_context[n]->stroke_opacity*=(1.0-opacity); + graphic_context[n]->fill_opacity*=opacity; + graphic_context[n]->stroke_opacity*=opacity; + } + else + { + graphic_context[n]->fill_opacity=(double) QuantumRange*opacity; + graphic_context[n]->stroke_opacity=(double) QuantumRange* + opacity; + } + if (graphic_context[n]->fill.opacity != (double) TransparentOpacity) + { + graphic_context[n]->fill.opacity= + graphic_context[n]->fill_opacity; + graphic_context[n]->stroke.opacity= + graphic_context[n]->stroke_opacity; } else { - graphic_context[n]->fill_opacity=((MagickRealType) QuantumRange- - graphic_context[n]->fill_opacity)*(1.0-opacity); - graphic_context[n]->stroke_opacity=((MagickRealType) - QuantumRange-graphic_context[n]->stroke_opacity)* - (1.0-opacity); + graphic_context[n]->fill.opacity=(MagickRealType) + ClampToQuantum((double) QuantumRange*opacity); + graphic_context[n]->stroke.opacity=(MagickRealType) + ClampToQuantum((double) QuantumRange*opacity); } break; } @@ -3486,15 +3509,15 @@ static MagickBooleanType RenderMVGContent(Image *image, (void) GetNextToken(q,&q,extent,token); if (*token == ',') (void) GetNextToken(q,&q,extent,token); - bounds.width=CastDoubleToUnsigned(GetDrawValue(token,&next_token)+ - 0.5); + bounds.width=CastDoubleToUnsigned(GetDrawValue(token, + &next_token)+0.5); if (token == next_token) ThrowPointExpectedException(image,token); (void) GetNextToken(q,&q,extent,token); if (*token == ',') (void) GetNextToken(q,&q,extent,token); - bounds.height=CastDoubleToUnsigned(GetDrawValue(token,&next_token)+ - 0.5); + bounds.height=CastDoubleToUnsigned(GetDrawValue(token, + &next_token)+0.5); if (token == next_token) ThrowPointExpectedException(image,token); for (p=q; *q != '\0'; ) @@ -3909,15 +3932,15 @@ static MagickBooleanType RenderMVGContent(Image *image, (void) GetNextToken(q,&q,extent,token); if (*token == ',') (void) GetNextToken(q,&q,extent,token); - graphic_context[n]->viewbox.width=CastDoubleToUnsigned(GetDrawValue( - token,&next_token)+0.5); + graphic_context[n]->viewbox.width=CastDoubleToUnsigned( + GetDrawValue(token,&next_token)+0.5); if (token == next_token) ThrowPointExpectedException(image,token); (void) GetNextToken(q,&q,extent,token); if (*token == ',') (void) GetNextToken(q,&q,extent,token); - graphic_context[n]->viewbox.height=CastDoubleToUnsigned(GetDrawValue( - token,&next_token)+0.5); + graphic_context[n]->viewbox.height=CastDoubleToUnsigned( + GetDrawValue(token,&next_token)+0.5); if (token == next_token) ThrowPointExpectedException(image,token); break; @@ -5519,8 +5542,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, else if (*primitive_info->text != '\0') { - const MagickInfo - *magick_info; + const char + *option; MagickStatusType path_status; @@ -5534,15 +5557,23 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, (void) CopyMagickString(clone_info->filename,primitive_info->text, MagickPathExtent); (void) SetImageInfo(clone_info,1,exception); - magick_info=GetMagickInfo(clone_info->magick,exception); - if ((magick_info != (const MagickInfo*) NULL) && - (LocaleCompare(magick_info->magick_module,"SVG") == 0)) + option=GetImageOption(clone_info,"svg:embedding"); + if ((option == (char *) NULL) && + (IsStringTrue(option) == MagickFalse)) { - (void) ThrowMagickException(exception,GetMagickModule(), - CorruptImageError,"ImageTypeNotSupported","`%s'", - clone_info->filename); - clone_info=DestroyImageInfo(clone_info); - break; + const MagickInfo + *magick_info; + + magick_info=GetMagickInfo(clone_info->magick,exception); + if ((magick_info != (const MagickInfo*) NULL) && + (LocaleCompare(magick_info->magick_module,"SVG") == 0)) + { + (void) ThrowMagickException(exception,GetMagickModule(), + CorruptImageError,"ImageTypeNotSupported","`%s'", + clone_info->filename); + clone_info=DestroyImageInfo(clone_info); + break; + } } (void) CopyMagickString(clone_info->filename,primitive_info->text, MagickPathExtent); @@ -5830,7 +5861,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+=(ptrdiff_t) p->coordinates) { if (p->coordinates == 1) continue; @@ -6224,9 +6255,9 @@ static MagickBooleanType TraceArcPath(MVGInfo *mvg_info,const PointInfo start, status&=TraceBezier(mvg_info,4); if (status == 0) break; - p=(*mvg_info->primitive_info)+mvg_info->offset; + p=(*mvg_info->primitive_info)+(ptrdiff_t) mvg_info->offset; mvg_info->offset+=p->coordinates; - p+=p->coordinates; + p+=(ptrdiff_t) p->coordinates; } if (status == 0) return(MagickFalse); @@ -6356,7 +6387,7 @@ static MagickBooleanType TraceBezier(MVGInfo *mvg_info, coefficients=(double *) RelinquishMagickMemory(coefficients); return(MagickFalse); } - p+=p->coordinates; + p+=(ptrdiff_t) p->coordinates; } if (TracePoint(p,end) == MagickFalse) { @@ -6364,7 +6395,7 @@ static MagickBooleanType TraceBezier(MVGInfo *mvg_info, coefficients=(double *) RelinquishMagickMemory(coefficients); return(MagickFalse); } - p+=p->coordinates; + p+=(ptrdiff_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++) @@ -6429,32 +6460,33 @@ static MagickBooleanType TraceEllipse(MVGInfo *mvg_info,const PointInfo center, primitive_info->coordinates=0; if ((fabs(radii.x) < MagickEpsilon) || (fabs(radii.y) < MagickEpsilon)) return(MagickTrue); - delta=2.0*PerceptibleReciprocal(MagickMax(radii.x,radii.y)); - step=MagickPI/8.0; - if ((delta >= 0.0) && (delta < (MagickPI/8.0))) - step=MagickPI/4.0/(MagickPI*PerceptibleReciprocal(delta)/2.0); + delta=PerceptibleReciprocal(MagickMax(radii.x,radii.y)); + step=MagickPI/(MagickPI*PerceptibleReciprocal(delta))/8.0; angle.x=DegreesToRadians(arc.x); y=arc.y; while (y < arc.x) y+=360.0; angle.y=DegreesToRadians(y); coordinates=ceil((angle.y-angle.x)/step+1.0); - if (CheckPrimitiveExtent(mvg_info,coordinates) == MagickFalse) + if (CheckPrimitiveExtent(mvg_info,coordinates+1) == MagickFalse) return(MagickFalse); + i=0; primitive_info=(*mvg_info->primitive_info)+mvg_info->offset; for (p=primitive_info; angle.x < angle.y; angle.x+=step) { point.x=cos(fmod(angle.x,DegreesToRadians(360.0)))*radii.x+center.x; point.y=sin(fmod(angle.x,DegreesToRadians(360.0)))*radii.y+center.y; + if (i++ >= (ssize_t) coordinates) + break; if (TracePoint(p,point) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ptrdiff_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+=(ptrdiff_t) p->coordinates; primitive_info->coordinates=(size_t) (p-primitive_info); primitive_info->closed_subpath=MagickFalse; x=fabs(primitive_info[0].point.x- @@ -6613,7 +6645,7 @@ static ssize_t TracePath(Image *image,MVGInfo *mvg_info,const char *path) status&=TraceArcPath(mvg_info,point,end,arc,angle,large_arc,sweep); q=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=q->coordinates; - q+=q->coordinates; + q+=(ptrdiff_t) q->coordinates; point=end; while (isspace((int) ((unsigned char) *p)) != 0) p++; @@ -6655,7 +6687,7 @@ static ssize_t TracePath(Image *image,MVGInfo *mvg_info,const char *path) return(-1); q=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=q->coordinates; - q+=q->coordinates; + q+=(ptrdiff_t) q->coordinates; point=end; while (isspace((int) ((unsigned char) *p)) != 0) p++; @@ -6682,7 +6714,7 @@ static ssize_t TracePath(Image *image,MVGInfo *mvg_info,const char *path) if (TracePoint(q,point) == MagickFalse) return(-1); mvg_info->offset+=q->coordinates; - q+=q->coordinates; + q+=(ptrdiff_t) q->coordinates; while (isspace((int) ((unsigned char) *p)) != 0) p++; if (*p == ',') @@ -6718,7 +6750,7 @@ static ssize_t TracePath(Image *image,MVGInfo *mvg_info,const char *path) if (TracePoint(q,point) == MagickFalse) return(-1); mvg_info->offset+=q->coordinates; - q+=q->coordinates; + q+=(ptrdiff_t) q->coordinates; while (isspace((int) ((unsigned char) *p)) != 0) p++; if (*p == ',') @@ -6766,7 +6798,7 @@ static ssize_t TracePath(Image *image,MVGInfo *mvg_info,const char *path) if (TracePoint(q,point) == MagickFalse) return(-1); mvg_info->offset+=q->coordinates; - q+=q->coordinates; + q+=(ptrdiff_t) q->coordinates; while (isspace((int) ((unsigned char) *p)) != 0) p++; if (*p == ',') @@ -6809,7 +6841,7 @@ static ssize_t TracePath(Image *image,MVGInfo *mvg_info,const char *path) return(-1); q=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=q->coordinates; - q+=q->coordinates; + q+=(ptrdiff_t) q->coordinates; point=end; while (isspace((int) ((unsigned char) *p)) != 0) p++; @@ -6860,7 +6892,7 @@ static ssize_t TracePath(Image *image,MVGInfo *mvg_info,const char *path) return(-1); q=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=q->coordinates; - q+=q->coordinates; + q+=(ptrdiff_t) q->coordinates; point=end; last_attribute=attribute; while (isspace((int) ((unsigned char) *p)) != 0) @@ -6912,7 +6944,7 @@ static ssize_t TracePath(Image *image,MVGInfo *mvg_info,const char *path) return(-1); q=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=q->coordinates; - q+=q->coordinates; + q+=(ptrdiff_t) q->coordinates; point=end; last_attribute=attribute; while (isspace((int) ((unsigned char) *p)) != 0) @@ -6943,7 +6975,7 @@ static ssize_t TracePath(Image *image,MVGInfo *mvg_info,const char *path) if (TracePoint(q,point) == MagickFalse) return(-1); mvg_info->offset+=q->coordinates; - q+=q->coordinates; + q+=(ptrdiff_t) q->coordinates; while (isspace((int) ((unsigned char) *p)) != 0) p++; if (*p == ',') @@ -6964,7 +6996,7 @@ static ssize_t TracePath(Image *image,MVGInfo *mvg_info,const char *path) if (TracePoint(q,point) == MagickFalse) return(-1); mvg_info->offset+=q->coordinates; - q+=q->coordinates; + q+=(ptrdiff_t) q->coordinates; primitive_info=(*mvg_info->primitive_info)+subpath_offset; primitive_info->coordinates=(size_t) (q-primitive_info); primitive_info->closed_subpath=MagickTrue; @@ -7012,23 +7044,23 @@ static MagickBooleanType TraceRectangle(PrimitiveInfo *primitive_info, p=primitive_info; if (TracePoint(p,start) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ptrdiff_t) p->coordinates; point.x=start.x; point.y=end.y; if (TracePoint(p,point) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ptrdiff_t) p->coordinates; if (TracePoint(p,end) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ptrdiff_t) p->coordinates; point.x=end.x; point.y=start.y; if (TracePoint(p,point) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ptrdiff_t) p->coordinates; if (TracePoint(p,start) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ptrdiff_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++) @@ -7077,7 +7109,7 @@ static MagickBooleanType TraceRoundRectangle(MVGInfo *mvg_info, degrees.y=360.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); - p=(*mvg_info->primitive_info)+mvg_info->offset; + p=(*mvg_info->primitive_info)+(ptrdiff_t) mvg_info->offset; mvg_info->offset+=p->coordinates; point.x=start.x+segment.x-arc.x; point.y=start.y+segment.y-arc.y; @@ -7085,7 +7117,7 @@ static MagickBooleanType TraceRoundRectangle(MVGInfo *mvg_info, degrees.y=90.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); - p=(*mvg_info->primitive_info)+mvg_info->offset; + p=(*mvg_info->primitive_info)+(ptrdiff_t) mvg_info->offset; mvg_info->offset+=p->coordinates; point.x=start.x+arc.x; point.y=start.y+segment.y-arc.y; @@ -7093,7 +7125,7 @@ static MagickBooleanType TraceRoundRectangle(MVGInfo *mvg_info, degrees.y=180.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); - p=(*mvg_info->primitive_info)+mvg_info->offset; + p=(*mvg_info->primitive_info)+(ptrdiff_t) mvg_info->offset; mvg_info->offset+=p->coordinates; point.x=start.x+arc.x; point.y=start.y+arc.y; @@ -7101,14 +7133,14 @@ static MagickBooleanType TraceRoundRectangle(MVGInfo *mvg_info, degrees.y=270.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); - p=(*mvg_info->primitive_info)+mvg_info->offset; + p=(*mvg_info->primitive_info)+(ptrdiff_t) mvg_info->offset; mvg_info->offset+=p->coordinates; if (CheckPrimitiveExtent(mvg_info,PrimitiveExtentPad) == MagickFalse) return(MagickFalse); - p=(*mvg_info->primitive_info)+mvg_info->offset; + p=(*mvg_info->primitive_info)+(ptrdiff_t) mvg_info->offset; if (TracePoint(p,(*mvg_info->primitive_info+offset)->point) == MagickFalse) return(MagickFalse); - p+=p->coordinates; + p+=(ptrdiff_t) p->coordinates; mvg_info->offset=offset; primitive_info=(*mvg_info->primitive_info)+offset; primitive_info->coordinates=(size_t) (p-primitive_info); @@ -7285,9 +7317,9 @@ static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info, offset.x=primitive_info[number_vertices-1].point.x-primitive_info[0].point.x; offset.y=primitive_info[number_vertices-1].point.y-primitive_info[0].point.y; closed_path=(fabs(offset.x) < MagickEpsilon) && - (fabs(offset.y) < MagickEpsilon) ? MagickTrue : MagickFalse; - if (((draw_info->linejoin == RoundJoin) || - (draw_info->linejoin == MiterJoin)) && (closed_path != MagickFalse)) + (fabs(offset.y) < MagickEpsilon) ? MagickTrue : MagickFalse; + if ((draw_info->linejoin == MiterJoin) || + ((draw_info->linejoin == RoundJoin) && (closed_path != MagickFalse))) { polygon_primitive[number_vertices]=primitive_info[1]; number_vertices++; @@ -7296,6 +7328,7 @@ static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info, /* Compute the slope for the first line segment, p. */ + closed_path=primitive_info[0].closed_subpath; dx.p=0.0; dy.p=0.0; for (n=1; n < (ssize_t) number_vertices; n++) diff --git a/magick/effect.c b/magick/effect.c index 66bb32c1f32a0c231e8a5300664fea1d0e190973..5e83aa5897eba462fa9d29a7e0fe748e358de895 100644 --- a/magick/effect.c +++ b/magick/effect.c @@ -313,6 +313,9 @@ MagickExport Image *AdaptiveBlurImageChannel(const Image *image, blur_indexes=GetCacheViewAuthenticIndexQueue(blur_view); for (x=0; x < (ssize_t) blur_image->columns; x++) { + const double + *magick_restrict k; + double alpha, gamma; @@ -320,9 +323,6 @@ MagickExport Image *AdaptiveBlurImageChannel(const Image *image, DoublePixelPacket pixel; - const double - *magick_restrict k; - ssize_t i, u, @@ -966,14 +966,17 @@ static void Hull(const Image *image,const ssize_t x_offset, ssize_t y; + assert(image != (const Image *) NULL); + assert(image->signature == MagickCoreSignature); assert(f != (Quantum *) NULL); assert(g != (Quantum *) NULL); - p=f+(columns+2); - q=g+(columns+2); - r=p+(y_offset*((ssize_t) columns+2)+x_offset); + assert(columns <= (MAGICK_SSIZE_MAX-2)); + p=f+(ptrdiff_t) (columns+2); + q=g+(ptrdiff_t) (columns+2); + r=p+(ptrdiff_t) (y_offset*((ssize_t) columns+2)+x_offset); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) \ - magick_number_threads(image,image,rows,1) + magick_number_threads(image,image,rows,2) #endif for (y=0; y < (ssize_t) rows; y++) { @@ -1005,13 +1008,13 @@ static void Hull(const Image *image,const ssize_t x_offset, } } - p=f+(columns+2); - q=g+(columns+2); - r=q+(y_offset*((ssize_t) columns+2)+x_offset); - s=q-(y_offset*((ssize_t) columns+2)+x_offset); + p=f+(ptrdiff_t) (columns+2); + q=g+(ptrdiff_t) (columns+2); + r=q+(ptrdiff_t) (y_offset*((ssize_t) columns+2)+x_offset); + s=q-(ptrdiff_t) (y_offset*((ssize_t) columns+2)+x_offset); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) \ - magick_number_threads(image,image,rows,1) + magick_number_threads(image,image,rows,2) #endif for (y=0; y < (ssize_t) rows; y++) { diff --git a/magick/feature.c b/magick/feature.c index 6b9d760375ac639c70964c7c955864ed90666cd1..921546dcba512abae8b3cd96bd722c790e45ad73 100644 --- a/magick/feature.c +++ b/magick/feature.c @@ -910,7 +910,7 @@ MagickExport ChannelFeatures *GetImageChannelFeatures(const Image *image, continue; } indexes=GetCacheViewVirtualIndexQueue(image_view); - p+=distance; + p+=(ptrdiff_t) distance; indexes+=distance; for (x=0; x < (ssize_t) image->columns; x++) { @@ -1841,7 +1841,8 @@ static Image *RenderHoughLines(const ImageInfo *image_info,const size_t columns, } (void) DrawImage(image,draw_info); draw_info=DestroyDrawInfo(draw_info); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + image=DestroyImageList(image); return(GetFirstImageInList(image)); } diff --git a/magick/fourier.c b/magick/fourier.c index c9a11d58bb73bbd791d3189510bc52dfdb760730..cb5647ac50418ca723b80f01b33fc587397d6292 100644 --- a/magick/fourier.c +++ b/magick/fourier.c @@ -281,31 +281,27 @@ MagickExport Image *ComplexImages(const Image *images,const ComplexOperator op, } for (x=0; x < (ssize_t) columns; x++) { - QuantumPixelPacket - ai = { (Quantum) (QuantumScale*(MagickRealType) GetPixelRed(Ai)), - (Quantum) (QuantumScale*(MagickRealType) GetPixelGreen(Ai)), - (Quantum) (QuantumScale*(MagickRealType) GetPixelBlue(Ai)), - (Quantum) (image->matte != MagickFalse ? QuantumScale* - (MagickRealType) GetPixelOpacity(Ai) : (MagickRealType) - OpaqueOpacity), 0 }, - ar = { (Quantum) (QuantumScale*(MagickRealType) GetPixelRed(Ar)), - (Quantum) (QuantumScale*(MagickRealType) GetPixelGreen(Ar)), - (Quantum) (QuantumScale*(MagickRealType) GetPixelBlue(Ar)), - (Quantum) (image->matte != MagickFalse ? QuantumScale* - (MagickRealType) GetPixelOpacity(Ar) : (MagickRealType) - OpaqueOpacity), 0 }, - bi = { (Quantum) (QuantumScale*(MagickRealType) GetPixelRed(Bi)), - (Quantum) (QuantumScale*(MagickRealType) GetPixelGreen(Bi)), - (Quantum) (QuantumScale*(MagickRealType) GetPixelBlue(Bi)), - (Quantum) (image->matte != MagickFalse ? QuantumScale* - (MagickRealType) GetPixelOpacity(Bi) : (MagickRealType) - OpaqueOpacity), 0 }, - br = { (Quantum) (QuantumScale*(MagickRealType) GetPixelRed(Br)), - (Quantum) (QuantumScale*(MagickRealType) GetPixelGreen(Br)), - (Quantum) (QuantumScale*(MagickRealType) GetPixelBlue(Br)), - (Quantum) (image->matte != MagickFalse ? QuantumScale* - (MagickRealType) GetPixelOpacity(Br) : (MagickRealType) - OpaqueOpacity), 0 }, + DoublePixelPacket + ai = { (double) (QuantumScale*(double) GetPixelRed(Ai)), + (double) (QuantumScale*(double) GetPixelGreen(Ai)), + (double) (QuantumScale*(double) GetPixelBlue(Ai)), + (double) (image->matte != MagickFalse ? QuantumScale* + (double) GetPixelOpacity(Ai) : (double) OpaqueOpacity), 0 }, + ar = { (double) (QuantumScale*(double) GetPixelRed(Ar)), + (double) (QuantumScale*(double) GetPixelGreen(Ar)), + (double) (QuantumScale*(double) GetPixelBlue(Ar)), + (double) (image->matte != MagickFalse ? QuantumScale* + (double) GetPixelOpacity(Ar) : (double) OpaqueOpacity), 0 }, + bi = { (double) (QuantumScale*(double) GetPixelRed(Bi)), + (double) (QuantumScale*(double) GetPixelGreen(Bi)), + (double) (QuantumScale*(double) GetPixelBlue(Bi)), + (double) (image->matte != MagickFalse ? QuantumScale* + (double) GetPixelOpacity(Bi) : (double) OpaqueOpacity), 0 }, + br = { (double) (QuantumScale*(double) GetPixelRed(Br)), + (double) (QuantumScale*(double) GetPixelGreen(Br)), + (double) (QuantumScale*(double) GetPixelBlue(Br)), + (double) (image->matte != MagickFalse ? QuantumScale* + (double) GetPixelOpacity(Br) : (double) OpaqueOpacity), 0 }, ci, cr; diff --git a/magick/fx.c b/magick/fx.c index 60422598b310fcefe2f3d218cc8fd7aff99183d2..a026d13ef9d7ba6212916d962ad42210d92a0489 100644 --- a/magick/fx.c +++ b/magick/fx.c @@ -148,9 +148,6 @@ struct _FxInfo RandomInfo *random_info; - MagickSizeType - cycles; - ExceptionInfo *exception; }; @@ -427,7 +424,7 @@ static double FxChannelStatistics(FxInfo *fx_info,const Image *image, (void) GetImageChannelKurtosis(image,channel,&kurtosis,&skewness, exception); - statistic=kurtosis; + statistic=QuantumRange*kurtosis; } if (LocaleNCompare(symbol,"maxima",6) == 0) { @@ -465,7 +462,7 @@ static double FxChannelStatistics(FxInfo *fx_info,const Image *image, (void) GetImageChannelKurtosis(image,channel,&kurtosis,&skewness, exception); - statistic=skewness; + statistic=QuantumRange*skewness; } if (LocaleNCompare(symbol,"standard_deviation",18) == 0) { @@ -740,14 +737,14 @@ static double FxGetSymbol(FxInfo *fx_info,const ChannelType channel, if (color != (MagickPixelPacket *) NULL) { pixel=(*color); - p+=length; + p+=(ptrdiff_t) length; } else if (QueryMagickColor(name,&pixel,fx_info->exception) != MagickFalse) { (void) AddValueToSplayTree(fx_info->colors,ConstantString(name), CloneMagickPixelPacket(&pixel)); - p+=length; + p+=(ptrdiff_t) length; } } } @@ -2166,7 +2163,7 @@ static double FxEvaluateSubexpression(FxInfo *fx_info,const ChannelType channel, FxParseConditional(subexpression,',',p,q); for (alpha=0.0; ; ) { - if (((fx_info->cycles++ % 8192) == 0) && (GetMagickTTL() <= 0)) + if (IsImageTTLExpired(fx_info->images) != MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitFatalError,"TimeLimitExceeded","`%s'", fx_info->images->filename); @@ -2241,7 +2238,7 @@ static double FxEvaluateSubexpression(FxInfo *fx_info,const ChannelType channel, FxParseConditional(subexpression,',',p,q); for (alpha=0.0; ; ) { - if (((fx_info->cycles++ % 8192) == 0) && (GetMagickTTL() <= 0)) + if (IsImageTTLExpired(fx_info->images) != MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitFatalError,"TimeLimitExceeded","`%s'", fx_info->images->filename); @@ -2623,7 +2620,7 @@ static double FxEvaluateSubexpression(FxInfo *fx_info,const ChannelType channel, FxParseConditional(subexpression,',',p,q); for (alpha=0.0; ; ) { - if (((fx_info->cycles++ % 8192) == 0) && (GetMagickTTL() <= 0)) + if (IsImageTTLExpired(fx_info->images) != MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitFatalError,"TimeLimitExceeded","`%s'", fx_info->images->filename); diff --git a/magick/gem-private.h b/magick/gem-private.h index 3289b7829d4093592362cd37bc7cb7732f7e464d..609657979da7ad8618c2178156560838f6a7655b 100644 --- a/magick/gem-private.h +++ b/magick/gem-private.h @@ -97,9 +97,12 @@ static inline void ConvertRGBToXYZ(const Quantum red,const Quantum green, r=QuantumScale*DecodePixelGamma((MagickRealType) red); g=QuantumScale*DecodePixelGamma((MagickRealType) green); b=QuantumScale*DecodePixelGamma((MagickRealType) blue); - *X=0.4124564*r+0.3575761*g+0.1804375*b; - *Y=0.2126729*r+0.7151522*g+0.0721750*b; - *Z=0.0193339*r+0.1191920*g+0.9503041*b; + *X=(0.4123955889674142161*r)+(0.3575834307637148171*g)+ + (0.1804926473817015735*b); + *Y=(0.2125862307855955516*r)+(0.7151703037034108499*g)+ + (0.07220049864333622685*b); + *Z=(0.01929721549174694484*r)+(0.1191838645808485318*g)+ + (0.9504971251315797660*b); } static inline void ConvertXYZToLab(const double X,const double Y,const double Z, @@ -157,14 +160,22 @@ static inline void ConvertXYZToRGB(const double X,const double Y,const double Z, double b, g, + min, r; assert(red != (Quantum *) NULL); assert(green != (Quantum *) NULL); assert(blue != (Quantum *) 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; + r=(3.240969941904521*X)+(-1.537383177570093*Y)+(-0.498610760293*Z); + g=(-0.96924363628087*X)+(1.87596750150772*Y)+(0.041555057407175*Z); + b=(0.055630079696993*X)+(-0.20397695888897*Y)+(1.056971514242878*Z); + min=MagickMin(r,MagickMin(g,b)); + if (min < 0.0) + { + r-=min; + g-=min; + b-=min; + } *red=ClampToQuantum((MagickRealType) EncodePixelGamma((MagickRealType) QuantumRange*r)); *green=ClampToQuantum((MagickRealType) EncodePixelGamma((MagickRealType) diff --git a/magick/gem.c b/magick/gem.c index 78eb3ff58e4b952d65523ac3ebb57ac407ca2eb2..e96ed2bbcefeabbc569c808338ec5eda7d8c33cf 100644 --- a/magick/gem.c +++ b/magick/gem.c @@ -743,8 +743,8 @@ MagickExport void ConvertHWBToRGB(const double hue,const double whiteness, static inline void ConvertLCHabToXYZ(const double luma,const double chroma, const double hue,double *X,double *Y,double *Z) { - ConvertLabToXYZ(luma,chroma*cos(hue*MagickPI/180.0),chroma* - sin(hue*MagickPI/180.0),X,Y,Z); + ConvertLabToXYZ(luma,chroma*cos(DegreesToRadians(hue)),chroma* + sin(DegreesToRadians(hue)),X,Y,Z); } MagickExport void ConvertLCHabToRGB(const double luma,const double chroma, @@ -796,8 +796,8 @@ MagickExport void ConvertLCHabToRGB(const double luma,const double chroma, static inline void ConvertLCHuvToXYZ(const double luma,const double chroma, const double hue,double *X,double *Y,double *Z) { - ConvertLuvToXYZ(luma,chroma*cos(hue*MagickPI/180.0),chroma* - sin(hue*MagickPI/180.0),X,Y,Z); + ConvertLuvToXYZ(luma,chroma*cos(DegreesToRadians(hue)),chroma* + sin(DegreesToRadians(hue)),X,Y,Z); } MagickExport void ConvertLCHuvToRGB(const double luma,const double chroma, @@ -1330,8 +1330,8 @@ static inline void ConvertXYZToLCHab(const double X,const double Y, b; ConvertXYZToLab(X,Y,Z,luma,&a,&b); - *chroma=hypot(255.0*(a-0.5),255.0*(b-0.5))/255.0+0.5; - *hue=180.0*atan2(255.0*(b-0.5),255.0*(a-0.5))/MagickPI/360.0; + *chroma=hypot(a-0.5,b-0.5)/255.0+0.5; + *hue=180.0*atan2(b-0.5,a-0.5)/MagickPI/360.0; if (*hue < 0.0) *hue+=1.0; } diff --git a/magick/geometry.c b/magick/geometry.c index 34afb785602ec25eabcbe73d066340c8253923b2..b9f070ce5d69136fb051109bc773fad4381dd0a0 100644 --- a/magick/geometry.c +++ b/magick/geometry.c @@ -88,25 +88,25 @@ static const PageInfo MagickPagesize("4A0", "4768x6741"), MagickPagesize("2A0", "3370x4768"), MagickPagesize("a0", "2384x3370"), + MagickPagesize("a10", "74x105"), MagickPagesize("a1", "1684x2384"), MagickPagesize("a2", "1191x1684"), MagickPagesize("a3", "842x1191"), - MagickPagesize("a4", "595x842"), MagickPagesize("a4small", "595x842"), + MagickPagesize("a4", "595x842"), MagickPagesize("a5", "420x595"), MagickPagesize("a6", "298x420"), MagickPagesize("a7", "210x298"), MagickPagesize("a8", "147x210"), MagickPagesize("a9", "105x147"), - MagickPagesize("a10", "74x105"), MagickPagesize("archa", "648x864"), MagickPagesize("archb", "864x1296"), MagickPagesize("archC", "1296x1728"), MagickPagesize("archd", "1728x2592"), MagickPagesize("arche", "2592x3456"), MagickPagesize("b0", "2920x4127"), - MagickPagesize("b1", "2064x2920"), MagickPagesize("b10", "91x127"), + MagickPagesize("b1", "2064x2920"), MagickPagesize("b2", "1460x2064"), MagickPagesize("b3", "1032x1460"), MagickPagesize("b4", "729x1032"), @@ -132,8 +132,8 @@ static const PageInfo MagickPagesize("folio", "612x936"), MagickPagesize("halfletter", "396x612"), MagickPagesize("isob0", "2835x4008"), - MagickPagesize("isob1", "2004x2835"), MagickPagesize("isob10", "88x125"), + MagickPagesize("isob1", "2004x2835"), MagickPagesize("isob2", "1417x2004"), MagickPagesize("isob3", "1001x1417"), MagickPagesize("isob4", "709x1001"), @@ -151,8 +151,8 @@ static const PageInfo MagickPagesize("jisb6", "128x182"), MagickPagesize("ledger", "1224x792"), MagickPagesize("legal", "612x1008"), - MagickPagesize("letter", "612x792"), MagickPagesize("lettersmall", "612x792"), + MagickPagesize("letter", "612x792"), MagickPagesize("monarch", "279x540"), MagickPagesize("quarto", "610x780"), MagickPagesize("statement", "396x612"), @@ -492,6 +492,8 @@ MagickExport char *GetPageGeometry(const char *page_geometry) int status; + if (Pagesizes[i].extent == 0) + break; /* sentinel */ status=LocaleNCompare(Pagesizes[i].name,page_geometry,Pagesizes[i].extent); if (status == 0) { diff --git a/magick/histogram.c b/magick/histogram.c index e2d80eaf47f917f03684cbcfdebd26293b95c23e..98b91938b98efd4d8ed454d9fb5852fc4d3b6f0c 100644 --- a/magick/histogram.c +++ b/magick/histogram.c @@ -66,14 +66,14 @@ Define declarations. */ #define MaxTreeDepth 8 -#define NodesInAList 1536 +#define HNodesInAList 1536 /* Typedef declarations. */ -typedef struct _NodeInfo +typedef struct _HNodeInfo { - struct _NodeInfo + struct _HNodeInfo *child[16]; ColorPacket @@ -87,20 +87,20 @@ typedef struct _NodeInfo size_t level; -} NodeInfo; +} HNodeInfo; -typedef struct _Nodes +typedef struct _HNodes { - NodeInfo - nodes[NodesInAList]; + HNodeInfo + nodes[HNodesInAList]; - struct _Nodes + struct _HNodes *next; -} Nodes; +} HNodes; -typedef struct _CubeInfo +typedef struct _HCubeInfo { - NodeInfo + HNodeInfo *root; ssize_t @@ -113,24 +113,24 @@ typedef struct _CubeInfo colors, free_nodes; - NodeInfo + HNodeInfo *node_info; - Nodes + HNodes *node_queue; -} CubeInfo; +} HCubeInfo; /* Forward declarations. */ -static CubeInfo - *GetCubeInfo(void); +static HCubeInfo + *GetHCubeInfo(void); -static NodeInfo - *GetNodeInfo(CubeInfo *,const size_t); +static HNodeInfo + *GetHNodeInfo(HCubeInfo *,const size_t); static void - DestroyColorCube(const Image *,NodeInfo *); + DestroyColorCube(const Image *,HNodeInfo *); /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -143,13 +143,13 @@ static void % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% ClassifyImageColors() builds a populated CubeInfo tree for the specified -% image. The returned tree should be deallocated using DestroyCubeInfo() +% ClassifyImageColors() builds a populated HCubeInfo tree for the specified +% image. The returned tree should be deallocated using DestroyHCubeInfo() % once it is no longer needed. % % The format of the ClassifyImageColors() method is: % -% CubeInfo *ClassifyImageColors(const Image *image, +% HCubeInfo *ClassifyImageColors(const Image *image, % ExceptionInfo *exception) % % A description of each parameter follows. @@ -160,7 +160,7 @@ static void % */ -static inline size_t ColorToNodeId(const Image *image, +static inline size_t ColorToHNodeId(const Image *image, const MagickPixelPacket *pixel,size_t index) { size_t @@ -205,7 +205,7 @@ static inline MagickBooleanType IsMagickColorMatch(const MagickPixelPacket *p, } -static CubeInfo *ClassifyImageColors(const Image *image, +static HCubeInfo *ClassifyImageColors(const Image *image, ExceptionInfo *exception) { #define EvaluateImageTag " Compute image colors... " @@ -213,7 +213,7 @@ static CubeInfo *ClassifyImageColors(const Image *image, CacheView *image_view; - CubeInfo + HCubeInfo *cube_info; MagickBooleanType @@ -223,7 +223,7 @@ static CubeInfo *ClassifyImageColors(const Image *image, pixel, target; - NodeInfo + HNodeInfo *node_info; const IndexPacket @@ -251,8 +251,8 @@ static CubeInfo *ClassifyImageColors(const Image *image, assert(image->signature == MagickCoreSignature); if (IsEventLogging() != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - cube_info=GetCubeInfo(); - if (cube_info == (CubeInfo *) NULL) + cube_info=GetHCubeInfo(); + if (cube_info == (HCubeInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename); @@ -277,11 +277,11 @@ static CubeInfo *ClassifyImageColors(const Image *image, for (level=1; level < MaxTreeDepth; level++) { SetMagickPixelPacket(image,p,indexes+x,&pixel); - id=ColorToNodeId(image,&pixel,index); - if (node_info->child[id] == (NodeInfo *) NULL) + id=ColorToHNodeId(image,&pixel,index); + if (node_info->child[id] == (HNodeInfo *) NULL) { - node_info->child[id]=GetNodeInfo(cube_info,level); - if (node_info->child[id] == (NodeInfo *) NULL) + node_info->child[id]=GetHNodeInfo(cube_info,level); + if (node_info->child[id] == (HNodeInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'", @@ -359,20 +359,20 @@ static CubeInfo *ClassifyImageColors(const Image *image, % % The format of the DefineImageHistogram method is: % -% DefineImageHistogram(const Image *image,NodeInfo *node_info, +% DefineImageHistogram(const Image *image,HNodeInfo *node_info, % ColorPacket **unique_colors) % % A description of each parameter follows. % % o image: the image. % -% o node_info: the address of a structure of type NodeInfo which points to a +% o node_info: the address of a structure of type HNodeInfo which points to a % node in the color cube tree that is to be pruned. % % o histogram: the image histogram. % */ -static void DefineImageHistogram(const Image *image,NodeInfo *node_info, +static void DefineImageHistogram(const Image *image,HNodeInfo *node_info, ColorPacket **histogram) { ssize_t @@ -386,7 +386,7 @@ static void DefineImageHistogram(const Image *image,NodeInfo *node_info, */ number_children=image->matte == MagickFalse ? 8UL : 16UL; for (i=0; i < (ssize_t) number_children; i++) - if (node_info->child[i] != (NodeInfo *) NULL) + if (node_info->child[i] != (HNodeInfo *) NULL) DefineImageHistogram(image,node_info->child[i],histogram); if (node_info->level == (MaxTreeDepth-1)) { @@ -416,22 +416,22 @@ static void DefineImageHistogram(const Image *image,NodeInfo *node_info, % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% DestroyCubeInfo() deallocates memory associated with a CubeInfo structure. +% DestroyHCubeInfo() deallocates memory associated with a HCubeInfo structure. % -% The format of the DestroyCubeInfo method is: +% The format of the DestroyHCubeInfo method is: % -% DestroyCubeInfo(const Image *image,CubeInfo *cube_info) +% DestroyHCubeInfo(const Image *image,HCubeInfo *cube_info) % % A description of each parameter follows: % % o image: the image. % -% o cube_info: the address of a structure of type CubeInfo. +% o cube_info: the address of a structure of type HCubeInfo. % */ -static CubeInfo *DestroyCubeInfo(const Image *image,CubeInfo *cube_info) +static HCubeInfo *DestroyHCubeInfo(const Image *image,HCubeInfo *cube_info) { - Nodes + HNodes *nodes; /* @@ -441,11 +441,11 @@ static CubeInfo *DestroyCubeInfo(const Image *image,CubeInfo *cube_info) do { nodes=cube_info->node_queue->next; - cube_info->node_queue=(Nodes *) + cube_info->node_queue=(HNodes *) RelinquishMagickMemory(cube_info->node_queue); cube_info->node_queue=nodes; - } while (cube_info->node_queue != (Nodes *) NULL); - return((CubeInfo *) RelinquishMagickMemory(cube_info)); + } while (cube_info->node_queue != (HNodes *) NULL); + return((HCubeInfo *) RelinquishMagickMemory(cube_info)); } /* @@ -464,17 +464,17 @@ static CubeInfo *DestroyCubeInfo(const Image *image,CubeInfo *cube_info) % % The format of the DestroyColorCube method is: % -% void DestroyColorCube(const Image *image,const NodeInfo *node_info) +% void DestroyColorCube(const Image *image,const HNodeInfo *node_info) % % A description of each parameter follows. % % o image: the image. % -% o node_info: the address of a structure of type NodeInfo which points to a +% o node_info: the address of a structure of type HNodeInfo which points to a % node in the color cube tree that is to be pruned. % */ -static void DestroyColorCube(const Image *image,NodeInfo *node_info) +static void DestroyColorCube(const Image *image,HNodeInfo *node_info) { ssize_t i; @@ -487,7 +487,7 @@ static void DestroyColorCube(const Image *image,NodeInfo *node_info) */ number_children=image->matte == MagickFalse ? 8UL : 16UL; for (i=0; i < (ssize_t) number_children; i++) - if (node_info->child[i] != (NodeInfo *) NULL) + if (node_info->child[i] != (HNodeInfo *) NULL) DestroyColorCube(image,node_info->child[i]); if (node_info->list != (ColorPacket *) NULL) node_info->list=(ColorPacket *) RelinquishMagickMemory(node_info->list); @@ -504,35 +504,35 @@ static void DestroyColorCube(const Image *image,NodeInfo *node_info) % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% GetCubeInfo() initializes the CubeInfo data structure. +% GetHCubeInfo() initializes the HCubeInfo data structure. % -% The format of the GetCubeInfo method is: +% The format of the GetHCubeInfo method is: % -% cube_info=GetCubeInfo() +% cube_info=GetHCubeInfo() % % A description of each parameter follows. % % o cube_info: A pointer to the Cube structure. % */ -static CubeInfo *GetCubeInfo(void) +static HCubeInfo *GetHCubeInfo(void) { - CubeInfo + HCubeInfo *cube_info; /* Initialize tree to describe color cube. */ - cube_info=(CubeInfo *) AcquireMagickMemory(sizeof(*cube_info)); - if (cube_info == (CubeInfo *) NULL) - return((CubeInfo *) NULL); + cube_info=(HCubeInfo *) AcquireMagickMemory(sizeof(*cube_info)); + if (cube_info == (HCubeInfo *) NULL) + return((HCubeInfo *) NULL); (void) memset(cube_info,0,sizeof(*cube_info)); /* Initialize root node. */ - cube_info->root=GetNodeInfo(cube_info,0); - if (cube_info->root == (NodeInfo *) NULL) - return((CubeInfo *) NULL); + cube_info->root=GetHNodeInfo(cube_info,0); + if (cube_info->root == (HNodeInfo *) NULL) + return((HCubeInfo *) NULL); return(cube_info); } @@ -569,13 +569,13 @@ MagickExport ColorPacket *GetImageHistogram(const Image *image, ColorPacket *histogram; - CubeInfo + HCubeInfo *cube_info; *number_colors=0; histogram=(ColorPacket *) NULL; cube_info=ClassifyImageColors(image,exception); - if (cube_info != (CubeInfo *) NULL) + if (cube_info != (HCubeInfo *) NULL) { histogram=(ColorPacket *) AcquireQuantumMemory((size_t) cube_info->colors+1,sizeof(*histogram)); @@ -591,7 +591,7 @@ MagickExport ColorPacket *GetImageHistogram(const Image *image, root=histogram; DefineImageHistogram(image,cube_info->root,&root); } - cube_info=DestroyCubeInfo(image,cube_info); + cube_info=DestroyHCubeInfo(image,cube_info); } return(histogram); } @@ -607,40 +607,40 @@ MagickExport ColorPacket *GetImageHistogram(const Image *image, % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% GetNodeInfo() allocates memory for a new node in the color cube tree and +% GetHNodeInfo() allocates memory for a new node in the color cube tree and % presets all fields to zero. % -% The format of the GetNodeInfo method is: +% The format of the GetHNodeInfo method is: % -% NodeInfo *GetNodeInfo(CubeInfo *cube_info,const size_t level) +% HNodeInfo *GetHNodeInfo(HCubeInfo *cube_info,const size_t level) % % A description of each parameter follows. % -% o cube_info: A pointer to the CubeInfo structure. +% o cube_info: A pointer to the HCubeInfo structure. % % o level: Specifies the level in the storage_class the node resides. % */ -static NodeInfo *GetNodeInfo(CubeInfo *cube_info,const size_t level) +static HNodeInfo *GetHNodeInfo(HCubeInfo *cube_info,const size_t level) { - NodeInfo + HNodeInfo *node_info; if (cube_info->free_nodes == 0) { - Nodes + HNodes *nodes; /* Allocate a new nodes of nodes. */ - nodes=(Nodes *) AcquireMagickMemory(sizeof(*nodes)); - if (nodes == (Nodes *) NULL) - return((NodeInfo *) NULL); + nodes=(HNodes *) AcquireMagickMemory(sizeof(*nodes)); + if (nodes == (HNodes *) NULL) + return((HNodeInfo *) NULL); nodes->next=cube_info->node_queue; cube_info->node_queue=nodes; cube_info->node_info=nodes->nodes; - cube_info->free_nodes=NodesInAList; + cube_info->free_nodes=HNodesInAList; } cube_info->free_nodes--; node_info=cube_info->node_info++; @@ -682,7 +682,7 @@ static MagickBooleanType CheckImageColors(const Image *image, CacheView *image_view; - CubeInfo + HCubeInfo *cube_info; MagickPixelPacket @@ -698,7 +698,7 @@ static MagickBooleanType CheckImageColors(const Image *image, ssize_t x; - NodeInfo + HNodeInfo *node_info; ssize_t @@ -717,8 +717,8 @@ static MagickBooleanType CheckImageColors(const Image *image, /* Initialize color description tree. */ - cube_info=GetCubeInfo(); - if (cube_info == (CubeInfo *) NULL) + cube_info=GetHCubeInfo(); + if (cube_info == (HCubeInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename); @@ -745,11 +745,11 @@ static MagickBooleanType CheckImageColors(const Image *image, for (level=1; level < MaxTreeDepth; level++) { SetMagickPixelPacket(image,p,indexes+x,&pixel); - id=ColorToNodeId(image,&pixel,index); - if (node_info->child[id] == (NodeInfo *) NULL) + id=ColorToHNodeId(image,&pixel,index); + if (node_info->child[id] == (HNodeInfo *) NULL) { - node_info->child[id]=GetNodeInfo(cube_info,level); - if (node_info->child[id] == (NodeInfo *) NULL) + node_info->child[id]=GetHNodeInfo(cube_info,level); + if (node_info->child[id] == (HNodeInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'", @@ -805,7 +805,7 @@ static MagickBooleanType CheckImageColors(const Image *image, break; } image_view=DestroyCacheView(image_view); - cube_info=DestroyCubeInfo(image,cube_info); + cube_info=DestroyHCubeInfo(image,cube_info); return(y < (ssize_t) image->rows ? MagickFalse : MagickTrue); } @@ -853,7 +853,7 @@ MagickExport MagickBooleanType IsHistogramImage(const Image *image, CacheView *image_view; - CubeInfo + HCubeInfo *cube_info; MagickPixelPacket @@ -869,7 +869,7 @@ MagickExport MagickBooleanType IsHistogramImage(const Image *image, ssize_t x; - NodeInfo + HNodeInfo *node_info; ssize_t @@ -895,8 +895,8 @@ MagickExport MagickBooleanType IsHistogramImage(const Image *image, /* Initialize color description tree. */ - cube_info=GetCubeInfo(); - if (cube_info == (CubeInfo *) NULL) + cube_info=GetHCubeInfo(); + if (cube_info == (HCubeInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename); @@ -921,11 +921,11 @@ MagickExport MagickBooleanType IsHistogramImage(const Image *image, for (level=1; level < MaxTreeDepth; level++) { SetMagickPixelPacket(image,p,indexes+x,&pixel); - id=ColorToNodeId(image,&pixel,index); - if (node_info->child[id] == (NodeInfo *) NULL) + id=ColorToHNodeId(image,&pixel,index); + if (node_info->child[id] == (HNodeInfo *) NULL) { - node_info->child[id]=GetNodeInfo(cube_info,level); - if (node_info->child[id] == (NodeInfo *) NULL) + node_info->child[id]=GetHNodeInfo(cube_info,level); + if (node_info->child[id] == (HNodeInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'", @@ -981,7 +981,7 @@ MagickExport MagickBooleanType IsHistogramImage(const Image *image, break; } image_view=DestroyCacheView(image_view); - cube_info=DestroyCubeInfo(image,cube_info); + cube_info=DestroyHCubeInfo(image,cube_info); return(y < (ssize_t) image->rows ? MagickFalse : MagickTrue); } @@ -1233,14 +1233,14 @@ MagickExport size_t GetNumberColors(const Image *image,FILE *file, number_colors=0; if (file == (FILE *) NULL) { - CubeInfo + HCubeInfo *cube_info; cube_info=ClassifyImageColors(image,exception); - if (cube_info != (CubeInfo *) NULL) + if (cube_info != (HCubeInfo *) NULL) { number_colors=cube_info->colors; - cube_info=DestroyCubeInfo(image,cube_info); + cube_info=DestroyHCubeInfo(image,cube_info); } return(number_colors); } @@ -1322,7 +1322,7 @@ MagickExport size_t GetNumberColors(const Image *image,FILE *file, */ static void UniqueColorsToImage(Image *unique_image,CacheView *unique_view, - CubeInfo *cube_info,const NodeInfo *node_info,ExceptionInfo *exception) + HCubeInfo *cube_info,const HNodeInfo *node_info,ExceptionInfo *exception) { #define UniqueColorsImageTag "UniqueColors/Image" @@ -1340,7 +1340,7 @@ static void UniqueColorsToImage(Image *unique_image,CacheView *unique_view, */ number_children=unique_image->matte == MagickFalse ? 8UL : 16UL; for (i=0; i < (ssize_t) number_children; i++) - if (node_info->child[i] != (NodeInfo *) NULL) + if (node_info->child[i] != (HNodeInfo *) NULL) UniqueColorsToImage(unique_image,unique_view,cube_info, node_info->child[i],exception); if (node_info->level == (MaxTreeDepth-1)) @@ -1393,14 +1393,14 @@ MagickExport Image *UniqueImageColors(const Image *image, CacheView *unique_view; - CubeInfo + HCubeInfo *cube_info; Image *unique_image; cube_info=ClassifyImageColors(image,exception); - if (cube_info == (CubeInfo *) NULL) + if (cube_info == (HCubeInfo *) NULL) return((Image *) NULL); unique_image=CloneImage(image,cube_info->colors,1,MagickTrue,exception); if (unique_image == (Image *) NULL) @@ -1415,6 +1415,6 @@ MagickExport Image *UniqueImageColors(const Image *image, UniqueColorsToImage(unique_image,unique_view,cube_info,cube_info->root, exception); unique_view=DestroyCacheView(unique_view); - cube_info=DestroyCubeInfo(image,cube_info); + cube_info=DestroyHCubeInfo(image,cube_info); return(unique_image); } diff --git a/magick/identify.c b/magick/identify.c index 154210a05f9d5039c7d986cfc2b0c5056acb77f6..5890629656da72e1b9d6baa557c9d2e0cf07e11f 100644 --- a/magick/identify.c +++ b/magick/identify.c @@ -93,6 +93,7 @@ #include "magick/string_.h" #include "magick/string-private.h" #include "magick/timer.h" +#include "magick/timer-private.h" #include "magick/token.h" #include "magick/utility.h" #include "magick/version.h" @@ -522,6 +523,9 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, ImageType type; + int + expired; + MagickBooleanType ping; @@ -1465,6 +1469,29 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, image->rows/elapsed_time+0.5),MagickFalse,format); (void) FormatLocaleFile(file," Pixels per second: %s\n",format); } + if (image->ttl != (time_t) 0) + { + char + iso8601[sizeof("9999-99-99T99:99:99Z")]; + + int + seconds; + + struct tm + timestamp; + + (void) GetMagickUTCTime(&image->ttl,×tamp); + (void) strftime(iso8601,sizeof(iso8601),"%Y-%m-%dT%H:%M:%SZ",×tamp); + seconds=MagickMax((int)(image->ttl-GetMagickTime()),0); + expired=' '; + if (seconds == 0) + expired='*'; + (void) FormatLocaleFile(file," Time-to-live: %g:%02g:%02g:%02g%c %s\n", + ceil((double) (seconds/(3600*24))), + ceil((double) ((seconds % (24*3600))/3600)), + ceil((double) ((seconds % 3600)/60)), + ceil((double) ((seconds % 3600) % 60)),expired,iso8601); + } (void) FormatLocaleFile(file," User time: %0.3fu\n",user_time); (void) FormatLocaleFile(file," Elapsed time: %lu:%02lu.%03lu\n", (unsigned long) (elapsed_time/60.0),(unsigned long) ceil(fmod( diff --git a/magick/image-private.h b/magick/image-private.h index 8e037c71812b0e1ba2fc440b4cde37c1016bbbea..040baf0f13c3f5f2688a11f55928e8370695e38a 100644 --- a/magick/image-private.h +++ b/magick/image-private.h @@ -65,22 +65,33 @@ extern "C" { static inline ssize_t CastDoubleToLong(const double x) { + double + value; + if (IsNaN(x) != 0) { errno=ERANGE; return(0); } - if (floor(x) > ((double) MAGICK_SSIZE_MAX-1)) + if (x < 0.0) { - errno=ERANGE; - return((ssize_t) MAGICK_SSIZE_MAX); + value=ceil(x); + if (value < ((double) MAGICK_SSIZE_MIN)) + { + errno=ERANGE; + return((ssize_t) MAGICK_SSIZE_MIN); + } } - if (ceil(x) < ((double) MAGICK_SSIZE_MIN+1)) + else { - errno=ERANGE; - return((ssize_t) MAGICK_SSIZE_MIN); + value=floor(x); + if (value > ((double) MAGICK_SSIZE_MAX)) + { + errno=ERANGE; + return((ssize_t) MAGICK_SSIZE_MAX); + } } - return((ssize_t) x); + return((ssize_t) value); } static inline QuantumAny CastDoubleToQuantumAny(const double x) @@ -105,22 +116,26 @@ static inline QuantumAny CastDoubleToQuantumAny(const double x) static inline size_t CastDoubleToUnsigned(const double x) { + double + value; + if (IsNaN(x) != 0) { errno=ERANGE; return(0); } - if (floor(x) > ((double) MAGICK_SSIZE_MAX-1)) + value=floor(x); + if (value >= ((double) MAGICK_SIZE_MAX)) { errno=ERANGE; return((size_t) MAGICK_SIZE_MAX); } - if (ceil(x) < 0.0) + if (value < 0.0) { errno=ERANGE; return(0); } - return((size_t) x); + return((size_t) value); } static inline double DegreesToRadians(const double degrees) diff --git a/magick/image.c b/magick/image.c index 115918867cae6ada00f42fd88540ba9bfea5a604..68b0a2130747d50891ea763b60ad0c5c42f7c74d 100644 --- a/magick/image.c +++ b/magick/image.c @@ -136,6 +136,9 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info) Image *image; + int + time_limit; + MagickStatusType flags; @@ -181,6 +184,9 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info) image->blob=CloneBlobInfo((BlobInfo *) NULL); InitializeExceptionInfo(&image->exception); image->timestamp=GetMagickTime(); + time_limit=(int) GetMagickResourceLimit(TimeResource); + if (time_limit > 0) + image->ttl=image->timestamp+time_limit; image->debug=(GetLogEventMask() & (ImageEvent | TransformEvent | CoderEvent)) != 0 ? MagickTrue : MagickFalse; image->reference_count=1; @@ -520,13 +526,10 @@ MagickExport Image *AppendImages(const Image *images, image_view=AcquireVirtualCacheView(next,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(next,next,next->rows,1) + magick_number_threads(next,next,next->rows,2) #endif for (y=0; y < (ssize_t) next->rows; y++) { - MagickBooleanType - sync; - const IndexPacket *magick_restrict indexes; @@ -536,6 +539,9 @@ MagickExport Image *AppendImages(const Image *images, IndexPacket *magick_restrict append_indexes; + MagickBooleanType + sync; + PixelPacket *magick_restrict q; @@ -839,6 +845,8 @@ MagickExport Image *CloneImage(const Image *image,const size_t columns, clone_image->blob=CloneBlobInfo((BlobInfo *) NULL); } clone_image->ping=image->ping; + clone_image->timestamp=image->timestamp; + clone_image->ttl=image->ttl; clone_image->debug=image->debug; clone_image->semaphore=AllocateSemaphoreInfo(); if (image->colormap != (PixelPacket *) NULL) @@ -1090,7 +1098,7 @@ MagickExport MagickBooleanType CopyImagePixels(Image *image, image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(source_image,image,geometry->height,1) + magick_number_threads(source_image,image,geometry->height,2) #endif for (y=0; y < (ssize_t) geometry->height; y++) { @@ -1822,7 +1830,7 @@ MagickExport MagickBooleanType IsHighDynamicRangeImage(const Image *image, *image_view; MagickBooleanType - status; + hdri = MagickFalse; MagickPixelPacket zero; @@ -1834,12 +1842,11 @@ MagickExport MagickBooleanType IsHighDynamicRangeImage(const Image *image, assert(image->signature == MagickCoreSignature); if (IsEventLogging() != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - status=MagickTrue; GetMagickPixelPacket(image,&zero); image_view=AcquireVirtualCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) - #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,image,image->rows,1) + #pragma omp parallel for schedule(static) shared(hdri) \ + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -1855,14 +1862,11 @@ MagickExport MagickBooleanType IsHighDynamicRangeImage(const Image *image, ssize_t x; - if (status == MagickFalse) + if (hdri != MagickFalse) continue; p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); if (p == (const PixelPacket *) NULL) - { - status=MagickFalse; - continue; - } + continue; indexes=GetCacheViewVirtualIndexQueue(image_view); pixel=zero; for (x=0; x < (ssize_t) image->columns; x++) @@ -1870,34 +1874,34 @@ MagickExport MagickBooleanType IsHighDynamicRangeImage(const Image *image, SetMagickPixelPacket(image,p,indexes+x,&pixel); if ((pixel.red < 0.0) || (pixel.red > (MagickRealType) QuantumRange) || (pixel.red != (QuantumAny) pixel.red)) - break; + hdri=MagickTrue; if ((pixel.green < 0.0) || (pixel.green > (MagickRealType) QuantumRange) || (pixel.green != (QuantumAny) pixel.green)) - break; + hdri=MagickTrue; if ((pixel.blue < 0.0) || (pixel.blue > (MagickRealType) QuantumRange) || (pixel.blue != (QuantumAny) pixel.blue)) - break; + hdri=MagickTrue; if (pixel.matte != MagickFalse) { if ((pixel.opacity < 0.0) || (pixel.opacity > (MagickRealType) QuantumRange) || (pixel.opacity != (QuantumAny) pixel.opacity)) - break; + hdri=MagickTrue; } if (pixel.colorspace == CMYKColorspace) { if ((pixel.index < 0.0) || (pixel.index > (MagickRealType) QuantumRange) || (pixel.index != (QuantumAny) pixel.index)) - break; + hdri=MagickTrue; } + if (hdri != MagickFalse) + break; p++; } - if (x < (ssize_t) image->columns) - status=MagickFalse; } image_view=DestroyCacheView(image_view); - return(status != MagickFalse ? MagickFalse : MagickTrue); + return(hdri); #endif } @@ -2100,7 +2104,7 @@ MagickExport Image *NewMagickImage(const ImageInfo *image_info, image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2304,7 +2308,7 @@ MagickExport MagickBooleanType ResetImagePixels(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2414,6 +2418,10 @@ MagickExport MagickBooleanType SetImageBackgroundColor(Image *image) status=MagickTrue; exception=(&image->exception); image_view=AcquireAuthenticCacheView(image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(status) \ + magick_number_threads(image,image,image->rows,2) +#endif for (y=0; y < (ssize_t) image->rows; y++) { PixelPacket @@ -2534,7 +2542,7 @@ MagickExport MagickBooleanType SetImageColor(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2751,6 +2759,9 @@ MagickExport MagickBooleanType SetImageInfo(ImageInfo *image_info, *q, subimage[MaxTextExtent]; + const char + *p; + const MagicInfo *magic_info; @@ -2766,9 +2777,6 @@ MagickExport MagickBooleanType SetImageInfo(ImageInfo *image_info, MagickBooleanType status; - const char - *p; - ssize_t count; @@ -2983,7 +2991,9 @@ MagickExport MagickBooleanType SetImageInfo(ImageInfo *image_info, image=AcquireImage(image_info); (void) CopyMagickString(image->filename,image_info->filename, MaxTextExtent); - status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); + sans_exception=AcquireExceptionInfo(); + status=OpenBlob(image_info,image,ReadBinaryBlobMode,sans_exception); + sans_exception=DestroyExceptionInfo(sans_exception); if (status == MagickFalse) { image=DestroyImage(image); @@ -2997,7 +3007,8 @@ MagickExport MagickBooleanType SetImageInfo(ImageInfo *image_info, */ *filename='\0'; status=ImageToFile(image,filename,exception); - (void) CloseBlob(image); + if (CloseBlob(image) == MagickFalse) + status=MagickFalse; if (status == MagickFalse) { (void) RelinquishUniqueFileResource(filename); @@ -3217,7 +3228,7 @@ MagickExport MagickBooleanType SetImageOpacity(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,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -3695,7 +3706,7 @@ MagickExport MagickBooleanType SyncImage(Image *image) image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(range_exception,status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { diff --git a/magick/image.h b/magick/image.h index 0dbd4d2e2d433cf807b3efa66e216272be39b200..018d30683926d4f5de44b212b19d0dc954978ad0 100644 --- a/magick/image.h +++ b/magick/image.h @@ -27,25 +27,6 @@ extern "C" { #define OpaqueOpacity ((Quantum) 0UL) #define TransparentOpacity (QuantumRange) -typedef enum -{ - UndefinedAlphaChannel, - ActivateAlphaChannel, - BackgroundAlphaChannel, - CopyAlphaChannel, - DeactivateAlphaChannel, - ExtractAlphaChannel, - OpaqueAlphaChannel, - ResetAlphaChannel, /* deprecated */ - SetAlphaChannel, - ShapeAlphaChannel, - TransparentAlphaChannel, - FlattenAlphaChannel, - RemoveAlphaChannel, - AssociateAlphaChannel, - DisassociateAlphaChannel -} AlphaChannelType; - typedef enum { UndefinedType, @@ -356,6 +337,9 @@ struct _Image long tietz_offset; + + time_t + ttl; }; struct _ImageInfo diff --git a/magick/list.c b/magick/list.c index 19b2a3403c8ac556b715994cb1330a3bcb910d81..d768effd4f193cc0ad311cbe2bd37b0aa72d7350 100644 --- a/magick/list.c +++ b/magick/list.c @@ -219,15 +219,14 @@ MagickExport Image *CloneImages(const Image *images,const char *scenes, *clone_images, *image; - ssize_t - i; - size_t length; ssize_t first, + i, last, + offset, step; assert(images != (const Image *) NULL); @@ -249,6 +248,7 @@ MagickExport Image *CloneImages(const Image *images,const char *scenes, while ((isspace((int) ((unsigned char) *p)) != 0) || (*p == ',')) p++; first=(ssize_t) strtol(p,&p,10); + offset=first; if (first < 0) first+=(ssize_t) length; else @@ -294,7 +294,7 @@ MagickExport Image *CloneImages(const Image *images,const char *scenes, } if (match == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(),OptionError, - "InvalidImageIndex","`%s'",images->filename); + "InvalidImageIndex","%g `%s'",(double) offset,images->filename); } } return(GetFirstImageInList(clone_images)); @@ -719,7 +719,7 @@ MagickExport ssize_t GetImageIndexInList(const Image *images) */ MagickExport size_t GetImageListLength(const Image *images) { - ssize_t + size_t i; if (images == (Image *) NULL) @@ -733,7 +733,7 @@ MagickExport size_t GetImageListLength(const Image *images) assert(images != images->previous); i++; } - return((size_t) i); + return(i); } /* diff --git a/magick/log.c b/magick/log.c index 08bcbd743a0163788e67d39a25ee1274eb78c173..4564fc946e77c8555fb146b24d83ecc7c4ea9304 100644 --- a/magick/log.c +++ b/magick/log.c @@ -1113,22 +1113,22 @@ static char *TranslateEvent(const LogEventType magick_unused(type), { case 'c': { - q+=CopyMagickString(q,GetClientName(),extent); + q+=(ptrdiff_t) CopyMagickString(q,GetClientName(),extent); break; } case 'd': { - q+=CopyMagickString(q,domain,extent); + q+=(ptrdiff_t) CopyMagickString(q,domain,extent); break; } case 'e': { - q+=CopyMagickString(q,event,extent); + q+=(ptrdiff_t) CopyMagickString(q,event,extent); break; } case 'f': { - q+=CopyMagickString(q,function,extent); + q+=(ptrdiff_t) CopyMagickString(q,function,extent); break; } case 'g': @@ -1139,19 +1139,19 @@ static char *TranslateEvent(const LogEventType magick_unused(type), q++; break; } - q+=FormatLocaleString(q,extent,"%.20g",(double) (log_info->generation % + q+=(ptrdiff_t) FormatLocaleString(q,extent,"%.20g",(double) (log_info->generation % log_info->generations)); break; } case 'i': { - q+=FormatLocaleString(q,extent,"%.20g",(double) + q+=(ptrdiff_t) FormatLocaleString(q,extent,"%.20g",(double) GetMagickThreadSignature()); break; } case 'l': { - q+=FormatLocaleString(q,extent,"%.20g",(double) line); + q+=(ptrdiff_t) FormatLocaleString(q,extent,"%.20g",(double) line); break; } case 'm': @@ -1165,39 +1165,39 @@ static char *TranslateEvent(const LogEventType magick_unused(type), p++; break; } - q+=CopyMagickString(q,p,extent); + q+=(ptrdiff_t) CopyMagickString(q,p,extent); break; } case 'n': { - q+=CopyMagickString(q,GetLogName(),extent); + q+=(ptrdiff_t) CopyMagickString(q,GetLogName(),extent); break; } case 'p': { - q+=FormatLocaleString(q,extent,"%.20g",(double) getpid()); + q+=(ptrdiff_t) FormatLocaleString(q,extent,"%.20g",(double) getpid()); break; } case 'r': { - q+=FormatLocaleString(q,extent,"%lu:%02lu.%03lu",(unsigned long) + q+=(ptrdiff_t) FormatLocaleString(q,extent,"%lu:%02lu.%03lu",(unsigned long) (elapsed_time/60.0),(unsigned long) floor(fmod(elapsed_time,60.0)), (unsigned long) (1000.0*(elapsed_time-floor(elapsed_time))+0.5)); break; } case 't': { - q+=FormatMagickTime(seconds,extent,q); + q+=(ptrdiff_t) FormatMagickTime(seconds,extent,q); break; } case 'u': { - q+=FormatLocaleString(q,extent,"%0.3fu",user_time); + q+=(ptrdiff_t) FormatLocaleString(q,extent,"%0.3fu",user_time); break; } case 'v': { - q+=CopyMagickString(q,MagickLibVersionText,extent); + q+=(ptrdiff_t) CopyMagickString(q,MagickLibVersionText,extent); break; } case '%': @@ -1278,7 +1278,7 @@ static char *TranslateFilename(const LogInfo *log_info) } case 'c': { - q+=CopyMagickString(q,GetClientName(),extent); + q+=(ptrdiff_t) CopyMagickString(q,GetClientName(),extent); break; } case 'g': @@ -1289,23 +1289,23 @@ static char *TranslateFilename(const LogInfo *log_info) q++; break; } - q+=FormatLocaleString(q,extent,"%.20g",(double) (log_info->generation % + q+=(ptrdiff_t) FormatLocaleString(q,extent,"%.20g",(double) (log_info->generation % log_info->generations)); break; } case 'n': { - q+=CopyMagickString(q,GetLogName(),extent); + q+=(ptrdiff_t) CopyMagickString(q,GetLogName(),extent); break; } case 'p': { - q+=FormatLocaleString(q,extent,"%.20g",(double) getpid()); + q+=(ptrdiff_t) FormatLocaleString(q,extent,"%.20g",(double) getpid()); break; } case 'v': { - q+=CopyMagickString(q,MagickLibVersionText,extent); + q+=(ptrdiff_t) CopyMagickString(q,MagickLibVersionText,extent); break; } case '%': diff --git a/magick/magic.c b/magick/magic.c index aad6d11ab033294e9ef03477e637d7651021bfec..b05af6f96f1685203a4b9cfdbd05058277eac941 100644 --- a/magick/magic.c +++ b/magick/magic.c @@ -90,6 +90,7 @@ static const MagicMapInfo { "8BIMTEXT", 0, MagicPattern("8BIM#") }, { "8BIM", 0, MagicPattern("8BIM") }, { "AVIF", 4, MagicPattern("ftypavif") }, + { "AVIF", 4, MagicPattern("ftypavis") }, { "BMP", 0, MagicPattern("BA") }, { "BMP", 0, MagicPattern("BM") }, { "BMP", 0, MagicPattern("CI") }, @@ -103,6 +104,8 @@ static const MagicMapInfo { "CALS", 8, MagicPattern("rorient:") }, { "CGM", 0, MagicPattern("BEGMF") }, { "CIN", 0, MagicPattern("\200\052\137\327") }, + { "CR2", 0, MagicPattern("II\x2a\x00\x10\x00\x00\x00CR\x02") }, + { "CR2", 0, MagicPattern("MM\x00\x2a\x00\x10\x00\x00RC\x02") }, { "CRW", 0, MagicPattern("II\x1a\x00\x00\x00HEAPCCDR") }, { "DCM", 128, MagicPattern("DICM") }, { "DCX", 0, MagicPattern("\261\150\336\72") }, @@ -127,7 +130,13 @@ static const MagicMapInfo { "HDR", 0, MagicPattern("#?RGBE") }, { "HEIC", 4, MagicPattern("ftypheic") }, { "HEIC", 4, MagicPattern("ftypheix") }, + { "HEIC", 4, MagicPattern("ftyphevc") }, + { "HEIC", 4, MagicPattern("ftypheim") }, + { "HEIC", 4, MagicPattern("ftypheis") }, + { "HEIC", 4, MagicPattern("ftyphevm") }, + { "HEIC", 4, MagicPattern("ftyphevs") }, { "HEIC", 4, MagicPattern("ftypmif1") }, + { "HEIC", 4, MagicPattern("ftypmsf1") }, { "HPGL", 0, MagicPattern("IN;") }, { "HTML", 1, MagicPattern("HTML") }, { "HTML", 1, MagicPattern("html") }, @@ -179,6 +188,8 @@ static const MagicMapInfo { "PSD", 0, MagicPattern("8BPS") }, { "PWP", 0, MagicPattern("SFW95") }, { "RAF", 0, MagicPattern("FUJIFILMCCD-RAW ") }, + { "RAW", 0, MagicPattern("IIU\x00\x08\x00\x00\x00") }, + { "RW2", 0, MagicPattern("IIU\x00\x18\x00\x00\x00") }, { "RLE", 0, MagicPattern("\122\314") }, { "SCT", 0, MagicPattern("CT") }, { "SFW", 0, MagicPattern("SFW94") }, @@ -991,7 +1002,7 @@ static MagickBooleanType LoadMagicCache(LinkedListInfo *cache,const char *xml, *end; *q++=(unsigned char) strtol(p,&end,8); - p+=(end-p); + p+=(ptrdiff_t) (end-p); magic_info->length++; continue; } diff --git a/magick/magick-baseconfig.h b/magick/magick-baseconfig.h index 0b62e6f65f931872faad2ff524d5f4c64ac6debc..3980a2754a71a21460d331ec521257e14583b21c 100644 --- a/magick/magick-baseconfig.h +++ b/magick/magick-baseconfig.h @@ -94,12 +94,12 @@ /* Define if you have GVC library */ /* #undef GVC_DELEGATE */ -/* Define to 1 if you have the `acosh' function. */ +/* Define to 1 if you have the 'acosh' function. */ #ifndef MAGICKCORE_HAVE_ACOSH #define MAGICKCORE_HAVE_ACOSH 1 #endif -/* Define to 1 if you have the `aligned_malloc' function. */ +/* Define to 1 if you have the 'aligned_malloc' function. */ /* #undef HAVE_ALIGNED_MALLOC */ /* Define to 1 if you have the header file. */ @@ -110,22 +110,22 @@ #define MAGICKCORE_HAVE_ARPA_INET_H 1 #endif -/* Define to 1 if you have the `asinh' function. */ +/* Define to 1 if you have the 'asinh' function. */ #ifndef MAGICKCORE_HAVE_ASINH #define MAGICKCORE_HAVE_ASINH 1 #endif -/* Define to 1 if you have the `atanh' function. */ +/* Define to 1 if you have the 'atanh' function. */ #ifndef MAGICKCORE_HAVE_ATANH #define MAGICKCORE_HAVE_ATANH 1 #endif -/* Define to 1 if you have the `atexit' function. */ +/* Define to 1 if you have the 'atexit' function. */ #ifndef MAGICKCORE_HAVE_ATEXIT #define MAGICKCORE_HAVE_ATEXIT 1 #endif -/* Define to 1 if you have the `atoll' function. */ +/* Define to 1 if you have the 'atoll' function. */ #ifndef MAGICKCORE_HAVE_ATOLL #define MAGICKCORE_HAVE_ATOLL 1 #endif @@ -135,32 +135,32 @@ #define MAGICKCORE_HAVE_BOOL /**/ #endif -/* Define to 1 if you have the `cabs' function. */ +/* Define to 1 if you have the 'cabs' function. */ #ifndef MAGICKCORE_HAVE_CABS #define MAGICKCORE_HAVE_CABS 1 #endif -/* Define to 1 if you have the `carg' function. */ +/* Define to 1 if you have the 'carg' function. */ #ifndef MAGICKCORE_HAVE_CARG #define MAGICKCORE_HAVE_CARG 1 #endif -/* Define to 1 if you have the `cimag' function. */ +/* Define to 1 if you have the 'cimag' function. */ #ifndef MAGICKCORE_HAVE_CIMAG #define MAGICKCORE_HAVE_CIMAG 1 #endif -/* Define to 1 if you have the `clock' function. */ +/* Define to 1 if you have the 'clock' function. */ #ifndef MAGICKCORE_HAVE_CLOCK #define MAGICKCORE_HAVE_CLOCK 1 #endif -/* Define to 1 if you have the `clock_getres' function. */ +/* Define to 1 if you have the 'clock_getres' function. */ #ifndef MAGICKCORE_HAVE_CLOCK_GETRES #define MAGICKCORE_HAVE_CLOCK_GETRES 1 #endif -/* Define to 1 if you have the `clock_gettime' function. */ +/* Define to 1 if you have the 'clock_gettime' function. */ #ifndef MAGICKCORE_HAVE_CLOCK_GETTIME #define MAGICKCORE_HAVE_CLOCK_GETTIME 1 #endif @@ -178,54 +178,54 @@ #define MAGICKCORE_HAVE_COMPLEX_H 1 #endif -/* Define to 1 if you have the `creal' function. */ +/* Define to 1 if you have the 'creal' function. */ #ifndef MAGICKCORE_HAVE_CREAL #define MAGICKCORE_HAVE_CREAL 1 #endif -/* Define to 1 if you have the `ctime_r' function. */ +/* Define to 1 if you have the 'ctime_r' function. */ #ifndef MAGICKCORE_HAVE_CTIME_R #define MAGICKCORE_HAVE_CTIME_R 1 #endif -/* Define to 1 if you have the declaration of `pread', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'pread', and to 0 if you don't. */ #ifndef MAGICKCORE_HAVE_DECL_PREAD #define MAGICKCORE_HAVE_DECL_PREAD 1 #endif -/* Define to 1 if you have the declaration of `pwrite', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'pwrite', and to 0 if you don't. */ #ifndef MAGICKCORE_HAVE_DECL_PWRITE #define MAGICKCORE_HAVE_DECL_PWRITE 1 #endif -/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you +/* Define to 1 if you have the declaration of 'strerror_r', and to 0 if you don't. */ #ifndef MAGICKCORE_HAVE_DECL_STRERROR_R #define MAGICKCORE_HAVE_DECL_STRERROR_R 1 #endif -/* Define to 1 if you have the declaration of `strlcpy', and to 0 if you +/* Define to 1 if you have the declaration of 'strlcpy', and to 0 if you don't. */ #ifndef MAGICKCORE_HAVE_DECL_STRLCPY #define MAGICKCORE_HAVE_DECL_STRLCPY 0 #endif -/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'tzname', and to 0 if you don't. */ /* #undef HAVE_DECL_TZNAME */ -/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you +/* Define to 1 if you have the declaration of 'vsnprintf', and to 0 if you don't. */ #ifndef MAGICKCORE_HAVE_DECL_VSNPRINTF #define MAGICKCORE_HAVE_DECL_VSNPRINTF 1 #endif -/* Define to 1 if you have the `directio' function. */ +/* Define to 1 if you have the 'directio' function. */ /* #undef HAVE_DIRECTIO */ -/* Define to 1 if you have the header file, and it defines `DIR'. +/* Define to 1 if you have the header file, and it defines 'DIR'. */ #ifndef MAGICKCORE_HAVE_DIRENT_H #define MAGICKCORE_HAVE_DIRENT_H 1 @@ -236,7 +236,7 @@ #define MAGICKCORE_HAVE_DLFCN_H 1 #endif -/* Define to 1 if you have the `erf' function. */ +/* Define to 1 if you have the 'erf' function. */ #ifndef MAGICKCORE_HAVE_ERF #define MAGICKCORE_HAVE_ERF 1 #endif @@ -246,12 +246,12 @@ #define MAGICKCORE_HAVE_ERRNO_H 1 #endif -/* Define to 1 if you have the `execvp' function. */ +/* Define to 1 if you have the 'execvp' function. */ #ifndef MAGICKCORE_HAVE_EXECVP #define MAGICKCORE_HAVE_EXECVP 1 #endif -/* Define to 1 if you have the `fchmod' function. */ +/* Define to 1 if you have the 'fchmod' function. */ #ifndef MAGICKCORE_HAVE_FCHMOD #define MAGICKCORE_HAVE_FCHMOD 1 #endif @@ -266,85 +266,85 @@ #define MAGICKCORE_HAVE_FLOAT_H 1 #endif -/* Define to 1 if you have the `floor' function. */ +/* Define to 1 if you have the 'floor' function. */ #ifndef MAGICKCORE_HAVE_FLOOR #define MAGICKCORE_HAVE_FLOOR 1 #endif -/* Define to 1 if you have the `fork' function. */ +/* Define to 1 if you have the 'fork' function. */ #ifndef MAGICKCORE_HAVE_FORK #define MAGICKCORE_HAVE_FORK 1 #endif -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +/* Define to 1 if fseeko (and ftello) are declared in stdio.h. */ #ifndef MAGICKCORE_HAVE_FSEEKO #define MAGICKCORE_HAVE_FSEEKO 1 #endif -/* Define to 1 if you have the `ftime' function. */ +/* Define to 1 if you have the 'ftime' function. */ #ifndef MAGICKCORE_HAVE_FTIME #define MAGICKCORE_HAVE_FTIME 1 #endif -/* Define to 1 if you have the `ftruncate' function. */ +/* Define to 1 if you have the 'ftruncate' function. */ #ifndef MAGICKCORE_HAVE_FTRUNCATE #define MAGICKCORE_HAVE_FTRUNCATE 1 #endif -/* Define to 1 if you have the `getcwd' function. */ +/* Define to 1 if you have the 'getcwd' function. */ #ifndef MAGICKCORE_HAVE_GETCWD #define MAGICKCORE_HAVE_GETCWD 1 #endif -/* Define to 1 if you have the `getc_unlocked' function. */ +/* Define to 1 if you have the 'getc_unlocked' function. */ #ifndef MAGICKCORE_HAVE_GETC_UNLOCKED #define MAGICKCORE_HAVE_GETC_UNLOCKED 1 #endif -/* Define to 1 if you have the `getdtablesize' function. */ +/* Define to 1 if you have the 'getdtablesize' function. */ #ifndef MAGICKCORE_HAVE_GETDTABLESIZE #define MAGICKCORE_HAVE_GETDTABLESIZE 1 #endif -/* Define to 1 if you have the `getentropy' function. */ +/* Define to 1 if you have the 'getentropy' function. */ #ifndef MAGICKCORE_HAVE_GETENTROPY #define MAGICKCORE_HAVE_GETENTROPY 1 #endif -/* Define to 1 if you have the `getexecname' function. */ +/* Define to 1 if you have the 'getexecname' function. */ /* #undef HAVE_GETEXECNAME */ -/* Define to 1 if you have the `getpagesize' function. */ +/* Define to 1 if you have the 'getpagesize' function. */ #ifndef MAGICKCORE_HAVE_GETPAGESIZE #define MAGICKCORE_HAVE_GETPAGESIZE 1 #endif -/* Define to 1 if you have the `getpid' function. */ +/* Define to 1 if you have the 'getpid' function. */ #ifndef MAGICKCORE_HAVE_GETPID #define MAGICKCORE_HAVE_GETPID 1 #endif -/* Define to 1 if you have the `getpwnam_r' function. */ +/* Define to 1 if you have the 'getpwnam_r' function. */ #ifndef MAGICKCORE_HAVE_GETPWNAM_R #define MAGICKCORE_HAVE_GETPWNAM_R 1 #endif -/* Define to 1 if you have the `getrlimit' function. */ +/* Define to 1 if you have the 'getrlimit' function. */ #ifndef MAGICKCORE_HAVE_GETRLIMIT #define MAGICKCORE_HAVE_GETRLIMIT 1 #endif -/* Define to 1 if you have the `getrusage' function. */ +/* Define to 1 if you have the 'getrusage' function. */ #ifndef MAGICKCORE_HAVE_GETRUSAGE #define MAGICKCORE_HAVE_GETRUSAGE 1 #endif -/* Define to 1 if you have the `gettimeofday' function. */ +/* Define to 1 if you have the 'gettimeofday' function. */ #ifndef MAGICKCORE_HAVE_GETTIMEOFDAY #define MAGICKCORE_HAVE_GETTIMEOFDAY 1 #endif -/* Define to 1 if you have the `gmtime_r' function. */ +/* Define to 1 if you have the 'gmtime_r' function. */ #ifndef MAGICKCORE_HAVE_GMTIME_R #define MAGICKCORE_HAVE_GMTIME_R 1 #endif @@ -352,12 +352,12 @@ /* [Compile with hugepage support] */ /* #undef HAVE_HUGEPAGES */ -/* Define to 1 if the system has the type `intmax_t'. */ +/* Define to 1 if the system has the type 'intmax_t'. */ #ifndef MAGICKCORE_HAVE_INTMAX_T #define MAGICKCORE_HAVE_INTMAX_T 1 #endif -/* Define to 1 if the system has the type `intptr_t'. */ +/* Define to 1 if the system has the type 'intptr_t'. */ #ifndef MAGICKCORE_HAVE_INTPTR_T #define MAGICKCORE_HAVE_INTPTR_T 1 #endif @@ -367,17 +367,17 @@ #define MAGICKCORE_HAVE_INTTYPES_H 1 #endif -/* Define to 1 if you have the `isnan' function. */ +/* Define to 1 if you have the 'isnan' function. */ #ifndef MAGICKCORE_HAVE_ISNAN #define MAGICKCORE_HAVE_ISNAN 1 #endif -/* Define to 1 if you have the `j0' function. */ +/* Define to 1 if you have the 'j0' function. */ #ifndef MAGICKCORE_HAVE_J0 #define MAGICKCORE_HAVE_J0 1 #endif -/* Define to 1 if you have the `j1' function. */ +/* Define to 1 if you have the 'j1' function. */ #ifndef MAGICKCORE_HAVE_J1 #define MAGICKCORE_HAVE_J1 1 #endif @@ -393,7 +393,7 @@ /* Define if you have the header file. */ /* #undef HAVE_LCMS2_LCMS2_H */ -/* Define to 1 if you have the `gcov' library (-lgcov). */ +/* Define to 1 if you have the 'gcov' library (-lgcov). */ /* #undef HAVE_LIBGCOV */ /* Define to 1 if you have the header file. */ @@ -411,7 +411,7 @@ #define MAGICKCORE_HAVE_LINUX_UNISTD_H 1 #endif -/* Define to 1 if you have the `lltostr' function. */ +/* Define to 1 if you have the 'lltostr' function. */ /* #undef HAVE_LLTOSTR */ /* Define to 1 if you have the header file. */ @@ -419,17 +419,17 @@ #define MAGICKCORE_HAVE_LOCALE_H 1 #endif -/* Define to 1 if you have the `localtime_r' function. */ +/* Define to 1 if you have the 'localtime_r' function. */ #ifndef MAGICKCORE_HAVE_LOCALTIME_R #define MAGICKCORE_HAVE_LOCALTIME_R 1 #endif -/* Define to 1 if the system has the type `long long int'. */ +/* Define to 1 if the system has the type 'long long int'. */ #ifndef MAGICKCORE_HAVE_LONG_LONG_INT #define MAGICKCORE_HAVE_LONG_LONG_INT 1 #endif -/* Define to 1 if you have the `lstat' function. */ +/* Define to 1 if you have the 'lstat' function. */ #ifndef MAGICKCORE_HAVE_LSTAT #define MAGICKCORE_HAVE_LSTAT 1 #endif @@ -450,12 +450,12 @@ #define MAGICKCORE_HAVE_MBSTATE_T 1 #endif -/* Define to 1 if you have the `memmove' function. */ +/* Define to 1 if you have the 'memmove' function. */ #ifndef MAGICKCORE_HAVE_MEMMOVE #define MAGICKCORE_HAVE_MEMMOVE 1 #endif -/* Define to 1 if you have the `memset' function. */ +/* Define to 1 if you have the 'memset' function. */ #ifndef MAGICKCORE_HAVE_MEMSET #define MAGICKCORE_HAVE_MEMSET 1 #endif @@ -463,17 +463,17 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_MINIX_CONFIG_H */ -/* Define to 1 if you have the `mkdir' function. */ +/* Define to 1 if you have the 'mkdir' function. */ #ifndef MAGICKCORE_HAVE_MKDIR #define MAGICKCORE_HAVE_MKDIR 1 #endif -/* Define to 1 if you have the `mkstemp' function. */ +/* Define to 1 if you have the 'mkstemp' function. */ #ifndef MAGICKCORE_HAVE_MKSTEMP #define MAGICKCORE_HAVE_MKSTEMP 1 #endif -/* Define to 1 if you have a working `mmap' system call. */ +/* Define to 1 if you have a working 'mmap' system call. */ #ifndef MAGICKCORE_HAVE_MMAP #define MAGICKCORE_HAVE_MMAP 1 #endif @@ -481,7 +481,7 @@ /* Define if you have the mtmalloc memory allocation library */ /* #undef HAVE_MTMALLOC */ -/* Define to 1 if you have the `munmap' function. */ +/* Define to 1 if you have the 'munmap' function. */ #ifndef MAGICKCORE_HAVE_MUNMAP #define MAGICKCORE_HAVE_MUNMAP 1 #endif @@ -496,12 +496,12 @@ #define MAGICKCORE_HAVE_NAMESPACE_STD /**/ #endif -/* Define to 1 if you have the `nanosleep' function. */ +/* Define to 1 if you have the 'nanosleep' function. */ #ifndef MAGICKCORE_HAVE_NANOSLEEP #define MAGICKCORE_HAVE_NANOSLEEP 1 #endif -/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* Define to 1 if you have the header file, and it defines 'DIR'. */ /* #undef HAVE_NDIR_H */ /* Define to 1 if you have the header file. */ @@ -514,7 +514,7 @@ #define MAGICKCORE_HAVE_NETINET_IN_H 1 #endif -/* Define to 1 if you have the `newlocale' function. */ +/* Define to 1 if you have the 'newlocale' function. */ #ifndef MAGICKCORE_HAVE_NEWLOCALE #define MAGICKCORE_HAVE_NEWLOCALE 1 #endif @@ -525,52 +525,52 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_OS_H */ -/* Define to 1 if you have the `pclose' function. */ +/* Define to 1 if you have the 'pclose' function. */ #ifndef MAGICKCORE_HAVE_PCLOSE #define MAGICKCORE_HAVE_PCLOSE 1 #endif -/* Define to 1 if you have the `poll' function. */ +/* Define to 1 if you have the 'poll' function. */ #ifndef MAGICKCORE_HAVE_POLL #define MAGICKCORE_HAVE_POLL 1 #endif -/* Define to 1 if you have the `popen' function. */ +/* Define to 1 if you have the 'popen' function. */ #ifndef MAGICKCORE_HAVE_POPEN #define MAGICKCORE_HAVE_POPEN 1 #endif -/* Define to 1 if you have the `posix_fadvise' function. */ +/* Define to 1 if you have the 'posix_fadvise' function. */ #ifndef MAGICKCORE_HAVE_POSIX_FADVISE #define MAGICKCORE_HAVE_POSIX_FADVISE 1 #endif -/* Define to 1 if you have the `posix_fallocate' function. */ +/* Define to 1 if you have the 'posix_fallocate' function. */ #ifndef MAGICKCORE_HAVE_POSIX_FALLOCATE #define MAGICKCORE_HAVE_POSIX_FALLOCATE 1 #endif -/* Define to 1 if you have the `posix_madvise' function. */ +/* Define to 1 if you have the 'posix_madvise' function. */ #ifndef MAGICKCORE_HAVE_POSIX_MADVISE #define MAGICKCORE_HAVE_POSIX_MADVISE 1 #endif -/* Define to 1 if you have the `posix_memalign' function. */ +/* Define to 1 if you have the 'posix_memalign' function. */ #ifndef MAGICKCORE_HAVE_POSIX_MEMALIGN #define MAGICKCORE_HAVE_POSIX_MEMALIGN 1 #endif -/* Define to 1 if you have the `posix_spawnp' function. */ +/* Define to 1 if you have the 'posix_spawnp' function. */ #ifndef MAGICKCORE_HAVE_POSIX_SPAWNP #define MAGICKCORE_HAVE_POSIX_SPAWNP 1 #endif -/* Define to 1 if you have the `pow' function. */ +/* Define to 1 if you have the 'pow' function. */ #ifndef MAGICKCORE_HAVE_POW #define MAGICKCORE_HAVE_POW 1 #endif -/* Define to 1 if you have the `pread' function. */ +/* Define to 1 if you have the 'pread' function. */ #ifndef MAGICKCORE_HAVE_PREAD #define MAGICKCORE_HAVE_PREAD 1 #endif @@ -588,96 +588,100 @@ #define MAGICKCORE_HAVE_PTHREAD_PRIO_INHERIT 1 #endif -/* Define to 1 if you have the `putenv' function. */ +/* Define to 1 if you have the 'putenv' function. */ #ifndef MAGICKCORE_HAVE_PUTENV #define MAGICKCORE_HAVE_PUTENV 1 #endif -/* Define to 1 if you have the `pwrite' function. */ +/* Define to 1 if you have the 'pwrite' function. */ #ifndef MAGICKCORE_HAVE_PWRITE #define MAGICKCORE_HAVE_PWRITE 1 #endif -/* Define to 1 if you have the `qsort_r' function. */ +/* Define to 1 if you have the 'qsort_r' function. */ #ifndef MAGICKCORE_HAVE_QSORT_R #define MAGICKCORE_HAVE_QSORT_R 1 #endif -/* Define to 1 if you have the `raise' function. */ +/* Define to 1 if you have the 'raise' function. */ #ifndef MAGICKCORE_HAVE_RAISE #define MAGICKCORE_HAVE_RAISE 1 #endif -/* Define to 1 if you have the `rand_r' function. */ +/* Define to 1 if you have the 'rand_r' function. */ #ifndef MAGICKCORE_HAVE_RAND_R #define MAGICKCORE_HAVE_RAND_R 1 #endif -/* Define to 1 if you have the `readlink' function. */ +/* Define to 1 if you have the 'readlink' function. */ #ifndef MAGICKCORE_HAVE_READLINK #define MAGICKCORE_HAVE_READLINK 1 #endif -/* Define to 1 if you have the `realpath' function. */ +/* Define to 1 if you have the 'realpath' function. */ #ifndef MAGICKCORE_HAVE_REALPATH #define MAGICKCORE_HAVE_REALPATH 1 #endif -/* Define to 1 if you have the `seekdir' function. */ +/* Define to 1 if you have the 'seekdir' function. */ #ifndef MAGICKCORE_HAVE_SEEKDIR #define MAGICKCORE_HAVE_SEEKDIR 1 #endif -/* Define to 1 if you have the `select' function. */ +/* Define to 1 if you have the 'select' function. */ #ifndef MAGICKCORE_HAVE_SELECT #define MAGICKCORE_HAVE_SELECT 1 #endif -/* Define to 1 if you have the `sendfile' function. */ +/* Define to 1 if you have the 'sendfile' function. */ #ifndef MAGICKCORE_HAVE_SENDFILE #define MAGICKCORE_HAVE_SENDFILE 1 #endif -/* Define to 1 if you have the `setlocale' function. */ +/* Define to 1 if you have the 'setlocale' function. */ #ifndef MAGICKCORE_HAVE_SETLOCALE #define MAGICKCORE_HAVE_SETLOCALE 1 #endif -/* Define to 1 if you have the `setvbuf' function. */ +/* Define to 1 if you have the 'setvbuf' function. */ #ifndef MAGICKCORE_HAVE_SETVBUF #define MAGICKCORE_HAVE_SETVBUF 1 #endif /* X11 server supports shape extension */ -/* #undef HAVE_SHAPE */ +#ifndef MAGICKCORE_HAVE_SHAPE +#define MAGICKCORE_HAVE_SHAPE 1 +#endif /* X11 server supports shared memory extension */ -/* #undef HAVE_SHARED_MEMORY */ +#ifndef MAGICKCORE_HAVE_SHARED_MEMORY +#define MAGICKCORE_HAVE_SHARED_MEMORY 1 +#endif -/* Define to 1 if you have the `sigaction' function. */ +/* Define to 1 if you have the 'sigaction' function. */ #ifndef MAGICKCORE_HAVE_SIGACTION #define MAGICKCORE_HAVE_SIGACTION 1 #endif -/* Define to 1 if you have the `sigemptyset' function. */ +/* Define to 1 if you have the 'sigemptyset' function. */ #ifndef MAGICKCORE_HAVE_SIGEMPTYSET #define MAGICKCORE_HAVE_SIGEMPTYSET 1 #endif -/* Define to 1 if you have the `socket' function. */ +/* Define to 1 if you have the 'socket' function. */ #ifndef MAGICKCORE_HAVE_SOCKET #define MAGICKCORE_HAVE_SOCKET 1 #endif -/* Define to 1 if you have the `spawnvp' function. */ +/* Define to 1 if you have the 'spawnvp' function. */ /* #undef HAVE_SPAWNVP */ -/* Define to 1 if you have the `sqrt' function. */ +/* Define to 1 if you have the 'sqrt' function. */ #ifndef MAGICKCORE_HAVE_SQRT #define MAGICKCORE_HAVE_SQRT 1 #endif -/* Define to 1 if you have the `stat' function. */ +/* Define to 1 if you have the 'stat' function. */ #ifndef MAGICKCORE_HAVE_STAT #define MAGICKCORE_HAVE_STAT 1 #endif @@ -712,37 +716,37 @@ #define MAGICKCORE_HAVE_STDLIB_H 1 #endif -/* Define to 1 if you have the `strcasecmp' function. */ +/* Define to 1 if you have the 'strcasecmp' function. */ #ifndef MAGICKCORE_HAVE_STRCASECMP #define MAGICKCORE_HAVE_STRCASECMP 1 #endif -/* Define to 1 if you have the `strcasestr' function. */ +/* Define to 1 if you have the 'strcasestr' function. */ #ifndef MAGICKCORE_HAVE_STRCASESTR #define MAGICKCORE_HAVE_STRCASESTR 1 #endif -/* Define to 1 if you have the `strchr' function. */ +/* Define to 1 if you have the 'strchr' function. */ #ifndef MAGICKCORE_HAVE_STRCHR #define MAGICKCORE_HAVE_STRCHR 1 #endif -/* Define to 1 if you have the `strcspn' function. */ +/* Define to 1 if you have the 'strcspn' function. */ #ifndef MAGICKCORE_HAVE_STRCSPN #define MAGICKCORE_HAVE_STRCSPN 1 #endif -/* Define to 1 if you have the `strdup' function. */ +/* Define to 1 if you have the 'strdup' function. */ #ifndef MAGICKCORE_HAVE_STRDUP #define MAGICKCORE_HAVE_STRDUP 1 #endif -/* Define to 1 if you have the `strerror' function. */ +/* Define to 1 if you have the 'strerror' function. */ #ifndef MAGICKCORE_HAVE_STRERROR #define MAGICKCORE_HAVE_STRERROR 1 #endif -/* Define if you have `strerror_r'. */ +/* Define if you have 'strerror_r'. */ #ifndef MAGICKCORE_HAVE_STRERROR_R #define MAGICKCORE_HAVE_STRERROR_R 1 #endif @@ -762,58 +766,62 @@ #define MAGICKCORE_HAVE_STRING_H 1 #endif -/* Define to 1 if you have the `strlcat' function. */ -/* #undef HAVE_STRLCAT */ +/* Define to 1 if you have the 'strlcat' function. */ +#ifndef MAGICKCORE_HAVE_STRLCAT +#define MAGICKCORE_HAVE_STRLCAT 1 +#endif -/* Define to 1 if you have the `strlcpy' function. */ -/* #undef HAVE_STRLCPY */ +/* Define to 1 if you have the 'strlcpy' function. */ +#ifndef MAGICKCORE_HAVE_STRLCPY +#define MAGICKCORE_HAVE_STRLCPY 1 +#endif -/* Define to 1 if you have the `strncasecmp' function. */ +/* Define to 1 if you have the 'strncasecmp' function. */ #ifndef MAGICKCORE_HAVE_STRNCASECMP #define MAGICKCORE_HAVE_STRNCASECMP 1 #endif -/* Define to 1 if you have the `strpbrk' function. */ +/* Define to 1 if you have the 'strpbrk' function. */ #ifndef MAGICKCORE_HAVE_STRPBRK #define MAGICKCORE_HAVE_STRPBRK 1 #endif -/* Define to 1 if you have the `strrchr' function. */ +/* Define to 1 if you have the 'strrchr' function. */ #ifndef MAGICKCORE_HAVE_STRRCHR #define MAGICKCORE_HAVE_STRRCHR 1 #endif -/* Define to 1 if you have the `strspn' function. */ +/* Define to 1 if you have the 'strspn' function. */ #ifndef MAGICKCORE_HAVE_STRSPN #define MAGICKCORE_HAVE_STRSPN 1 #endif -/* Define to 1 if you have the `strstr' function. */ +/* Define to 1 if you have the 'strstr' function. */ #ifndef MAGICKCORE_HAVE_STRSTR #define MAGICKCORE_HAVE_STRSTR 1 #endif -/* Define to 1 if you have the `strtod' function. */ +/* Define to 1 if you have the 'strtod' function. */ #ifndef MAGICKCORE_HAVE_STRTOD #define MAGICKCORE_HAVE_STRTOD 1 #endif -/* Define to 1 if you have the `strtod_l' function. */ +/* Define to 1 if you have the 'strtod_l' function. */ #ifndef MAGICKCORE_HAVE_STRTOD_L #define MAGICKCORE_HAVE_STRTOD_L 1 #endif -/* Define to 1 if you have the `strtol' function. */ +/* Define to 1 if you have the 'strtol' function. */ #ifndef MAGICKCORE_HAVE_STRTOL #define MAGICKCORE_HAVE_STRTOL 1 #endif -/* Define to 1 if you have the `strtoul' function. */ +/* Define to 1 if you have the 'strtoul' function. */ #ifndef MAGICKCORE_HAVE_STRTOUL #define MAGICKCORE_HAVE_STRTOUL 1 #endif -/* Define to 1 if `tm_zone' is a member of `struct tm'. */ +/* Define to 1 if 'tm_zone' is a member of 'struct tm'. */ #ifndef MAGICKCORE_HAVE_STRUCT_TM_TM_ZONE #define MAGICKCORE_HAVE_STRUCT_TM_TM_ZONE 1 #endif @@ -821,22 +829,22 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_SUN_PREFETCH_H */ -/* Define to 1 if you have the `symlink' function. */ +/* Define to 1 if you have the 'symlink' function. */ #ifndef MAGICKCORE_HAVE_SYMLINK #define MAGICKCORE_HAVE_SYMLINK 1 #endif -/* Define to 1 if you have the `sysconf' function. */ +/* Define to 1 if you have the 'sysconf' function. */ #ifndef MAGICKCORE_HAVE_SYSCONF #define MAGICKCORE_HAVE_SYSCONF 1 #endif -/* Define to 1 if you have the `system' function. */ +/* Define to 1 if you have the 'system' function. */ #ifndef MAGICKCORE_HAVE_SYSTEM #define MAGICKCORE_HAVE_SYSTEM 1 #endif -/* Define to 1 if you have the header file, and it defines `DIR'. +/* Define to 1 if you have the header file, and it defines 'DIR'. */ /* #undef HAVE_SYS_DIR_H */ @@ -850,7 +858,7 @@ #define MAGICKCORE_HAVE_SYS_MMAN_H 1 #endif -/* Define to 1 if you have the header file, and it defines `DIR'. +/* Define to 1 if you have the header file, and it defines 'DIR'. */ /* #undef HAVE_SYS_NDIR_H */ @@ -910,92 +918,42 @@ /* Define if you have the tcmalloc memory allocation library */ /* #undef HAVE_TCMALLOC */ -/* Define to 1 if you have the `telldir' function. */ +/* Define to 1 if you have the 'telldir' function. */ #ifndef MAGICKCORE_HAVE_TELLDIR #define MAGICKCORE_HAVE_TELLDIR 1 #endif -/* Define to 1 if you have the `tempnam' function. */ +/* Define to 1 if you have the 'tempnam' function. */ #ifndef MAGICKCORE_HAVE_TEMPNAM #define MAGICKCORE_HAVE_TEMPNAM 1 #endif -/* Define to 1 if you have the header file. */ -#ifndef MAGICKCORE_HAVE_TIFFCONF_H -#define MAGICKCORE_HAVE_TIFFCONF_H 1 -#endif - -/* Define to 1 if you have the `TIFFIsBigEndian' function. */ -#ifndef MAGICKCORE_HAVE_TIFFISBIGENDIAN -#define MAGICKCORE_HAVE_TIFFISBIGENDIAN 1 -#endif - -/* Define to 1 if you have the `TIFFIsCODECConfigured' function. */ -#ifndef MAGICKCORE_HAVE_TIFFISCODECCONFIGURED -#define MAGICKCORE_HAVE_TIFFISCODECCONFIGURED 1 -#endif - -/* Define to 1 if you have the `TIFFMergeFieldInfo' function. */ -#ifndef MAGICKCORE_HAVE_TIFFMERGEFIELDINFO -#define MAGICKCORE_HAVE_TIFFMERGEFIELDINFO 1 -#endif - -/* Define to 1 if you have the `TIFFReadEXIFDirectory' function. */ -#ifndef MAGICKCORE_HAVE_TIFFREADEXIFDIRECTORY -#define MAGICKCORE_HAVE_TIFFREADEXIFDIRECTORY 1 -#endif - -/* Define to 1 if you have the `TIFFReadGPSDirectory' function. */ -#ifndef MAGICKCORE_HAVE_TIFFREADGPSDIRECTORY -#define MAGICKCORE_HAVE_TIFFREADGPSDIRECTORY 1 -#endif - -/* Define to 1 if you have the `TIFFSetErrorHandlerExt' function. */ -#ifndef MAGICKCORE_HAVE_TIFFSETERRORHANDLEREXT -#define MAGICKCORE_HAVE_TIFFSETERRORHANDLEREXT 1 -#endif - -/* Define to 1 if you have the `TIFFSetTagExtender' function. */ -#ifndef MAGICKCORE_HAVE_TIFFSETTAGEXTENDER -#define MAGICKCORE_HAVE_TIFFSETTAGEXTENDER 1 -#endif - -/* Define to 1 if you have the `TIFFSetWarningHandlerExt' function. */ -#ifndef MAGICKCORE_HAVE_TIFFSETWARNINGHANDLEREXT -#define MAGICKCORE_HAVE_TIFFSETWARNINGHANDLEREXT 1 -#endif - -/* Define to 1 if you have the `TIFFSwabArrayOfTriples' function. */ -#ifndef MAGICKCORE_HAVE_TIFFSWABARRAYOFTRIPLES -#define MAGICKCORE_HAVE_TIFFSWABARRAYOFTRIPLES 1 -#endif - -/* Define to 1 if you have the `times' function. */ +/* Define to 1 if you have the 'times' function. */ #ifndef MAGICKCORE_HAVE_TIMES #define MAGICKCORE_HAVE_TIMES 1 #endif -/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use - `HAVE_STRUCT_TM_TM_ZONE' instead. */ +/* Define to 1 if your 'struct tm' has 'tm_zone'. Deprecated, use + 'HAVE_STRUCT_TM_TM_ZONE' instead. */ #ifndef MAGICKCORE_HAVE_TM_ZONE #define MAGICKCORE_HAVE_TM_ZONE 1 #endif -/* Define to 1 if you don't have `tm_zone' but do have the external array - `tzname'. */ +/* Define to 1 if you don't have 'tm_zone' but do have the external array + 'tzname'. */ /* #undef HAVE_TZNAME */ -/* Define to 1 if the system has the type `uintmax_t'. */ +/* Define to 1 if the system has the type 'uintmax_t'. */ #ifndef MAGICKCORE_HAVE_UINTMAX_T #define MAGICKCORE_HAVE_UINTMAX_T 1 #endif -/* Define to 1 if the system has the type `uintptr_t'. */ +/* Define to 1 if the system has the type 'uintptr_t'. */ #ifndef MAGICKCORE_HAVE_UINTPTR_T #define MAGICKCORE_HAVE_UINTPTR_T 1 #endif -/* Define to 1 if you have the `ulltostr' function. */ +/* Define to 1 if you have the 'ulltostr' function. */ /* #undef HAVE_ULLTOSTR */ /* Define if you have umem memory allocation library */ @@ -1006,22 +964,22 @@ #define MAGICKCORE_HAVE_UNISTD_H 1 #endif -/* Define to 1 if the system has the type `unsigned long long int'. */ +/* Define to 1 if the system has the type 'unsigned long long int'. */ #ifndef MAGICKCORE_HAVE_UNSIGNED_LONG_LONG_INT #define MAGICKCORE_HAVE_UNSIGNED_LONG_LONG_INT 1 #endif -/* Define to 1 if you have the `uselocale' function. */ +/* Define to 1 if you have the 'uselocale' function. */ #ifndef MAGICKCORE_HAVE_USELOCALE #define MAGICKCORE_HAVE_USELOCALE 1 #endif -/* Define to 1 if you have the `usleep' function. */ +/* Define to 1 if you have the 'usleep' function. */ #ifndef MAGICKCORE_HAVE_USLEEP #define MAGICKCORE_HAVE_USLEEP 1 #endif -/* Define to 1 if you have the `utime' function. */ +/* Define to 1 if you have the 'utime' function. */ #ifndef MAGICKCORE_HAVE_UTIME #define MAGICKCORE_HAVE_UTIME 1 #endif @@ -1031,28 +989,28 @@ #define MAGICKCORE_HAVE_UTIME_H 1 #endif -/* Define to 1 if you have the `vfprintf' function. */ +/* Define to 1 if you have the 'vfprintf' function. */ #ifndef MAGICKCORE_HAVE_VFPRINTF #define MAGICKCORE_HAVE_VFPRINTF 1 #endif -/* Define to 1 if you have the `vfprintf_l' function. */ +/* Define to 1 if you have the 'vfprintf_l' function. */ /* #undef HAVE_VFPRINTF_L */ -/* Define to 1 if you have the `vsnprintf' function. */ +/* Define to 1 if you have the 'vsnprintf' function. */ #ifndef MAGICKCORE_HAVE_VSNPRINTF #define MAGICKCORE_HAVE_VSNPRINTF 1 #endif -/* Define to 1 if you have the `vsnprintf_l' function. */ +/* Define to 1 if you have the 'vsnprintf_l' function. */ /* #undef HAVE_VSNPRINTF_L */ -/* Define to 1 if you have the `vsprintf' function. */ +/* Define to 1 if you have the 'vsprintf' function. */ #ifndef MAGICKCORE_HAVE_VSPRINTF #define MAGICKCORE_HAVE_VSPRINTF 1 #endif -/* Define to 1 if you have the `waitpid' function. */ +/* Define to 1 if you have the 'waitpid' function. */ #ifndef MAGICKCORE_HAVE_WAITPID #define MAGICKCORE_HAVE_WAITPID 1 #endif @@ -1065,32 +1023,32 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_XLOCALE_H */ -/* Define to 1 if you have the `_aligned_malloc' function. */ +/* Define to 1 if you have the '_aligned_malloc' function. */ /* #undef HAVE__ALIGNED_MALLOC */ -/* Define to 1 if the system has the type `_Bool'. */ +/* Define to 1 if the system has the type '_Bool'. */ #ifndef MAGICKCORE_HAVE__BOOL #define MAGICKCORE_HAVE__BOOL 1 #endif -/* Define to 1 if you have the `_exit' function. */ +/* Define to 1 if you have the '_exit' function. */ #ifndef MAGICKCORE_HAVE__EXIT #define MAGICKCORE_HAVE__EXIT 1 #endif -/* Define to 1 if you have the `_NSGetExecutablePath' function. */ +/* Define to 1 if you have the '_NSGetExecutablePath' function. */ /* #undef HAVE__NSGETEXECUTABLEPATH */ -/* Define to 1 if you have the `_pclose' function. */ +/* Define to 1 if you have the '_pclose' function. */ /* #undef HAVE__PCLOSE */ -/* Define to 1 if you have the `_popen' function. */ +/* Define to 1 if you have the '_popen' function. */ /* #undef HAVE__POPEN */ -/* Define to 1 if you have the `_wfopen' function. */ +/* Define to 1 if you have the '_wfopen' function. */ /* #undef HAVE__WFOPEN */ -/* Define to 1 if you have the `_wstat' function. */ +/* Define to 1 if you have the '_wstat' function. */ /* #undef HAVE__WSTAT */ /* define if your compiler has __attribute__ */ @@ -1104,7 +1062,9 @@ #endif /* Define if you have libheif library */ -/* #undef HEIC_DELEGATE */ +#ifndef MAGICKCORE_HEIC_DELEGATE +#define MAGICKCORE_HEIC_DELEGATE 1 +#endif /* Directory where ImageMagick architecture headers live. */ #ifndef MAGICKCORE_INCLUDEARCH_PATH @@ -1135,17 +1095,19 @@ #endif /* Define if you have OPENJP2 library */ -/* #undef LIBOPENJP2_DELEGATE */ +#ifndef MAGICKCORE_LIBOPENJP2_DELEGATE +#define MAGICKCORE_LIBOPENJP2_DELEGATE 1 +#endif /* Directory where architecture-dependent files live. */ -#ifndef MAGICKCORE_LIBRARY_PATH -#define MAGICKCORE_LIBRARY_PATH "/usr/lib64/ImageMagick-6.9.12/" +#ifndef MAGICKCORE_LIBRARY_ABSOLUTE_PATH +#define MAGICKCORE_LIBRARY_ABSOLUTE_PATH "/usr/lib64/ImageMagick-6.9.13/" #endif /* Subdirectory of lib where ImageMagick architecture dependent files are installed. */ #ifndef MAGICKCORE_LIBRARY_RELATIVE_PATH -#define MAGICKCORE_LIBRARY_RELATIVE_PATH "ImageMagick-6.9.12" +#define MAGICKCORE_LIBRARY_RELATIVE_PATH "ImageMagick-6.9.13" #endif /* Binaries in libraries path base name (will be during install linked to bin) @@ -1224,7 +1186,7 @@ /* Define to the full name and version of this package. */ #ifndef MAGICKCORE_PACKAGE_STRING -#define MAGICKCORE_PACKAGE_STRING "ImageMagick 6.9.12-98" +#define MAGICKCORE_PACKAGE_STRING "ImageMagick 6.9.13-25" #endif /* Define to the one symbol short name of this package. */ @@ -1239,7 +1201,7 @@ /* Define to the version of this package. */ #ifndef MAGICKCORE_PACKAGE_VERSION -#define MAGICKCORE_PACKAGE_VERSION "6.9.12-98" +#define MAGICKCORE_PACKAGE_VERSION "6.9.13-25" #endif /* Define if you have PANGOCAIRO library */ @@ -1303,45 +1265,50 @@ #define MAGICKCORE_SHARE_RELATIVE_PATH "ImageMagick-6" #endif -/* The size of `double', as computed by sizeof. */ +/* The size of 'double', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_DOUBLE #define MAGICKCORE_SIZEOF_DOUBLE 8 #endif -/* The size of `double_t', as computed by sizeof. */ +/* The size of 'double_t', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_DOUBLE_T #define MAGICKCORE_SIZEOF_DOUBLE_T 8 #endif -/* The size of `float', as computed by sizeof. */ +/* The size of 'float', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_FLOAT #define MAGICKCORE_SIZEOF_FLOAT 4 #endif -/* The size of `float_t', as computed by sizeof. */ +/* The size of 'float_t', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_FLOAT_T #define MAGICKCORE_SIZEOF_FLOAT_T 4 #endif -/* The size of `long double', as computed by sizeof. */ +/* The size of 'long double', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_LONG_DOUBLE #define MAGICKCORE_SIZEOF_LONG_DOUBLE 16 #endif -/* The size of `unsigned long long', as computed by sizeof. */ +/* The size of 'size_t', as computed by sizeof. */ +#ifndef MAGICKCORE_SIZEOF_SIZE_T +#define MAGICKCORE_SIZEOF_SIZE_T 8 +#endif + +/* The size of 'unsigned long long', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG #define MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG 8 #endif -/* The size of `void *', as computed by sizeof. */ +/* The size of 'void *', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_VOID_P #define MAGICKCORE_SIZEOF_VOID_P 8 #endif -/* Define to 1 if the `S_IS*' macros in do not work properly. */ +/* Define to 1 if the 'S_IS*' macros in do not work properly. */ /* #undef STAT_MACROS_BROKEN */ -/* Define to 1 if all of the C90 standard headers exist (not just the ones +/* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #ifndef MAGICKCORE_STDC_HEADERS @@ -1363,10 +1330,10 @@ #define MAGICKCORE_TIFF_DELEGATE 1 #endif -/* Define to 1 if your declares `struct tm'. */ +/* Define to 1 if your declares 'struct tm'. */ /* #undef TM_IN_SYS_TIME */ -/* Enable extensions on AIX 3, Interix. */ +/* Enable extensions on AIX, Interix, z/OS. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 #endif @@ -1427,11 +1394,15 @@ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # define __STDC_WANT_IEC_60559_DFP_EXT__ 1 #endif +/* Enable extensions specified by C23 Annex F. */ +#ifndef __STDC_WANT_IEC_60559_EXT__ +# define __STDC_WANT_IEC_60559_EXT__ 1 +#endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1 #endif -/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # define __STDC_WANT_IEC_60559_TYPES_EXT__ 1 #endif @@ -1512,7 +1483,9 @@ #endif /* Define if you have ZSTD library */ -/* #undef ZSTD_DELEGATE */ +#ifndef MAGICKCORE_ZSTD_DELEGATE +#define MAGICKCORE_ZSTD_DELEGATE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -1520,12 +1493,15 @@ /* enable run-time bounds-checking */ /* #undef _FORTIFY_SOURCE */ -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* Define to 1 if necessary to make fseeko visible. */ /* #undef _LARGEFILE_SOURCE */ -/* Define for large files, on AIX-style hosts. */ +/* Define to 1 on platforms where this makes off_t a 64-bit type. */ /* #undef _LARGE_FILES */ +/* Number of bits in time_t, on hosts where this is settable. */ +/* #undef _TIME_BITS */ + /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ @@ -1541,22 +1517,25 @@ #define below would cause a syntax error. */ /* #undef _UINT8_T */ -/* Define to 1 if type `char' is unsigned and your compiler does not +/* Define to 1 if type 'char' is unsigned and your compiler does not predefine this macro. */ #ifndef __CHAR_UNSIGNED__ /* # undef __CHAR_UNSIGNED__ */ #endif +/* Define to 1 on platforms where this makes time_t a 64-bit type. */ +/* #undef __MINGW_USE_VC2005_COMPAT */ + /* Define to appropriate substitute if compiler does not have __func__ */ /* #undef __func__ */ -/* Define to empty if `const' does not conform to ANSI C. */ +/* Define to empty if 'const' does not conform to ANSI C. */ /* #undef const */ -/* Define to `int' if doesn't define. */ +/* Define as 'int' if doesn't define. */ /* #undef gid_t */ -/* Define to `__inline__' or `__inline' if that's what the C compiler +/* Define to '__inline__' or '__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ @@ -1589,10 +1568,10 @@ /* Define to a type if does not define. */ /* #undef mbstate_t */ -/* Define to `int' if does not define. */ +/* Define to 'int' if does not define. */ /* #undef mode_t */ -/* Define to `long int' if does not define. */ +/* Define to 'long int' if does not define. */ /* #undef off_t */ /* Define as a signed integer type capable of holding a process identifier. */ @@ -1615,13 +1594,13 @@ # define __restrict__ #endif -/* Define to `unsigned int' if does not define. */ +/* Define as 'unsigned int' if doesn't define. */ /* #undef size_t */ -/* Define to `int' if does not define. */ +/* Define as 'int' if doesn't define. */ /* #undef ssize_t */ -/* Define to `int' if doesn't define. */ +/* Define as 'int' if doesn't define. */ /* #undef uid_t */ /* Define to the type of an unsigned integer type of width exactly 16 bits if @@ -1648,8 +1627,8 @@ pointer, if such a type exists, and if the system does not define it. */ /* #undef uintptr_t */ -/* Define to empty if the keyword `volatile' does not work. Warning: valid - code using `volatile' can become incorrect without. Disable with care. */ +/* Define to empty if the keyword 'volatile' does not work. Warning: valid + code using 'volatile' can become incorrect without. Disable with care. */ /* #undef volatile */ /* once: _MAGICK_MAGICK_BASECONFIG_H */ diff --git a/magick/magick-config.h b/magick/magick-config.h index 27784c7bf6c7966e87a7c844b981a1bc67a41c97..2ae2cb5c1d161ebce5c3276d15b85f8c57ffd45f 100644 --- a/magick/magick-config.h +++ b/magick/magick-config.h @@ -110,7 +110,7 @@ extern "C" { #endif #ifndef MAGICKCORE_MODULES_PATH -# define MAGICKCORE_MODULES_PATH MAGICKCORE_LIBRARY_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_MODULES_DIRNAME +# define MAGICKCORE_MODULES_PATH MAGICKCORE_LIBRARY_ABSOLUTE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_MODULES_DIRNAME #endif #ifndef MAGICKCORE_MODULES_RELATIVE_PATH @@ -149,7 +149,7 @@ extern "C" { #endif #ifndef MAGICKCORE_SHAREARCH_PATH -# define MAGICKCORE_SHAREARCH_PATH MAGICKCORE_LIBRARY_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_SHAREARCH_DIRNAME MAGICKCORE_DIR_SEPARATOR +# define MAGICKCORE_SHAREARCH_PATH MAGICKCORE_LIBRARY_ABSOLUTE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_SHAREARCH_DIRNAME MAGICKCORE_DIR_SEPARATOR #endif #ifndef MAGICKCORE_SHAREARCH_RELATIVE_PATH diff --git a/magick/magick-private.h b/magick/magick-private.h new file mode 100644 index 0000000000000000000000000000000000000000..a3abff5263e03047def6a3439617ef6c2a348438 --- /dev/null +++ b/magick/magick-private.h @@ -0,0 +1,32 @@ +/* + 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 + obtain a copy of the License at + + https://imagemagick.org/script/license.php + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + MagickCore private magick methods. +*/ +#ifndef MAGICKCORE_MAGICK_PRIVATE_H +#define MAGICKCORE_MAGICK_PRIVATE_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +extern MagickPrivate void + ResetMagickPrecision(void); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif diff --git a/magick/magick.c b/magick/magick.c index 508e224dd756e3c26f19603d3c45853038aa7438..e7adb55203ce980788548e45d1f45675fd13907e 100644 --- a/magick/magick.c +++ b/magick/magick.c @@ -130,6 +130,9 @@ static volatile MagickBooleanType instantiate_magickcore = MagickFalse, magickcore_signal_in_progress = MagickFalse, magick_list_initialized = MagickFalse; + +static int + magick_precision = 0; /* Forward declarations. @@ -1368,7 +1371,6 @@ MagickExport void MagickCoreGenesis(const char *path, #endif (void) RegistryComponentGenesis(); (void) MonitorComponentGenesis(); - (void) GetMagickTTL(); instantiate_magickcore=MagickTrue; UnlockMagickMutex(); } @@ -1518,6 +1520,29 @@ MagickExport MagickInfo *RegisterMagickInfo(MagickInfo *magick_info) % % % % % % ++ R e s e t M a g i c k P r e c i s i o n % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ResetMagickPrecision() resets the magick_precision value. +% +% The format of the ResetMagickPrecision method is: +% +% void ResetMagickPrecision(void) +% +*/ +MagickPrivate void ResetMagickPrecision(void) +{ + magick_precision=0; +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % + S e t M a g i c k I n f o % % % % % @@ -1594,9 +1619,6 @@ MagickExport int SetMagickPrecision(const int precision) { #define MagickPrecision (4+MAGICKCORE_QUANTUM_DEPTH/8) - static int - magick_precision = 0; - if (IsEventLogging() != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); if (precision > 0) diff --git a/magick/matrix.c b/magick/matrix.c index 3034da88e01370aa6620bb67f81c0f1e9bbf02d5..e851284d290e2a78fc366c3e801fa79079019019 100644 --- a/magick/matrix.c +++ b/magick/matrix.c @@ -150,10 +150,10 @@ static inline MagickOffsetType WriteMatrixElements( { #if !defined(MAGICKCORE_HAVE_PWRITE) count=write(matrix_info->file,buffer+i,(size_t) MagickMin(length-i, - (MagickSizeType) MAGICK_SSIZE_MAX)); + (MagickSizeType) MagickMaxBufferExtent)); #else count=pwrite(matrix_info->file,buffer+i,(size_t) MagickMin(length-i, - (MagickSizeType) MAGICK_SSIZE_MAX),(off_t) (offset+i)); + (MagickSizeType) MagickMaxBufferExtent),(off_t) (offset+i)); #endif if (count <= 0) { @@ -683,10 +683,10 @@ static inline MagickOffsetType ReadMatrixElements( { #if !defined(MAGICKCORE_HAVE_PREAD) count=read(matrix_info->file,buffer+i,(size_t) MagickMin(length-i, - (MagickSizeType) MAGICK_SSIZE_MAX)); + (MagickSizeType) MagickMaxBufferExtent)); #else count=pread(matrix_info->file,buffer+i,(size_t) MagickMin(length-i, - (MagickSizeType) MAGICK_SSIZE_MAX),(off_t) (offset+i)); + (MagickSizeType) MagickMaxBufferExtent),(off_t) (offset+i)); #endif if (count <= 0) { @@ -938,7 +938,7 @@ MagickExport Image *MatrixToImage(const MatrixInfo *matrix_info, image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { diff --git a/magick/memory-private.h b/magick/memory-private.h index 17666f2da6e6cfe307e4078d7129645856e46c8b..61dd3cef242dc9be589beb8a8d7d6e5dc17e6094 100644 --- a/magick/memory-private.h +++ b/magick/memory-private.h @@ -62,7 +62,8 @@ extern MagickPrivate MagickBooleanType extern MagickPrivate void ResetMaxMemoryRequest(void), - ResetVirtualAnonymousMemory(void); + ResetVirtualAnonymousMemory(void), + SetMaxMemoryRequest(const MagickSizeType); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/memory.c b/magick/memory.c index 92d43759ff509c4fbb8894a69327d63e29dfe4cb..633b3010747b939d52800af461ba8e24ed6db21f 100644 --- a/magick/memory.c +++ b/magick/memory.c @@ -1563,6 +1563,33 @@ MagickExport void SetMagickMemoryMethods( % % % % % % ++ S e t M a x M e m o r y R e q u e s t % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SetMaxMemoryRequest() sets the max_memory_request value. +% +% The format of the ResetMaxMemoryRequest method is: +% +% void SetMaxMemoryRequest(const MagickSizeType limit) +% +% A description of each parameter follows: +% +% o limit: the maximum memory request limit. +% +*/ +MagickPrivate void SetMaxMemoryRequest(const MagickSizeType limit) +{ + max_memory_request=MagickMin(limit,GetMaxMemoryRequest()); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % S h r e d F i l e % % % % % @@ -1645,7 +1672,7 @@ MagickPrivate MagickBooleanType ShredMagickMemory(void *memory, SetRandomKey(random_info,quantum,GetStringInfoDatum(key)); (void) memcpy(p,GetStringInfoDatum(key),(size_t) MagickMin(quantum,length-j)); - p+=quantum; + p+=(ptrdiff_t) quantum; } if (j < length) break; diff --git a/magick/method-attribute.h b/magick/method-attribute.h index 4b09547861760bfa3e046ed56b4cc96b2b8d1ef7..b1e3696393b36c9e6aeb94723e1d28ec02ed408b 100644 --- a/magick/method-attribute.h +++ b/magick/method-attribute.h @@ -22,7 +22,7 @@ extern "C" { #endif -#if defined(__BORLANDC__) && defined(_DLL) +#if defined(_DLL) # define _MAGICKDLL_ # define _MAGICKLIB_ # define MAGICKCORE_MODULES_SUPPORT diff --git a/magick/mime.c b/magick/mime.c index cc51302c4656355a50b9380acb3ad4ac8a314200..beeab9d0a7eae9fb3cb17b448687ab136ac6a22f 100644 --- a/magick/mime.c +++ b/magick/mime.c @@ -904,6 +904,7 @@ static MagickBooleanType LoadMimeCache(LinkedListInfo *cache,const char *xml, (void) SubstituteString((char **) &token,"<","<"); (void) SubstituteString((char **) &token,"&","&"); (void) SubstituteString((char **) &token,""","\""); + (void) SubstituteString((char **) &token,"'","'"); mime_info->magic=(unsigned char *) AcquireString(token); q=mime_info->magic; for (p=token; *p != '\0'; ) @@ -917,7 +918,7 @@ static MagickBooleanType LoadMimeCache(LinkedListInfo *cache,const char *xml, *end; *q++=(unsigned char) strtol(p,&end,8); - p+=(end-p); + p+=(ptrdiff_t) (end-p); mime_info->length++; continue; } diff --git a/magick/module.c b/magick/module.c index 11e9bec7fe91dc48a1135e669b27359ee444343a..1108d5755a6dc5c3a7ab281f0d6d67ef377c25cb 100644 --- a/magick/module.c +++ b/magick/module.c @@ -60,6 +60,7 @@ #include "magick/splay-tree.h" #include "magick/static.h" #include "magick/string_.h" +#include "magick/timer-private.h" #include "magick/token.h" #include "magick/utility.h" #include "magick/utility-private.h" @@ -147,7 +148,7 @@ MagickExport ModuleInfo *AcquireModuleInfo(const char *path,const char *tag) module_info->path=ConstantString(path); if (tag != (const char *) NULL) module_info->tag=ConstantString(tag); - module_info->timestamp=time(0); + module_info->timestamp=GetMagickTime(); module_info->signature=MagickCoreSignature; return(module_info); } diff --git a/magick/nt-base-private.h b/magick/nt-base-private.h index d260d45d64ad2915d1cf59ebb43cd019e91dc8f3..05c360da0cab57623c50c8f4fbe859a6dfd6f498 100644 --- a/magick/nt-base-private.h +++ b/magick/nt-base-private.h @@ -87,7 +87,7 @@ static inline void *NTAcquireQuantumMemory(const size_t count, } extern MagickPrivate char - *NTGetLastError(void); + *NTGetEnvironmentValue(const char *); #if !defined(MAGICKCORE_LTDL_DELEGATE) extern MagickPrivate const char diff --git a/magick/nt-base.c b/magick/nt-base.c index f0fe79bac2f0d19b9331909ff85a44a8e0e1e993..a1d286e75cffec802c4f1bbe5042eae75fed91c0 100644 --- a/magick/nt-base.c +++ b/magick/nt-base.c @@ -71,18 +71,19 @@ #if !defined(MAP_FAILED) #define MAP_FAILED ((void *)(LONG_PTR) -1) #endif +#define MaxWideByteExtent 100 /* -Typdef declarations. + Typdef declarations. */ /* -We need to make sure only one instance is created for each process and that -is why we wrap the new/delete instance methods. + We need to make sure only one instance is created for each process and that + is why we wrap the new/delete instance methods. -From: http://www.ghostscript.com/doc/current/API.htm -"The Win32 DLL gsdll32.dll can be used by multiple programs simultaneously, -but only once within each process" + From: http://www.ghostscript.com/doc/current/API.htm + "The Win32 DLL gsdll32.dll can be used by multiple programs simultaneously, + but only once within each process" */ typedef struct _NTGhostInfo { @@ -213,13 +214,13 @@ static unsigned char *NTGetRegistryValue(HKEY root,const char *key,DWORD flags, status; wchar_t - wide_name[100]; + wide_name[MaxWideByteExtent]; value=(unsigned char *) NULL; status=RegOpenKeyExA(root,key,0,(KEY_READ | flags),®istry_key); if (status != ERROR_SUCCESS) return(value); - if (MultiByteToWideChar(CP_UTF8,0,name,-1,wide_name,100) == 0) + if (MultiByteToWideChar(CP_UTF8,0,name,-1,wide_name,MaxWideByteExtent) == 0) { RegCloseKey(registry_key); return(value); @@ -783,6 +784,57 @@ MagickPrivate MagickBooleanType NTGatherRandomData(const size_t length, % % % % % % +% N T G e t E n v i r o n m e n t V a l u e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% NTGetEnvironmentValue() returns the environment string that matches the +% specified name. +% +% The format of the NTGetEnvironmentValue method is: +% +% char *GetEnvironmentValue(const char *name) +% +% A description of each parameter follows: +% +% o name: the environment name. +% +*/ +extern MagickPrivate char *NTGetEnvironmentValue(const char *name) +{ + char + *environment = (char *) NULL; + + DWORD + size; + + LPWSTR + wide; + + wchar_t + wide_name[MaxWideByteExtent]; + + if (MultiByteToWideChar(CP_UTF8,0,name,-1,wide_name,MaxWideByteExtent) == 0) + return(environment); + size=GetEnvironmentVariableW(wide_name,(LPWSTR) NULL,0); + if (size == 0) + return(environment); + wide=(LPWSTR) NTAcquireQuantumMemory((const size_t) size,sizeof(*wide)); + if (wide == (LPWSTR) NULL) + return(environment); + if (GetEnvironmentVariableW(wide_name,wide,size) != 0) + environment=create_utf8_string(wide); + wide=(LPWSTR) RelinquishMagickMemory(wide); + return(environment); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % N T G e t E x e c u t i o n P a t h % % % % % @@ -819,20 +871,24 @@ MagickPrivate MagickBooleanType NTGetExecutionPath(char *path, % % % % % % -% N T G e t L a s t E r r o r % +% N T G e t L a s t E r r o r M e s s a g e % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% NTGetLastError() returns the last error that occurred. +% NTGetLastErrorMessage() returns the last error that occurred. % -% The format of the NTGetLastError method is: +% The format of the NTGetLastErrorMessage method is: % -% char *NTGetLastError(void) +% char *NTGetLastErrorMessage(DWORD last_error) +% +% A description of each parameter follows: +% +% o last_error: The value of GetLastError. % */ -char *NTGetLastError(void) +static char *NTGetLastErrorMessage(DWORD last_error) { char *reason; @@ -844,7 +900,7 @@ char *NTGetLastError(void) buffer = (LPVOID) NULL; status=FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM,NULL,GetLastError(), + FORMAT_MESSAGE_FROM_SYSTEM,NULL,last_error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),(LPTSTR) &buffer,0,NULL); if (!status) reason=AcquireString("An unknown error occurred"); @@ -885,7 +941,7 @@ MagickPrivate const char *NTGetLibraryError(void) *error; *last_error='\0'; - error=NTGetLastError(); + error=NTGetLastErrorMessage(GetLastError()); if (error) (void) CopyMagickString(last_error,error,MaxTextExtent); error=DestroyString(error); @@ -1005,12 +1061,10 @@ static int NTLocateGhostscript(DWORD flags,int *root_index, status; static const char - *products[4] = + *products[2] = { - "GPL Ghostscript", - "GNU Ghostscript", - "AFPL Ghostscript", - "Aladdin Ghostscript" + "Artifex Ghostscript", + "GPL Ghostscript" }; /* @@ -2146,9 +2200,10 @@ MagickPrivate int NTSystemCommand(const char *command,char *output) } #define CopyLastError \ + last_error=GetLastError(); \ if (output != (char *) NULL) \ { \ - error=NTGetLastError(); \ + error=NTGetLastErrorMessage(last_error); \ if (error != (char *) NULL) \ { \ CopyMagickString(output,error,MaxTextExtent); \ @@ -2161,7 +2216,8 @@ MagickPrivate int NTSystemCommand(const char *command,char *output) local_command[MaxTextExtent]; DWORD - child_status; + child_status, + last_error; int status; @@ -2229,7 +2285,7 @@ MagickPrivate int NTSystemCommand(const char *command,char *output) { CopyLastError; CleanupOutputHandles; - return(-1); + return(last_error == ERROR_FILE_NOT_FOUND ? 127 : -1); } if (output != (char *) NULL) *output='\0'; @@ -2565,7 +2621,7 @@ MagickPrivate void NTWindowsGenesis(void) (void) SetErrorMode(StringToInteger(mode)); mode=DestroyString(mode); } -#if defined(_DEBUG) && !defined(__BORLANDC__) && !defined(__MINGW32__) +#if defined(_DEBUG) && !defined(__MINGW32__) if (IsEventLogging() != MagickFalse) { int diff --git a/magick/nt-base.h b/magick/nt-base.h index 11bb6307c6bfd0f49e6b2cdcbe5fa54372a3e339..251944da0732c2ef24d5ffe3f586c6e4c26551af 100644 --- a/magick/nt-base.h +++ b/magick/nt-base.h @@ -69,11 +69,7 @@ extern "C" { #endif #if !defined(chsize) -# if defined(__BORLANDC__) -# define chsize(file,length) chsize(file,length) -# else -# define chsize(file,length) _chsize(file,length) -# endif +# define chsize(file,length) _chsize(file,length) #endif #if !defined(access) @@ -106,13 +102,13 @@ extern "C" { # define fseek _fseeki64 #endif #endif -#if !defined(fstat) && !defined(__BORLANDC__) +#if !defined(fstat) #if defined(MAGICKCORE_WINDOWS_SUPPORT) && \ !(defined(_MSC_VER) && (_MSC_VER < 1400)) && \ !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ < 0x800)) -# define fstat _fstati64 +# define fstat _fstat64 #else -# define fstat _fstat +# define fstat _fstat64 #endif #endif #if !defined(fsync) @@ -224,13 +220,13 @@ extern "C" { #if !defined(strtod_l) #define strtod_l _strtod_l #endif -#if !defined(stat) && !defined(__BORLANDC__) +#if !defined(stat) #if defined(MAGICKCORE_WINDOWS_SUPPORT) && \ !(defined(_MSC_VER) && (_MSC_VER < 1400)) && \ !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ < 0x800)) -# define stat _stati64 +# define stat _stat64 #else -# define stat _stat +# define stat _stat64 #endif #endif #if !defined(strcasecmp) @@ -282,7 +278,7 @@ extern "C" { #if !defined(write) # define write(fd,buffer,count) _write(fd,buffer,(unsigned int) count) #endif -#if !defined(wstat) && !defined(__BORLANDC__) +#if !defined(wstat) #if defined(MAGICKCORE_WINDOWS_SUPPORT) && \ !(defined(_MSC_VER) && (_MSC_VER < 1400)) && \ !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ < 0x800)) @@ -292,17 +288,6 @@ extern "C" { #endif #endif -#if defined(__BORLANDC__) -#undef _O_RANDOM -#define _O_RANDOM 0 -#undef _O_SEQUENTIAL -#define _O_SEQUENTIAL 0 -#undef _O_SHORT_LIVED -#define _O_SHORT_LIVED 0 -#undef _O_TEMPORARY -#define _O_TEMPORARY 0 -#endif - #undef gettimeofday typedef struct _GhostInfo diff --git a/magick/opencl-private.h b/magick/opencl-private.h index cf80a478bcbc5694ec4b43e41d342e0eb949655d..9b080243d386cd640b1bf9056e7ea6fd20fda564 100644 --- a/magick/opencl-private.h +++ b/magick/opencl-private.h @@ -24,6 +24,13 @@ Include declarations. #include "magick/studio.h" #include "magick/opencl.h" +#if defined(MAGICKCORE_HAVE_CL_CL_H) +# include +#endif +#if defined(MAGICKCORE_HAVE_OPENCL_CL_H) +# include +#endif + #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif diff --git a/magick/opencl.c b/magick/opencl.c index b84909dff90b8e1508cf026b2c1b880686908883..3929ae033c4c9c1504aea94eddea70361a63e686 100644 --- a/magick/opencl.c +++ b/magick/opencl.c @@ -41,6 +41,7 @@ Include declarations. */ #include "magick/studio.h" +#include "magick/accelerate-kernels-private.h" #include "magick/artifact.h" #include "magick/cache.h" #include "magick/cache-private.h" @@ -911,8 +912,8 @@ static void saveBinaryCLProgram(MagickCLEnv clEnv,MagickOpenCLProgram prog, } for (i = 0; i < num_devices; i++) { - binary_program[i]=AcquireQuantumMemory(MagickMax(*(program_sizes+i),1), - sizeof(**binary_program)); + binary_program[i]=(unsigned char *) AcquireQuantumMemory( + MagickMax(*(program_sizes+i),1),sizeof(**binary_program)); if (binary_program[i] == (unsigned char *) NULL) { status=CL_OUT_OF_HOST_MEMORY; @@ -2457,6 +2458,8 @@ static ds_status AcceleratePerfEvaluator(ds_device *device, CloneString(&imageInfo->size,ACCELERATE_PERF_DIMEN); CopyMagickString(imageInfo->filename,"xc:none",MaxTextExtent); inputImage=ReadImage(imageInfo,exception); + if (inputImage == (Image *) NULL) + ReturnStatus(DS_PERF_EVALUATOR_ERROR); initAccelerateTimer(&timer); diff --git a/magick/option.c b/magick/option.c index cb85a94d81ef61fb0e41c6c82bdd3ba4727106dd..fef6f516f400f41a83f591b07921158e338c3529 100644 --- a/magick/option.c +++ b/magick/option.c @@ -43,6 +43,7 @@ #include "magick/studio.h" #include "magick/artifact.h" #include "magick/cache.h" +#include "magick/channel.h" #include "magick/color.h" #include "magick/compare.h" #include "magick/constitute.h" @@ -106,6 +107,7 @@ static const OptionInfo { "Extract", ExtractAlphaChannel, UndefinedOptionFlag, MagickFalse }, { "Flatten", FlattenAlphaChannel, UndefinedOptionFlag, MagickFalse }, { "Off", DeactivateAlphaChannel, UndefinedOptionFlag, MagickFalse }, + { "OffIfOpaque", OffIfOpaqueAlphaChannel, UndefinedOptionFlag, MagickFalse }, { "On", ActivateAlphaChannel, UndefinedOptionFlag, MagickFalse }, { "Opaque", OpaqueAlphaChannel, UndefinedOptionFlag, MagickFalse }, { "Remove", RemoveAlphaChannel, UndefinedOptionFlag, MagickFalse }, diff --git a/magick/paint.c b/magick/paint.c index b788789e38adcf12d94d8b197206e39c02ba7d97..8755c1fd7254ba35d6c7deee68582753bbab8fa0 100644 --- a/magick/paint.c +++ b/magick/paint.c @@ -147,22 +147,17 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, *floodplane_image; MagickBooleanType - skip; + skip, + status; MagickPixelPacket - fill, pixel; MemoryInfo *segment_info; - PixelPacket - fill_color; - - SegmentInfo - *s; - SegmentInfo + *s, *segment_stack; ssize_t @@ -200,7 +195,11 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, floodplane_image=CloneImage(image,0,0,MagickTrue,&image->exception); if (floodplane_image == (Image *) NULL) return(MagickFalse); - (void) SetImageAlphaChannel(floodplane_image,OpaqueAlphaChannel); + floodplane_image->matte=MagickFalse; + floodplane_image->colorspace=GRAYColorspace; + (void) QueryColorCompliance("#000",AllCompliance, + &floodplane_image->background_color,exception); + (void) SetImageBackgroundColor(floodplane_image); segment_info=AcquireVirtualMemory(MaxStacksize,sizeof(*segment_stack)); if (segment_info == (MemoryInfo *) NULL) { @@ -216,7 +215,6 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, y=y_offset; start=0; s=segment_stack; - GetMagickPixelPacket(image,&fill); GetMagickPixelPacket(image,&pixel); image_view=AcquireVirtualCacheView(image,exception); floodplane_view=AcquireAuthenticCacheView(floodplane_image,exception); @@ -230,12 +228,12 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, const PixelPacket *magick_restrict p; - ssize_t - x; - PixelPacket *magick_restrict q; + ssize_t + x; + /* Pop segment off stack. */ @@ -253,16 +251,16 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL)) break; indexes=GetCacheViewVirtualIndexQueue(image_view); - p+=x1; - q+=x1; + p+=(ptrdiff_t) x1; + q+=(ptrdiff_t) x1; for (x=x1; x >= 0; x--) { - if (q->opacity == (Quantum) TransparentOpacity) + if (GetPixelGray(q) != 0) break; SetMagickPixelPacket(image,p,indexes+x,&pixel); if (IsMagickColorSimilar(&pixel,target) == invert) break; - q->opacity=(Quantum) TransparentOpacity; + SetPixelGray(q,QuantumRange); p--; q--; } @@ -292,12 +290,12 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, indexes=GetCacheViewVirtualIndexQueue(image_view); for ( ; x < (ssize_t) image->columns; x++) { - if (q->opacity == (Quantum) TransparentOpacity) + if (GetPixelGray(q) != 0) break; SetMagickPixelPacket(image,p,indexes+x,&pixel); if (IsMagickColorSimilar(&pixel,target) == invert) break; - q->opacity=(Quantum) TransparentOpacity; + SetPixelGray(q,QuantumRange); p++; q++; } @@ -321,7 +319,7 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, indexes=GetCacheViewVirtualIndexQueue(image_view); for ( ; x <= x2; x++) { - if (q->opacity == (Quantum) TransparentOpacity) + if (GetPixelGray(q) != 0) break; SetMagickPixelPacket(image,p,indexes+x,&pixel); if (IsMagickColorSimilar(&pixel,target) != invert) @@ -333,6 +331,11 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, start=x; } while (x <= x2); } + status=MagickTrue; +#if defined(MMAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static) shared(status) \ + magick_number_threads(floodplane_image,image,image->rows,2) +#endif for (y=0; y < (ssize_t) image->rows; y++) { const PixelPacket @@ -341,26 +344,37 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, IndexPacket *magick_restrict indexes; - ssize_t - x; - PixelPacket *magick_restrict q; + ssize_t + x; + /* Tile fill color onto floodplane. */ - p=GetCacheViewVirtualPixels(floodplane_view,0,y,image->columns,1, - exception); + if (status == MagickFalse) + continue; + p=GetCacheViewVirtualPixels(floodplane_view,0,y,image->columns,1,exception); q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception); if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL)) - break; + { + status=MagickFalse; + continue; + } indexes=GetCacheViewAuthenticIndexQueue(image_view); for (x=0; x < (ssize_t) image->columns; x++) { - if (GetPixelOpacity(p) != OpaqueOpacity) + if (GetPixelGray(p) != 0) { + MagickPixelPacket + fill; + + PixelPacket + fill_color; + (void) GetFillColor(draw_info,x,y,&fill_color); + GetMagickPixelPacket(image,&fill); SetMagickPixelPacket(image,&fill_color,(IndexPacket *) NULL,&fill); if (image->colorspace == CMYKColorspace) ConvertRGBToCMYK(&fill); @@ -381,7 +395,7 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, q++; } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) - break; + status=MagickFalse; } floodplane_view=DestroyCacheView(floodplane_view); image_view=DestroyCacheView(image_view); diff --git a/magick/pixel.c b/magick/pixel.c index f2a5b5fa82ac886203510b48d07ab3dd72773e3d..70c7958cb07fdac74bfa406a2d84767d43e216d6 100644 --- a/magick/pixel.c +++ b/magick/pixel.c @@ -39,9 +39,9 @@ Include declarations. */ #include "magick/studio.h" -#include "magick/property.h" #include "magick/blob.h" #include "magick/blob-private.h" +#include "magick/cache-private.h" #include "magick/color-private.h" #include "magick/draw.h" #include "magick/exception.h" @@ -59,6 +59,7 @@ #include "magick/option.h" #include "magick/pixel.h" #include "magick/pixel-private.h" +#include "magick/property.h" #include "magick/quantum.h" #include "magick/resource_.h" #include "magick/semaphore.h" @@ -4502,7 +4503,7 @@ MagickExport MagickBooleanType InterpolateMagickPixelPacket( status=MagickTrue; x_offset=CastDoubleToLong(floor(x)); y_offset=CastDoubleToLong(floor(y)); - interpolate = method; + interpolate=method; if (interpolate == UndefinedInterpolatePixel) interpolate=image->interpolate; GetMagickPixelPacket(image,pixel); diff --git a/magick/policy.c b/magick/policy.c index 4acb37b6411ac4be680ad22a95bfcccbc807b551..b735658fa8f60d3481b315bfdaeef1b886dc4265 100644 --- a/magick/policy.c +++ b/magick/policy.c @@ -38,12 +38,16 @@ Include declarations. */ #include "magick/studio.h" +#include "magick/cache-private.h" #include "magick/client.h" #include "magick/configure.h" #include "magick/exception.h" #include "magick/exception-private.h" +#include "magick/hashmap-private.h" #include "magick/locale_.h" +#include "magick/magick-private.h" #include "magick/memory_.h" +#include "magick/memory-private.h" #include "magick/monitor.h" #include "magick/monitor-private.h" #include "magick/option.h" @@ -51,7 +55,10 @@ #include "magick/policy-private.h" #include "magick/resource_.h" #include "magick/semaphore.h" +#include "magick/stream-private.h" #include "magick/string_.h" +#include "magick/string-private.h" +#include "magick/timer-private.h" #include "magick/token.h" #include "magick/utility.h" #include "magick/xml-tree.h" @@ -133,6 +140,8 @@ static SemaphoreInfo static MagickBooleanType IsPolicyCacheInstantiated(ExceptionInfo *), LoadPolicyCache(LinkedListInfo *,const char *,const char *,const size_t, + ExceptionInfo *), + SetMagickSecurityPolicyValue(const PolicyDomain,const char *,const char *, ExceptionInfo *); /* @@ -167,7 +176,7 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename, LinkedListInfo *cache; - MagickBooleanType + MagickStatusType status; ssize_t @@ -280,16 +289,17 @@ static LinkedListInfo *AcquirePolicyCache(const char *filename, static PolicyInfo *GetPolicyInfo(const char *name,ExceptionInfo *exception) { char - policyname[MagickPathExtent]; + policyname[MagickPathExtent], + *q; + + ElementInfo + *p; PolicyDomain domain; PolicyInfo - *p; - - char - *q; + *policy; assert(exception != (ExceptionInfo *) NULL); if (IsPolicyCacheInstantiated(exception) == MagickFalse) @@ -324,26 +334,31 @@ static PolicyInfo *GetPolicyInfo(const char *name,ExceptionInfo *exception) /* Search for policy tag. */ + policy=(PolicyInfo *) NULL; LockSemaphoreInfo(policy_semaphore); ResetLinkedListIterator(policy_cache); - p=(PolicyInfo *) GetNextValueInLinkedList(policy_cache); + p=GetHeadElementInLinkedList(policy_cache); if ((name == (const char *) NULL) || (LocaleCompare(name,"*") == 0)) { UnlockSemaphoreInfo(policy_semaphore); - return(p); + if (p != (ElementInfo *) NULL) + policy=(PolicyInfo *) p->value; + return(policy); } - while (p != (PolicyInfo *) NULL) + while (p != (ElementInfo *) NULL) { - if ((domain == UndefinedPolicyDomain) || (p->domain == domain)) - if (LocaleCompare(policyname,p->name) == 0) + policy=(PolicyInfo *) p->value; + if ((domain == UndefinedPolicyDomain) || (policy->domain == domain)) + if (LocaleCompare(policyname,policy->name) == 0) break; - p=(PolicyInfo *) GetNextValueInLinkedList(policy_cache); + p=p->next; } - if (p != (PolicyInfo *) NULL) - (void) InsertValueInLinkedList(policy_cache,0, - RemoveElementByValueFromLinkedList(policy_cache,p)); + if (p == (ElementInfo *) NULL) + policy=(PolicyInfo *) NULL; + else + (void) SetHeadElementInLinkedList(policy_cache,p); UnlockSemaphoreInfo(policy_semaphore); - return(p); + return(policy); } /* @@ -1094,8 +1109,8 @@ MagickExport void PolicyComponentTerminus(void) % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% SetMagickSecurityPolicy() sets the ImageMagick security policy. It returns -% MagickFalse if the policy is already set or if the policy does not parse. +% SetMagickSecurityPolicy() sets or restricts the ImageMagick security policy. +% It returns MagickFalse if the policy the policy does not parse. % % The format of the SetMagickSecurityPolicy method is: % @@ -1140,30 +1155,160 @@ static MagickBooleanType ValidateSecurityPolicy(const char *policy, MagickExport MagickBooleanType SetMagickSecurityPolicy(const char *policy, ExceptionInfo *exception) { - PolicyInfo - *p; - MagickBooleanType status; + LinkedListInfo + *user_policies; + + PolicyInfo + *p; + + /* + Load user policies. + */ assert(exception != (ExceptionInfo *) NULL); if (policy == (const char *) NULL) return(MagickFalse); if (ValidateSecurityPolicy(policy,PolicyFilename,exception) == MagickFalse) return(MagickFalse); - if (IsPolicyCacheInstantiated(exception) == MagickFalse) - return(MagickFalse); - LockSemaphoreInfo(policy_semaphore); - ResetLinkedListIterator(policy_cache); - p=(PolicyInfo *) GetNextValueInLinkedList(policy_cache); - if ((p != (PolicyInfo *) NULL) && (p->domain != UndefinedPolicyDomain)) + status=LoadPolicyCache(policy_cache,policy,"[user-policy]",0,exception); + if (status == MagickFalse) + return(status); + /* + Synchronize user policies. + */ + user_policies=NewLinkedList(0); + status=LoadPolicyCache(user_policies,policy,"[user-policy]",0,exception); + if (status == MagickFalse) { - UnlockSemaphoreInfo(policy_semaphore); + user_policies=DestroyLinkedList(user_policies,DestroyPolicyElement); return(MagickFalse); } - UnlockSemaphoreInfo(policy_semaphore); - status=LoadPolicyCache(policy_cache,policy,"[user-policy]",0,exception); - if (status == MagickFalse) + ResetLinkedListIterator(user_policies); + p=(PolicyInfo *) GetNextValueInLinkedList(user_policies); + while (p != (PolicyInfo *) NULL) + { + if ((p->name != (char *) NULL) && (p->value != (char *) NULL)) + (void) SetMagickSecurityPolicyValue(p->domain,p->name,p->value,exception); + p=(PolicyInfo *) GetNextValueInLinkedList(user_policies); + } + user_policies=DestroyLinkedList(user_policies,DestroyPolicyElement); + return(status); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S e t M a g i c k S e c u r i t y P o l i c y V a l u e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SetMagickSecurityPolicyValue() sets a value associated with an ImageMagick +% security policy. For most policies, the value must be less than any value +% set by the security policy configuration file (i.e. policy.xml). It returns +% MagickFalse if the policy cannot be modified or if the policy does not parse. +% +% The format of the SetMagickSecurityPolicyValue method is: +% +% MagickBooleanType SetMagickSecurityPolicyValue( +% const PolicyDomain domain,const char *name,const char *value, +% ExceptionInfo *exception) +% +% A description of each parameter follows: +% +% o domain: the domain of the policy (e.g. system, resource). +% +% o name: the name of the policy. +% +% o value: the value to set the policy to. +% +% o exception: return any errors or warnings in this structure. +% +*/ +static MagickBooleanType SetMagickSecurityPolicyValue(const PolicyDomain domain, + const char *name,const char *value,ExceptionInfo *exception) +{ + magick_unreferenced(exception); + assert(exception != (ExceptionInfo *) NULL); + if ((name == (const char *) NULL) || (value == (const char *) NULL)) return(MagickFalse); - return(ResourceComponentGenesis()); + switch (domain) + { + case CachePolicyDomain: + { + if (LocaleCompare(name,"memory-map") == 0) + { + if (LocaleCompare(value,"anonymous") != 0) + return(MagickFalse); + ResetCacheAnonymousMemory(); + ResetStreamAnonymousMemory(); + return(MagickTrue); + } + break; + } + case ResourcePolicyDomain: + { + ssize_t + type; + + type=ParseCommandOption(MagickResourceOptions,MagickFalse,name); + if (type >= 0) + { + MagickSizeType + limit; + + limit=MagickResourceInfinity; + if (LocaleCompare("unlimited",value) != 0) + limit=StringToMagickSizeType(value,100.0); + if ((ResourceType) type == TimeResource) + limit=(MagickSizeType) ParseMagickTimeToLive(value); + return(SetMagickResourceLimit((ResourceType) type,limit)); + } + break; + } + case SystemPolicyDomain: + { + if (LocaleCompare(name,"max-memory-request") == 0) + { + MagickSizeType + limit; + + limit=MagickResourceInfinity; + if (LocaleCompare("unlimited",value) != 0) + limit=StringToMagickSizeType(value,100.0); + SetMaxMemoryRequest(limit); + return(MagickTrue); + } + if (LocaleCompare(name,"memory-map") == 0) + { + if (LocaleCompare(value,"anonymous") != 0) + return(MagickFalse); + ResetVirtualAnonymousMemory(); + return(MagickTrue); + } + if (LocaleCompare(name,"precision") == 0) + { + int + limit; + + limit=StringToInteger(value); + SetMagickPrecision(limit); + return(MagickTrue); + } + break; + } + case CoderPolicyDomain: + case DelegatePolicyDomain: + case FilterPolicyDomain: + case ModulePolicyDomain: + case PathPolicyDomain: + default: + break; + } + return(MagickFalse); } diff --git a/magick/prepress.c b/magick/prepress.c index 238e8657cb1b4bd7a43268cb7c1ed2b889f9e271..a7dac0908c6c0bacac4d377a72c45302fff31ae2 100644 --- a/magick/prepress.c +++ b/magick/prepress.c @@ -113,7 +113,7 @@ MagickExport double GetImageTotalInkDensity(Image *image) image_view=AcquireVirtualCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { diff --git a/magick/profile.c b/magick/profile.c index 23317caf1b5f0a43dad5bb6a5c50c2341e7ca781..82a5066de9e081138120f4c2d2116b78a99ec20b 100644 --- a/magick/profile.c +++ b/magick/profile.c @@ -986,8 +986,10 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name, source_info.scale[0]=100.0; source_info.scale[1]=255.0; source_info.scale[2]=255.0; +#if !defined(MAGICKCORE_HDRI_SUPPORT) source_info.translate[1]=(-0.5); source_info.translate[2]=(-0.5); +#endif break; } case cmsSigRgbData: @@ -1036,8 +1038,10 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name, target_info.scale[0]=0.01; target_info.scale[1]=1/255.0; target_info.scale[2]=1/255.0; +#if !defined(MAGICKCORE_HDRI_SUPPORT) target_info.translate[1]=0.5; target_info.translate[2]=0.5; +#endif break; } case cmsSigRgbData: @@ -1482,10 +1486,10 @@ static void WriteTo8BimProfile(Image *image,const char *name, q=p; if (LocaleNCompare((char *) p,"8BIM",4) != 0) break; - p+=4; + p+=(ptrdiff_t) 4; p=ReadResourceShort(p,&id); p=ReadResourceByte(p,&length_byte); - p+=length_byte; + p+=(ptrdiff_t) length_byte; if (((length_byte+1) & 0x01) != 0) p++; if (p > (datum+length-4)) @@ -1497,7 +1501,7 @@ static void WriteTo8BimProfile(Image *image,const char *name, if ((count < 0) || (p > (datum+length-count)) || (count > (ssize_t) length)) break; if (id != profile_id) - p+=count; + p+=(ptrdiff_t) count; else { size_t @@ -1574,10 +1578,10 @@ static void GetProfilesFromResourceBlock(Image *image, { if (LocaleNCompare((char *) p,"8BIM",4) != 0) break; - p+=4; + p+=(ptrdiff_t) 4; p=ReadResourceShort(p,&id); p=ReadResourceByte(p,&length_byte); - p+=length_byte; + p+=(ptrdiff_t) length_byte; if (((length_byte+1) & 0x01) != 0) p++; if (p > (datum+length-4)) @@ -1629,7 +1633,7 @@ static void GetProfilesFromResourceBlock(Image *image, SetStringInfoDatum(profile,p); (void) SetImageProfileInternal(image,"iptc",profile,MagickTrue); profile=DestroyStringInfo(profile); - p+=count; + p+=(ptrdiff_t) count; break; } case 0x040c: @@ -1637,7 +1641,7 @@ static void GetProfilesFromResourceBlock(Image *image, /* Thumbnail. */ - p+=count; + p+=(ptrdiff_t) count; break; } case 0x040f: @@ -1649,7 +1653,7 @@ static void GetProfilesFromResourceBlock(Image *image, SetStringInfoDatum(profile,p); (void) SetImageProfileInternal(image,"icc",profile,MagickTrue); profile=DestroyStringInfo(profile); - p+=count; + p+=(ptrdiff_t) count; break; } case 0x0422: @@ -1661,7 +1665,7 @@ static void GetProfilesFromResourceBlock(Image *image, SetStringInfoDatum(profile,p); (void) SetImageProfileInternal(image,"exif",profile,MagickTrue); profile=DestroyStringInfo(profile); - p+=count; + p+=(ptrdiff_t) count; break; } case 0x0424: @@ -1673,12 +1677,12 @@ static void GetProfilesFromResourceBlock(Image *image, SetStringInfoDatum(profile,p); (void) SetImageProfileInternal(image,"xmp",profile,MagickTrue); profile=DestroyStringInfo(profile); - p+=count; + p+=(ptrdiff_t) count; break; } default: { - p+=count; + p+=(ptrdiff_t) count; break; } } @@ -2211,7 +2215,7 @@ static MagickBooleanType Sync8BimProfile(const Image *image, count=(ssize_t) ReadProfileByte(&p,&length); if ((count >= (ssize_t) length) || (count < 0)) return(MagickFalse); - p+=count; + p+=(ptrdiff_t) count; length-=count; if ((*p & 0x01) == 0) (void) ReadProfileByte(&p,&length); @@ -2237,7 +2241,7 @@ static MagickBooleanType Sync8BimProfile(const Image *image, } if (id == 0x0422) (void) SyncExifProfile(image,p,count); - p+=count; + p+=(ptrdiff_t) count; length-=count; } return(MagickTrue); diff --git a/magick/property.c b/magick/property.c index 4a26c3ba1ad714065bee6e30dbc9999d291420e8..6315efa4abc617ee7aab9ab6ebcd34a65633a42c 100644 --- a/magick/property.c +++ b/magick/property.c @@ -833,6 +833,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image, #define TAG_GPS_OFFSET 0x8825 #define TAG_INTEROP_OFFSET 0xa005 + #define EXIFGPSFractions(format,arg1,arg2,arg3,arg4,arg5,arg6) \ { \ size_t \ @@ -843,56 +844,59 @@ static MagickBooleanType GetEXIFProperty(const Image *image, \ for ( ; component < components; component++) \ { \ - extent=(size_t) ((ssize_t) extent+FormatLocaleString(buffer+extent, \ - MagickPathExtent-extent,format", ",(arg1),(arg2),(arg3),(arg4),(arg5), \ - (arg6))); \ + if (component != 0) \ + extent+=(size_t) FormatLocaleString(buffer+extent,MagickPathExtent- \ + extent,", "); \ + extent+=(size_t) FormatLocaleString(buffer+extent,MagickPathExtent- \ + extent,format,(arg1),(arg2),(arg3),(arg4),(arg5),(arg6)); \ if (extent >= (MagickPathExtent-1)) \ extent=MagickPathExtent-1; \ } \ - if (extent > 1) \ - buffer[extent-2]='\0'; \ + buffer[extent]='\0'; \ value=AcquireString(buffer); \ } #define EXIFMultipleValues(format,arg) \ { \ - ssize_t \ - component; \ - \ size_t \ - length; \ + extent = 0; \ + \ + ssize_t \ + component = 0; \ \ - length=0; \ - for (component=0; component < components; component++) \ + for ( ; component < components; component++) \ { \ - length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \ - format", ",arg); \ - if (length >= (MaxTextExtent-1)) \ - length=MaxTextExtent-1; \ + if (component != 0) \ + extent+=(size_t) FormatLocaleString(buffer+extent,MagickPathExtent- \ + extent,", "); \ + extent+=(size_t) FormatLocaleString(buffer+extent,MagickPathExtent- \ + extent,format,arg); \ + if (extent >= (MagickPathExtent-1)) \ + extent=MagickPathExtent-1; \ } \ - if (length > 1) \ - buffer[length-2]='\0'; \ + buffer[extent]='\0'; \ value=AcquireString(buffer); \ } #define EXIFMultipleFractions(format,arg1,arg2) \ { \ - ssize_t \ - component; \ - \ size_t \ - length; \ + extent = 0; \ \ - length=0; \ - for (component=0; component < components; component++) \ + ssize_t \ + component = 0; \ + \ + for ( ; component < components; component++) \ { \ - length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \ - format", ",(arg1),(arg2)); \ - if (length >= (MaxTextExtent-1)) \ - length=MaxTextExtent-1; \ + if (component != 0) \ + extent+=(size_t) FormatLocaleString(buffer+extent,MagickPathExtent-\ + extent,", "); \ + extent+=(size_t) FormatLocaleString(buffer+extent,MagickPathExtent- \ + extent,format,(arg1),(arg2)); \ + if (extent >= (MagickPathExtent-1)) \ + extent=MagickPathExtent-1; \ } \ - if (length > 1) \ - buffer[length-2]='\0'; \ + buffer[extent]='\0'; \ value=AcquireString(buffer); \ } @@ -1470,7 +1474,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image, if ((all != 0) || (tag == (size_t) tag_value)) { char - buffer[MaxTextExtent], + buffer[6*sizeof(double)+MaxTextExtent], *value; if ((p < exif) || (p > (exif+length-tag_bytes[format]))) @@ -2881,7 +2885,7 @@ static const char *GetMagickPropertyLetter(const ImageInfo *image_info, (void) CopyMagickString(value,image->magick_filename,MaxTextExtent); p=value; q=value+strlen(value); - for (p+=strspn(p,allowlist); p != q; p+=strspn(p,allowlist)) + for (p+=strspn(p,allowlist); p != q; p+=(ptrdiff_t) strspn(p,allowlist)) *p='_'; break; } @@ -3708,7 +3712,7 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info, } \ q=interpret_text+strlen(interpret_text); \ } \ - q+=FormatLocaleString(q,extent,"%s=%s\n",(key),(value)); \ + q+=(ptrdiff_t) FormatLocaleString(q,extent,"%s=%s\n",(key),(value)); \ } #define AppendString2Text(string) \ @@ -3728,7 +3732,7 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info, q=interpret_text+strlen(interpret_text); \ } \ (void) CopyMagickString(q,(string),extent); \ - q+=length; \ + q+=(ptrdiff_t) length; \ } char @@ -3839,19 +3843,19 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info, if (LocaleNCompare("<",p,4) == 0) { *q++='<'; - p+=3; + p+=(ptrdiff_t) 3; } else if (LocaleNCompare(">",p,4) == 0) { *q++='>'; - p+=3; + p+=(ptrdiff_t) 3; } else if (LocaleNCompare("&",p,5) == 0) { *q++='&'; - p+=4; + p+=(ptrdiff_t) 4; } else *q++=(*p); diff --git a/magick/quantize.c b/magick/quantize.c index 5f9e677cbcc053bc595ab1cfabfc501957204596..5c79d99d7d0344bae3988fdcf5b86a80def0d5ab 100644 --- a/magick/quantize.c +++ b/magick/quantize.c @@ -211,16 +211,16 @@ #endif #define ErrorQueueLength 16 #define ErrorRelativeWeight PerceptibleReciprocal(16) -#define MaxNodes 266817 +#define MaxQNodes 266817 #define MaxTreeDepth 8 -#define NodesInAList 1920 +#define QNodesInAList 1920 /* Typedef declarations. */ -typedef struct _NodeInfo +typedef struct _QNodeInfo { - struct _NodeInfo + struct _QNodeInfo *parent, *child[16]; @@ -237,20 +237,20 @@ typedef struct _NodeInfo color_number, id, level; -} NodeInfo; +} QNodeInfo; -typedef struct _Nodes +typedef struct _QNodes { - NodeInfo + QNodeInfo *nodes; - struct _Nodes + struct _QNodes *next; -} Nodes; +} QNodes; -typedef struct _CubeInfo +typedef struct _QCubeInfo { - NodeInfo + QNodeInfo *root; size_t @@ -276,10 +276,10 @@ typedef struct _CubeInfo free_nodes, color_number; - NodeInfo + QNodeInfo *next_node; - Nodes + QNodes *node_queue; MemoryInfo @@ -313,30 +313,30 @@ typedef struct _CubeInfo MagickSizeType span; -} CubeInfo; +} QCubeInfo; /* Method prototypes. */ -static CubeInfo - *GetCubeInfo(const QuantizeInfo *,const size_t,const size_t); +static QCubeInfo + *GetQCubeInfo(const QuantizeInfo *,const size_t,const size_t); -static NodeInfo - *GetNodeInfo(CubeInfo *,const size_t,const size_t,NodeInfo *); +static QNodeInfo + *GetQNodeInfo(QCubeInfo *,const size_t,const size_t,QNodeInfo *); static MagickBooleanType - AssignImageColors(Image *,CubeInfo *), - ClassifyImageColors(CubeInfo *,const Image *,ExceptionInfo *), - DitherImage(Image *,CubeInfo *), + AssignImageColors(Image *,QCubeInfo *), + ClassifyImageColors(QCubeInfo *,const Image *,ExceptionInfo *), + DitherImage(Image *,QCubeInfo *), SetGrayscaleImage(Image *); static void - ClosestColor(const Image *,CubeInfo *,const NodeInfo *), - DefineImageColormap(Image *,CubeInfo *,NodeInfo *), - DestroyCubeInfo(CubeInfo *), - PruneLevel(CubeInfo *,const NodeInfo *), - PruneToCubeDepth(CubeInfo *,const NodeInfo *), - ReduceImageColors(const Image *,CubeInfo *); + ClosestColor(const Image *,QCubeInfo *,const QNodeInfo *), + DefineImageColormap(Image *,QCubeInfo *,QNodeInfo *), + DestroyQCubeInfo(QCubeInfo *), + PruneLevel(QCubeInfo *,const QNodeInfo *), + PruneToCubeDepth(QCubeInfo *,const QNodeInfo *), + ReduceImageColors(const Image *,QCubeInfo *); /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -414,7 +414,7 @@ MagickExport QuantizeInfo *AcquireQuantizeInfo(const ImageInfo *image_info) % % The format of the AssignImageColors() method is: % -% MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info) +% MagickBooleanType AssignImageColors(Image *image,QCubeInfo *cube_info) % % A description of each parameter follows. % @@ -424,7 +424,7 @@ MagickExport QuantizeInfo *AcquireQuantizeInfo(const ImageInfo *image_info) % */ -static inline void AssociateAlphaPixel(const CubeInfo *cube_info, +static inline void AssociateAlphaPixel(const QCubeInfo *cube_info, const PixelPacket *pixel,DoublePixelPacket *alpha_pixel) { MagickRealType @@ -448,7 +448,7 @@ static inline void AssociateAlphaPixel(const CubeInfo *cube_info, alpha_pixel->opacity=(MagickRealType) GetPixelOpacity(pixel); } -static inline size_t ColorToNodeId(const CubeInfo *cube_info, +static inline size_t ColorToQNodeId(const QCubeInfo *cube_info, const DoublePixelPacket *pixel,size_t index) { size_t @@ -477,19 +477,19 @@ static inline MagickBooleanType IsSameColor(const Image *image, return(MagickTrue); } -static MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info) +static MagickBooleanType AssignImageColors(Image *image,QCubeInfo *cube_info) { #define AssignImageTag "Assign/Image" ColorspaceType colorspace; - ssize_t - y; - size_t number_colors; + ssize_t + y; + /* Allocate image colormap. */ @@ -530,15 +530,15 @@ static MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info) #endif for (y=0; y < (ssize_t) image->rows; y++) { - CubeInfo - cube; - IndexPacket *magick_restrict indexes; PixelPacket *magick_restrict q; + QCubeInfo + cube; + ssize_t x; @@ -561,7 +561,7 @@ static MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info) DoublePixelPacket pixel; - const NodeInfo + const QNodeInfo *node_info; ssize_t @@ -581,8 +581,8 @@ static MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info) node_info=cube.root; for (index=MaxTreeDepth-1; (ssize_t) index > 0; index--) { - id=ColorToNodeId(&cube,&pixel,index); - if (node_info->child[id] == (NodeInfo *) NULL) + id=ColorToQNodeId(&cube,&pixel,index); + if (node_info->child[id] == (QNodeInfo *) NULL) break; node_info=node_info->child[id]; } @@ -706,7 +706,7 @@ static MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info) % % The format of the ClassifyImageColors() method is: % -% MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, +% MagickBooleanType ClassifyImageColors(QCubeInfo *cube_info, % const Image *image,ExceptionInfo *exception) % % A description of each parameter follows. @@ -717,7 +717,7 @@ static MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info) % */ -static inline void SetAssociatedAlpha(const Image *image,CubeInfo *cube_info) +static inline void SetAssociatedAlpha(const Image *image,QCubeInfo *cube_info) { MagickBooleanType associate_alpha; @@ -730,7 +730,7 @@ static inline void SetAssociatedAlpha(const Image *image,CubeInfo *cube_info) cube_info->associate_alpha=associate_alpha; } -static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, +static MagickBooleanType ClassifyImageColors(QCubeInfo *cube_info, const Image *image,ExceptionInfo *exception) { #define ClassifyImageTag "Classify/Image" @@ -750,7 +750,7 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, MagickRealType bisect; - NodeInfo + QNodeInfo *node_info; size_t @@ -794,7 +794,7 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); if (p == (const PixelPacket *) NULL) break; - if (cube_info->nodes > MaxNodes) + if (cube_info->nodes > MaxQNodes) { /* Prune one level if the color tree is too large. @@ -821,18 +821,18 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, distance; bisect*=0.5; - id=ColorToNodeId(cube_info,&pixel,index); + id=ColorToQNodeId(cube_info,&pixel,index); mid.red+=(id & 1) != 0 ? bisect : -bisect; mid.green+=(id & 2) != 0 ? bisect : -bisect; mid.blue+=(id & 4) != 0 ? bisect : -bisect; mid.opacity+=(id & 8) != 0 ? bisect : -bisect; - if (node_info->child[id] == (NodeInfo *) NULL) + if (node_info->child[id] == (QNodeInfo *) NULL) { /* Set colors of new node to contain pixel. */ - node_info->child[id]=GetNodeInfo(cube_info,id,level,node_info); - if (node_info->child[id] == (NodeInfo *) NULL) + node_info->child[id]=GetQNodeInfo(cube_info,id,level,node_info); + if (node_info->child[id] == (QNodeInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'", @@ -875,7 +875,7 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, else node_info->total_color.opacity+=count*QuantumScale*(MagickRealType) ClampPixel(OpaqueOpacity); - p+=count; + p+=(ptrdiff_t) count; } if (cube_info->colors > cube_info->maximum_colors) { @@ -898,7 +898,7 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception); if (p == (const PixelPacket *) NULL) break; - if (cube_info->nodes > MaxNodes) + if (cube_info->nodes > MaxQNodes) { /* Prune one level if the color tree is too large. @@ -925,18 +925,18 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, distance; bisect*=0.5; - id=ColorToNodeId(cube_info,&pixel,index); + id=ColorToQNodeId(cube_info,&pixel,index); mid.red+=(id & 1) != 0 ? bisect : -bisect; mid.green+=(id & 2) != 0 ? bisect : -bisect; mid.blue+=(id & 4) != 0 ? bisect : -bisect; mid.opacity+=(id & 8) != 0 ? bisect : -bisect; - if (node_info->child[id] == (NodeInfo *) NULL) + if (node_info->child[id] == (QNodeInfo *) NULL) { /* Set colors of new node to contain pixel. */ - node_info->child[id]=GetNodeInfo(cube_info,id,level,node_info); - if (node_info->child[id] == (NodeInfo *) NULL) + node_info->child[id]=GetQNodeInfo(cube_info,id,level,node_info); + if (node_info->child[id] == (QNodeInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","%s", @@ -979,7 +979,7 @@ static MagickBooleanType ClassifyImageColors(CubeInfo *cube_info, else node_info->total_color.opacity+=count*QuantumScale*(MagickRealType) ClampPixel(OpaqueOpacity); - p+=count; + p+=(ptrdiff_t) count; } proceed=SetImageProgress(image,ClassifyImageTag,(MagickOffsetType) y, image->rows); @@ -1056,8 +1056,8 @@ MagickExport QuantizeInfo *CloneQuantizeInfo(const QuantizeInfo *quantize_info) % % The format of the ClosestColor method is: % -% void ClosestColor(const Image *image,CubeInfo *cube_info, -% const NodeInfo *node_info) +% void ClosestColor(const Image *image,QCubeInfo *cube_info, +% const QNodeInfo *node_info) % % A description of each parameter follows. % @@ -1065,25 +1065,25 @@ MagickExport QuantizeInfo *CloneQuantizeInfo(const QuantizeInfo *quantize_info) % % o cube_info: A pointer to the Cube structure. % -% o node_info: the address of a structure of type NodeInfo which points to a +% o node_info: the address of a structure of type QNodeInfo which points to a % node in the color cube tree that is to be pruned. % */ -static void ClosestColor(const Image *image,CubeInfo *cube_info, - const NodeInfo *node_info) +static void ClosestColor(const Image *image,QCubeInfo *cube_info, + const QNodeInfo *node_info) { - ssize_t - i; - size_t number_children; + ssize_t + i; + /* Traverse any children. */ 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) + if (node_info->child[i] != (QNodeInfo *) NULL) ClosestColor(image,cube_info,node_info->child[i]); if (node_info->number_unique != 0) { @@ -1196,8 +1196,8 @@ MagickExport MagickBooleanType CompressImageColormap(Image *image) % % The format of the DefineImageColormap method is: % -% void DefineImageColormap(Image *image,CubeInfo *cube_info, -% NodeInfo *node_info) +% void DefineImageColormap(Image *image,QCubeInfo *cube_info, +% QNodeInfo *node_info) % % A description of each parameter follows. % @@ -1205,12 +1205,12 @@ MagickExport MagickBooleanType CompressImageColormap(Image *image) % % o cube_info: A pointer to the Cube structure. % -% o node_info: the address of a structure of type NodeInfo which points to a +% o node_info: the address of a structure of type QNodeInfo which points to a % node in the color cube tree that is to be pruned. % */ -static void DefineImageColormap(Image *image,CubeInfo *cube_info, - NodeInfo *node_info) +static void DefineImageColormap(Image *image,QCubeInfo *cube_info, + QNodeInfo *node_info) { size_t number_children; @@ -1223,7 +1223,7 @@ static void DefineImageColormap(Image *image,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) + if (node_info->child[i] != (QNodeInfo *) NULL) DefineImageColormap(image,cube_info,node_info->child[i]); if (node_info->number_unique != 0) { @@ -1296,26 +1296,26 @@ static void DefineImageColormap(Image *image,CubeInfo *cube_info, % % % % % % -+ D e s t r o y C u b e I n f o % ++ D e s t r o y Q C u b e I n f o % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% DestroyCubeInfo() deallocates memory associated with an image. +% DestroyQCubeInfo() deallocates memory associated with an image. % -% The format of the DestroyCubeInfo method is: +% The format of the DestroyQCubeInfo method is: % -% DestroyCubeInfo(CubeInfo *cube_info) +% DestroyQCubeInfo(QCubeInfo *cube_info) % % A description of each parameter follows: % -% o cube_info: the address of a structure of type CubeInfo. +% o cube_info: the address of a structure of type QCubeInfo. % */ -static void DestroyCubeInfo(CubeInfo *cube_info) +static void DestroyQCubeInfo(QCubeInfo *cube_info) { - Nodes + QNodes *nodes; /* @@ -1324,16 +1324,16 @@ static void DestroyCubeInfo(CubeInfo *cube_info) do { nodes=cube_info->node_queue->next; - cube_info->node_queue->nodes=(NodeInfo *) RelinquishMagickMemory( + cube_info->node_queue->nodes=(QNodeInfo *) RelinquishMagickMemory( cube_info->node_queue->nodes); - cube_info->node_queue=(Nodes *) RelinquishMagickMemory( + cube_info->node_queue=(QNodes *) RelinquishMagickMemory( cube_info->node_queue); cube_info->node_queue=nodes; - } while (cube_info->node_queue != (Nodes *) NULL); + } while (cube_info->node_queue != (QNodes *) NULL); if (cube_info->memory_info != (MemoryInfo *) NULL) cube_info->memory_info=RelinquishVirtualMemory(cube_info->memory_info); cube_info->quantize_info=DestroyQuantizeInfo(cube_info->quantize_info); - cube_info=(CubeInfo *) RelinquishMagickMemory(cube_info); + cube_info=(QCubeInfo *) RelinquishMagickMemory(cube_info); } /* @@ -1388,7 +1388,7 @@ MagickExport QuantizeInfo *DestroyQuantizeInfo(QuantizeInfo *quantize_info) % % The format of the DitherImage method is: % -% MagickBooleanType DitherImage(Image *image,CubeInfo *cube_info) +% MagickBooleanType DitherImage(Image *image,QCubeInfo *cube_info) % % A description of each parameter follows. % @@ -1438,7 +1438,7 @@ static DoublePixelPacket **AcquirePixelTLS(const size_t count) return(pixels); } -static inline ssize_t CacheOffset(CubeInfo *cube_info, +static inline ssize_t CacheOffset(QCubeInfo *cube_info, const DoublePixelPacket *pixel) { #define RedShift(pixel) (((pixel) >> CacheShift) << (0*(8-CacheShift))) @@ -1457,7 +1457,7 @@ static inline ssize_t CacheOffset(CubeInfo *cube_info, return(offset); } -static MagickBooleanType FloydSteinbergDither(Image *image,CubeInfo *cube_info) +static MagickBooleanType FloydSteinbergDither(Image *image,QCubeInfo *cube_info) { #define DitherImageTag "Dither/Image" @@ -1490,9 +1490,6 @@ static MagickBooleanType FloydSteinbergDither(Image *image,CubeInfo *cube_info) const int id = GetOpenMPThreadId(); - CubeInfo - cube; - DoublePixelPacket *current, *previous; @@ -1503,6 +1500,9 @@ static MagickBooleanType FloydSteinbergDither(Image *image,CubeInfo *cube_info) PixelPacket *magick_restrict q; + QCubeInfo + cube; + size_t index; @@ -1578,7 +1578,7 @@ static MagickBooleanType FloydSteinbergDither(Image *image,CubeInfo *cube_info) i=CacheOffset(&cube,&pixel); if (cube.cache[i] < 0) { - NodeInfo + QNodeInfo *node_info; size_t @@ -1590,8 +1590,8 @@ static MagickBooleanType FloydSteinbergDither(Image *image,CubeInfo *cube_info) node_info=cube.root; for (index=MaxTreeDepth-1; (ssize_t) index > 0; index--) { - id=ColorToNodeId(&cube,&pixel,index); - if (node_info->child[id] == (NodeInfo *) NULL) + id=ColorToQNodeId(&cube,&pixel,index); + if (node_info->child[id] == (QNodeInfo *) NULL) break; node_info=node_info->child[id]; } @@ -1645,10 +1645,10 @@ static MagickBooleanType FloydSteinbergDither(Image *image,CubeInfo *cube_info) } static MagickBooleanType - RiemersmaDither(Image *,CacheView *,CubeInfo *,const unsigned int); + RiemersmaDither(Image *,CacheView *,QCubeInfo *,const unsigned int); static MagickBooleanType Riemersma(Image *image,CacheView *image_view, - CubeInfo *cube_info,const size_t level,const unsigned int direction) + QCubeInfo *cube_info,const size_t level,const unsigned int direction) { MagickStatusType status; @@ -1774,13 +1774,10 @@ static MagickBooleanType Riemersma(Image *image,CacheView *image_view, } static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view, - CubeInfo *cube_info,const unsigned int direction) + QCubeInfo *cube_info,const unsigned int direction) { #define DitherImageTag "Dither/Image" - CubeInfo - *p; - DoublePixelPacket color, pixel; @@ -1788,6 +1785,9 @@ static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view, MagickBooleanType proceed; + QCubeInfo + *p; + size_t index; @@ -1836,7 +1836,7 @@ static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view, i=CacheOffset(cube_info,&pixel); if (p->cache[i] < 0) { - NodeInfo + QNodeInfo *node_info; size_t @@ -1848,8 +1848,8 @@ static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view, node_info=p->root; for (index=MaxTreeDepth-1; (ssize_t) index > 0; index--) { - id=ColorToNodeId(cube_info,&pixel,index); - if (node_info->child[id] == (NodeInfo *) NULL) + id=ColorToQNodeId(cube_info,&pixel,index); + if (node_info->child[id] == (QNodeInfo *) NULL) break; node_info=node_info->child[id]; } @@ -1902,7 +1902,7 @@ static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view, return(MagickTrue); } -static MagickBooleanType DitherImage(Image *image,CubeInfo *cube_info) +static MagickBooleanType DitherImage(Image *image,QCubeInfo *cube_info) { CacheView *image_view; @@ -1949,17 +1949,17 @@ static MagickBooleanType DitherImage(Image *image,CubeInfo *cube_info) % % % % % % -+ G e t C u b e I n f o % ++ G e t Q C u b e I n f o % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% GetCubeInfo() initialize the Cube data structure. +% GetQCubeInfo() initialize the Cube data structure. % -% The format of the GetCubeInfo method is: +% The format of the GetQCubeInfo method is: % -% CubeInfo GetCubeInfo(const QuantizeInfo *quantize_info, +% QCubeInfo GetQCubeInfo(const QuantizeInfo *quantize_info, % const size_t depth,const size_t maximum_colors) % % A description of each parameter follows. @@ -1978,15 +1978,15 @@ static MagickBooleanType DitherImage(Image *image,CubeInfo *cube_info) % o maximum_colors: maximum colors. % */ -static CubeInfo *GetCubeInfo(const QuantizeInfo *quantize_info, +static QCubeInfo *GetQCubeInfo(const QuantizeInfo *quantize_info, const size_t depth,const size_t maximum_colors) { - CubeInfo - *cube_info; - MagickRealType weight; + QCubeInfo + *cube_info; + size_t length; @@ -1996,9 +1996,9 @@ static CubeInfo *GetCubeInfo(const QuantizeInfo *quantize_info, /* Initialize tree to describe color cube_info. */ - cube_info=(CubeInfo *) AcquireMagickMemory(sizeof(*cube_info)); - if (cube_info == (CubeInfo *) NULL) - return((CubeInfo *) NULL); + cube_info=(QCubeInfo *) AcquireMagickMemory(sizeof(*cube_info)); + if (cube_info == (QCubeInfo *) NULL) + return((QCubeInfo *) NULL); (void) memset(cube_info,0,sizeof(*cube_info)); cube_info->depth=depth; if (cube_info->depth > MaxTreeDepth) @@ -2009,9 +2009,9 @@ static CubeInfo *GetCubeInfo(const QuantizeInfo *quantize_info, /* Initialize root node. */ - cube_info->root=GetNodeInfo(cube_info,0,0,(NodeInfo *) NULL); - if (cube_info->root == (NodeInfo *) NULL) - return((CubeInfo *) NULL); + cube_info->root=GetQNodeInfo(cube_info,0,0,(QNodeInfo *) NULL); + if (cube_info->root == (QNodeInfo *) NULL) + return((QCubeInfo *) NULL); cube_info->root->parent=cube_info->root; cube_info->quantize_info=CloneQuantizeInfo(quantize_info); if (cube_info->quantize_info->dither == MagickFalse) @@ -2022,7 +2022,7 @@ static CubeInfo *GetCubeInfo(const QuantizeInfo *quantize_info, length=(size_t) (1UL << (4*(8-CacheShift))); cube_info->memory_info=AcquireVirtualMemory(length,sizeof(*cube_info->cache)); if (cube_info->memory_info == (MemoryInfo *) NULL) - return((CubeInfo *) NULL); + return((QCubeInfo *) NULL); cube_info->cache=(ssize_t *) GetVirtualMemoryBlob(cube_info->memory_info); /* Initialize color cache. @@ -2052,48 +2052,48 @@ static CubeInfo *GetCubeInfo(const QuantizeInfo *quantize_info, % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% GetNodeInfo() allocates memory for a new node in the color cube tree and +% GetQNodeInfo() allocates memory for a new node in the color cube tree and % presets all fields to zero. % -% The format of the GetNodeInfo method is: +% The format of the GetQNodeInfo method is: % -% NodeInfo *GetNodeInfo(CubeInfo *cube_info,const size_t id, -% const size_t level,NodeInfo *parent) +% QNodeInfo *GetQNodeInfo(QCubeInfo *cube_info,const size_t id, +% const size_t level,QNodeInfo *parent) % % A description of each parameter follows. % -% o node: The GetNodeInfo method returns a pointer to a queue of nodes. +% o node: The GetQNodeInfo method returns a pointer to a queue of nodes. % % o id: Specifies the child number of the node. % % o level: Specifies the level in the storage_class the node resides. % */ -static NodeInfo *GetNodeInfo(CubeInfo *cube_info,const size_t id, - const size_t level,NodeInfo *parent) +static QNodeInfo *GetQNodeInfo(QCubeInfo *cube_info,const size_t id, + const size_t level,QNodeInfo *parent) { - NodeInfo + QNodeInfo *node_info; if (cube_info->free_nodes == 0) { - Nodes + QNodes *nodes; /* Allocate a new queue of nodes. */ - nodes=(Nodes *) AcquireMagickMemory(sizeof(*nodes)); - if (nodes == (Nodes *) NULL) - return((NodeInfo *) NULL); - nodes->nodes=(NodeInfo *) AcquireQuantumMemory(NodesInAList, + nodes=(QNodes *) AcquireMagickMemory(sizeof(*nodes)); + if (nodes == (QNodes *) NULL) + return((QNodeInfo *) NULL); + nodes->nodes=(QNodeInfo *) AcquireQuantumMemory(QNodesInAList, sizeof(*nodes->nodes)); - if (nodes->nodes == (NodeInfo *) NULL) - return((NodeInfo *) NULL); + if (nodes->nodes == (QNodeInfo *) NULL) + return((QNodeInfo *) NULL); nodes->next=cube_info->node_queue; cube_info->node_queue=nodes; cube_info->next_node=nodes->nodes; - cube_info->free_nodes=NodesInAList; + cube_info->free_nodes=QNodesInAList; } cube_info->nodes++; cube_info->free_nodes--; @@ -2325,13 +2325,25 @@ MagickExport MagickBooleanType PosterizeImage(Image *image,const size_t levels, return(status); } +static inline Quantum PosterizePixel(const Quantum pixel,const size_t levels) +{ + double + step_size; + + size_t + level_index; + + if (levels < 2) + return(pixel); + step_size=1.0/(levels-1.0); + level_index=(step_size == 0.0) ? 0 : floor((double) pixel/step_size); + return(ClampToQuantum(level_index*step_size)); +} + MagickExport MagickBooleanType PosterizeImageChannel(Image *image, const ChannelType channel,const size_t levels,const MagickBooleanType dither) { #define PosterizeImageTag "Posterize/Image" -#define PosterizePixel(pixel) ClampToQuantum((MagickRealType) QuantumRange*( \ - MagickRound(QuantumScale*(MagickRealType) pixel*(levels-1)))/ \ - MagickMax((ssize_t) levels-1,1)) CacheView *image_view; @@ -2368,16 +2380,16 @@ MagickExport MagickBooleanType PosterizeImageChannel(Image *image, */ if ((channel & RedChannel) != 0) image->colormap[i].red=(MagickRealType) - PosterizePixel(image->colormap[i].red); + PosterizePixel(image->colormap[i].red,levels); if ((channel & GreenChannel) != 0) image->colormap[i].green=(MagickRealType) - PosterizePixel(image->colormap[i].green); + PosterizePixel(image->colormap[i].green,levels); if ((channel & BlueChannel) != 0) image->colormap[i].blue=(MagickRealType) - PosterizePixel(image->colormap[i].blue); + PosterizePixel(image->colormap[i].blue,levels); if ((channel & OpacityChannel) != 0) image->colormap[i].opacity=(MagickRealType) - PosterizePixel(image->colormap[i].opacity); + PosterizePixel(image->colormap[i].opacity,levels); } /* Posterize image. @@ -2413,17 +2425,18 @@ MagickExport MagickBooleanType PosterizeImageChannel(Image *image, for (x=0; x < (ssize_t) image->columns; x++) { if ((channel & RedChannel) != 0) - SetPixelRed(q,PosterizePixel(GetPixelRed(q))); + SetPixelRed(q,PosterizePixel(GetPixelRed(q),levels)); if ((channel & GreenChannel) != 0) - SetPixelGreen(q,PosterizePixel(GetPixelGreen(q))); + SetPixelGreen(q,PosterizePixel(GetPixelGreen(q),levels)); if ((channel & BlueChannel) != 0) - SetPixelBlue(q,PosterizePixel(GetPixelBlue(q))); + SetPixelBlue(q,PosterizePixel(GetPixelBlue(q),levels)); if (((channel & OpacityChannel) != 0) && (image->matte != MagickFalse)) - SetPixelOpacity(q,PosterizePixel(GetPixelOpacity(q))); + SetPixelOpacity(q,PosterizePixel(GetPixelOpacity(q),levels)); if (((channel & IndexChannel) != 0) && (image->colorspace == CMYKColorspace)) - SetPixelIndex(indexes+x,PosterizePixel(GetPixelIndex(indexes+x))); + SetPixelIndex(indexes+x,PosterizePixel(GetPixelIndex(indexes+x), + levels)); q++; } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) @@ -2445,9 +2458,8 @@ MagickExport MagickBooleanType PosterizeImageChannel(Image *image, image_view=DestroyCacheView(image_view); quantize_info=AcquireQuantizeInfo((ImageInfo *) NULL); quantize_info->number_colors=(size_t) MagickMin((ssize_t) levels*levels* - levels,MaxColormapSize+1); + levels,MaxColormapSize); quantize_info->dither=dither; - quantize_info->tree_depth=MaxTreeDepth; status=QuantizeImage(quantize_info,image); quantize_info=DestroyQuantizeInfo(quantize_info); return(status); @@ -2469,7 +2481,7 @@ MagickExport MagickBooleanType PosterizeImageChannel(Image *image, % % The format of the PruneSubtree method is: % -% PruneChild(CubeInfo *cube_info,const NodeInfo *node_info) +% PruneChild(QCubeInfo *cube_info,const QNodeInfo *node_info) % % A description of each parameter follows. % @@ -2478,9 +2490,9 @@ MagickExport MagickBooleanType PosterizeImageChannel(Image *image, % o node_info: pointer to node in color cube tree that is to be pruned. % */ -static void PruneChild(CubeInfo *cube_info,const NodeInfo *node_info) +static void PruneChild(QCubeInfo *cube_info,const QNodeInfo *node_info) { - NodeInfo + QNodeInfo *parent; size_t @@ -2494,7 +2506,7 @@ static void PruneChild(CubeInfo *cube_info,const NodeInfo *node_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) + if (node_info->child[i] != (QNodeInfo *) NULL) PruneChild(cube_info,node_info->child[i]); if (cube_info->nodes > cube_info->maximum_colors) { @@ -2507,7 +2519,7 @@ static void PruneChild(CubeInfo *cube_info,const NodeInfo *node_info) parent->total_color.green+=node_info->total_color.green; parent->total_color.blue+=node_info->total_color.blue; parent->total_color.opacity+=node_info->total_color.opacity; - parent->child[node_info->id]=(NodeInfo *) NULL; + parent->child[node_info->id]=(QNodeInfo *) NULL; cube_info->nodes--; } } @@ -2528,7 +2540,7 @@ static void PruneChild(CubeInfo *cube_info,const NodeInfo *node_info) % % The format of the PruneLevel method is: % -% PruneLevel(CubeInfo *cube_info,const NodeInfo *node_info) +% PruneLevel(QCubeInfo *cube_info,const QNodeInfo *node_info) % % A description of each parameter follows. % @@ -2537,7 +2549,7 @@ static void PruneChild(CubeInfo *cube_info,const NodeInfo *node_info) % o node_info: pointer to node in color cube tree that is to be pruned. % */ -static void PruneLevel(CubeInfo *cube_info,const NodeInfo *node_info) +static void PruneLevel(QCubeInfo *cube_info,const QNodeInfo *node_info) { size_t number_children; @@ -2550,7 +2562,7 @@ static void PruneLevel(CubeInfo *cube_info,const NodeInfo *node_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) + if (node_info->child[i] != (QNodeInfo *) NULL) PruneLevel(cube_info,node_info->child[i]); if (node_info->level == cube_info->depth) PruneChild(cube_info,node_info); @@ -2573,7 +2585,7 @@ static void PruneLevel(CubeInfo *cube_info,const NodeInfo *node_info) % % The format of the PruneToCubeDepth method is: % -% PruneToCubeDepth(CubeInfo *cube_info,const NodeInfo *node_info) +% PruneToCubeDepth(QCubeInfo *cube_info,const QNodeInfo *node_info) % % A description of each parameter follows. % @@ -2582,7 +2594,7 @@ static void PruneLevel(CubeInfo *cube_info,const NodeInfo *node_info) % o node_info: pointer to node in color cube tree that is to be pruned. % */ -static void PruneToCubeDepth(CubeInfo *cube_info,const NodeInfo *node_info) +static void PruneToCubeDepth(QCubeInfo *cube_info,const QNodeInfo *node_info) { size_t number_children; @@ -2595,7 +2607,7 @@ static void PruneToCubeDepth(CubeInfo *cube_info,const NodeInfo *node_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) + if (node_info->child[i] != (QNodeInfo *) NULL) PruneToCubeDepth(cube_info,node_info->child[i]); if (node_info->level > cube_info->depth) PruneChild(cube_info,node_info); @@ -2632,12 +2644,12 @@ static void PruneToCubeDepth(CubeInfo *cube_info,const NodeInfo *node_info) MagickExport MagickBooleanType QuantizeImage(const QuantizeInfo *quantize_info, Image *image) { - CubeInfo - *cube_info; - MagickBooleanType status; + QCubeInfo + *cube_info; + size_t depth, maximum_colors; @@ -2680,8 +2692,8 @@ MagickExport MagickBooleanType QuantizeImage(const QuantizeInfo *quantize_info, /* Initialize color cube. */ - cube_info=GetCubeInfo(quantize_info,depth,maximum_colors); - if (cube_info == (CubeInfo *) NULL) + cube_info=GetQCubeInfo(quantize_info,depth,maximum_colors); + if (cube_info == (QCubeInfo *) NULL) ThrowBinaryImageException(ResourceLimitError,"MemoryAllocationFailed", image->filename); status=ClassifyImageColors(cube_info,image,&image->exception); @@ -2694,7 +2706,7 @@ MagickExport MagickBooleanType QuantizeImage(const QuantizeInfo *quantize_info, ReduceImageColors(image,cube_info); status=AssignImageColors(image,cube_info); } - DestroyCubeInfo(cube_info); + DestroyQCubeInfo(cube_info); return(status); } @@ -2729,9 +2741,6 @@ MagickExport MagickBooleanType QuantizeImage(const QuantizeInfo *quantize_info, MagickExport MagickBooleanType QuantizeImages(const QuantizeInfo *quantize_info, Image *images) { - CubeInfo - *cube_info; - Image *image; @@ -2742,6 +2751,9 @@ MagickExport MagickBooleanType QuantizeImages(const QuantizeInfo *quantize_info, MagickProgressMonitor progress_monitor; + QCubeInfo + *cube_info; + size_t depth, maximum_colors, @@ -2788,8 +2800,8 @@ MagickExport MagickBooleanType QuantizeImages(const QuantizeInfo *quantize_info, /* Initialize color cube. */ - cube_info=GetCubeInfo(quantize_info,depth,maximum_colors); - if (cube_info == (CubeInfo *) NULL) + cube_info=GetQCubeInfo(quantize_info,depth,maximum_colors); + if (cube_info == (QCubeInfo *) NULL) { (void) ThrowMagickException(&images->exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",images->filename); @@ -2834,7 +2846,7 @@ MagickExport MagickBooleanType QuantizeImages(const QuantizeInfo *quantize_info, image=GetNextImageInList(image); } } - DestroyCubeInfo(cube_info); + DestroyQCubeInfo(cube_info); return(status); } @@ -2856,8 +2868,8 @@ MagickExport MagickBooleanType QuantizeImages(const QuantizeInfo *quantize_info, % % The format of the QuantizeErrorFlatten method is: % -% size_t QuantizeErrorFlatten(const CubeInfo *cube_info, -% const NodeInfo *node_info,const ssize_t offset, +% size_t QuantizeErrorFlatten(const QCubeInfo *cube_info, +% const QNodeInfo *node_info,const ssize_t offset, % MagickRealType *quantize_error) % % A description of each parameter follows. @@ -2871,8 +2883,8 @@ MagickExport MagickBooleanType QuantizeImages(const QuantizeInfo *quantize_info, % o quantize_error: the quantization error vector. % */ -static size_t QuantizeErrorFlatten(const CubeInfo *cube_info, - const NodeInfo *node_info,const ssize_t offset, +static size_t QuantizeErrorFlatten(const QCubeInfo *cube_info, + const QNodeInfo *node_info,const ssize_t offset, MagickRealType *quantize_error) { size_t @@ -2888,7 +2900,7 @@ static size_t QuantizeErrorFlatten(const CubeInfo *cube_info, n=1; 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) + if (node_info->child[i] != (QNodeInfo *) NULL) n+=QuantizeErrorFlatten(cube_info,node_info->child[i],offset+n, quantize_error); return(n); @@ -2910,7 +2922,7 @@ static size_t QuantizeErrorFlatten(const CubeInfo *cube_info, % % The format of the Reduce method is: % -% Reduce(CubeInfo *cube_info,const NodeInfo *node_info) +% Reduce(QCubeInfo *cube_info,const QNodeInfo *node_info) % % A description of each parameter follows. % @@ -2919,7 +2931,7 @@ static size_t QuantizeErrorFlatten(const CubeInfo *cube_info, % o node_info: pointer to node in color cube tree that is to be pruned. % */ -static void Reduce(CubeInfo *cube_info,const NodeInfo *node_info) +static void Reduce(QCubeInfo *cube_info,const QNodeInfo *node_info) { size_t number_children; @@ -2932,7 +2944,7 @@ static void Reduce(CubeInfo *cube_info,const NodeInfo *node_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) + if (node_info->child[i] != (QNodeInfo *) NULL) Reduce(cube_info,node_info->child[i]); if (node_info->quantize_error <= cube_info->pruning_threshold) PruneChild(cube_info,node_info); @@ -2993,7 +3005,7 @@ static void Reduce(CubeInfo *cube_info,const NodeInfo *node_info) % % The format of the ReduceImageColors method is: % -% ReduceImageColors(const Image *image,CubeInfo *cube_info) +% ReduceImageColors(const Image *image,QCubeInfo *cube_info) % % A description of each parameter follows. % @@ -3018,7 +3030,7 @@ static int MagickRealTypeCompare(const void *error_p,const void *error_q) return(-1); } -static void ReduceImageColors(const Image *image,CubeInfo *cube_info) +static void ReduceImageColors(const Image *image,QCubeInfo *cube_info) { #define ReduceImageTag "Reduce/Image" @@ -3100,12 +3112,12 @@ static void ReduceImageColors(const Image *image,CubeInfo *cube_info) MagickExport MagickBooleanType RemapImage(const QuantizeInfo *quantize_info, Image *image,const Image *remap_image) { - CubeInfo - *cube_info; - MagickBooleanType status; + QCubeInfo + *cube_info; + /* Initialize color cube. */ @@ -3115,9 +3127,8 @@ MagickExport MagickBooleanType RemapImage(const QuantizeInfo *quantize_info, (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); assert(remap_image != (Image *) NULL); assert(remap_image->signature == MagickCoreSignature); - cube_info=GetCubeInfo(quantize_info,MaxTreeDepth, - quantize_info->number_colors); - if (cube_info == (CubeInfo *) NULL) + cube_info=GetQCubeInfo(quantize_info,MaxTreeDepth,MaxColormapSize); + if (cube_info == (QCubeInfo *) NULL) ThrowBinaryImageException(ResourceLimitError,"MemoryAllocationFailed", image->filename); cube_info->quantize_info->colorspace=remap_image->colorspace; @@ -3128,9 +3139,11 @@ MagickExport MagickBooleanType RemapImage(const QuantizeInfo *quantize_info, Classify image colors from the reference image. */ cube_info->quantize_info->number_colors=cube_info->colors; + if (cube_info->colors > cube_info->maximum_colors) + ReduceImageColors(image,cube_info); status=AssignImageColors(image,cube_info); } - DestroyCubeInfo(cube_info); + DestroyQCubeInfo(cube_info); return(status); } @@ -3165,15 +3178,15 @@ MagickExport MagickBooleanType RemapImage(const QuantizeInfo *quantize_info, MagickExport MagickBooleanType RemapImages(const QuantizeInfo *quantize_info, Image *images,const Image *remap_image) { - CubeInfo - *cube_info; - Image *image; MagickBooleanType status; + QCubeInfo + *cube_info; + assert(images != (Image *) NULL); assert(images->signature == MagickCoreSignature); if (IsEventLogging() != MagickFalse) @@ -3190,9 +3203,9 @@ MagickExport MagickBooleanType RemapImages(const QuantizeInfo *quantize_info, /* Classify image colors from the reference image. */ - cube_info=GetCubeInfo(quantize_info,MaxTreeDepth, + cube_info=GetQCubeInfo(quantize_info,MaxTreeDepth, quantize_info->number_colors); - if (cube_info == (CubeInfo *) NULL) + if (cube_info == (QCubeInfo *) NULL) ThrowBinaryImageException(ResourceLimitError,"MemoryAllocationFailed", image->filename); status=ClassifyImageColors(cube_info,remap_image,&image->exception); @@ -3210,7 +3223,7 @@ MagickExport MagickBooleanType RemapImages(const QuantizeInfo *quantize_info, break; } } - DestroyCubeInfo(cube_info); + DestroyQCubeInfo(cube_info); return(status); } diff --git a/magick/quantum-export.c b/magick/quantum-export.c index 75efcc9d10c10a54f281f1108d863089b569fd7b..062db72a91b4f9889bd189cd68c1dedca8f9c5f5 100644 --- a/magick/quantum-export.c +++ b/magick/quantum-export.c @@ -84,8 +84,7 @@ % % ExportQuantumPixels() transfers one or more pixel components from the image % pixel cache to a user supplied buffer. The pixels are returned in network -% byte order. MagickTrue is returned if the pixels are successfully -% transferred, otherwise MagickFalse. +% byte order. It returns the number of exported pixels. % % The format of the ExportQuantumPixels method is: % @@ -261,7 +260,7 @@ static void ExportAlphaQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToChar((Quantum) (QuantumRange-GetPixelOpacity(p))); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -277,7 +276,7 @@ static void ExportAlphaQuantum(QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelAlpha(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -286,7 +285,7 @@ static void ExportAlphaQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToShort((Quantum) (QuantumRange-GetPixelOpacity(p))); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -305,7 +304,7 @@ static void ExportAlphaQuantum(QuantumInfo *quantum_info, pixel=(float) (GetPixelAlpha(p)); q=PopQuantumFloatPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -314,7 +313,7 @@ static void ExportAlphaQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToLong((Quantum) (QuantumRange-GetPixelOpacity(p))); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -330,7 +329,7 @@ static void ExportAlphaQuantum(QuantumInfo *quantum_info, pixel=(double) (GetPixelAlpha(p)); q=PopQuantumDoublePixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -344,7 +343,7 @@ static void ExportAlphaQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info,ScaleQuantumToAny((Quantum) (GetPixelAlpha(p)),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -374,7 +373,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, q=PopCharPixel(ScaleQuantumToChar(GetPixelGreen(p)),q); q=PopCharPixel(ScaleQuantumToChar(GetPixelRed(p)),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -394,7 +393,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, ScaleQuantumToAny(GetPixelBlue(p),range) << 2); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -409,7 +408,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(p),range); q=PopQuantumLongPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -422,7 +421,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(p),range); q=PopQuantumPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -478,7 +477,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, } } q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel << 4),q); - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } for (bit=0; bit < (ssize_t) (3*number_pixels % 2); bit++) { @@ -503,7 +502,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, } } q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel << 4),q); - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } if (bit != 0) p++; @@ -520,7 +519,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(p),range); q=PopQuantumLongPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -533,7 +532,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(p),range); q=PopQuantumPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -553,7 +552,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelRed(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -566,7 +565,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(GetPixelRed(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -583,7 +582,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, q=PopQuantumFloatPixel(quantum_info,(float) GetPixelGreen(p),q); q=PopQuantumFloatPixel(quantum_info,(float) GetPixelBlue(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -596,7 +595,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(GetPixelRed(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -610,7 +609,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, q=PopQuantumDoublePixel(quantum_info,(double) GetPixelGreen(p),q); q=PopQuantumDoublePixel(quantum_info,(double) GetPixelBlue(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -628,7 +627,7 @@ static void ExportBGRQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny(GetPixelBlue(p),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -663,7 +662,7 @@ static void ExportBGRAQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToChar((Quantum) GetPixelAlpha(p)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -724,7 +723,7 @@ static void ExportBGRAQuantum(QuantumInfo *quantum_info, n++; } p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -742,7 +741,7 @@ static void ExportBGRAQuantum(QuantumInfo *quantum_info, range); q=PopQuantumLongPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -758,7 +757,7 @@ static void ExportBGRAQuantum(QuantumInfo *quantum_info, range); q=PopQuantumPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -780,7 +779,7 @@ static void ExportBGRAQuantum(QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelAlpha(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -795,7 +794,7 @@ static void ExportBGRAQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToShort((Quantum) GetPixelAlpha(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -817,7 +816,7 @@ static void ExportBGRAQuantum(QuantumInfo *quantum_info, pixel=(float) GetPixelAlpha(p); q=PopQuantumFloatPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -832,7 +831,7 @@ static void ExportBGRAQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToLong((Quantum) GetPixelAlpha(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -851,7 +850,7 @@ static void ExportBGRAQuantum(QuantumInfo *quantum_info, pixel=(double) GetPixelAlpha(p); q=PopQuantumDoublePixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -871,7 +870,7 @@ static void ExportBGRAQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny((Quantum) GetPixelAlpha(p),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -906,7 +905,7 @@ static void ExportBGROQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToChar(GetPixelOpacity(p)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -967,7 +966,7 @@ static void ExportBGROQuantum(QuantumInfo *quantum_info, n++; } p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -984,7 +983,7 @@ static void ExportBGROQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelOpacity(p),range); q=PopQuantumLongPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -999,7 +998,7 @@ static void ExportBGROQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelOpacity(p),range); q=PopQuantumPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1021,7 +1020,7 @@ static void ExportBGROQuantum(QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelOpacity(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1036,7 +1035,7 @@ static void ExportBGROQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(GetPixelOpacity(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1058,7 +1057,7 @@ static void ExportBGROQuantum(QuantumInfo *quantum_info, pixel=(float) GetPixelOpacity(p); q=PopQuantumFloatPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1073,7 +1072,7 @@ static void ExportBGROQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(GetPixelOpacity(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1092,7 +1091,7 @@ static void ExportBGROQuantum(QuantumInfo *quantum_info, pixel=(double) GetPixelOpacity(p); q=PopQuantumDoublePixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1112,7 +1111,7 @@ static void ExportBGROQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny(GetPixelOpacity(p),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1145,7 +1144,7 @@ static void ExportBlackQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToChar(GetPixelIndex(indexes+x)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1161,7 +1160,7 @@ static void ExportBlackQuantum(const Image *image,QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelIndex(indexes+x)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1170,7 +1169,7 @@ static void ExportBlackQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(GetPixelIndex(indexes+x)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1185,7 +1184,7 @@ static void ExportBlackQuantum(const Image *image,QuantumInfo *quantum_info, { q=PopQuantumFloatPixel(quantum_info,(float) GetPixelIndex(indexes+x),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1194,7 +1193,7 @@ static void ExportBlackQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(GetPixelIndex(indexes+x)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1207,7 +1206,7 @@ static void ExportBlackQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumDoublePixel(quantum_info,(double) GetPixelIndex(indexes+x), q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1224,7 +1223,7 @@ static void ExportBlackQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny((Quantum) GetPixelIndex(indexes+x),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1253,7 +1252,7 @@ static void ExportBlueQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToChar(GetPixelBlue(p)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1269,7 +1268,7 @@ static void ExportBlueQuantum(QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelBlue(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1278,7 +1277,7 @@ static void ExportBlueQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(GetPixelBlue(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1293,7 +1292,7 @@ static void ExportBlueQuantum(QuantumInfo *quantum_info, { q=PopQuantumFloatPixel(quantum_info,(float) GetPixelBlue(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1302,7 +1301,7 @@ static void ExportBlueQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(GetPixelBlue(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1314,7 +1313,7 @@ static void ExportBlueQuantum(QuantumInfo *quantum_info, { q=PopQuantumDoublePixel(quantum_info,(double) GetPixelBlue(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1328,7 +1327,7 @@ static void ExportBlueQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny(GetPixelBlue(p),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1400,7 +1399,7 @@ static void ExportCbYCrYQuantum(QuantumInfo *quantum_info, (cbcr[0]) << 12 | (size_t) (cbcr[2]) << 2); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1447,7 +1446,7 @@ static void ExportCbYCrYQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny(cbcr[2],range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1489,7 +1488,7 @@ static void ExportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToChar(GetPixelIndex(indexes+x)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1511,7 +1510,7 @@ static void ExportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelIndex(indexes+x)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1526,7 +1525,7 @@ static void ExportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(GetPixelIndex(indexes+x)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1544,7 +1543,7 @@ static void ExportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumFloatPixel(quantum_info,(float) GetPixelBlue(p),q); q=PopQuantumFloatPixel(quantum_info,(float) GetPixelIndex(indexes+x),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1559,7 +1558,7 @@ static void ExportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(GetPixelIndex(indexes+x)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1575,7 +1574,7 @@ static void ExportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumDoublePixel(quantum_info,(double) GetPixelIndex(indexes+x),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1595,7 +1594,7 @@ static void ExportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny(GetPixelIndex(indexes+x),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1639,7 +1638,7 @@ static void ExportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToChar((Quantum) GetPixelAlpha(p)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1663,7 +1662,7 @@ static void ExportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelAlpha(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1680,7 +1679,7 @@ static void ExportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToShort((Quantum) GetPixelAlpha(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1703,7 +1702,7 @@ static void ExportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, pixel=(float) (GetPixelAlpha(p)); q=PopQuantumFloatPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1720,7 +1719,7 @@ static void ExportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToLong((Quantum) GetPixelAlpha(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1741,7 +1740,7 @@ static void ExportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, pixel=(double) (GetPixelAlpha(p)); q=PopQuantumDoublePixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1763,7 +1762,7 @@ static void ExportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny((Quantum) GetPixelAlpha(p),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1807,7 +1806,7 @@ static void ExportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToChar(GetPixelOpacity(p)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1831,7 +1830,7 @@ static void ExportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelOpacity(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1848,7 +1847,7 @@ static void ExportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(GetPixelOpacity(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1871,7 +1870,7 @@ static void ExportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, pixel=(float) (GetPixelOpacity(p)); q=PopQuantumFloatPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1888,7 +1887,7 @@ static void ExportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(GetPixelOpacity(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1909,7 +1908,7 @@ static void ExportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, pixel=(double) (GetPixelOpacity(p)); q=PopQuantumDoublePixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1931,7 +1930,7 @@ static void ExportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny(GetPixelOpacity(p),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2037,7 +2036,7 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToChar(ClampToQuantum(GetPixelLuma(image,p))); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2056,8 +2055,8 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(image,p+1)),range) << 12 | ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(image,p+0)),range) << 2); q=PopLongPixel(quantum_info->endian,pixel,q); - p+=3; - q+=quantum_info->pad; + p+=(ptrdiff_t) 3; + q+=(ptrdiff_t) quantum_info->pad; } if (x < (ssize_t) number_pixels) { @@ -2077,7 +2076,7 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(ClampToQuantum( GetPixelLuma(image,p)),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2094,7 +2093,7 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(ClampToQuantum(GetPixelLuma(image,p))); q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel >> 4),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2103,7 +2102,7 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(ClampToQuantum( GetPixelLuma(image,p)),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2119,7 +2118,7 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelLuma(image,p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2128,7 +2127,7 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(ClampToQuantum(GetPixelLuma(image,p))); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2147,7 +2146,7 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, pixel=(float) GetPixelLuma(image,p); q=PopQuantumFloatPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2156,7 +2155,7 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(ClampToQuantum(GetPixelLuma(image,p))); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2172,7 +2171,7 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, pixel=(double) GetPixelLuma(image,p); q=PopQuantumDoublePixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2186,7 +2185,7 @@ static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(image,p)),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2296,7 +2295,7 @@ static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToChar((Quantum) (QuantumRange-GetPixelOpacity(p))); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2314,7 +2313,7 @@ static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelAlpha(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2325,7 +2324,7 @@ static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToShort((Quantum) (QuantumRange-GetPixelOpacity(p))); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2346,7 +2345,7 @@ static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, pixel=(float) (GetPixelAlpha(p)); q=PopQuantumFloatPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2357,7 +2356,7 @@ static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, pixel=ScaleQuantumToLong((Quantum) (QuantumRange-GetPixelOpacity(p))); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2375,7 +2374,7 @@ static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, pixel=(double) (GetPixelAlpha(p)); q=PopQuantumDoublePixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2391,7 +2390,7 @@ static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny((Quantum) (GetPixelAlpha(p)),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2420,7 +2419,7 @@ static void ExportGreenQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToChar(GetPixelGreen(p)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2436,7 +2435,7 @@ static void ExportGreenQuantum(QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelGreen(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2445,7 +2444,7 @@ static void ExportGreenQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(GetPixelGreen(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2460,7 +2459,7 @@ static void ExportGreenQuantum(QuantumInfo *quantum_info, { q=PopQuantumFloatPixel(quantum_info,(float) GetPixelGreen(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2469,7 +2468,7 @@ static void ExportGreenQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(GetPixelGreen(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2481,7 +2480,7 @@ static void ExportGreenQuantum(QuantumInfo *quantum_info, { q=PopQuantumDoublePixel(quantum_info,(double) GetPixelGreen(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2495,7 +2494,7 @@ static void ExportGreenQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny(GetPixelGreen(p),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2584,7 +2583,7 @@ static void ExportIndexQuantum(const Image *image,QuantumInfo *quantum_info, for (x=0; x < (ssize_t) number_pixels; x++) { q=PopCharPixel((unsigned char) GetPixelIndex(indexes+x),q); - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2596,14 +2595,14 @@ static void ExportIndexQuantum(const Image *image,QuantumInfo *quantum_info, { q=PopShortPixel(quantum_info->endian,SinglePrecisionToHalf( QuantumScale*(MagickRealType) GetPixelIndex(indexes+x)),q); - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } for (x=0; x < (ssize_t) number_pixels; x++) { q=PopShortPixel(quantum_info->endian,(unsigned short) GetPixelIndex(indexes+x),q); - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2615,14 +2614,14 @@ static void ExportIndexQuantum(const Image *image,QuantumInfo *quantum_info, { q=PopQuantumFloatPixel(quantum_info,(float) GetPixelIndex(indexes+x),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } for (x=0; x < (ssize_t) number_pixels; x++) { q=PopLongPixel(quantum_info->endian,(unsigned int) GetPixelIndex(indexes+x),q); - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2635,7 +2634,7 @@ static void ExportIndexQuantum(const Image *image,QuantumInfo *quantum_info, q=PopQuantumDoublePixel(quantum_info,(double) GetPixelIndex(indexes+x), q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2647,7 +2646,7 @@ static void ExportIndexQuantum(const Image *image,QuantumInfo *quantum_info, { q=PopQuantumPixel(quantum_info,(QuantumAny) GetPixelIndex(indexes+x),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2751,7 +2750,7 @@ static void ExportIndexAlphaQuantum(const Image *image, pixel=ScaleQuantumToChar((Quantum) (QuantumRange-GetPixelOpacity(p))); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2769,7 +2768,7 @@ static void ExportIndexAlphaQuantum(const Image *image, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelAlpha(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2780,7 +2779,7 @@ static void ExportIndexAlphaQuantum(const Image *image, pixel=ScaleQuantumToShort((Quantum) (QuantumRange-GetPixelOpacity(p))); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2800,7 +2799,7 @@ static void ExportIndexAlphaQuantum(const Image *image, pixel=(float) (GetPixelAlpha(p)); q=PopQuantumFloatPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2811,7 +2810,7 @@ static void ExportIndexAlphaQuantum(const Image *image, pixel=ScaleQuantumToLong((Quantum) (QuantumRange-GetPixelOpacity(p))); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2829,7 +2828,7 @@ static void ExportIndexAlphaQuantum(const Image *image, pixel=(double) (GetPixelAlpha(p)); q=PopQuantumDoublePixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2847,7 +2846,7 @@ static void ExportIndexAlphaQuantum(const Image *image, q=PopQuantumPixel(quantum_info,ScaleQuantumToAny((Quantum) (GetPixelAlpha(p)),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2876,7 +2875,7 @@ static void ExportOpacityQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToChar(GetPixelOpacity(p)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2892,7 +2891,7 @@ static void ExportOpacityQuantum(QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelOpacity(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2901,7 +2900,7 @@ static void ExportOpacityQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(GetPixelOpacity(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2916,7 +2915,7 @@ static void ExportOpacityQuantum(QuantumInfo *quantum_info, { q=PopQuantumFloatPixel(quantum_info,(float) GetPixelOpacity(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2925,7 +2924,7 @@ static void ExportOpacityQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(GetPixelOpacity(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2937,7 +2936,7 @@ static void ExportOpacityQuantum(QuantumInfo *quantum_info, { q=PopQuantumDoublePixel(quantum_info,(double) GetPixelOpacity(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2951,7 +2950,7 @@ static void ExportOpacityQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny(GetPixelOpacity(p),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2980,7 +2979,7 @@ static void ExportRedQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToChar(GetPixelRed(p)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -2996,7 +2995,7 @@ static void ExportRedQuantum(QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelRed(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3005,7 +3004,7 @@ static void ExportRedQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(GetPixelRed(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3020,7 +3019,7 @@ static void ExportRedQuantum(QuantumInfo *quantum_info, { q=PopQuantumFloatPixel(quantum_info,(float) GetPixelRed(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3029,7 +3028,7 @@ static void ExportRedQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(GetPixelRed(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3041,7 +3040,7 @@ static void ExportRedQuantum(QuantumInfo *quantum_info, { q=PopQuantumDoublePixel(quantum_info,(double) GetPixelRed(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3055,7 +3054,7 @@ static void ExportRedQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelRed(p),range), q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3085,7 +3084,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, q=PopCharPixel(ScaleQuantumToChar(GetPixelGreen(p)),q); q=PopCharPixel(ScaleQuantumToChar(GetPixelBlue(p)),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3105,7 +3104,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, ScaleQuantumToAny(GetPixelBlue(p),range) << 2); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3120,7 +3119,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(p),range); q=PopQuantumLongPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3133,7 +3132,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(p),range); q=PopQuantumPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3191,7 +3190,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, } q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel << 4), q); - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } for (bit=0; bit < (ssize_t) (3*number_pixels % 2); bit++) { @@ -3217,7 +3216,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, } q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel << 4), q); - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } if (bit != 0) p++; @@ -3234,7 +3233,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(p),range); q=PopQuantumLongPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3247,7 +3246,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(p),range); q=PopQuantumPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3267,7 +3266,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelBlue(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3280,7 +3279,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(GetPixelBlue(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3297,7 +3296,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, q=PopQuantumFloatPixel(quantum_info,(float) GetPixelGreen(p),q); q=PopQuantumFloatPixel(quantum_info,(float) GetPixelBlue(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3310,7 +3309,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(GetPixelBlue(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3324,7 +3323,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, q=PopQuantumDoublePixel(quantum_info,(double) GetPixelGreen(p),q); q=PopQuantumDoublePixel(quantum_info,(double) GetPixelBlue(p),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3342,7 +3341,7 @@ static void ExportRGBQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info, ScaleQuantumToAny(GetPixelBlue(p),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3377,7 +3376,7 @@ static void ExportRGBAQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToChar((Quantum) GetPixelAlpha(p)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3438,7 +3437,7 @@ static void ExportRGBAQuantum(QuantumInfo *quantum_info, n++; } p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3456,7 +3455,7 @@ static void ExportRGBAQuantum(QuantumInfo *quantum_info, range); q=PopQuantumLongPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3472,7 +3471,7 @@ static void ExportRGBAQuantum(QuantumInfo *quantum_info, range); q=PopQuantumPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3494,7 +3493,7 @@ static void ExportRGBAQuantum(QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelAlpha(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3509,7 +3508,7 @@ static void ExportRGBAQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToShort((Quantum) GetPixelAlpha(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3531,7 +3530,7 @@ static void ExportRGBAQuantum(QuantumInfo *quantum_info, pixel=(float) GetPixelAlpha(p); q=PopQuantumFloatPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3546,7 +3545,7 @@ static void ExportRGBAQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToLong((Quantum) GetPixelAlpha(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3565,7 +3564,7 @@ static void ExportRGBAQuantum(QuantumInfo *quantum_info, pixel=(double) GetPixelAlpha(p); q=PopQuantumDoublePixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3585,7 +3584,7 @@ static void ExportRGBAQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info,ScaleQuantumToAny((Quantum) GetPixelAlpha(p),range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3620,7 +3619,7 @@ static void ExportRGBOQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToChar(GetPixelOpacity(p)); q=PopCharPixel(pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3681,7 +3680,7 @@ static void ExportRGBOQuantum(QuantumInfo *quantum_info, n++; } p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3698,7 +3697,7 @@ static void ExportRGBOQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelOpacity(p),range); q=PopQuantumLongPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3713,7 +3712,7 @@ static void ExportRGBOQuantum(QuantumInfo *quantum_info, pixel=(unsigned int) ScaleQuantumToAny(GetPixelOpacity(p),range); q=PopQuantumPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3735,7 +3734,7 @@ static void ExportRGBOQuantum(QuantumInfo *quantum_info, pixel=SinglePrecisionToHalf(QuantumScale*(MagickRealType) GetPixelOpacity(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3750,7 +3749,7 @@ static void ExportRGBOQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToShort(GetPixelOpacity(p)); q=PopShortPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3772,7 +3771,7 @@ static void ExportRGBOQuantum(QuantumInfo *quantum_info, pixel=(float) GetPixelOpacity(p); q=PopQuantumFloatPixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3787,7 +3786,7 @@ static void ExportRGBOQuantum(QuantumInfo *quantum_info, pixel=ScaleQuantumToLong(GetPixelOpacity(p)); q=PopLongPixel(quantum_info->endian,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3806,7 +3805,7 @@ static void ExportRGBOQuantum(QuantumInfo *quantum_info, pixel=(double) GetPixelOpacity(p); q=PopQuantumDoublePixel(quantum_info,pixel,q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } @@ -3826,7 +3825,7 @@ static void ExportRGBOQuantum(QuantumInfo *quantum_info, q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelOpacity(p), range),q); p++; - q+=quantum_info->pad; + q+=(ptrdiff_t) quantum_info->pad; } break; } diff --git a/magick/quantum-import.c b/magick/quantum-import.c index 7cef70d36fd305953b723a215238c4ee7db2b1e4..1cd625c4224a759181921ac458b486a34063344e 100644 --- a/magick/quantum-import.c +++ b/magick/quantum-import.c @@ -84,8 +84,7 @@ % % ImportQuantumPixels() transfers one or more pixel components from a user % supplied buffer into the image pixel cache of an image. The pixels are -% expected in network byte order. It returns MagickTrue if the pixels are -% successfully transferred, otherwise MagickFalse. +% expected in network byte order. It returns the number of imported pixels. % % The format of the ImportQuantumPixels method is: % @@ -320,7 +319,7 @@ static void ImportAlphaQuantum(QuantumInfo *quantum_info, { p=PushCharPixel(p,&pixel); SetPixelAlpha(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -337,7 +336,7 @@ static void ImportAlphaQuantum(QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -346,7 +345,7 @@ static void ImportAlphaQuantum(QuantumInfo *quantum_info, { p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -362,7 +361,7 @@ static void ImportAlphaQuantum(QuantumInfo *quantum_info, { p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -371,7 +370,7 @@ static void ImportAlphaQuantum(QuantumInfo *quantum_info, { p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -387,7 +386,7 @@ static void ImportAlphaQuantum(QuantumInfo *quantum_info, { p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -405,7 +404,7 @@ static void ImportAlphaQuantum(QuantumInfo *quantum_info, { p=PushDoublePixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -422,7 +421,7 @@ static void ImportAlphaQuantum(QuantumInfo *quantum_info, { p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelAlpha(q,ScaleAnyToQuantum(pixel,range)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -462,7 +461,7 @@ static void ImportBGRQuantum(QuantumInfo *quantum_info, p=PushCharPixel(p,&pixel); SetPixelRed(q,ScaleCharToQuantum(pixel)); SetPixelOpacity(q,OpaqueOpacity); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -478,7 +477,7 @@ static void ImportBGRQuantum(QuantumInfo *quantum_info, SetPixelRed(q,ScaleAnyToQuantum((pixel >> 22) & 0x3ff,range)); SetPixelGreen(q,ScaleAnyToQuantum((pixel >> 12) & 0x3ff,range)); SetPixelBlue(q,ScaleAnyToQuantum((pixel >> 2) & 0x3ff,range)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -567,7 +566,7 @@ static void ImportBGRQuantum(QuantumInfo *quantum_info, break; } } - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; } for (bit=0; bit < (ssize_t) (3*number_pixels % 2); bit++) { @@ -595,7 +594,7 @@ static void ImportBGRQuantum(QuantumInfo *quantum_info, break; } } - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; } if (bit != 0) p++; @@ -645,7 +644,7 @@ static void ImportBGRQuantum(QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelBlue(q,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -658,7 +657,7 @@ static void ImportBGRQuantum(QuantumInfo *quantum_info, SetPixelGreen(q,ScaleShortToQuantum(pixel)); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelRed(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -678,7 +677,7 @@ static void ImportBGRQuantum(QuantumInfo *quantum_info, SetPixelGreen(q,ClampToQuantum(pixel)); p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelBlue(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -691,7 +690,7 @@ static void ImportBGRQuantum(QuantumInfo *quantum_info, SetPixelGreen(q,ScaleLongToQuantum(pixel)); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelRed(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -711,7 +710,7 @@ static void ImportBGRQuantum(QuantumInfo *quantum_info, SetPixelGreen(q,ClampToQuantum(pixel)); p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelBlue(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -733,7 +732,7 @@ static void ImportBGRQuantum(QuantumInfo *quantum_info, SetPixelGreen(q,ClampToQuantum(pixel)); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelBlue(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -788,7 +787,7 @@ static void ImportBGRAQuantum(QuantumInfo *quantum_info, SetPixelRed(q,ScaleCharToQuantum(pixel)); p=PushCharPixel(p,&pixel); SetPixelAlpha(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -844,7 +843,7 @@ static void ImportBGRAQuantum(QuantumInfo *quantum_info, } n++; } - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -884,7 +883,7 @@ static void ImportBGRAQuantum(QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -899,7 +898,7 @@ static void ImportBGRAQuantum(QuantumInfo *quantum_info, SetPixelRed(q,ScaleShortToQuantum(pixel)); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -921,7 +920,7 @@ static void ImportBGRAQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -936,7 +935,7 @@ static void ImportBGRAQuantum(QuantumInfo *quantum_info, SetPixelRed(q,ScaleLongToQuantum(pixel)); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -958,7 +957,7 @@ static void ImportBGRAQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -982,7 +981,7 @@ static void ImportBGRAQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1039,7 +1038,7 @@ static void ImportBGROQuantum(QuantumInfo *quantum_info, SetPixelRed(q,ScaleCharToQuantum(pixel)); p=PushCharPixel(p,&pixel); SetPixelOpacity(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1095,7 +1094,7 @@ static void ImportBGROQuantum(QuantumInfo *quantum_info, } n++; } - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1135,7 +1134,7 @@ static void ImportBGROQuantum(QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(q,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1150,7 +1149,7 @@ static void ImportBGROQuantum(QuantumInfo *quantum_info, SetPixelRed(q,ScaleShortToQuantum(pixel)); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1172,7 +1171,7 @@ static void ImportBGROQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelOpacity(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1187,7 +1186,7 @@ static void ImportBGROQuantum(QuantumInfo *quantum_info, SetPixelRed(q,ScaleLongToQuantum(pixel)); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1209,7 +1208,7 @@ static void ImportBGROQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelOpacity(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1233,7 +1232,7 @@ static void ImportBGROQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelOpacity(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1288,7 +1287,7 @@ static void ImportBlackQuantum(const Image *image,QuantumInfo *quantum_info, { p=PushCharPixel(p,&pixel); SetPixelIndex(indexes+x,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1304,7 +1303,7 @@ static void ImportBlackQuantum(const Image *image,QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelIndex(indexes+x,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1312,7 +1311,7 @@ static void ImportBlackQuantum(const Image *image,QuantumInfo *quantum_info, { p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelIndex(indexes+x,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; } break; } @@ -1327,7 +1326,7 @@ static void ImportBlackQuantum(const Image *image,QuantumInfo *quantum_info, { p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelIndex(indexes+x,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1336,7 +1335,7 @@ static void ImportBlackQuantum(const Image *image,QuantumInfo *quantum_info, { p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelIndex(indexes+x,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1352,7 +1351,7 @@ static void ImportBlackQuantum(const Image *image,QuantumInfo *quantum_info, { p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelIndex(indexes+x,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1370,7 +1369,7 @@ static void ImportBlackQuantum(const Image *image,QuantumInfo *quantum_info, { p=PushDoublePixel(quantum_info,p,&pixel); SetPixelIndex(indexes+x,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1387,7 +1386,7 @@ static void ImportBlackQuantum(const Image *image,QuantumInfo *quantum_info, { p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelIndex(indexes+x,ScaleAnyToQuantum(pixel,range)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1416,7 +1415,7 @@ static void ImportBlueQuantum(QuantumInfo *quantum_info, { p=PushCharPixel(p,&pixel); SetPixelBlue(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1433,7 +1432,7 @@ static void ImportBlueQuantum(QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelBlue(q,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1442,7 +1441,7 @@ static void ImportBlueQuantum(QuantumInfo *quantum_info, { p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelBlue(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1458,7 +1457,7 @@ static void ImportBlueQuantum(QuantumInfo *quantum_info, { p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelBlue(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1467,7 +1466,7 @@ static void ImportBlueQuantum(QuantumInfo *quantum_info, { p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelBlue(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1483,7 +1482,7 @@ static void ImportBlueQuantum(QuantumInfo *quantum_info, { p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelBlue(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1501,7 +1500,7 @@ static void ImportBlueQuantum(QuantumInfo *quantum_info, { p=PushDoublePixel(quantum_info,p,&pixel); SetPixelBlue(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1518,7 +1517,7 @@ static void ImportBlueQuantum(QuantumInfo *quantum_info, { p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelBlue(q,ScaleAnyToQuantum(pixel,range)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1586,7 +1585,7 @@ static void ImportCbYCrYQuantum(const Image *image,QuantumInfo *quantum_info, cbcr[i]=(Quantum) (quantum); n++; } - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; SetPixelRed(q,cbcr[1]); SetPixelGreen(q,cbcr[0]); SetPixelBlue(q,cbcr[2]); @@ -1656,7 +1655,7 @@ static void ImportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelBlue(q,ScaleCharToQuantum(pixel)); p=PushCharPixel(p,&pixel); SetPixelIndex(indexes+x,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1682,7 +1681,7 @@ static void ImportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelIndex(indexes+x,ClampToQuantum((double) QuantumRange* (double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1697,7 +1696,7 @@ static void ImportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelBlue(q,ScaleShortToQuantum(pixel)); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelIndex(indexes+x,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1719,7 +1718,7 @@ static void ImportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelIndex(indexes+x,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1734,7 +1733,7 @@ static void ImportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelBlue(q,ScaleLongToQuantum(pixel)); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelIndex(indexes+x,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1756,7 +1755,7 @@ static void ImportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelIndex(indexes+x,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1780,7 +1779,7 @@ static void ImportCMYKQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelIndex(indexes+x,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1846,7 +1845,7 @@ static void ImportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ScaleCharToQuantum(pixel)); p=PushCharPixel(p,&pixel); SetPixelAlpha(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1875,7 +1874,7 @@ static void ImportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ClampToQuantum((MagickRealType) QuantumRange* (double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1892,7 +1891,7 @@ static void ImportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ScaleShortToQuantum(pixel)); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1916,7 +1915,7 @@ static void ImportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ClampToQuantum(pixel)); p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1933,7 +1932,7 @@ static void ImportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ScaleLongToQuantum(pixel)); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1957,7 +1956,7 @@ static void ImportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ClampToQuantum(pixel)); p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -1983,7 +1982,7 @@ static void ImportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ClampToQuantum(pixel)); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2051,7 +2050,7 @@ static void ImportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ScaleCharToQuantum(pixel)); p=PushCharPixel(p,&pixel); SetPixelOpacity(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2080,7 +2079,7 @@ static void ImportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(q,ClampToQuantum((double) QuantumRange* (double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2097,7 +2096,7 @@ static void ImportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ScaleShortToQuantum(pixel)); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2121,7 +2120,7 @@ static void ImportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ClampToQuantum(pixel)); p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelOpacity(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2138,7 +2137,7 @@ static void ImportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ScaleLongToQuantum(pixel)); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2162,7 +2161,7 @@ static void ImportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ClampToQuantum(pixel)); p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelOpacity(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2188,7 +2187,7 @@ static void ImportCMYKOQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,ClampToQuantum(pixel)); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelOpacity(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2315,7 +2314,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); SetPixelOpacity(q,OpaqueOpacity); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2327,7 +2326,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); SetPixelOpacity(q,OpaqueOpacity); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2353,7 +2352,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ScaleAnyToQuantum((pixel >> 2) & 0x3ff,range)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } if (x++ < (ssize_t) (number_pixels-1)) @@ -2387,7 +2386,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ScaleAnyToQuantum((pixel >> 22) & 0x3ff,range)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } if (x++ < (ssize_t) (number_pixels-1)) @@ -2413,7 +2412,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ScaleAnyToQuantum(pixel,range)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2437,7 +2436,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ScaleAnyToQuantum((QuantumAny) (pixel >> 4),range)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } for (bit=0; bit < (ssize_t) (number_pixels % 2); bit++) @@ -2447,7 +2446,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, (pixel >> 4),range)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } if (bit != 0) @@ -2460,7 +2459,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ScaleAnyToQuantum(pixel,range)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2478,7 +2477,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,QuantumRange-ScaleShortToQuantum(pixel)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2492,7 +2491,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, (double) HalfToSinglePrecision(pixel))); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2506,7 +2505,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ScaleShortToQuantum(pixel)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2517,7 +2516,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ScaleShortToQuantum(pixel)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2535,7 +2534,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ClampToQuantum(pixel)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2546,7 +2545,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ScaleLongToQuantum(pixel)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2564,7 +2563,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ClampToQuantum(pixel)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2584,7 +2583,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ClampToQuantum(pixel)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2600,7 +2599,7 @@ static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelRed(q,ScaleAnyToQuantum(pixel,range)); SetPixelGreen(q,GetPixelRed(q)); SetPixelBlue(q,GetPixelRed(q)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2693,7 +2692,7 @@ static void ImportGrayAlphaQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,GetPixelRed(q)); p=PushCharPixel(p,&pixel); SetPixelAlpha(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2709,7 +2708,7 @@ static void ImportGrayAlphaQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,GetPixelRed(q)); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelOpacity(q,ScaleAnyToQuantum(pixel,range)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2725,7 +2724,7 @@ static void ImportGrayAlphaQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,GetPixelRed(q)); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelOpacity(q,ScaleAnyToQuantum(pixel,range)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2747,7 +2746,7 @@ static void ImportGrayAlphaQuantum(QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ClampToQuantum((double) QuantumRange* (double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2760,7 +2759,7 @@ static void ImportGrayAlphaQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,GetPixelRed(q)); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2780,7 +2779,7 @@ static void ImportGrayAlphaQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,GetPixelRed(q)); p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2793,7 +2792,7 @@ static void ImportGrayAlphaQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,GetPixelRed(q)); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2813,7 +2812,7 @@ static void ImportGrayAlphaQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,GetPixelRed(q)); p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2835,7 +2834,7 @@ static void ImportGrayAlphaQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,GetPixelRed(q)); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2856,7 +2855,7 @@ static void ImportGrayAlphaQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,GetPixelRed(q)); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelAlpha(q,ScaleAnyToQuantum(pixel,range)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2885,7 +2884,7 @@ static void ImportGreenQuantum(QuantumInfo *quantum_info, { p=PushCharPixel(p,&pixel); SetPixelGreen(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2902,7 +2901,7 @@ static void ImportGreenQuantum(QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelGreen(q,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2911,7 +2910,7 @@ static void ImportGreenQuantum(QuantumInfo *quantum_info, { p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelGreen(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2927,7 +2926,7 @@ static void ImportGreenQuantum(QuantumInfo *quantum_info, { p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelGreen(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2936,7 +2935,7 @@ static void ImportGreenQuantum(QuantumInfo *quantum_info, { p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelGreen(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2952,7 +2951,7 @@ static void ImportGreenQuantum(QuantumInfo *quantum_info, { p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelGreen(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2970,7 +2969,7 @@ static void ImportGreenQuantum(QuantumInfo *quantum_info, { p=PushDoublePixel(quantum_info,p,&pixel); SetPixelGreen(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -2987,7 +2986,7 @@ static void ImportGreenQuantum(QuantumInfo *quantum_info, { p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelGreen(q,ScaleAnyToQuantum(pixel,range)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3095,7 +3094,7 @@ static void ImportIndexQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,PushColormapIndex(image,pixel, &range_exception)); SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3114,7 +3113,7 @@ static void ImportIndexQuantum(const Image *image,QuantumInfo *quantum_info, ClampToQuantum((double) QuantumRange* (double) HalfToSinglePrecision(pixel)),&range_exception)); SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3125,7 +3124,7 @@ static void ImportIndexQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,PushColormapIndex(image,pixel, &range_exception)); SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3143,7 +3142,7 @@ static void ImportIndexQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,PushColormapIndex(image,(size_t) ClampToQuantum(pixel),&range_exception)); SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3154,7 +3153,7 @@ static void ImportIndexQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,PushColormapIndex(image,pixel, &range_exception)); SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3172,7 +3171,7 @@ static void ImportIndexQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,PushColormapIndex(image,(size_t) ClampToQuantum(pixel),&range_exception)); SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3192,7 +3191,7 @@ static void ImportIndexQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,PushColormapIndex(image,(size_t) ClampToQuantum(pixel),&range_exception)); SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3207,7 +3206,7 @@ static void ImportIndexQuantum(const Image *image,QuantumInfo *quantum_info, SetPixelIndex(indexes+x,PushColormapIndex(image,pixel, &range_exception)); SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3318,7 +3317,7 @@ static void ImportIndexAlphaQuantum(const Image *image, SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); p=PushCharPixel(p,&pixel); SetPixelAlpha(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3340,7 +3339,7 @@ static void ImportIndexAlphaQuantum(const Image *image, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3353,7 +3352,7 @@ static void ImportIndexAlphaQuantum(const Image *image, SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3373,7 +3372,7 @@ static void ImportIndexAlphaQuantum(const Image *image, SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3386,7 +3385,7 @@ static void ImportIndexAlphaQuantum(const Image *image, SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3406,7 +3405,7 @@ static void ImportIndexAlphaQuantum(const Image *image, SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3428,7 +3427,7 @@ static void ImportIndexAlphaQuantum(const Image *image, SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3446,7 +3445,7 @@ static void ImportIndexAlphaQuantum(const Image *image, SetPixelRGBO(q,image->colormap+(ssize_t) GetPixelIndex(indexes+x)); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelAlpha(q,ScaleAnyToQuantum(pixel,range)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3478,7 +3477,7 @@ static void ImportRedQuantum(QuantumInfo *quantum_info, { p=PushCharPixel(p,&pixel); SetPixelRed(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3495,7 +3494,7 @@ static void ImportRedQuantum(QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelRed(q,ClampToQuantum((double) QuantumRange* (double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3504,7 +3503,7 @@ static void ImportRedQuantum(QuantumInfo *quantum_info, { p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelRed(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3520,7 +3519,7 @@ static void ImportRedQuantum(QuantumInfo *quantum_info, { p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelRed(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3529,7 +3528,7 @@ static void ImportRedQuantum(QuantumInfo *quantum_info, { p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelRed(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3545,7 +3544,7 @@ static void ImportRedQuantum(QuantumInfo *quantum_info, { p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelRed(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3563,7 +3562,7 @@ static void ImportRedQuantum(QuantumInfo *quantum_info, { p=PushDoublePixel(quantum_info,p,&pixel); SetPixelRed(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3580,7 +3579,7 @@ static void ImportRedQuantum(QuantumInfo *quantum_info, { p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelRed(q,ScaleAnyToQuantum(pixel,range)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3620,7 +3619,7 @@ static void ImportRGBQuantum(QuantumInfo *quantum_info, p=PushCharPixel(p,&pixel); SetPixelBlue(q,ScaleCharToQuantum(pixel)); SetPixelOpacity(q,OpaqueOpacity); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3636,7 +3635,7 @@ static void ImportRGBQuantum(QuantumInfo *quantum_info, SetPixelRed(q,ScaleAnyToQuantum((pixel >> 22) & 0x3ff,range)); SetPixelGreen(q,ScaleAnyToQuantum((pixel >> 12) & 0x3ff,range)); SetPixelBlue(q,ScaleAnyToQuantum((pixel >> 2) & 0x3ff,range)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3725,7 +3724,7 @@ static void ImportRGBQuantum(QuantumInfo *quantum_info, break; } } - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; } for (bit=0; bit < (ssize_t) (3*number_pixels % 2); bit++) { @@ -3753,7 +3752,7 @@ static void ImportRGBQuantum(QuantumInfo *quantum_info, break; } } - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; } if (bit != 0) p++; @@ -3803,7 +3802,7 @@ static void ImportRGBQuantum(QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelBlue(q,ClampToQuantum((double) QuantumRange* (double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3816,7 +3815,7 @@ static void ImportRGBQuantum(QuantumInfo *quantum_info, SetPixelGreen(q,ScaleShortToQuantum(pixel)); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelBlue(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3836,7 +3835,7 @@ static void ImportRGBQuantum(QuantumInfo *quantum_info, SetPixelGreen(q,ClampToQuantum(pixel)); p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelBlue(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3849,7 +3848,7 @@ static void ImportRGBQuantum(QuantumInfo *quantum_info, SetPixelGreen(q,ScaleLongToQuantum(pixel)); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelBlue(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3869,7 +3868,7 @@ static void ImportRGBQuantum(QuantumInfo *quantum_info, SetPixelGreen(q,ClampToQuantum(pixel)); p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelBlue(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3891,7 +3890,7 @@ static void ImportRGBQuantum(QuantumInfo *quantum_info, SetPixelGreen(q,ClampToQuantum(pixel)); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelBlue(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -3946,7 +3945,7 @@ static void ImportRGBAQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ScaleCharToQuantum(pixel)); p=PushCharPixel(p,&pixel); SetPixelAlpha(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4002,7 +4001,7 @@ static void ImportRGBAQuantum(QuantumInfo *quantum_info, } n++; } - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4042,7 +4041,7 @@ static void ImportRGBAQuantum(QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ClampToQuantum((double) QuantumRange* (double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4057,7 +4056,7 @@ static void ImportRGBAQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ScaleShortToQuantum(pixel)); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4079,7 +4078,7 @@ static void ImportRGBAQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4094,7 +4093,7 @@ static void ImportRGBAQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ScaleLongToQuantum(pixel)); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelAlpha(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4116,7 +4115,7 @@ static void ImportRGBAQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4140,7 +4139,7 @@ static void ImportRGBAQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelAlpha(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4197,7 +4196,7 @@ static void ImportRGBOQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ScaleCharToQuantum(pixel)); p=PushCharPixel(p,&pixel); SetPixelOpacity(q,ScaleCharToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4253,7 +4252,7 @@ static void ImportRGBOQuantum(QuantumInfo *quantum_info, } n++; } - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4293,7 +4292,7 @@ static void ImportRGBOQuantum(QuantumInfo *quantum_info, p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(q,ClampToQuantum((double) QuantumRange*(double) HalfToSinglePrecision(pixel))); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4308,7 +4307,7 @@ static void ImportRGBOQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ScaleShortToQuantum(pixel)); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(q,ScaleShortToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4330,7 +4329,7 @@ static void ImportRGBOQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushQuantumFloatPixel(quantum_info,p,&pixel); SetPixelOpacity(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4345,7 +4344,7 @@ static void ImportRGBOQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ScaleLongToQuantum(pixel)); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(q,ScaleLongToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4367,7 +4366,7 @@ static void ImportRGBOQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushQuantumFloat24Pixel(quantum_info,p,&pixel); SetPixelOpacity(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; @@ -4391,7 +4390,7 @@ static void ImportRGBOQuantum(QuantumInfo *quantum_info, SetPixelBlue(q,ClampToQuantum(pixel)); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelOpacity(q,ClampToQuantum(pixel)); - p+=quantum_info->pad; + p+=(ptrdiff_t) quantum_info->pad; q++; } break; diff --git a/magick/random.c b/magick/random.c index ba09dc6b8f465974fe8c6762894df84626843ce7..2a5efa77d2b09e7ca6a64ee3ec4a9c7f8a084b15 100644 --- a/magick/random.c +++ b/magick/random.c @@ -60,6 +60,7 @@ #include "magick/string_.h" #include "magick/thread_.h" #include "magick/thread-private.h" +#include "magick/timer-private.h" #include "magick/utility-private.h" #if defined(MAGICKCORE_HAVE_GETENTROPY) #include @@ -105,7 +106,7 @@ struct _RandomInfo SemaphoreInfo *semaphore; - ssize_t + time_t timestamp; size_t @@ -192,7 +193,7 @@ MagickExport RandomInfo *AcquireRandomInfo(void) random_info->protocol_major=RandomProtocolMajorVersion; random_info->protocol_minor=RandomProtocolMinorVersion; random_info->semaphore=AllocateSemaphoreInfo(); - random_info->timestamp=(ssize_t) time(0); + random_info->timestamp=GetMagickTime(); random_info->signature=MagickCoreSignature; /* Seed random nonce. @@ -339,7 +340,7 @@ static ssize_t ReadRandom(int file,unsigned char *source,size_t length) continue; return(-1); } - q+=count; + q+=(ptrdiff_t) count; offset+=count; } return(offset); @@ -900,7 +901,7 @@ MagickExport void SetRandomKey(RandomInfo *random_info,const size_t length, IncrementRandomNonce(random_info->nonce); (void) memcpy(p,GetStringInfoDatum(GetSignatureDigest( signature_info)),GetSignatureDigestsize(signature_info)); - p+=GetSignatureDigestsize(signature_info); + p+=(ptrdiff_t) GetSignatureDigestsize(signature_info); i-=GetSignatureDigestsize(signature_info); } if (i != 0) diff --git a/magick/resample.c b/magick/resample.c index 51f58051e9647de975add4c67ecc078050b861ca..dc45e2d1d5aa69f62a99f0a74aaf6bbbd5678f99 100644 --- a/magick/resample.c +++ b/magick/resample.c @@ -608,11 +608,11 @@ MagickExport MagickBooleanType ResamplePixelColor( weight = 0.0; #if FILTER_LUT /* Note that the ellipse has been pre-scaled so F = WLUT_WIDTH */ - if ((Q >= 0.0) && ((int) Q < WLUT_WIDTH)) { - weight = resample_filter->filter_lut[(int)Q]; + if (((int) Q >= 0) && ((int) Q < WLUT_WIDTH)) { + weight = resample_filter->filter_lut[(int) Q]; #else /* Note that the ellipse has been pre-scaled so F = support^2 */ - if ((Q >= 0.0) && (Q < (double)resample_filter->F)) { + if ((Q >= 0.0) && (Q < resample_filter->F)) { weight = GetResizeFilterWeight(resample_filter->filter_def, sqrt(Q)); /* a SquareRoot! Arrggghhhhh... */ #endif diff --git a/magick/resize.c b/magick/resize.c index 2ebfefd75d8eafeea96ea60e0f32dc24a5c8399b..00eb951ee46c98daa54e9af435562a171b90886a 100644 --- a/magick/resize.c +++ b/magick/resize.c @@ -2094,7 +2094,7 @@ MagickExport Image *MagnifyImage(const Image *image,ExceptionInfo *exception) *r=p[4]; r++; *r=p[4]; - r+=(magnify_image->columns-1); + r+=(ptrdiff_t) (magnify_image->columns-1); *r=p[4]; r++; *r=p[4]; @@ -2113,7 +2113,7 @@ MagickExport Image *MagnifyImage(const Image *image,ExceptionInfo *exception) *r=p[5]; else *r=p[4]; - r+=(magnify_image->columns-1); + r+=(ptrdiff_t) (magnify_image->columns-1); if (fabs((double) (intensity[3]-intensity[7])) < MagickEpsilon) *r=p[3]; else @@ -2142,7 +2142,7 @@ MagickExport Image *MagnifyImage(const Image *image,ExceptionInfo *exception) *r=indexes[4]; r++; *r=indexes[4]; - r+=(magnify_image->columns-1); + r+=(ptrdiff_t) (magnify_image->columns-1); *r=indexes[4]; r++; *r=indexes[4]; @@ -2161,7 +2161,7 @@ MagickExport Image *MagnifyImage(const Image *image,ExceptionInfo *exception) *r=indexes[5]; else *r=indexes[4]; - r+=(magnify_image->columns-1); + r+=(ptrdiff_t) (magnify_image->columns-1); if (fabs((double) (intensity[3]-intensity[7])) < MagickEpsilon) *r=indexes[3]; else @@ -2174,7 +2174,7 @@ MagickExport Image *MagnifyImage(const Image *image,ExceptionInfo *exception) } magnify_indexes+=2; } - q+=2; + q+=(ptrdiff_t) 2; } if (SyncCacheViewAuthenticPixels(magnify_view,exception) == MagickFalse) status=MagickFalse; @@ -3149,7 +3149,7 @@ MagickExport Image *SampleImage(const Image *image,const size_t columns, sample_view=AcquireAuthenticCacheView(sample_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,sample_image,sample_image->rows,1) + magick_number_threads(image,sample_image,sample_image->rows,2) #endif for (y=0; y < (ssize_t) sample_image->rows; y++) { @@ -3706,17 +3706,39 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, % o exception: return any errors or warnings in this structure. % */ + +static void url_encode(const char *uri,char *encode_uri) +{ + char + *p; + + const char + *hex = "0123456789ABCDEF"; + + for (p=encode_uri; *uri != '\0'; uri++) + if ((('a' <= *uri) && (*uri <= 'z')) || (('A' <= *uri) && (*uri <= 'Z')) || + (('0' <= *uri) && (*uri <= '9')) || (strchr("/-_.~",*uri) != 0)) + *p++=(*uri); + else + { + *p++='%'; + *p++=hex[(*uri >> 4) & 0xF]; + *p++=hex[*uri & 0xF]; + } + *p='\0'; +} + MagickExport Image *ThumbnailImage(const Image *image,const size_t columns, const size_t rows,ExceptionInfo *exception) { #define SampleFactor 5 char - filename[MaxTextExtent], - value[MaxTextExtent]; + encode_uri[3*MagickPathExtent+1] = "/0"; const char - *name; + *name, + *mime_type; Image *thumbnail_image; @@ -3742,8 +3764,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); @@ -3786,36 +3808,26 @@ MagickExport Image *ThumbnailImage(const Image *image,const size_t columns, name=GetNextImageProfile(thumbnail_image); } (void) DeleteImageProperty(thumbnail_image,"comment"); - (void) CopyMagickString(value,image->magick_filename,MaxTextExtent); - if (strstr(image->magick_filename,"//") == (char *) NULL) - (void) FormatLocaleString(value,MaxTextExtent,"file://%s", - image->magick_filename); - (void) SetImageProperty(thumbnail_image,"Thumb::URI",value); - GetPathComponent(image->magick_filename,TailPath,filename); - (void) CopyMagickString(value,filename,MaxTextExtent); - if (GetPathAttributes(image->filename,&attributes) != MagickFalse) - { - (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double) - attributes.st_mtime); - (void) SetImageProperty(thumbnail_image,"Thumb::MTime",value); - } - (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double) - attributes.st_mtime); - (void) FormatMagickSize(GetBlobSize(image),MagickFalse,value); - (void) ConcatenateMagickString(value,"B",MaxTextExtent); - (void) SetImageProperty(thumbnail_image,"Thumb::Size",value); - (void) FormatLocaleString(value,MaxTextExtent,"image/%s",image->magick); - LocaleLower(value); - (void) SetImageProperty(thumbnail_image,"Thumb::Mimetype",value); + url_encode(image->filename,encode_uri); + if (*image->filename != '/') + (void) FormatImageProperty(thumbnail_image,"Thumb::URI","./%s",encode_uri); + else + (void) FormatImageProperty(thumbnail_image,"Thumb::URI","file://%s", + encode_uri); + if (GetPathAttributes(image->filename,&attributes) != MagickFalse ) + (void) FormatImageProperty(thumbnail_image,"Thumb::MTime","%.20g",(double) + attributes.st_mtime); + (void) FormatImageProperty(thumbnail_image,"Thumb::Size","%.20g", + (double) GetBlobSize(image)); + mime_type=GetImageProperty(image,"mime:type"); + if (mime_type != (const char *) NULL) + (void) SetImageProperty(thumbnail_image,"Thumb::Mimetype",mime_type); (void) SetImageProperty(thumbnail_image,"software",MagickAuthoritativeURL); - (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double) - image->magick_columns); - (void) SetImageProperty(thumbnail_image,"Thumb::Image::Width",value); - (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double) - image->magick_rows); - (void) SetImageProperty(thumbnail_image,"Thumb::Image::Height",value); - (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double) - GetImageListLength(image)); - (void) SetImageProperty(thumbnail_image,"Thumb::Document::Pages",value); + (void) FormatImageProperty(thumbnail_image,"Thumb::Image::Width","%.20g", + (double) image->magick_columns); + (void) FormatImageProperty(thumbnail_image,"Thumb::Image::Height","%.20g", + (double) image->magick_rows); + (void) FormatImageProperty(thumbnail_image,"Thumb::Document::Pages","%.20g", + (double) GetImageListLength(image)); return(thumbnail_image); } diff --git a/magick/resource.c b/magick/resource.c index 8fdc0e4be0a4a67849544ceec125b338945506a7..6dd009b2596d173e6330634bec2f0636627210ab 100644 --- a/magick/resource.c +++ b/magick/resource.c @@ -62,6 +62,7 @@ #include "magick/string-private.h" #include "magick/splay-tree.h" #include "magick/thread-private.h" +#include "magick/timer-private.h" #include "magick/token.h" #include "magick/timer-private.h" #include "magick/utility.h" @@ -73,7 +74,7 @@ #define MagickPathTemplate "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" /* min 6 X's */ #define NumberOfResourceTypes \ (sizeof(resource_semaphore)/sizeof(*resource_semaphore)) - + /* Typedef declarations. */ @@ -136,7 +137,7 @@ static ResourceInfo MagickULLConstant(768), /* file limit */ MagickULLConstant(1), /* thread limit */ MagickULLConstant(0), /* throttle limit */ - (MagickSizeType) MAGICK_SSIZE_MAX /* time limit */ + MagickULLConstant(0), /* time limit */ }; static SemaphoreInfo @@ -386,12 +387,10 @@ 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+request) > (MagickSizeType) resource_info.time) { resource_info.time+=request; - if ((limit == MagickResourceInfinity) || - ((MagickSizeType) resource_info.time < limit)) + if ((limit == 0) || ((MagickSizeType) resource_info.time < limit)) status=MagickTrue; else resource_info.time-=request; @@ -954,12 +953,10 @@ static ssize_t FormatPixelSize(const MagickSizeType size, length; ssize_t + count, i, j; - ssize_t - count; - static const char *bi_units[] = { @@ -995,6 +992,64 @@ static ssize_t FormatPixelSize(const MagickSizeType size, return(count); } +static void FormatTimeToLive(const MagickSizeType ttl,char *timeString) +{ + MagickSizeType + days, + hours, + minutes, + months, + seconds, + weeks, + years; + + years=ttl/31536000; + seconds=ttl % 31536000; + if (seconds == 0) + { + (void) FormatLocaleString(timeString,MagickPathExtent,"%lld years",years); + return; + } + months=ttl/2628000; + seconds=ttl % 2628000; + if (seconds == 0) + { + (void) FormatLocaleString(timeString,MagickPathExtent,"%lld months", + months); + return; + } + weeks=ttl/604800; + seconds=ttl % 604800; + if (seconds == 0) + { + (void) FormatLocaleString(timeString,MagickPathExtent,"%lld weeks",weeks); + return; + } + days=ttl/86400; + seconds=ttl % 86400; + if (seconds == 0) + { + (void) FormatLocaleString(timeString,MagickPathExtent,"%lld days",days); + return; + } + hours=ttl/3600; + seconds=ttl % 3600; + if (seconds == 0) + { + (void) FormatLocaleString(timeString,MagickPathExtent,"%lld hours",hours); + return; + } + minutes=ttl/60; + seconds=ttl % 60; + if (seconds == 0) + { + (void) FormatLocaleString(timeString,MagickPathExtent,"%lld minutes", + minutes); + return; + } + (void) FormatLocaleString(timeString,MagickPathExtent,"%lld seconds",ttl); +} + MagickExport MagickBooleanType ListMagickResourceInfo(FILE *file, ExceptionInfo *magick_unused(exception)) { @@ -1028,9 +1083,8 @@ MagickExport MagickBooleanType ListMagickResourceInfo(FILE *file, if (resource_info.disk_limit != MagickResourceInfinity) (void) FormatMagickSize(resource_info.disk_limit,MagickTrue,disk_limit); (void) CopyMagickString(time_limit,"unlimited",MaxTextExtent); - if (resource_info.time_limit != MagickResourceInfinity) - (void) FormatLocaleString(time_limit,MaxTextExtent,"%.20g",(double) - ((MagickOffsetType) resource_info.time_limit)); + if (resource_info.time_limit != 0) + FormatTimeToLive(resource_info.time_limit,time_limit); (void) FormatLocaleFile(file,"Resource limits:\n"); (void) FormatLocaleFile(file," Width: %s\n",width_limit); (void) FormatLocaleFile(file," Height: %s\n",height_limit); @@ -1221,7 +1275,6 @@ MagickExport void RelinquishMagickResource(const ResourceType type, { resource_info.time-=size; assert(resource_info.time >= 0); - if (logging != MagickFalse) if (logging != MagickFalse) { (void) FormatMagickSize((MagickSizeType) resource_info.time, @@ -1348,11 +1401,10 @@ MagickExport MagickBooleanType ResourceComponentGenesis(void) MagickSizeType memory; - ssize_t - i; - ssize_t files, + i, + number_threads, pages, pagesize; @@ -1449,7 +1501,10 @@ MagickExport MagickBooleanType ResourceComponentGenesis(void) (void) SetMagickResourceLimit(FileResource,StringToSizeType(limit,100.0)); limit=DestroyString(limit); } - (void) SetMagickResourceLimit(ThreadResource,GetOpenMPMaximumThreads()); + number_threads=(ssize_t) GetOpenMPMaximumThreads(); + if (number_threads > 1) + number_threads--; /* reserve core for OS */ + (void) SetMagickResourceLimit(ThreadResource,(size_t) number_threads); limit=GetEnvironmentValue("MAGICK_THREAD_LIMIT"); if (limit != (char *) NULL) { @@ -1465,11 +1520,12 @@ MagickExport MagickBooleanType ResourceComponentGenesis(void) 100.0)); limit=DestroyString(limit); } - (void) SetMagickResourceLimit(TimeResource,MagickResourceInfinity); + (void) SetMagickResourceLimit(TimeResource,0); limit=GetEnvironmentValue("MAGICK_TIME_LIMIT"); if (limit != (char *) NULL) { - (void) SetMagickResourceLimit(TimeResource,StringToSizeType(limit,100.0)); + (void) SetMagickResourceLimit(TimeResource,(MagickSizeType) + ParseMagickTimeToLive(limit)); limit=DestroyString(limit); } (void) SetMagickResourceLimit(ListLengthResource,MagickResourceInfinity); @@ -1660,9 +1716,8 @@ MagickExport MagickBooleanType SetMagickResourceLimit(const ResourceType type, if (value == (char *) NULL) resource_info.time_limit=limit; else - resource_info.time_limit=MagickMin(limit,StringToSizeType(value,100.0)); - resource_info.time_limit=MagickMin(resource_info.time_limit, - (MagickSizeType) MAGICK_SSIZE_MAX); + resource_info.time_limit=MagickMin(limit,(MagickSizeType) + ParseMagickTimeToLive(value)); break; } case WidthResource: diff --git a/magick/shear.c b/magick/shear.c index 1868b7a3158596e278deb6b11917cc25e6f402cb..3526a2c94762ea47ef76174f0d9081f5d442f2c5 100644 --- a/magick/shear.c +++ b/magick/shear.c @@ -904,7 +904,7 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, */ #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,rotate_image,image->rows,1) + magick_number_threads(image,rotate_image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -939,7 +939,7 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, } indexes=GetCacheViewVirtualIndexQueue(image_view); rotate_indexes=GetCacheViewAuthenticIndexQueue(rotate_view); - q+=image->columns; + q+=(ptrdiff_t) image->columns; for (x=0; x < (ssize_t) image->columns; x++) *--q=(*p++); if ((indexes != (IndexPacket *) NULL) && @@ -986,7 +986,7 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations, tile_width=image->columns; #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,rotate_image,image->rows/tile_height,1) + magick_number_threads(image,rotate_image,image->rows/tile_height,2) #endif for (tile_y=0; tile_y < (ssize_t) image->rows; tile_y+=(ssize_t) tile_height) { @@ -1226,7 +1226,7 @@ static MagickBooleanType XShearImage(Image *image,const MagickRealType degrees, continue; } indexes=GetCacheViewAuthenticIndexQueue(image_view); - p+=x_offset; + p+=(ptrdiff_t) x_offset; indexes+=x_offset; displacement=degrees*(MagickRealType) (y-height/2.0); if (displacement == 0.0) @@ -1282,7 +1282,7 @@ static MagickBooleanType XShearImage(Image *image,const MagickRealType degrees, /* Transfer pixels right-to-left. */ - p+=width; + p+=(ptrdiff_t) width; indexes+=width; q=p+step; shear_indexes=indexes+step; @@ -1448,7 +1448,7 @@ static MagickBooleanType YShearImage(Image *image,const MagickRealType degrees, continue; } indexes=GetCacheViewAuthenticIndexQueue(image_view); - p+=y_offset; + p+=(ptrdiff_t) y_offset; indexes+=y_offset; displacement=degrees*(MagickRealType) (x-width/2.0); if (displacement == 0.0) @@ -1504,7 +1504,7 @@ static MagickBooleanType YShearImage(Image *image,const MagickRealType degrees, /* Transfer pixels bottom-to-top. */ - p+=height; + p+=(ptrdiff_t) height; indexes+=height; q=p+step; shear_indexes=indexes+step; diff --git a/magick/signature.c b/magick/signature.c index ced210f781eaeea1a1abaf4ba54986c650cec231..5467417bfbc3b623e04e05b915ccaa0415e4cfc5 100644 --- a/magick/signature.c +++ b/magick/signature.c @@ -82,7 +82,7 @@ struct _SignatureInfo MagickBooleanType lsb_first; - ssize_t + time_t timestamp; size_t @@ -138,7 +138,7 @@ MagickExport SignatureInfo *AcquireSignatureInfo(void) lsb_first=1; signature_info->lsb_first=(int) (*(char *) &lsb_first) == 1 ? MagickTrue : MagickFalse; - signature_info->timestamp=(ssize_t) time(0); + signature_info->timestamp=GetMagickTime(); signature_info->signature=MagickCoreSignature; InitializeSignature(signature_info); return(signature_info); @@ -641,14 +641,14 @@ RestoreMSCWarning for (i=0; i < 16; i++) { T=(*((unsigned int *) p)); - p+=4; + p+=(ptrdiff_t) 4; W[i]=Trunc32(T); } else for (i=0; i < 16; i+=2) { T=(*((unsigned int *) p)); - p+=8; + p+=(ptrdiff_t) 8; W[i]=Trunc32(T >> shift); W[i+1]=Trunc32(T); } @@ -660,7 +660,7 @@ RestoreMSCWarning for (i=0; i < 16; i++) { T=(*((unsigned int *) p)); - p+=4; + p+=(ptrdiff_t) 4; W[i]=((T << 24) & 0xff000000) | ((T << 8) & 0x00ff0000) | ((T >> 8) & 0x0000ff00) | ((T >> 24) & 0x000000ff); } @@ -668,7 +668,7 @@ RestoreMSCWarning for (i=0; i < 16; i+=2) { T=(*((unsigned int *) p)); - p+=8; + p+=(ptrdiff_t) 8; W[i]=((T << 24) & 0xff000000) | ((T << 8) & 0x00ff0000) | ((T >> 8) & 0x0000ff00) | ((T >> 24) & 0x000000ff); T>>=shift; @@ -788,7 +788,7 @@ MagickExport void UpdateSignature(SignatureInfo *signature_info, (void) memcpy(GetStringInfoDatum(signature_info->message)+ signature_info->extent,p,i); n-=i; - p+=i; + p+=(ptrdiff_t) i; signature_info->extent+=i; if (signature_info->extent != GetStringInfoLength(signature_info->message)) @@ -798,7 +798,7 @@ MagickExport void UpdateSignature(SignatureInfo *signature_info, while (n >= GetStringInfoLength(signature_info->message)) { SetStringInfoDatum(signature_info->message,p); - p+=GetStringInfoLength(signature_info->message); + p+=(ptrdiff_t) GetStringInfoLength(signature_info->message); n-=GetStringInfoLength(signature_info->message); TransformSignature(signature_info); } diff --git a/magick/splay-tree.c b/magick/splay-tree.c index 0a44badfcb3b083eb571c36de9454dc86b9b2861..7b7dd2cef139bea14b960673e4fe9833ddac7f6a 100644 --- a/magick/splay-tree.c +++ b/magick/splay-tree.c @@ -680,11 +680,9 @@ MagickExport MagickBooleanType DeleteNodeFromSplayTree( */ MagickExport SplayTreeInfo *DestroySplayTree(SplayTreeInfo *splay_tree) { - NodeInfo - *node; - NodeInfo *active, + *node, *pend; LockSemaphoreInfo(splay_tree->semaphore); @@ -1027,14 +1025,12 @@ static int IterateOverSplayTree(SplayTreeInfo *splay_tree, final_transition; NodeInfo + *node, **nodes; ssize_t i; - NodeInfo - *node; - TransitionType transition; @@ -1380,11 +1376,9 @@ MagickExport void *RemoveNodeFromSplayTree(SplayTreeInfo *splay_tree, */ MagickExport void ResetSplayTree(SplayTreeInfo *splay_tree) { - NodeInfo - *node; - NodeInfo *active, + *node, *pend; assert(splay_tree != (SplayTreeInfo *) NULL); @@ -1519,11 +1513,9 @@ static NodeInfo *Splay(SplayTreeInfo *splay_tree,const size_t depth, int compare; - NodeInfo - **next; - NodeInfo *n, + **next, *p; n=(*node); diff --git a/magick/statistic.c b/magick/statistic.c index b8806762df65cc56610053967f2ecc37256b3cd8..3f2560ad23c8ad8905d8c7b5d2ab540989777301 100644 --- a/magick/statistic.c +++ b/magick/statistic.c @@ -365,6 +365,8 @@ static MagickRealType ApplyEvaluateOperator(RandomInfo *random_info, } case PowEvaluateOperator: { + if (fabs(value) <= MagickEpsilon) + break; if (((double) pixel < 0.0) && ((value-floor(value)) > MagickEpsilon)) result=(double) -((MagickRealType) QuantumRange*pow(-(QuantumScale* (double) pixel),(double) value)); @@ -558,7 +560,7 @@ MagickExport Image *EvaluateImages(const Image *images, #if defined(MAGICKCORE_OPENMP_SUPPORT) key=GetRandomSecretKey(random_info[0]); #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,images,image->rows,key == ~0UL) + magick_number_threads(image,images,image->rows,key == ~0UL ? 0 : 1) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -666,7 +668,7 @@ MagickExport Image *EvaluateImages(const Image *images, #if defined(MAGICKCORE_OPENMP_SUPPORT) key=GetRandomSecretKey(random_info[0]); #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,images,image->rows,key == ~0UL) + magick_number_threads(image,images,image->rows,key == ~0UL ? 0 : 1) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -859,7 +861,7 @@ MagickExport MagickBooleanType EvaluateImageChannel(Image *image, #if defined(MAGICKCORE_OPENMP_SUPPORT) key=GetRandomSecretKey(random_info[0]); #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,image,image->rows,key == ~0UL) + magick_number_threads(image,image,image->rows,key == ~0UL ? 0 : 1) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -1141,7 +1143,7 @@ MagickExport MagickBooleanType FunctionImageChannel(Image *image, image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -1456,42 +1458,48 @@ MagickExport MagickBooleanType GetImageChannelKurtosis(const Image *image, { if ((channel & RedChannel) != 0) { - mean+=(MagickRealType) GetPixelRed(p); - sum_squares+=(double) GetPixelRed(p)*(double) GetPixelRed(p); - sum_cubes+=(double) GetPixelRed(p)*(double) GetPixelRed(p)*(double) + mean+=QuantumScale*GetPixelRed(p); + sum_squares+=QuantumScale*GetPixelRed(p)*QuantumScale*GetPixelRed(p); + sum_cubes+=QuantumScale*GetPixelRed(p)*QuantumScale*GetPixelRed(p)* + QuantumScale*GetPixelRed(p); + sum_fourth_power+=QuantumScale*GetPixelRed(p)*QuantumScale* + GetPixelRed(p)*QuantumScale*GetPixelRed(p)*QuantumScale* GetPixelRed(p); - sum_fourth_power+=(double) GetPixelRed(p)*(double) GetPixelRed(p)* - (double) GetPixelRed(p)*(double) GetPixelRed(p); area++; } if ((channel & GreenChannel) != 0) { - mean+=(MagickRealType) GetPixelGreen(p); - sum_squares+=(double) GetPixelGreen(p)*(double) GetPixelGreen(p); - sum_cubes+=(double) GetPixelGreen(p)*(double) GetPixelGreen(p)* - (double) GetPixelGreen(p); - sum_fourth_power+=(double) GetPixelGreen(p)*(double) GetPixelGreen(p)* - (double) GetPixelGreen(p)*(double) GetPixelGreen(p); + mean+=QuantumScale*GetPixelGreen(p); + sum_squares+=QuantumScale*GetPixelGreen(p)*QuantumScale* + GetPixelGreen(p); + sum_cubes+=QuantumScale*GetPixelGreen(p)*QuantumScale* + GetPixelGreen(p)*QuantumScale*GetPixelGreen(p); + sum_fourth_power+=QuantumScale*GetPixelGreen(p)*QuantumScale* + GetPixelGreen(p)*QuantumScale*GetPixelGreen(p)*QuantumScale* + GetPixelGreen(p); area++; } if ((channel & BlueChannel) != 0) { - mean+=(MagickRealType) GetPixelBlue(p); - sum_squares+=(double) GetPixelBlue(p)*(double) GetPixelBlue(p); - sum_cubes+=(double) GetPixelBlue(p)*(double) GetPixelBlue(p)*(double) + mean+=QuantumScale*GetPixelBlue(p); + sum_squares+=QuantumScale*GetPixelBlue(p)*QuantumScale* + GetPixelBlue(p); + sum_cubes+=QuantumScale*GetPixelBlue(p)*QuantumScale*GetPixelBlue(p)* + QuantumScale*GetPixelBlue(p); + sum_fourth_power+=QuantumScale*GetPixelBlue(p)*QuantumScale* + GetPixelBlue(p)*QuantumScale*GetPixelBlue(p)*QuantumScale* GetPixelBlue(p); - sum_fourth_power+=(double) GetPixelBlue(p)*(double) GetPixelBlue(p)* - (double) GetPixelBlue(p)*(double) GetPixelBlue(p); area++; } if ((channel & OpacityChannel) != 0) { - mean+=(MagickRealType) GetPixelAlpha(p); - sum_squares+=(double) GetPixelOpacity(p)*(double) GetPixelAlpha(p); - sum_cubes+=(double) GetPixelOpacity(p)*(double) GetPixelAlpha(p)* - (double) GetPixelAlpha(p); - sum_fourth_power+=(double) GetPixelAlpha(p)*(double) GetPixelAlpha(p)* - (double) GetPixelAlpha(p)*GetPixelAlpha(p); + mean+=QuantumScale*GetPixelAlpha(p); + sum_squares+=QuantumScale*GetPixelOpacity(p)*QuantumScale* + GetPixelAlpha(p); + sum_cubes+=QuantumScale*GetPixelOpacity(p)*QuantumScale* + GetPixelAlpha(p)*QuantumScale*GetPixelAlpha(p); + sum_fourth_power+=QuantumScale*GetPixelAlpha(p)*QuantumScale* + GetPixelAlpha(p)*QuantumScale*GetPixelAlpha(p)*GetPixelAlpha(p); area++; } if (((channel & IndexChannel) != 0) && @@ -1500,7 +1508,7 @@ MagickExport MagickBooleanType GetImageChannelKurtosis(const Image *image, double index; - index=(double) GetPixelIndex(indexes+x); + index=QuantumScale*GetPixelIndex(indexes+x); mean+=index; sum_squares+=index*index; sum_cubes+=index*index*index; @@ -1594,7 +1602,11 @@ MagickExport MagickBooleanType GetImageChannelMean(const Image *image, (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); channel_statistics=GetImageChannelStatistics(image,exception); if (channel_statistics == (ChannelStatistics *) NULL) - return(MagickFalse); + { + *mean=NAN; + *standard_deviation=NAN; + return(MagickFalse); + } channels=0; channel_statistics[CompositeChannels].mean=0.0; channel_statistics[CompositeChannels].standard_deviation=0.0; @@ -2355,15 +2367,13 @@ MagickExport ChannelStatistics *GetImageChannelStatistics(const Image *image, QuantumAny range; - ssize_t - i; - size_t channels, depth, length; ssize_t + i, y; assert(image != (Image *) NULL); @@ -2475,38 +2485,38 @@ MagickExport ChannelStatistics *GetImageChannelStatistics(const Image *image, channel_statistics[RedChannel].minima=(double) GetPixelRed(p); if ((double) GetPixelRed(p) > channel_statistics[RedChannel].maxima) channel_statistics[RedChannel].maxima=(double) GetPixelRed(p); - channel_statistics[RedChannel].sum+=(double) GetPixelRed(p); - channel_statistics[RedChannel].sum_squared+=(double) GetPixelRed(p)* - (double) GetPixelRed(p); - channel_statistics[RedChannel].sum_cubed+=(double) GetPixelRed(p)* - (double) GetPixelRed(p)*(double) GetPixelRed(p); - channel_statistics[RedChannel].sum_fourth_power+=(double) - GetPixelRed(p)*(double) GetPixelRed(p)*(double) GetPixelRed(p)* - (double) GetPixelRed(p); + channel_statistics[RedChannel].sum+=QuantumScale*GetPixelRed(p); + channel_statistics[RedChannel].sum_squared+=QuantumScale*GetPixelRed(p)* + QuantumScale*GetPixelRed(p); + channel_statistics[RedChannel].sum_cubed+=QuantumScale*GetPixelRed(p)* + QuantumScale*GetPixelRed(p)*QuantumScale*GetPixelRed(p); + channel_statistics[RedChannel].sum_fourth_power+=QuantumScale* + GetPixelRed(p)*QuantumScale*GetPixelRed(p)*QuantumScale*GetPixelRed(p)* + QuantumScale*GetPixelRed(p); if ((double) GetPixelGreen(p) < channel_statistics[GreenChannel].minima) channel_statistics[GreenChannel].minima=(double) GetPixelGreen(p); if ((double) GetPixelGreen(p) > channel_statistics[GreenChannel].maxima) channel_statistics[GreenChannel].maxima=(double) GetPixelGreen(p); - channel_statistics[GreenChannel].sum+=(double) GetPixelGreen(p); - channel_statistics[GreenChannel].sum_squared+=(double) GetPixelGreen(p)* - (double) GetPixelGreen(p); - channel_statistics[GreenChannel].sum_cubed+=(double) GetPixelGreen(p)* - (double) GetPixelGreen(p)*(double) GetPixelGreen(p); - channel_statistics[GreenChannel].sum_fourth_power+=(double) - GetPixelGreen(p)*(double) GetPixelGreen(p)*(double) GetPixelGreen(p)* - (double) GetPixelGreen(p); + channel_statistics[GreenChannel].sum+=QuantumScale*GetPixelGreen(p); + channel_statistics[GreenChannel].sum_squared+=QuantumScale*GetPixelGreen(p)* + QuantumScale*GetPixelGreen(p); + channel_statistics[GreenChannel].sum_cubed+=QuantumScale*GetPixelGreen(p)* + QuantumScale*GetPixelGreen(p)*QuantumScale*GetPixelGreen(p); + channel_statistics[GreenChannel].sum_fourth_power+=QuantumScale* + GetPixelGreen(p)*QuantumScale*GetPixelGreen(p)*QuantumScale* + GetPixelGreen(p)*QuantumScale*GetPixelGreen(p); if ((double) GetPixelBlue(p) < channel_statistics[BlueChannel].minima) channel_statistics[BlueChannel].minima=(double) GetPixelBlue(p); if ((double) GetPixelBlue(p) > channel_statistics[BlueChannel].maxima) channel_statistics[BlueChannel].maxima=(double) GetPixelBlue(p); - channel_statistics[BlueChannel].sum+=(double) GetPixelBlue(p); - channel_statistics[BlueChannel].sum_squared+=(double) GetPixelBlue(p)* - (double) GetPixelBlue(p); - channel_statistics[BlueChannel].sum_cubed+=(double) GetPixelBlue(p)* - (double) GetPixelBlue(p)*(double) GetPixelBlue(p); - channel_statistics[BlueChannel].sum_fourth_power+=(double) - GetPixelBlue(p)*(double) GetPixelBlue(p)*(double) GetPixelBlue(p)* - (double) GetPixelBlue(p); + channel_statistics[BlueChannel].sum+=QuantumScale*GetPixelBlue(p); + channel_statistics[BlueChannel].sum_squared+=QuantumScale*GetPixelBlue(p)* + QuantumScale*GetPixelBlue(p); + channel_statistics[BlueChannel].sum_cubed+=QuantumScale*GetPixelBlue(p)* + QuantumScale*GetPixelBlue(p)*QuantumScale*GetPixelBlue(p); + channel_statistics[BlueChannel].sum_fourth_power+=QuantumScale* + GetPixelBlue(p)*QuantumScale*GetPixelBlue(p)*QuantumScale* + GetPixelBlue(p)*QuantumScale*GetPixelBlue(p); histogram[ScaleQuantumToMap(GetPixelRed(p))].red++; histogram[ScaleQuantumToMap(GetPixelGreen(p))].green++; histogram[ScaleQuantumToMap(GetPixelBlue(p))].blue++; @@ -2516,13 +2526,15 @@ MagickExport ChannelStatistics *GetImageChannelStatistics(const Image *image, channel_statistics[OpacityChannel].minima=(double) GetPixelAlpha(p); if ((double) GetPixelAlpha(p) > channel_statistics[OpacityChannel].maxima) channel_statistics[OpacityChannel].maxima=(double) GetPixelAlpha(p); - channel_statistics[OpacityChannel].sum+=GetPixelAlpha(p); - channel_statistics[OpacityChannel].sum_squared+=(double) - GetPixelAlpha(p)*GetPixelAlpha(p); - channel_statistics[OpacityChannel].sum_cubed+=(double) - GetPixelAlpha(p)*GetPixelAlpha(p)*GetPixelAlpha(p); - channel_statistics[OpacityChannel].sum_fourth_power+=(double) - GetPixelAlpha(p)*GetPixelAlpha(p)*GetPixelAlpha(p)*GetPixelAlpha(p); + channel_statistics[OpacityChannel].sum+=QuantumScale*GetPixelAlpha(p); + channel_statistics[OpacityChannel].sum_squared+=QuantumScale* + GetPixelAlpha(p)*QuantumScale*GetPixelAlpha(p); + channel_statistics[OpacityChannel].sum_cubed+=QuantumScale* + GetPixelAlpha(p)*QuantumScale*GetPixelAlpha(p)*QuantumScale* + GetPixelAlpha(p); + channel_statistics[OpacityChannel].sum_fourth_power+=QuantumScale* + GetPixelAlpha(p)*QuantumScale*GetPixelAlpha(p)*QuantumScale* + GetPixelAlpha(p)*QuantumScale*GetPixelAlpha(p); histogram[ScaleQuantumToMap(GetPixelAlpha(p))].opacity++; } if (image->colorspace == CMYKColorspace) @@ -2533,16 +2545,17 @@ MagickExport ChannelStatistics *GetImageChannelStatistics(const Image *image, if ((double) GetPixelIndex(indexes+x) > channel_statistics[BlackChannel].maxima) channel_statistics[BlackChannel].maxima=(double) GetPixelIndex(indexes+x); - channel_statistics[BlackChannel].sum+=(double) + channel_statistics[BlackChannel].sum+=QuantumScale* + GetPixelIndex(indexes+x); + channel_statistics[BlackChannel].sum_squared+=QuantumScale* + GetPixelIndex(indexes+x)*QuantumScale*GetPixelIndex(indexes+x); + channel_statistics[BlackChannel].sum_cubed+=QuantumScale* + GetPixelIndex(indexes+x)*QuantumScale*GetPixelIndex(indexes+x)* + QuantumScale*GetPixelIndex(indexes+x); + channel_statistics[BlackChannel].sum_fourth_power+=QuantumScale* + GetPixelIndex(indexes+x)*QuantumScale*GetPixelIndex(indexes+x)* + QuantumScale*GetPixelIndex(indexes+x)*QuantumScale* GetPixelIndex(indexes+x); - channel_statistics[BlackChannel].sum_squared+=(double) - GetPixelIndex(indexes+x)*(double) GetPixelIndex(indexes+x); - channel_statistics[BlackChannel].sum_cubed+=(double) - GetPixelIndex(indexes+x)*(double) GetPixelIndex(indexes+x)* - (double) GetPixelIndex(indexes+x); - channel_statistics[BlackChannel].sum_fourth_power+=(double) - GetPixelIndex(indexes+x)*(double) GetPixelIndex(indexes+x)* - (double) GetPixelIndex(indexes+x)*(double) GetPixelIndex(indexes+x); histogram[ScaleQuantumToMap(GetPixelIndex(indexes+x))].index++; } x++; @@ -2696,6 +2709,16 @@ MagickExport ChannelStatistics *GetImageChannelStatistics(const Image *image, channel_statistics[i].mean)*(standard_deviation*standard_deviation* standard_deviation*standard_deviation)-3.0; } + for (i=0; i <= (ssize_t) CompositeChannels; i++) + { + channel_statistics[i].mean*=QuantumRange; + channel_statistics[i].variance*=QuantumRange; + channel_statistics[i].standard_deviation*=QuantumRange; + channel_statistics[i].sum*=QuantumRange; + channel_statistics[i].sum_squared*=QuantumRange; + channel_statistics[i].sum_cubed*=QuantumRange; + channel_statistics[i].sum_fourth_power*=QuantumRange; + } channel_statistics[CompositeChannels].mean=0.0; channel_statistics[CompositeChannels].standard_deviation=0.0; for (i=0; i < (ssize_t) CompositeChannels; i++) @@ -2922,7 +2945,7 @@ MagickExport Image *PolynomialImageChannel(const Image *images, polynomial_pixel[x].blue)); if (image->matte == MagickFalse) SetPixelOpacity(q,ClampToQuantum((MagickRealType) QuantumRange- - (MagickRealType) QuantumRange*polynomial_pixel[x].opacity)); + (MagickRealType) QuantumRange*polynomial_pixel[x].opacity)); else SetPixelAlpha(q,ClampToQuantum((MagickRealType) QuantumRange- (MagickRealType) QuantumRange*polynomial_pixel[x].opacity)); @@ -3123,6 +3146,7 @@ static void AddNodePixelList(PixelList *pixel_list,const ssize_t channel, Determine where it belongs in the list. */ search=65536UL; + (void) memset(update,0,sizeof(update)); for (level=list->level; level >= 0; level--) { while (list->nodes[search].next[level] < color) @@ -3730,8 +3754,8 @@ MagickExport Image *StatisticImageChannel(const Image *image, { for (u=0; u < (ssize_t) neighbor_width; u++) InsertPixelList(image,r+u,s+u,pixel_list[id]); - r+=image->columns+neighbor_width; - s+=image->columns+neighbor_width; + r+=(ptrdiff_t) image->columns+neighbor_width; + s+=(ptrdiff_t) image->columns+neighbor_width; } GetMagickPixelPacket(image,&pixel); SetMagickPixelPacket(image,p+neighbor_width*neighbor_height/2,indexes+x+ diff --git a/magick/stream-private.h b/magick/stream-private.h index ce5927eb1bc5b08872951bb17444a253f735c450..2161006eb4382f30549e241d53467315421323b5 100644 --- a/magick/stream-private.h +++ b/magick/stream-private.h @@ -43,6 +43,9 @@ extern MagickExport void SetStreamInfoMap(StreamInfo *,const char *), SetStreamInfoStorageType(StreamInfo *,const StorageType); +extern MagickPrivate void + ResetStreamAnonymousMemory(void); + #if defined(__cplusplus) || defined(c_plusplus) } #endif diff --git a/magick/stream.c b/magick/stream.c index 027d52d61d7d8d0a98091a9d498c4b61f722392c..b479f007fb8708b6d2634364b89a4d8454d1f0b1 100644 --- a/magick/stream.c +++ b/magick/stream.c @@ -521,7 +521,7 @@ static MagickBooleanType GetOneVirtualPixelFromStream(const Image *image, % % GetStreamInfoClientData() gets the stream info client data. % -% The format of the SetStreamInfoClientData method is: +% The format of the GetStreamInfoClientData method is: % % const void *GetStreamInfoClientData(StreamInfo *stream_info) % @@ -1004,6 +1004,28 @@ MagickExport Image *ReadStream(const ImageInfo *image_info,StreamHandler stream, % % % % % % ++ R e s e t S t r e a m A n o n y m o u s M e m o r y % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ResetStreamAnonymousMemory() resets the anonymous_memory value. +% +% The format of the ResetStreamAnonymousMemory method is: +% +% void ResetStreamAnonymousMemory(void) +% +*/ +MagickPrivate void ResetStreamAnonymousMemory(void) +{ +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % + S e t S t r e a m I n f o C l i e n t D a t a % % % % % diff --git a/magick/string-private.h b/magick/string-private.h index 69690991475245879bb9e307596383497ffa0e62..4e889890b0818e09e6666070908d6354e238ea50 100644 --- a/magick/string-private.h +++ b/magick/string-private.h @@ -114,6 +114,30 @@ static inline long StringToLong(const char *magick_restrict value) return(strtol(value,(char **) NULL,10)); } +static inline MagickOffsetType StringToMagickOffsetType(const char *string, + const double interval) +{ + double + value; + + value=SiPrefixToDoubleInterval(string,interval); + if (value >= (double) MagickULLConstant(~0)) + return((MagickOffsetType) MagickULLConstant(~0)); + return((MagickOffsetType) value); +} + +static inline MagickSizeType StringToMagickSizeType(const char *string, + const double interval) +{ + double + value; + + value=SiPrefixToDoubleInterval(string,interval); + if (value >= (double) MagickULLConstant(~0)) + return(MagickULLConstant(~0)); + return((MagickSizeType) value); +} + static inline size_t StringToSizeType(const char *string,const double interval) { double diff --git a/magick/string.c b/magick/string.c index bec3e1dc73628de4b38dda9217b0f78d9bd37c06..b295254200723bc3347fe7e8d589a7fab75e2d48 100644 --- a/magick/string.c +++ b/magick/string.c @@ -659,7 +659,7 @@ MagickExport StringInfo *ConfigureFileToStringInfo(const char *filename) for (i=0; i < length; i+=count) { count=read(file,string+i,(size_t) MagickMin(length-i,(size_t) - MAGICK_SSIZE_MAX)); + MagickMaxBufferExtent)); if (count <= 0) { count=0; @@ -1180,6 +1180,9 @@ MagickExport ssize_t FormatMagickSize(const MagickSizeType size, */ MagickExport char *GetEnvironmentValue(const char *name) { +#if defined(MAGICKCORE_WINDOWS_SUPPORT) + return(NTGetEnvironmentValue(name)); +#else const char *environment; @@ -1187,6 +1190,7 @@ MagickExport char *GetEnvironmentValue(const char *name) if (environment == (const char *) NULL) return((char *) NULL); return(ConstantString(environment)); +#endif } /* @@ -1382,7 +1386,7 @@ MagickExport double InterpretSiPrefixValue(const char *magick_restrict string, if (q[1] == 'i') { value*=pow(2.0,e/0.3); - q+=2; + q+=(ptrdiff_t) 2; } else { @@ -1644,7 +1648,7 @@ MagickExport char *SanitizeString(const char *source) sanitize_source=AcquireString(source); p=sanitize_source; q=sanitize_source+strlen(sanitize_source); - for (p+=strspn(p,allowlist); p != q; p+=strspn(p,allowlist)) + for (p+=strspn(p,allowlist); p != q; p+=(ptrdiff_t) strspn(p,allowlist)) *p='_'; return(sanitize_source); } @@ -2423,7 +2427,7 @@ MagickExport char **StringToStrings(const char *text,size_t *count) { (void) FormatLocaleString(hex_string,MagickPathExtent,"%02x",*(p+j)); (void) CopyMagickString(q,hex_string,MagickPathExtent); - q+=2; + q+=(ptrdiff_t) 2; if ((j % 0x04) == 0) *q++=' '; } @@ -2626,7 +2630,7 @@ MagickExport MagickBooleanType SubstituteString(char **string, (void) memmove(p+replace_extent,p+search_extent, strlen(p+search_extent)+1); (void) memcpy(p,replace,replace_extent); - p+=replace_extent-1; + p+=(ptrdiff_t) replace_extent-1; } return(status); } diff --git a/magick/studio.h b/magick/studio.h index 7db1d72680b0af8b7a3826ec078a37108146ef3c..35d49739773797caf26820c9305675f3b52259a8 100644 --- a/magick/studio.h +++ b/magick/studio.h @@ -149,11 +149,9 @@ extern "C" { #endif #if defined(MAGICKCORE_HAVE_CL_CL_H) && !defined(MAGICK_PIXEL_RGBA) -# include # define MAGICKCORE_OPENCL_SUPPORT 1 #endif #if defined(MAGICKCORE_HAVE_OPENCL_CL_H) && !defined(MAGICK_PIXEL_RGBA) -# include # define MAGICKCORE_OPENCL_SUPPORT 1 #endif @@ -290,7 +288,7 @@ extern int vsnprintf(char *,size_t,const char *,va_list); # define Exit exit # define IsBasenameSeparator(c) \ (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse) -# define MAGICKCORE_LIBRARY_PATH "sys$login:" +# define MAGICKCORE_LIBRARY_ABSOLUTE_PATH "sys$login:" # define MAGICKCORE_SHARE_PATH "sys$login:" # define X11_PREFERENCES_PATH "decw$user_defaults:" # define ProcessPendingEvents(text) @@ -315,7 +313,7 @@ extern int vsnprintf(char *,size_t,const char *,va_list); # define DirectoryListSeparator ';' # define EditorOptions "" # define IsBasenameSeparator(c) ((c) == ':' ? MagickTrue : MagickFalse) -# define MAGICKCORE_LIBRARY_PATH "" +# define MAGICKCORE_LIBRARY_ABSOLUTE_PATH "" # define MAGICKCORE_SHARE_PATH "" # define X11_PREFERENCES_PATH "~/." # if defined(DISABLE_SIOUX) diff --git a/magick/thread-private.h b/magick/thread-private.h index e221ca7b674e1c00b5fc730e428250558edf78de..72db6746694178e56d9863eb1fa6ec593a10edfc 100644 --- a/magick/thread-private.h +++ b/magick/thread-private.h @@ -27,8 +27,8 @@ extern "C" { #endif -#define magick_number_threads(source,destination,chunk,multithreaded) \ - num_threads(GetMagickNumberThreads(source,destination,chunk,multithreaded)) +#define magick_number_threads(source,destination,chunk,factor) \ + num_threads(GetMagickNumberThreads(source,destination,chunk,factor)) #if defined(__clang__) || (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 10)) #define MagickCachePrefetch(address,mode,locality) \ __builtin_prefetch(address,mode,locality) @@ -48,8 +48,10 @@ extern "C" { #endif static inline int GetMagickNumberThreads(const Image *source, - const Image *destination,const size_t chunk,int multithreaded) + const Image *destination,const size_t chunk,const int factor) { +#define WorkLoadFactor (64UL << factor) + const CacheType destination_type = (CacheType) GetImagePixelCacheType(destination), source_type = (CacheType) GetImagePixelCacheType(source); @@ -60,15 +62,12 @@ static inline int GetMagickNumberThreads(const Image *source, /* Return number of threads dependent on cache type and work load. */ - if (multithreaded == 0) - return(1); + number_threads=(int) MagickMax(MagickMin(chunk/WorkLoadFactor, + GetMagickResourceLimit(ThreadResource)),1); if (((source_type != MemoryCache) && (source_type != MapCache)) || ((destination_type != MemoryCache) && (destination_type != MapCache))) - number_threads=(int) MagickMin(GetMagickResourceLimit(ThreadResource),2); - else - number_threads=(int) MagickMin((ssize_t) - GetMagickResourceLimit(ThreadResource),(ssize_t) (chunk)/64); - return(MagickMax(number_threads,1)); + number_threads=MagickMin(number_threads,2); + return(number_threads); } static inline MagickThreadType GetMagickThreadId(void) @@ -159,7 +158,7 @@ static inline void SetOpenMPNested(const int value) omp_set_nested(value); #else static inline void SetOpenMPNested(const int magick_unused(value)) -{ +{ magick_unreferenced(value); #endif } diff --git a/magick/threshold.c b/magick/threshold.c index 0e058d0971c1f78fe8b33cd8422799f1e04b92ad..41018788ecf161ac4aa5990c3ccfefecf7d8ab91 100644 --- a/magick/threshold.c +++ b/magick/threshold.c @@ -294,7 +294,7 @@ MagickExport Image *AdaptiveThresholdImage(const Image *image, if (image->colorspace == CMYKColorspace) channel_sum.index=(MagickRealType) GetPixelIndex(indexes+(r-p)+u); } - r+=image->columns+width; + r+=(ptrdiff_t) image->columns+width; } for (x=0; x < (ssize_t) image->columns; x++) { @@ -324,7 +324,7 @@ MagickExport Image *AdaptiveThresholdImage(const Image *image, if (image->colorspace == CMYKColorspace) channel_sum.index=(MagickRealType) GetPixelIndex(indexes+x+(r-p)+ width-1); - r+=image->columns+width; + r+=(ptrdiff_t) image->columns+width; } mean.red=(MagickRealType) (channel_sum.red/number_pixels+offset); mean.green=(MagickRealType) (channel_sum.green/number_pixels+offset); @@ -864,7 +864,7 @@ MagickExport MagickBooleanType BilevelImageChannel(Image *image, image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -1208,7 +1208,7 @@ MagickExport MagickBooleanType ClampImageChannel(Image *image, image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2689,7 +2689,7 @@ MagickExport MagickBooleanType WhiteThresholdImageChannel(Image *image, image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { diff --git a/magick/timer-private.h b/magick/timer-private.h index d591a331576adf83a793927c2ec570608faa8c50..48e52792491e7015799dd41aafa4cfeefa060eb4 100644 --- a/magick/timer-private.h +++ b/magick/timer-private.h @@ -22,7 +22,9 @@ extern "C" { #endif -static inline void GetMagickUTCtime(const time_t *timep,struct tm *result) +#include "magick/locale_.h" + +static inline void GetMagickUTCTime(const time_t *timep,struct tm *result) { #if defined(MAGICKCORE_HAVE_GMTIME_R) (void) gmtime_r(timep,result); @@ -54,12 +56,50 @@ static inline void GetMagickLocaltime(const time_t *timep,struct tm *result) #endif } -extern MagickPrivate MagickOffsetType - GetMagickTTL(void); - extern MagickExport time_t GetMagickTime(void); +static inline MagickBooleanType IsImageTTLExpired(const Image* image) +{ + if (image->ttl == (time_t) 0) + return(MagickFalse); + return(image->ttl < GetMagickTime() ? MagickTrue : MagickFalse); +} + +static inline time_t ParseMagickTimeToLive(const char *time_to_live) +{ + char + *q; + + time_t + ttl; + + /* + Time to live, absolute or relative, e.g. 1440, 2 hours, 3 days, ... + */ + ttl=(time_t) InterpretLocaleValue(time_to_live,&q); + if (q != time_to_live) + { + while (isspace((int) ((unsigned char) *q)) != 0) + q++; + if (LocaleNCompare(q,"second",6) == 0) + ttl*=1; + if (LocaleNCompare(q,"minute",6) == 0) + ttl*=60; + if (LocaleNCompare(q,"hour",4) == 0) + ttl*=3600; + if (LocaleNCompare(q,"day",3) == 0) + ttl*=86400; + if (LocaleNCompare(q,"week",4) == 0) + ttl*=604800; + if (LocaleNCompare(q,"month",5) == 0) + ttl*=2628000; + if (LocaleNCompare(q,"year",4) == 0) + ttl*=31536000; + } + return(ttl); +} + #if defined(__cplusplus) || defined(c_plusplus) } #endif diff --git a/magick/timer.c b/magick/timer.c index 5041092b77659c28e9530067a67a63de34bec88a..753eea9fd1a430332879094a0bbeecd30572de3b 100644 --- a/magick/timer.c +++ b/magick/timer.c @@ -265,7 +265,7 @@ MagickExport ssize_t FormatMagickTime(const time_t time,const size_t length, utc_time; assert(timestamp != (char *) NULL); - GetMagickUTCtime(&time,&utc_time); + GetMagickUTCTime(&time,&utc_time); count=FormatLocaleString(timestamp,length, "%04d-%02d-%02dT%02d:%02d:%02d%+03d:00",utc_time.tm_year+1900, utc_time.tm_mon+1,utc_time.tm_mday,utc_time.tm_hour,utc_time.tm_min, @@ -329,7 +329,7 @@ MagickExport double GetElapsedTime(TimerInfo *time_info) MagickExport time_t GetMagickTime(void) { static time_t - constant_magick_time = (time_t) 0; + magick_epoch = (time_t) 0; static MagickBooleanType epoch_initialized = MagickFalse; @@ -339,56 +339,21 @@ MagickExport time_t GetMagickTime(void) const char *source_date_epoch; - epoch_initialized=MagickTrue; source_date_epoch=getenv("SOURCE_DATE_EPOCH"); if (source_date_epoch != (const char *) NULL) { time_t epoch; - epoch=(time_t) StringToDouble(source_date_epoch,(char **) NULL); + epoch=(time_t) StringToMagickOffsetType(source_date_epoch,100.0); if ((epoch > 0) && (epoch <= time((time_t *) NULL))) - constant_magick_time=epoch; + magick_epoch=epoch; } - } - if (constant_magick_time != 0) - return(constant_magick_time); - return(time((time_t *) NULL)); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -+ G e t M a g i c k T T L % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% GetMagickTTL() returns the time as the number of seconds to live. -% -% The format of the GetMagickTTL method is: -% -% MagickSizeType GetMagickTTL(void) -% -*/ -MagickPrivate MagickOffsetType GetMagickTTL(void) -{ - static time_t - magick_epoch = (time_t) 0; - - static MagickBooleanType - epoch_initialized = MagickFalse; - - if (epoch_initialized == MagickFalse) - { epoch_initialized=MagickTrue; - magick_epoch=time((time_t *) NULL); } - return((MagickOffsetType) GetMagickResourceLimit(TimeResource)- - (GetMagickTime()-magick_epoch)); + if (magick_epoch != 0) + return(magick_epoch); + return(time((time_t *) NULL)); } /* diff --git a/magick/transform.c b/magick/transform.c index 55d28b2bbbb79816c810fc2b52d427f23a08583c..23de3922997832adc8febffacebd275cbb6fb222 100644 --- a/magick/transform.c +++ b/magick/transform.c @@ -107,7 +107,7 @@ MagickExport Image *AutoOrientImage(const Image *image, assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickCoreSignature); orient_image=(Image *) NULL; - switch(orientation) + switch (orientation) { case UndefinedOrientation: case TopLeftOrientation: @@ -254,7 +254,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,extent.y,2) #endif for (y=0; y < (ssize_t) extent.y; y++) { @@ -318,7 +318,7 @@ MagickExport Image *ChopImage(const Image *image,const RectangleInfo *chop_info, */ #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,image,image->rows,1) + magick_number_threads(image,image,image->rows,2) #endif for (y=0; y < (ssize_t) (image->rows-(extent.y+extent.height)); y++) { @@ -686,24 +686,28 @@ 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=CastDoubleToUnsigned((double) page.width+page.x- + bounding_box.x); page.x=0; } else { - page.width-=bounding_box.x-page.x; + page.width=CastDoubleToUnsigned((double) 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=CastDoubleToUnsigned((double) page.height+page.y- + bounding_box.y); page.y=0; } else { - page.height-=bounding_box.y-page.y; + page.height=CastDoubleToUnsigned((double) page.height-(bounding_box.y- + page.y)); page.y-=bounding_box.y; if (page.y < 0) page.y=0; @@ -749,7 +753,7 @@ MagickExport Image *CropImage(const Image *image,const RectangleInfo *geometry, crop_view=AcquireAuthenticCacheView(crop_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,crop_image,crop_image->rows,1) + magick_number_threads(image,crop_image,crop_image->rows,2) #endif for (y=0; y < (ssize_t) crop_image->rows; y++) { @@ -1088,7 +1092,7 @@ MagickExport Image *ExcerptImage(const Image *image, excerpt_view=AcquireAuthenticCacheView(excerpt_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,excerpt_image,excerpt_image->rows,1) + magick_number_threads(image,excerpt_image,excerpt_image->rows,2) #endif for (y=0; y < (ssize_t) excerpt_image->rows; y++) { @@ -1285,7 +1289,7 @@ MagickExport Image *FlipImage(const Image *image,ExceptionInfo *exception) flip_view=AcquireAuthenticCacheView(flip_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,flip_image,flip_image->rows,1) + magick_number_threads(image,flip_image,flip_image->rows,2) #endif for (y=0; y < (ssize_t) flip_image->rows; y++) { @@ -1414,7 +1418,7 @@ MagickExport Image *FlopImage(const Image *image,ExceptionInfo *exception) flop_view=AcquireAuthenticCacheView(flop_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(image,flop_image,flop_image->rows,1) + magick_number_threads(image,flop_image,flop_image->rows,2) #endif for (y=0; y < (ssize_t) flop_image->rows; y++) { @@ -1443,7 +1447,7 @@ MagickExport Image *FlopImage(const Image *image,ExceptionInfo *exception) status=MagickFalse; continue; } - q+=flop_image->columns; + q+=(ptrdiff_t) flop_image->columns; indexes=GetCacheViewVirtualIndexQueue(image_view); flop_indexes=GetCacheViewAuthenticIndexQueue(flop_view); for (x=0; x < (ssize_t) flop_image->columns; x++) @@ -1531,7 +1535,7 @@ static MagickBooleanType CopyImageRegion(Image *destination,const Image *source, destination_view=AcquireAuthenticCacheView(destination,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(status) \ - magick_number_threads(source,destination,rows,1) + magick_number_threads(source,destination,rows,2) #endif for (y=0; y < (ssize_t) rows; y++) { @@ -1845,7 +1849,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,splice_geometry.y,2) #endif for (y=0; y < (ssize_t) splice_geometry.y; y++) { @@ -1924,7 +1928,7 @@ MagickExport Image *SpliceImage(const Image *image, } #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,splice_image,splice_image->rows,1) + 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++) @@ -2247,7 +2251,7 @@ MagickExport Image *TransposeImage(const Image *image,ExceptionInfo *exception) transpose_view=AcquireAuthenticCacheView(transpose_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,transpose_image,image->rows,1) + magick_number_threads(image,transpose_image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2377,7 +2381,7 @@ MagickExport Image *TransverseImage(const Image *image,ExceptionInfo *exception) transverse_view=AcquireAuthenticCacheView(transverse_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,transverse_image,image->rows,1) + magick_number_threads(image,transverse_image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -2407,7 +2411,7 @@ MagickExport Image *TransverseImage(const Image *image,ExceptionInfo *exception) status=MagickFalse; continue; } - q+=image->columns; + q+=(ptrdiff_t) image->columns; for (x=0; x < (ssize_t) image->columns; x++) *--q=(*p++); indexes=GetCacheViewAuthenticIndexQueue(image_view); diff --git a/magick/type.c b/magick/type.c index c89a783eeaeb8b0f2f0393ea7cde5d5c10a30266..e2bbcd3633cd7f14efc2500755574f0316eb1d82 100644 --- a/magick/type.c +++ b/magick/type.c @@ -944,6 +944,7 @@ MagickExport MagickBooleanType ListTypeInfo(FILE *file,ExceptionInfo *exception) const char *family, *glyphs, + *metrics, *name, *path, *stretch, @@ -975,15 +976,18 @@ MagickExport MagickBooleanType ListTypeInfo(FILE *file,ExceptionInfo *exception) (type_info[i]->path != (char *) NULL)) (void) FormatLocaleFile(file,"\nPath: %s\n",type_info[i]->path); path=type_info[i]->path; - name="unknown"; + name="not defined"; if (type_info[i]->name != (char *) NULL) name=type_info[i]->name; - family="unknown"; + family="not defined"; if (type_info[i]->family != (char *) NULL) family=type_info[i]->family; style=CommandOptionToMnemonic(MagickStyleOptions,type_info[i]->style); stretch=CommandOptionToMnemonic(MagickStretchOptions,type_info[i]->stretch); - glyphs="unknown"; + metrics="not defined"; + if (type_info[i]->metrics != (char *) NULL) + metrics=type_info[i]->metrics; + glyphs="not defined"; if (type_info[i]->glyphs != (char *) NULL) glyphs=type_info[i]->glyphs; (void) FormatLocaleString(weight,MaxTextExtent,"%.20g",(double) @@ -993,6 +997,7 @@ MagickExport MagickBooleanType ListTypeInfo(FILE *file,ExceptionInfo *exception) (void) FormatLocaleFile(file," style: %s\n",style); (void) FormatLocaleFile(file," stretch: %s\n",stretch); (void) FormatLocaleFile(file," weight: %s\n",weight); + (void) FormatLocaleFile(file," metrics: %s\n",metrics); (void) FormatLocaleFile(file," glyphs: %s\n",glyphs); } (void) fflush(file); @@ -1260,8 +1265,7 @@ static MagickBooleanType LoadTypeCache(SplayTreeInfo *cache,const char *xml, { if (LocaleCompare((char *) keyword,"glyphs") == 0) { - if (SetTypeNodePath(filename,font_path,token,&type_info->glyphs) == - MagickFalse) + if (SetTypeNodePath(filename,font_path,token,&type_info->glyphs) == MagickFalse) type_info=(TypeInfo *) DestroyTypeNode(type_info); break; } @@ -1272,8 +1276,7 @@ static MagickBooleanType LoadTypeCache(SplayTreeInfo *cache,const char *xml, { if (LocaleCompare((char *) keyword,"metrics") == 0) { - if (SetTypeNodePath(filename,font_path,token,&type_info->metrics) == - MagickFalse) + if (SetTypeNodePath(filename,font_path,token,&type_info->metrics) == MagickFalse) type_info=(TypeInfo *) DestroyTypeNode(type_info); break; } diff --git a/magick/utility-private.h b/magick/utility-private.h index 42c7cef9379113465423eac989c978b06be29298..82678075f948005feb17933c1c2461f3ce3b1421 100644 --- a/magick/utility-private.h +++ b/magick/utility-private.h @@ -21,6 +21,9 @@ #include "magick/memory_.h" #include "magick/nt-base.h" #include "magick/nt-base-private.h" +#if defined(MAGICKCORE_HAVE_UTIME_H) +#include +#endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { @@ -265,6 +268,80 @@ static inline int rename_utf8(const char *source,const char *destination) #endif } +static inline int set_file_timestamp(const char *path,struct stat *attributes) +{ + int + status; + +#if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) +#if defined(MAGICKCORE_HAVE_UTIMENSAT) +#if defined(__APPLE__) || defined(__NetBSD__) +#define st_atim st_atimespec +#define st_ctim st_ctimespec +#define st_mtim st_mtimespec +#endif + + struct timespec + timestamp[2]; + + timestamp[0].tv_sec=attributes->st_atim.tv_sec; + timestamp[0].tv_nsec=attributes->st_atim.tv_nsec; + timestamp[1].tv_sec=attributes->st_mtim.tv_sec; + timestamp[1].tv_nsec=attributes->st_mtim.tv_nsec; + status=utimensat(AT_FDCWD,path,timestamp,0); +#else + struct utimbuf + timestamp; + + timestamp.actime=attributes->st_atime; + timestamp.modtime=attributes->st_mtime; + status=utime(path,×tamp); +#endif +#else + HANDLE + handle; + + wchar_t + *path_wide; + + status=(-1); + path_wide=create_wchar_path(path); + if (path_wide == (WCHAR *) NULL) + return(status); + handle=CreateFileW(path_wide,FILE_WRITE_ATTRIBUTES,FILE_SHARE_WRITE | + FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL); + if (handle != (HANDLE) NULL) + { + FILETIME + creation_time, + last_access_time, + last_write_time; + + ULARGE_INTEGER + date_time; + + date_time.QuadPart=(ULONGLONG) (attributes->st_ctime*10000000LL)+ + 116444736000000000LL; + creation_time.dwLowDateTime=date_time.LowPart; + creation_time.dwHighDateTime=date_time.HighPart; + 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=(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); + CloseHandle(handle); + status=0; + } + path_wide=(WCHAR *) RelinquishMagickMemory(path_wide); +#endif + return(status); +} + static inline int stat_utf8(const char *path,struct stat *attributes) { #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) @@ -279,7 +356,7 @@ static inline int stat_utf8(const char *path,struct stat *attributes) path_wide=create_wchar_path(path); if (path_wide == (WCHAR *) NULL) return(-1); - status=wstat(path_wide,attributes); + status=_wstati64(path_wide,attributes); path_wide=(WCHAR *) RelinquishMagickMemory(path_wide); return(status); #endif diff --git a/magick/utility.c b/magick/utility.c index 0355a7a8a311bc202b1b68ac62fa41fc92e85423..83523600f3ae9eeae52a913203f2f636956e93a4 100644 --- a/magick/utility.c +++ b/magick/utility.c @@ -178,13 +178,13 @@ MagickExport MagickBooleanType AcquireUniqueSymbolicLink(const char *source, char *passes; - (void) AcquireUniqueFilename(destination); - (void) RelinquishUniqueFileResource(destination); passes=GetPolicyValue("system:shred"); if (passes != (char *) NULL) passes=DestroyString(passes); else { + (void) AcquireUniqueFilename(destination); + (void) RelinquishUniqueFileResource(destination); if (*source == *DirectorySeparator) { if (symlink(source,destination) == 0) @@ -522,7 +522,7 @@ MagickExport char *Base64Encode(const unsigned char *blob, if (encode == (char *) NULL) return((char *) NULL); i=0; - for (p=blob; p < (blob+blob_length-2); p+=3) + for (p=blob; p < (blob+blob_length-2); p+=(ptrdiff_t) 3) { encode[i++]=Base64[(int) (*p >> 2)]; encode[i++]=Base64[(int) (((*p & 0x03) << 4)+(*(p+1) >> 4))]; diff --git a/magick/version.c b/magick/version.c index 7a12137d537e1aca64ef130f253dc815374d717b..75f00e96d388b5b12f9f54847101ff81e1da394e 100644 --- a/magick/version.c +++ b/magick/version.c @@ -551,16 +551,16 @@ MagickExport unsigned int GetMagickCoreSignature(const StringInfo *nonce) p=GetStringInfoDatum(version); signature=MAGICKCORE_QUANTUM_DEPTH; (void) memcpy(p,&signature,sizeof(signature)); - p+=sizeof(signature); + p+=(ptrdiff_t) sizeof(signature); signature=MAGICKCORE_HDRI_ENABLE; (void) memcpy(p,&signature,sizeof(signature)); - p+=sizeof(signature); + p+=(ptrdiff_t) sizeof(signature); signature=MagickLibInterface; (void) memcpy(p,&signature,sizeof(signature)); - p+=sizeof(signature); + p+=(ptrdiff_t) sizeof(signature); signature=1; /* endinaness */ (void) memcpy(p,&signature,sizeof(signature)); - p+=sizeof(signature); + p+=(ptrdiff_t) sizeof(signature); SetStringInfoLength(version,p-GetStringInfoDatum(version)); if (nonce != (const StringInfo *) NULL) ConcatenateStringInfo(version,nonce); diff --git a/magick/version.h b/magick/version.h index 22ec7fb0f0e78b9c0bb69e280663314d6ef7643b..44840b636f04ee511bcbe3c4b130a1584b446636 100644 --- a/magick/version.h +++ b/magick/version.h @@ -27,20 +27,20 @@ extern "C" { */ #define MagickPackageName "ImageMagick" #define MagickCopyright "(C) 1999 ImageMagick Studio LLC" -#define MagickLibVersion 0x69C -#define MagickLibVersionText "6.9.12" +#define MagickLibVersion 0x69D +#define MagickLibVersionText "6.9.13" #define MagickLibVersionNumber 7,0,0 -#define MagickLibAddendum "-98" +#define MagickLibAddendum "-25" #define MagickLibInterface 7 #define MagickLibMinInterface 7 #define MagickPlatform "x86_64" -#define MagickppLibVersionText "6.9.12" +#define MagickppLibVersionText "6.9.13" #define MagickppLibVersionNumber 9:0:0 -#define MagickppLibAddendum "-98" +#define MagickppLibAddendum "-25" #define MagickppLibInterface 9 #define MagickppLibMinInterface 9 -#define MagickGitRevision "18038" -#define MagickReleaseDate "2023-10-08" +#define MagickGitRevision "18639" +#define MagickReleaseDate "2025-03-29" #define MagickHomeURL "file:///usr/share/doc/ImageMagick-6/index.html" #define MagickAuthoritativeLicense \ "https://imagemagick.org/script/license.php" diff --git a/magick/version.h.in b/magick/version.h.in index 493c32a59032b3b193ffbda3751c95d53295ff40..43e719a27e4e96ced8c999a94e33eb0c9004c7cb 100644 --- a/magick/version.h.in +++ b/magick/version.h.in @@ -39,7 +39,7 @@ extern "C" { #define MagickppLibAddendum "@PACKAGE_VERSION_ADDENDUM@" #define MagickppLibInterface @MAGICKPP_LIBRARY_CURRENT@ #define MagickppLibMinInterface @MAGICKPP_LIBRARY_CURRENT_MIN@ -#define MagickGitRevision "18038" +#define MagickGitRevision "18639" #define MagickReleaseDate "@PACKAGE_RELEASE_DATE@" #define MagickHomeURL "file://@DOCUMENTATION_PATH@/index.html" #define MagickAuthoritativeLicense \ diff --git a/magick/vision.c b/magick/vision.c index 3136bf161e354da9c51be6a8aed646a9ca9d3fd5..084062664a787519a1f7650eda53cd3000e4001b 100644 --- a/magick/vision.c +++ b/magick/vision.c @@ -272,7 +272,7 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, status=MagickFalse; continue; } - p+=image->columns; + p+=(ptrdiff_t) image->columns; for (x=0; x < (ssize_t) image->columns; x++) { ssize_t diff --git a/magick/visual-effects.c b/magick/visual-effects.c index dc22bdcd112441452ee66d3c1f6c49fecb7940ec..d91278dbaee71464df5e3d55ac42c6b4ed2b5d32 100644 --- a/magick/visual-effects.c +++ b/magick/visual-effects.c @@ -53,6 +53,7 @@ #include "magick/attribute.h" #include "magick/cache.h" #include "magick/cache-view.h" +#include "magick/cache-private.h" #include "magick/channel.h" #include "magick/color.h" #include "magick/color-private.h" @@ -216,7 +217,7 @@ MagickExport Image *AddNoiseImageChannel(const Image *image, #if defined(MAGICKCORE_OPENMP_SUPPORT) key=GetRandomSecretKey(random_info[0]); #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,noise_image,image->rows,key == ~0UL) + magick_number_threads(image,noise_image,image->rows,key == ~0UL ? 0 : 2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -384,7 +385,7 @@ MagickExport Image *BlueShiftImage(const Image *image,const double factor, shift_view=AcquireAuthenticCacheView(shift_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,shift_image,image->rows,1) + magick_number_threads(image,shift_image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -649,7 +650,7 @@ MagickExport Image *ColorizeImage(const Image *image,const char *opacity, colorize_view=AcquireAuthenticCacheView(colorize_image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(static) shared(progress,status) \ - magick_number_threads(image,colorize_image,image->rows,1) + magick_number_threads(image,colorize_image,image->rows,2) #endif for (y=0; y < (ssize_t) image->rows; y++) { @@ -1068,21 +1069,21 @@ MagickExport Image *ImplodeImage(const Image *image,const double amount, double distance; + IndexPacket + *magick_restrict implode_indexes; + MagickPixelPacket pixel; + PixelPacket + *magick_restrict q; + PointInfo delta; - IndexPacket - *magick_restrict implode_indexes; - ssize_t x; - PixelPacket - *magick_restrict q; - if (status == MagickFalse) continue; q=GetCacheViewAuthenticPixels(implode_view,0,y,implode_image->columns,1, @@ -1093,31 +1094,36 @@ MagickExport Image *ImplodeImage(const Image *image,const double amount, continue; } implode_indexes=GetCacheViewAuthenticIndexQueue(implode_view); - delta.y=scale.y*(double) (y-center.y); + delta.y=scale.y*((double) y-center.y); pixel=zero; for (x=0; x < (ssize_t) image->columns; x++) { /* Determine if the pixel is within an ellipse. */ - delta.x=scale.x*(double) (x-center.x); + delta.x=scale.x*((double) x-center.x); distance=delta.x*delta.x+delta.y*delta.y; if (distance < (radius*radius)) { double factor; + PointInfo + offset; + /* Implode the pixel. */ factor=1.0; if (distance > 0.0) - factor=pow(sin((double) (MagickPI*sqrt((double) distance)* - PerceptibleReciprocal(radius)/2)),-amount); - status=InterpolateMagickPixelPacket(image,image_view, - UndefinedInterpolatePixel,(double) (factor*delta.x* - PerceptibleReciprocal(scale.x)+center.x),(double) (factor*delta.y* - PerceptibleReciprocal(scale.y)+center.y),&pixel,exception); + factor=pow(sin((double) (MagickPI*sqrt(distance)* + PerceptibleReciprocal(radius)/2.0)),-amount); + offset.x=factor*delta.x*PerceptibleReciprocal(scale.x)+center.x; + offset.y=factor*delta.y*PerceptibleReciprocal(scale.y)+center.y; + if ((IsValidPixelOffset(offset.x,image->columns) != MagickFalse) && + (IsValidPixelOffset(offset.y,image->rows) != MagickFalse)) + status=InterpolateMagickPixelPacket(image,image_view, + UndefinedInterpolatePixel,offset.x,offset.y,&pixel,exception); if (status == MagickFalse) break; SetPixelPacket(implode_image,&pixel,q,implode_indexes+x); @@ -3463,22 +3469,22 @@ static inline void HatTransform(const float *magick_restrict pixels, for (i=0; i < (ssize_t) scale; i++) { kernel[i]=0.25f*(*p+(*p)+(*q)+(*r)); - p+=stride; + p+=(ptrdiff_t) stride; q-=stride; - r+=stride; + r+=(ptrdiff_t) stride; } for ( ; i < (ssize_t) (extent-scale); i++) { kernel[i]=0.25f*(2.0f*(*p)+*(p-scale*stride)+*(p+scale*stride)); - p+=stride; + p+=(ptrdiff_t) stride; } q=p-scale*stride; r=pixels+stride*(extent-2); for ( ; i < (ssize_t) extent; i++) { kernel[i]=0.25f*(*p+(*p)+(*q)+(*r)); - p+=stride; - q+=stride; + p+=(ptrdiff_t) stride; + q+=(ptrdiff_t) stride; r-=stride; } } @@ -3645,7 +3651,7 @@ MagickExport Image *WaveletDenoiseImage(const Image *image, p=kernel+id*image->columns; q=pixels+y*image->columns; HatTransform(q+high_pass,1,image->columns,(size_t) (1UL << level),p); - q+=low_pass; + q+=(ptrdiff_t) low_pass; for (x=0; x < (ssize_t) image->columns; x++) *q++=(*p++); } @@ -3671,7 +3677,7 @@ MagickExport Image *WaveletDenoiseImage(const Image *image, for (y=0; y < (ssize_t) image->rows; y++) { *q=(*p++); - q+=image->columns; + q+=(ptrdiff_t) image->columns; } } /* diff --git a/magick/widget.c b/magick/widget.c index 8cedfc8ab1e4b28feaa801d156ccf2ba6fbadbc2..6278bf6691b1e0c5ca3b63be33ce279467ed1063 100644 --- a/magick/widget.c +++ b/magick/widget.c @@ -1168,7 +1168,8 @@ static void XEditText(Display *display,XWidgetInfo *text_info, q=text_info->text+Extent(text_info->text)+strlen(text); for (i=0; i <= Extent(text_info->cursor); i++) { - *q=(*(q-Extent(text))); + if ((q-Extent(text)) > text_info->text) + *q=(*(q-Extent(text))); q--; } p=text; @@ -1792,8 +1793,8 @@ MagickExport void XColorBrowserWidget(Display *display,XWindows *windows, 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=(int) windows->widget.width-(int) action_info.width- + (int) cancel_info.width-2*QuantumMargin-2; action_info.y=cancel_info.y; XGetWidgetInfo(GrabButtonText,&grab_info); grab_info.width=width; @@ -5668,8 +5669,8 @@ MagickExport void XFontBrowserWidget(Display *display,XWindows *windows, 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=(int) windows->widget.width-(int) action_info.width- + (int) cancel_info.width-2*QuantumMargin-2; action_info.y=cancel_info.y; XGetWidgetInfo(BackButtonText,&back_info); back_info.width=width; diff --git a/magick/xml-tree.c b/magick/xml-tree.c index 419271288362aeb8fada96b34f57187866b0a96e..9e0013f2b10041aa64ad4d61e96a0a10bf4a6f6d 100644 --- a/magick/xml-tree.c +++ b/magick/xml-tree.c @@ -602,11 +602,11 @@ MagickPrivate char *FileToXML(const char *filename,const size_t extent) offset; size_t + i, length; ssize_t - count, - i; + count; void *map; @@ -688,7 +688,7 @@ MagickPrivate char *FileToXML(const char *filename,const size_t extent) (void) lseek(file,0,SEEK_SET); for (i=0; i < length; i+=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) MagickMaxBufferExtent)); if (count <= 0) { count=0; @@ -2012,7 +2012,7 @@ MagickExport XMLTreeInfo *NewXMLTree(const char *xml,ExceptionInfo *exception) utf8=DestroyString(utf8); return(&root->root); } - p+=strcspn(p,XMLWhitespace "/>"); + p+=(ptrdiff_t) strcspn(p,XMLWhitespace "/>"); while (isspace((int) ((unsigned char) *p)) != 0) *p++='\0'; if (((isalpha((int) ((unsigned char) *p)) != 0) || (*p == '_')) && @@ -2050,13 +2050,13 @@ MagickExport XMLTreeInfo *NewXMLTree(const char *xml,ExceptionInfo *exception) attributes[l+2]=(char *) NULL; attributes[l+1]=(char *) NULL; attributes[l]=p; - p+=strcspn(p,XMLWhitespace "=/>"); + p+=(ptrdiff_t) strcspn(p,XMLWhitespace "=/>"); if ((*p != '=') && (isspace((int) ((unsigned char) *p)) == 0)) attributes[l]=ConstantString(""); else { *p++='\0'; - p+=strspn(p,XMLWhitespace "="); + p+=(ptrdiff_t) strspn(p,XMLWhitespace "="); c=(*p); if ((c == '"') || (c == '\'')) { @@ -2158,7 +2158,7 @@ MagickExport XMLTreeInfo *NewXMLTree(const char *xml,ExceptionInfo *exception) Close tag. */ tag=p+1; - p+=strcspn(tag,XMLWhitespace ">")+1; + p+=(ptrdiff_t) strcspn(tag,XMLWhitespace ">")+1; c=(*p); if ((c == '\0') && (terminal != '>')) { @@ -2178,7 +2178,7 @@ MagickExport XMLTreeInfo *NewXMLTree(const char *xml,ExceptionInfo *exception) ignore_depth--; *p=c; if (isspace((int) ((unsigned char) *p)) != 0) - p+=strspn(p,XMLWhitespace); + p+=(ptrdiff_t) strspn(p,XMLWhitespace); } else if (strncmp(p,"!--",3) == 0) @@ -2205,7 +2205,7 @@ MagickExport XMLTreeInfo *NewXMLTree(const char *xml,ExceptionInfo *exception) p=strstr(p,"]]>"); if (p != (char *) NULL) { - p+=2; + p+=(ptrdiff_t) 2; if (ignore_depth == 0) ParseCharacterContent(root,tag+8,(size_t) (p-tag-10),'c'); } @@ -2227,7 +2227,7 @@ MagickExport XMLTreeInfo *NewXMLTree(const char *xml,ExceptionInfo *exception) ((l != 0) && ((*p != ']') || (*(p+strspn(p+1,XMLWhitespace)+1) != '>')))); l=(ssize_t) ((*p == '[') ? 1 : l)) - p+=strcspn(p+1,"[]>")+1; + p+=(ptrdiff_t) strcspn(p+1,"[]>")+1; if ((*p == '\0') && (terminal != '>')) { (void) ThrowMagickException(exception,GetMagickModule(), diff --git a/magick/xwindow.c b/magick/xwindow.c index c9db8410c552f52746a8a9ebe1530d58b6b5cfd3..108092499a9673d8ec0174d6b703944894c3f56b 100644 --- a/magick/xwindow.c +++ b/magick/xwindow.c @@ -2192,7 +2192,7 @@ static void XDitherImage(Image *image,XImage *ximage) if (j == 16) j=0; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; i++; if (i == 2) i=0; @@ -3558,7 +3558,7 @@ MagickExport void XGetResourceInfo(const ImageInfo *image_info, resource_info->title=XGetResourceClass(database,client_name,"title", (char *) NULL); resource_value=XGetResourceClass(database,client_name,"undoCache", - (char *) "256"); + (char *) "4096"); resource_info->undo_cache=(unsigned int) StringToUnsignedLong(resource_value); resource_value=XGetResourceClass(database,client_name,"update", (char *) "False"); @@ -5000,10 +5000,7 @@ MagickExport Image *XImportImage(const ImageInfo *image_info, image=XGetWindowImage(display,target,ximage_info->borders, ximage_info->descend ? 1U : 0U); (void) XUngrabServer(display); - if (image == (Image *) NULL) - ThrowXWindowException(XServerError,"UnableToReadXWindowImage", - image_info->filename) - else + if (image != (Image *) NULL) { (void) CopyMagickString(image->filename,image_info->filename, MaxTextExtent); @@ -5929,7 +5926,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info, } if (bit != 0) *q=byte >> (8-bit); - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } } else @@ -5984,7 +5981,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info, } } } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6024,7 +6021,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info, } } } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6052,7 +6049,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info, pixel=pixels[(ssize_t) GetPixelIndex(indexes+x)]; *q++=(unsigned char) pixel; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6084,7 +6081,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info, pixel>>=8; } } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6141,7 +6138,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info, } p++; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6182,7 +6179,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info, } p++; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6210,7 +6207,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info, *q++=(unsigned char) pixel; p++; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6325,7 +6322,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info, } p++; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } } break; @@ -6363,7 +6360,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info, } if (bit != 0) *q=byte >> (8-bit); - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } } canvas_view=DestroyCacheView(canvas_view); @@ -6538,7 +6535,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info, } if (bit != 0) *q=byte << (8-bit); - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } } else @@ -6593,7 +6590,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info, } } } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6633,7 +6630,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info, } } } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6661,7 +6658,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info, pixel=pixels[(ssize_t) GetPixelIndex(indexes+x)]; *q++=(unsigned char) pixel; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6698,7 +6695,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info, for (k=0; k < (int) bytes_per_pixel; k++) *q++=channel[k]; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6755,7 +6752,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info, } p++; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6796,7 +6793,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info, } p++; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6824,7 +6821,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info, *q++=(unsigned char) pixel; p++; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } break; } @@ -6939,7 +6936,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info, } p++; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } } break; @@ -6977,7 +6974,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info, } if (bit != 0) *q=byte << (8-bit); - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } } canvas_view=DestroyCacheView(canvas_view); @@ -7207,7 +7204,7 @@ MagickExport void XMakeMagnifyImage(Display *display,XWindows *windows) } if (q_bit != 0) *q=byte >> (8-q_bit); - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } } y++; @@ -7279,7 +7276,7 @@ MagickExport void XMakeMagnifyImage(Display *display,XWindows *windows) } if (q_bit != 0) *q=byte << (8-q_bit); - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } } y++; @@ -7315,7 +7312,7 @@ MagickExport void XMakeMagnifyImage(Display *display,XWindows *windows) *q++=(*p); p++; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } y++; } @@ -7348,9 +7345,9 @@ MagickExport void XMakeMagnifyImage(Display *display,XWindows *windows) for (l=0; l < magnify; l++) for (m=0; m < bytes_per_pixel; m++) *q++=(*(p+m)); - p+=bytes_per_pixel; + p+=(ptrdiff_t) bytes_per_pixel; } - q+=scanline_pad; + q+=(ptrdiff_t) scanline_pad; } y++; } @@ -9221,7 +9218,7 @@ static Window XSelectWindow(Display *display,RectangleInfo *crop_info) annotate_context=XCreateGC(display,root_window,(size_t) (GCBackground | GCForeground | GCFunction | GCSubwindowMode),&context_values); if (annotate_context == (GC) NULL) - return(MagickFalse); + return((Window) NULL); /* Grab the pointer using target cursor. */ @@ -9321,6 +9318,8 @@ static Window XSelectWindow(Display *display,RectangleInfo *crop_info) } if ((crop_info->width != 0) && (crop_info->height != 0)) target_window=root_window; + if (event.xbutton.button == Button3) + target_window=(Window) NULL; return(target_window); } diff --git a/wand/MagickWand-config.in b/wand/MagickWand-config.in index da7f750104b5d524470c703a520723ff9fd9c3cc..03680cfdc8dbb74374a507d3c398c3c6177fdf4c 100644 --- a/wand/MagickWand-config.in +++ b/wand/MagickWand-config.in @@ -6,6 +6,9 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ +libdir=@libdir@ +pkgconfigdir=@pkgconfigdir@ +export PKG_CONFIG_LIBDIR="${pkgconfigdir}" usage="\ Usage: MagickWand-config [--cflags] [--cppflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version]" diff --git a/wand/compare.c b/wand/compare.c index 6566d198e1b51aa9068f70a58fc07d0b0e431d75..4325697a447eef73fc1cce2e75c39bb5eca6d5f8 100644 --- a/wand/compare.c +++ b/wand/compare.c @@ -44,6 +44,7 @@ #include "wand/studio.h" #include "wand/MagickWand.h" #include "wand/mogrify-private.h" +#include "magick/image-private.h" #include "magick/string-private.h" /* @@ -104,6 +105,7 @@ static MagickBooleanType CompareUsage(void) " -separate separate an image channel into a grayscale image\n" " -write filename write images to this file", settings[] = + " -adjoin join images into a single multi-image file\n" " -alpha option on, activate, off, deactivate, set, opaque, copy\n" " transparent, extract, background, or shape\n" " -authenticate password\n" @@ -194,7 +196,7 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info, int argc,char **argv,char **metadata,ExceptionInfo *exception) { #define CompareEpsilon (1.0e-06) -#define DefaultDissimilarityThreshold 0.31830988618379067154 +#define DefaultDissimilarityThreshold (1.0/MagickPI) #define DefaultSimilarityThreshold (-1.0) #define DestroyCompare() \ { \ @@ -255,6 +257,7 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info, fire, pend, respect_parenthesis, + similar = MagickTrue, subimage_search; MagickStatusType @@ -371,6 +374,8 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info, { case 'a': { + if (LocaleCompare("adjoin",option+1) == 0) + break; if (LocaleCompare("alpha",option+1) == 0) { ssize_t @@ -1164,69 +1169,82 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info, similarity_image=SimilarityMetricImage(image,reconstruct_image,metric, &offset,&similarity_metric,exception); if (similarity_metric > dissimilarity_threshold) - ThrowCompareException(ImageError,"ImagesTooDissimilar",image->filename); + (void) ThrowMagickException(exception,GetMagickModule(),ImageWarning, + "ImagesTooDissimilar","`%s'",image->filename); } - if ((reconstruct_image->columns == image->columns) && - (reconstruct_image->rows == image->rows)) + if (similarity_image == (Image *) NULL) difference_image=CompareImageChannels(image,reconstruct_image,channels, metric,&distortion,exception); else - if (similarity_image == (Image *) NULL) - difference_image=CompareImageChannels(image,reconstruct_image,channels, - metric,&distortion,exception); - else - { - Image - *composite_image; + { + Image + *composite_image; - /* - Determine if reconstructed image is a subimage of the image. - */ - composite_image=CloneImage(image,0,0,MagickTrue,exception); - if (composite_image == (Image *) NULL) - difference_image=CompareImageChannels(image,reconstruct_image, - channels,metric,&distortion,exception); - else - { - Image - *distort_image; + /* + Determine if reconstructed image is a subimage of the image. + */ + composite_image=CloneImage(image,0,0,MagickTrue,exception); + if (composite_image == (Image *) NULL) + difference_image=CompareImageChannels(image,reconstruct_image, + channels,metric,&distortion,exception); + else + { + Image + *distort_image; - RectangleInfo - page; + RectangleInfo + page; - (void) CompositeImage(composite_image,CopyCompositeOp, - reconstruct_image,offset.x,offset.y); - difference_image=CompareImageChannels(image,composite_image, - channels,metric,&distortion,exception); - if (difference_image != (Image *) NULL) - { - difference_image->page.x=offset.x; - difference_image->page.y=offset.y; - } - composite_image=DestroyImage(composite_image); - page.width=reconstruct_image->columns; - page.height=reconstruct_image->rows; - page.x=offset.x; - page.y=offset.y; - distort_image=CropImage(image,&page,exception); - if (distort_image != (Image *) NULL) - { - Image - *sans_image; + (void) CompositeImage(composite_image,CopyCompositeOp, + reconstruct_image,offset.x,offset.y); + difference_image=CompareImageChannels(image,composite_image, + channels,metric,&distortion,exception); + if (difference_image != (Image *) NULL) + { + difference_image->page.x=offset.x; + difference_image->page.y=offset.y; + } + composite_image=DestroyImage(composite_image); + page.width=reconstruct_image->columns; + page.height=reconstruct_image->rows; + page.x=offset.x; + page.y=offset.y; + distort_image=CropImage(image,&page,exception); + if (distort_image != (Image *) NULL) + { + Image + *sans_image; - sans_image=CompareImageChannels(distort_image,reconstruct_image, - channels,metric,&distortion,exception); - distort_image=DestroyImage(distort_image); - if (sans_image != (Image *) NULL) - sans_image=DestroyImage(sans_image); - } - } - if (difference_image != (Image *) NULL) - { - AppendImageToList(&difference_image,similarity_image); - similarity_image=(Image *) NULL; - } - } + sans_image=CompareImageChannels(distort_image,reconstruct_image, + channels,metric,&distortion,exception); + distort_image=DestroyImage(distort_image); + if (sans_image != (Image *) NULL) + sans_image=DestroyImage(sans_image); + } + } + if (difference_image != (Image *) NULL) + { + AppendImageToList(&difference_image,similarity_image); + similarity_image=(Image *) NULL; + } + } + if (fabs(distortion) > CompareEpsilon) + similar=MagickFalse; + switch (metric) + { + case NormalizedCrossCorrelationErrorMetric: + { + distortion=1.0-distortion; + similarity_metric=1.0-similarity_metric; + } + case PeakSignalToNoiseRatioMetric: + { + distortion=fabs(distortion); + similarity_metric=fabs(similarity_metric); + } + default: + break; + } if (difference_image == (Image *) NULL) status=0; else @@ -1245,6 +1263,9 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info, case MeanSquaredErrorMetric: case PeakAbsoluteErrorMetric: case RootMeanSquaredErrorMetric: + case AbsoluteErrorMetric: + case NormalizedCrossCorrelationErrorMetric: + case PerceptualHashErrorMetric: { (void) FormatLocaleFile(stderr,"%.*g (%.*g)",GetMagickPrecision(), (double) QuantumRange*distortion,GetMagickPrecision(), @@ -1254,15 +1275,7 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info, case PeakSignalToNoiseRatioMetric: { (void) FormatLocaleFile(stderr,"%.*g (%.*g)",GetMagickPrecision(), - distortion,GetMagickPrecision(),0.01*distortion); - break; - } - case AbsoluteErrorMetric: - case NormalizedCrossCorrelationErrorMetric: - case PerceptualHashErrorMetric: - { - (void) FormatLocaleFile(stderr,"%.*g",GetMagickPrecision(), - distortion); + 48.1647*distortion,GetMagickPrecision(),distortion); break; } case MeanErrorPerPixelMetric: @@ -1277,8 +1290,9 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info, break; } if (subimage_search != MagickFalse) - (void) FormatLocaleFile(stderr," @ %.20g,%.20g",(double) - difference_image->page.x,(double) difference_image->page.y); + (void) FormatLocaleFile(stderr," @ %.20g,%.20g [%.*g]", + (double) offset.x,(double) offset.y,GetMagickPrecision(), + similarity_metric); } else { @@ -1437,8 +1451,13 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info, channel_distortion=(double *) RelinquishMagickMemory( channel_distortion); if (subimage_search != MagickFalse) - (void) FormatLocaleFile(stderr," Offset: %.20g,%.20g\n",(double) - difference_image->page.x,(double) difference_image->page.y); + { + (void) FormatLocaleFile(stderr," Offset: %.20g,%.20g\n", + (double) difference_image->page.x,(double) + difference_image->page.y); + (void) FormatLocaleFile(stderr," Similarity metric: %.*g\n", + GetMagickPrecision(),similarity_metric); + } } (void) ResetImagePage(difference_image,"0x0+0+0"); if (difference_image->next != (Image *) NULL) @@ -1461,14 +1480,7 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info, } DestroyCompare(); image_info=restore_info; - if ((metric == NormalizedCrossCorrelationErrorMetric) || - (metric == UndefinedErrorMetric)) - { - if (fabs(distortion-1.0) > CompareEpsilon) - (void) SetImageOption(image_info,"compare:dissimilar","true"); - } - else - if (fabs(distortion) > CompareEpsilon) - (void) SetImageOption(image_info,"compare:dissimilar","true"); + if (similar == MagickFalse) + (void) SetImageOption(image_info,"compare:dissimilar","true"); return(status != 0 ? MagickTrue : MagickFalse); } diff --git a/wand/drawing-wand.c b/wand/drawing-wand.c index 8d3a9f7ff3651fea60c9774c28d43f4456e9909a..09a3e8286caafe33d39fe8ac1a71077cccf04074 100644 --- a/wand/drawing-wand.c +++ b/wand/drawing-wand.c @@ -279,8 +279,7 @@ static int MVGAutoWrapPrintf(DrawingWand *wand,const char *format,...) static void MVGAppendColor(DrawingWand *wand,const PixelPacket *color) { - if ((GetPixelRed(color) == 0) && - (GetPixelGreen(color) == 0) && + if ((GetPixelRed(color) == 0) && (GetPixelGreen(color) == 0) && (GetPixelBlue(color) == 0) && (GetPixelOpacity(color) == (Quantum) TransparentOpacity)) (void) MVGPrintf(wand,"none"); @@ -943,7 +942,7 @@ WandExport MagickBooleanType DrawComposite(DrawingWand *wand, for (i=(ssize_t) encoded_length; i > 0; i-=76) { (void) MVGPrintf(wand,"%.76s",p); - p+=76; + p+=(ptrdiff_t) 76; if (i > 76) (void) MVGPrintf(wand,"\n"); } @@ -1851,27 +1850,24 @@ WandExport void DrawGetStrokeColor(const DrawingWand *wand, WandExport double *DrawGetStrokeDashArray(const DrawingWand *wand, size_t *number_elements) { - double - *dasharray; - const double *p; double + *dasharray, *q; + size_t + n = 0; + ssize_t i; - size_t - n; - assert(wand != (const DrawingWand *) NULL); assert(wand->signature == WandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); assert(number_elements != (size_t *) NULL); - n=0; p=CurrentContext->dash_pattern; if (p != (const double *) NULL) while (fabs(*p++) >= MagickEpsilon) diff --git a/wand/identify.c b/wand/identify.c index 3bd41f8a5d8870b71f052197d6cdf344a845d136..db695ce969b6caea1d1a26c2b6bf5ef4811024cb 100644 --- a/wand/identify.c +++ b/wand/identify.c @@ -499,6 +499,8 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info, ThrowIdentifyException(OptionError,"NoSuchOption",argv[i]); break; } + if (LocaleNCompare("identify:locate",argv[i],15) == 0) + image_info->ping=MagickFalse; break; } if (LocaleCompare("density",option+1) == 0) @@ -579,6 +581,7 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info, if (i == (ssize_t) argc) ThrowIdentifyException(OptionError,"MissingArgument",option); format=argv[i]; + image_info->ping=MagickFalse; break; } if (LocaleCompare("fuzz",option+1) == 0) diff --git a/wand/magick-property.c b/wand/magick-property.c index c4ce738377f065f3f65cc02916abdfd178f9981f..0e4401dcbc721645e3312f378c17fd0d5a0e5245 100644 --- a/wand/magick-property.c +++ b/wand/magick-property.c @@ -566,7 +566,7 @@ WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact) % % % % % % -% M a g i c k G e t I m a g e P r o p e r t i e s % +% M a g i c k G e t I m a g e A r t i f a c t s % % % % % % % @@ -600,12 +600,12 @@ WandExport char **MagickGetImageArtifacts(MagickWand *wand, const char *artifact; - ssize_t - i; - size_t length; + ssize_t + i; + assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); if (wand->debug != MagickFalse) @@ -616,13 +616,13 @@ WandExport char **MagickGetImageArtifacts(MagickWand *wand, "ContainsNoImages","`%s'",wand->name); return((char **) NULL); } - (void) GetImageProperty(wand->images,"exif:*"); + (void) GetImageArtifact(wand->images,"exif:*"); length=1024; artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts)); if (artifacts == (char **) NULL) return((char **) NULL); - ResetImagePropertyIterator(wand->images); - artifact=GetNextImageProperty(wand->images); + ResetImageArtifactIterator(wand->images); + artifact=GetNextImageArtifact(wand->images); for (i=0; artifact != (const char *) NULL; ) { if ((*artifact != '[') && @@ -644,7 +644,7 @@ WandExport char **MagickGetImageArtifacts(MagickWand *wand, artifacts[i]=ConstantString(artifact); i++; } - artifact=GetNextImageProperty(wand->images); + artifact=GetNextImageArtifact(wand->images); } artifacts[i]=(char *) NULL; *number_artifacts=(size_t) i; diff --git a/wand/method-attribute.h b/wand/method-attribute.h index 0631d66222a7fa49fa9bf461bbb2e65d6ca4602f..8790d11072b10264e4a8ceb4b5217e9208e4f077 100644 --- a/wand/method-attribute.h +++ b/wand/method-attribute.h @@ -22,7 +22,7 @@ extern "C" { #endif -#if defined(__BORLANDC__) && defined(_DLL) +#if defined(_DLL) # define _MAGICKDLL_ # define _MAGICKLIB_ # define MAGICKCORE_MODULES_SUPPORT diff --git a/wand/mogrify.c b/wand/mogrify.c index 4d2dee273494be54e4876398f02a202122e5008d..bc80d54fb00ab9c95c2881f42f758c77dfb2a42d 100644 --- a/wand/mogrify.c +++ b/wand/mogrify.c @@ -4002,24 +4002,13 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info, status&=WriteImages(image_info,image,image->filename,exception); if (status != MagickFalse) { -#if defined(MAGICKCORE_HAVE_UTIME) - { - MagickBooleanType - preserve_timestamp; - - preserve_timestamp=IsStringTrue(GetImageOption(image_info, - "preserve-timestamp")); - if (preserve_timestamp != MagickFalse) - { - struct utimbuf - timestamp; + MagickBooleanType + preserve_timestamp; - timestamp.actime=properties.st_atime; - timestamp.modtime=properties.st_mtime; - (void) utime(image->filename,×tamp); - } - } -#endif + preserve_timestamp=IsStringTrue(GetImageOption(image_info, + "preserve-timestamp")); + if (preserve_timestamp != MagickFalse) + (void) set_file_timestamp(image->filename,&properties); if (*backup_filename != '\0') (void) remove_utf8(backup_filename); } @@ -7180,6 +7169,8 @@ WandExport MagickBooleanType MogrifyImageInfo(ImageInfo *image_info, limit=MagickResourceInfinity; if (LocaleCompare("unlimited",argv[i+2]) != 0) limit=(MagickSizeType) SiPrefixToDoubleInterval(argv[i+2],100.0); + if (type == TimeResource) + limit=(MagickSizeType) ParseMagickTimeToLive(argv[i+2]); (void) SetMagickResourceLimit(type,limit); break; } @@ -8843,7 +8834,7 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, if ((p == (Image *) NULL) || (q == (Image *) NULL)) { (void) ThrowMagickException(exception,GetMagickModule(), - OptionError,"NoSuchImage","`%s'",(*images)->filename); + OptionError,"InvalidImageIndex","`%s'",(*images)->filename); status=MagickFalse; break; } diff --git a/wand/studio.h b/wand/studio.h index f69095660b4ce8c67b5b9265f615af7adaf54a0d..59be1d52eaf69b0860b911383603ce364d0272fc 100644 --- a/wand/studio.h +++ b/wand/studio.h @@ -139,11 +139,9 @@ extern "C" { #endif #if defined(MAGICKCORE_HAVE_CL_CL_H) && !defined(MAGICK_PIXEL_RGBA) -# include # define MAGICKCORE_OPENCL_SUPPORT 1 #endif #if defined(MAGICKCORE_HAVE_OPENCL_CL_H) && !defined(MAGICK_PIXEL_RGBA) -# include # define MAGICKCORE_OPENCL_SUPPORT 1 #endif @@ -273,7 +271,7 @@ extern int vsnprintf(char *,size_t,const char *,va_list); # define Exit exit # define IsBasenameSeparator(c) \ (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse) -# define MAGICKCORE_LIBRARY_PATH "sys$login:" +# define MAGICKCORE_LIBRARY_ABSOLUTE_PATH "sys$login:" # define MAGICKCORE_SHARE_PATH "sys$login:" # define X11_PREFERENCES_PATH "decw$user_defaults:" # define ProcessPendingEvents(text) @@ -298,7 +296,7 @@ extern int vsnprintf(char *,size_t,const char *,va_list); # define DirectoryListSeparator ';' # define EditorOptions "" # define IsBasenameSeparator(c) ((c) == ':' ? MagickTrue : MagickFalse) -# define MAGICKCORE_LIBRARY_PATH "" +# define MAGICKCORE_LIBRARY_ABSOLUTE_PATH "" # define MAGICKCORE_SHARE_PATH "" # define X11_PREFERENCES_PATH "~/." # if defined(DISABLE_SIOUX) diff --git a/www/Magick++/Documentation.html b/www/Magick++/Documentation.html index 6f560ef1eebff94d21fafe95533a441965dfa6bd..86759cf4f452c4f400bbd45b91dd177f264b3ae0 100644 --- a/www/Magick++/Documentation.html +++ b/www/Magick++/Documentation.html @@ -9,12 +9,12 @@

-

Magick++ provides a simple C++ API to the ImageMagick image processing library which supports reading and writing a huge number of image formats as well as supporting a broad spectrum of traditional image processing operations. The ImageMagick C API is complex and the data structures are currently not documented. Magick++ provides access to most of the features available from the C API but in a simple object-oriented and well-documented framework.

+

Magick++ provides a simple C++ API to the ImageMagick image processing library which supports reading and writing a huge number of image formats as well as supporting a broad spectrum of traditional image processing operations. The ImageMagick C API is complex and the data structures are currently not documented. Magick++ provides access to most of the features available from the C API but in a simple object-oriented and well-documented framework.

Magick++ is intended to support commercial-grade application development. In order to avoid possible conflicts with the user's application, all symbols contained in Magick++ (included by the header <Magick++.h>) are scoped to the namespace Magick. Symbols from the ImageMagick C library are imported under the MagickCore namespace to avoid possible conflicts and ImageMagick macros are only included within the Magick++ implementation so they won't impact the user's application.

-

The core class in Magick++ is the Image class. The Image class provides methods to manipulate a single image frame (e.g. a JPEG image). Standard Template Library (STL)compatible algorithms and function objects are provided in order to manipulate multiple image frames or to read and write file formats which support multiple image frames (e.g. GIF animations, MPEG animations, and Postscript files).

+

The core class in Magick++ is the Image class. The Image class provides methods to manipulate a single image frame (e.g. a JPEG image). Standard Template Library (STL)compatible algorithms and function objects are provided in order to manipulate multiple image frames or to read and write file formats which support multiple image frames (e.g. GIF animations, MPEG animations, and Postscript files).

The Image class supports reference-counted memory management which supports the semantics of an intrinsic variable type (e.g. 'int') with an extremely efficient operator = and copy constructor (only a pointer is assigned) while ensuring that the image data is replicated as required so that it the image may be modified without impacting earlier generations. Since the Image class manages heap memory internally, images are best allocated via C++ automatic (stack-based) memory allocation. This support allows most programs using Magick++ to be written without using any pointers, simplifying the implementation and avoiding the risks of using pointers. When a program uses automatic memory allocation to allocate Magick++ images, that aspect of the program becomes naturally exception-safe and thread-safe.

-

The image class uses a number of supportive classes in order to specify arguments. Colors are specified via the Color class. Colors specified in X11-style string form are implicitly converted to the Color class. Geometry arguments (those specifying width, height, and/or x and y offset) are specified via the Geometry class. Similar to the Color class, geometries specified as an X11-style string are implicitly converted to the Geometry class. Two dimensional drawable objects are specified via the Drawable class. Drawable objects may be provided as a single object or as a list of objects to be rendered using the current image options. Montage options (a montage is a rendered grid of thumbnails in one image) are specified via the Montage class.

-

Errors are reported using C++ exceptions derived from the Exception class, which is itself derived from the standard C++ exception class. Exceptions are reported synchronous with the operation and are caught by the first matching try block as the stack is unraveled. This allows a clean coding style in which multiple related Magick++ commands may be executed with errors handled as a unit rather than line-by-line. Since the Image object provides reference-counted memory management, unreferenced images on the stack are automagically cleaned up, avoiding the potential for memory leaks.

+

The image class uses a number of supportive classes in order to specify arguments. Colors are specified via the Color class. Colors specified in X11-style string form are implicitly converted to the Color class. Geometry arguments (those specifying width, height, and/or x and y offset) are specified via the Geometry class. Similar to the Color class, geometries specified as an X11-style string are implicitly converted to the Geometry class. Two dimensional drawable objects are specified via the Drawable class. Drawable objects may be provided as a single object or as a list of objects to be rendered using the current image options. Montage options (a montage is a rendered grid of thumbnails in one image) are specified via the Montage class.

+

Errors are reported using C++ exceptions derived from the Exception class, which is itself derived from the standard C++ exception class. Exceptions are reported synchronous with the operation and are caught by the first matching try block as the stack is unraveled. This allows a clean coding style in which multiple related Magick++ commands may be executed with errors handled as a unit rather than line-by-line. Since the Image object provides reference-counted memory management, unreferenced images on the stack are automagically cleaned up, avoiding the potential for memory leaks.

For ease of access, the documentation for the available user-level classes is available via the following table.


@@ -24,41 +24,41 @@ - + - + +coderInfoList()) - + - + - + - + - + - + - + - + - + +Image::fontTypeMetrics).
Blob
Blob Binary Large OBject container.
CoderInfo
CoderInfo Report information about supported image formats (use with -coderInfoList())
Color
Color Color specification.
Drawable
Drawable Drawable shape (for input to 'draw').
Exception
Exception C++ exception objects.
Geometry
Geometry Geometry specification.
Image
Image Image frame. This is the primary object in Magick++.
Montage
Montage Montage options for montageImages().
Pixels
Pixels Low-level access to image pixels.
STL
STL STL algorithms and function objects for operating on containers of image frames.
TypeMetric
TypeMetric Container for font type metrics (use with -Image::fontTypeMetrics).
diff --git a/www/Magick++/Install.html b/www/Magick++/Install.html index 79ff2e72751ba32369f08838f8fb63b4639b3b03..017023435fb0d4ed52a5c9aa1823655eb5008b5c 100644 --- a/www/Magick++/Install.html +++ b/www/Magick++/Install.html @@ -10,7 +10,7 @@

Installing Magick++

General

-

In order to compile Magick++ you must have access to a standard C++ implementation. The author uses gcc 3.4 (GNU C++) which is available under UNIX and under the Cygwin UNIX-emulation environment for Windows. Standards compliant commercial C++ compilers should also work fine. Most modern C++ compilers for Microsoft Windows or the Mac should work (project files are provided for Microsoft Visual C++ 8.0).

+

In order to compile Magick++ you must have access to a standard C++ implementation. The author uses gcc 3.4 (GNU C++) which is available under UNIX and under the Cygwin UNIX-emulation environment for Windows. Standards compliant commercial C++ compilers should also work fine. Most modern C++ compilers for Microsoft Windows or the Mac should work (project files are provided for Microsoft Visual C++ 8.0).

It was decided that Magick++ will be around for the long-haul, so its API definition depends on valuable C++ features which should be common in all current and future C++ compilers. The compiler must support the following C++ standard features:

  • @@ -84,7 +84,7 @@

    Visual C++ 8.0 Standard Edition Service Pack 5

    -

    Windows '98 + Cygwin 1.3.10

    +

    Windows '98 + Cygwin 1.3.10

    Intel Pentium III

    @@ -98,7 +98,7 @@

    GCC 2.95.3-5

    -

    Windows XP + Cygwin 1.3.10

    +

    Windows XP + Cygwin 1.3.10

    Intel Pentium IV

    @@ -262,7 +262,7 @@ specifies additional options to the configure script. The following table shows

    Visual C++

    Windows NT through Windows Vista are supported by the ImageMagick source package for NT available in the 'win2k' subdirectory of the ImageMagick ftp site (and mirrors). The ImageMagick source package for NT provides sources to ImageMagick, Magick++, add-on libraries (e.g. JPEG), and a ready-made Visual C++ 8.0 build environment. Please read the configuration and build instructions in README.txt (under the heading "Windows Win2K/XP VISUAL C++ 8.0 COMPILATION") in order to build Magick++.

    Cygwin & GCC

    -

    It is possible to build both ImageMagick and Magick++ under the Cygwin Unix-emulation environment for Windows NT. Obtain and install Cgywin from http://www.cygwin.com/ . An X11R6 environment for Cygwin is available from http://www.cygwin.com/xfree/ .To build using Cygwin and GCC, follow the instructions for building under Unix.

    +

    It is possible to build both ImageMagick and Magick++ under the Cygwin Unix-emulation environment for Windows NT. Obtain and install Cgywin from http://www.cygwin.com/ . An X11R6 environment for Cygwin is available from http://www.cygwin.com/xfree/ .To build using Cygwin and GCC, follow the instructions for building under Unix.

diff --git a/www/Magick++/index.html b/www/Magick++/index.html index 1b8fede92c58f729d1998714abac72cb500b0faf..8d352949b794d39e4379cb0fac2a5241be77c77b 100644 --- a/www/Magick++/index.html +++ b/www/Magick++/index.html @@ -10,13 +10,13 @@

ImageMagick Magick++ API

-

Magick++ is the object-oriented C++ API to the ImageMagick +

Magick++ is the object-oriented C++ API to the ImageMagick image-processing library, the most comprehensive open-source image -processing package available. Read the latest NEWS -and ChangeLog for Magick++. +processing package available. Read the latest NEWS +and ChangeLog for Magick++.

Magick++ -supports an object model which is inspired by PerlMagick. +supports an object model which is inspired by PerlMagick. Images support implicit reference counting so that copy constructors and assignment incur almost no cost. The cost of actually copying an image (if necessary) is done just before modification and this copy @@ -41,8 +41,8 @@ provided for all Magick++ classes, class methods, and template functions which comprise the API. See a Gentle Introduction to Magick++ for an introductory tutorial to Magick++. We include the source if you want to correct, enhance, or expand the tutorial.

Obtaining Magick++

-

Magick++ is included as part of ImageMagick -source releases and may be retrieved via ftp +

Magick++ is included as part of ImageMagick +source releases and may be retrieved via ftp or Github.

Installation

diff --git a/www/Magick++/logo.png b/www/Magick++/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d9054ec50519bebcc648a1d4d6303a6bd6380c3f Binary files /dev/null and b/www/Magick++/logo.png differ diff --git a/www/Magick++/magick.css b/www/Magick++/magick.css index 4ada3463d42cca128a312b56ca514ee25ef5fef5..d3d6a1663ac09dc3f278e334ac23df5bd2fd1e2d 100644 --- a/www/Magick++/magick.css +++ b/www/Magick++/magick.css @@ -158,7 +158,7 @@ div.text { } div.titlebar { - background-image: url("https://legacy.imagemagick.org/images/background.jpg"); + background-image: url("../images/background.jpg"); background-repeat: repeat-x; height: 118px; width: 100%; @@ -727,7 +727,7 @@ th.size-norm, tr.size-norm, td.size-norm { } #titlebar { - background-image: url("https://legacy.imagemagick.org/images/background.jpg"); + background-image: url("../images/background.jpg"); background-repeat: repeat-x; height: 118px; } diff --git a/www/advanced-linux-installation.html b/www/advanced-linux-installation.html index 5d3b296d4fe8b56c310173c4edeaba01bc78cfd2..2e3fcdbd4552e139d4d756ec54a6c3fe2a6937f0 100644 --- a/www/advanced-linux-installation.html +++ b/www/advanced-linux-installation.html @@ -1,18 +1,17 @@ - - - + + - ImageMagick (legacy) – Advanced Linux Source Installation + ImageMagick – Advanced Linux Source Installation - + - - + + @@ -22,19 +21,82 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

Advanced Linux Source Installation

+
+
-
-
+

Advanced Linux Installation

-

Download & UnpackConfigureBuildInstallLinux-specific Build InstructionsMac OS X-specific Build InstructionsMinGW-specific Build InstructionsDealing with Unexpected Problems

+

Download & UnpackConfigureBuildInstallLinux-specific Build InstructionsMac OS X-specific Build InstructionsMinGW-specific Build InstructionsDealing with Unexpected Problems

-

It's possible you don't want to concern yourself with advanced installation under Linux or Linux systems. If so, you also have the option of installing a pre-compiled binary release or if you still want to install from source without all the fuss see the simple Install From Source instructions. However, if you want to customize the configuration and installation of ImageMagick under Linux or Linux systems, lets begin.

+

It's possible you don't want to concern yourself with advanced installation under Linux or Linux systems. If so, you also have the option of installing a pre-compiled binary release or if you still want to install from source without all the fuss see the simple Install From Source instructions. However, if you want to customize the configuration and installation of ImageMagick under Linux or Linux systems, lets begin.

Download & Unpack

-

ImageMagick builds on a variety of Linux and Linux-like operating systems including Linux, Solaris, FreeBSD, Mac OS X, and others. A compiler is required and fortunately almost all modern Linux systems have one. Download ImageMagick.tar.gz from imagemagick.org or a mirror and verify the distribution against its message digest.

+

ImageMagick builds on a variety of Linux and Linux-like operating systems including Linux, Solaris, FreeBSD, Mac OS X, and others. A compiler is required and fortunately almost all modern Linux systems have one. Download ImageMagick.tar.gz from imagemagick.org or a mirror and verify the distribution against its message digest.

Unpack the distribution it with this command:

@@ -109,7 +163,10 @@

The configure script looks at your environment and decides what it can cobble together to get ImageMagick compiled and installed on your system. This includes finding a compiler, where your compiler header files are located (e.g. stdlib.h), and if any delegate libraries are available for ImageMagick to use (e.g. JPEG, PNG, TIFF, etc.). If you are willing to accept configure's default options, and build from within the source directory, you can simply type:

-
    $ cd ImageMagick-6.9.12-93$ ./configure
+

+cd ImageMagick-6.9.13-22
+./configure
+

Watch the configure script output to verify that it finds everything that you think it should. Pay particular attention to the last lines of the script output. For example, here is a recent report from our system:

@@ -344,7 +401,7 @@ Options used to compile and link: --without-perl disable build/install of PerlMagick, or

- By default, PerlMagick is conveniently compiled and installed as part of ImageMagick's normal configure, make, sudo make install process. When --without-perl is specified, you must first install ImageMagick, change to the PerlMagick subdirectory, build, and finally install PerlMagick. Note, PerlMagick is configured even if --without-perl is specified. If the argument --with-perl=/path/to/perl is supplied, /../path/to/perl is be taken as the PERL interpreter to use. This important in case the perl executable in your PATH is not PERL5, or is not the PERL you want to use. + By default, PerlMagick is conveniently compiled and installed as part of ImageMagick's normal configure, make, sudo make install process. When --without-perl is specified, you must first install ImageMagick, download the PerlMagick source distribution, build, and finally install PerlMagick. Note, PerlMagick is configured even if --without-perl is specified. If the argument --with-perl=/path/to/perl is supplied, /../path/to/perl is be taken as the PERL interpreter to use. This important in case the perl executable in your PATH is not PERL5, or is not the PERL you want to use. --with-perl=PERL @@ -519,7 +576,7 @@ $ identify logo.gif

Linux-specific Build instructions

-

Download ImageMagick.src.rpm from imagemagick.org or its mirrors and verify the distribution against its message digest.

+

Download ImageMagick.src.rpm from imagemagick.org or its mirrors and verify the distribution against its message digest.

Build ImageMagick with this command:

@@ -528,12 +585,13 @@ $ identify logo.gif

After the build you, locate the RPMS folder and install the ImageMagick binary RPM distribution:

-
    $ rpm -ivh ImageMagick-6.9.12-?.*.rpm
+
rpm -ivh ImageMagick-6.9.13.-?.*.rpm
+

Mac OS X-specific Build instructions

Perform these steps as an administrator or with the sudo command:

-

Install MacPorts. Download and install MacPorts and type the following commands:

+

Install MacPorts. Download and install MacPorts and type the following commands:

$ sudo port -v install freetype +bytecode
 $ sudo port -v install librsvg
@@ -551,9 +609,11 @@ $ sudo port -v install graphviz +gs +wmf +jbig +jpeg2 +lcms
 
 

Now lets build ImageMagick:

-

Download the ImageMagick source distribution and verify the distribution against its message digest.

+

Download the ImageMagick source distribution and verify the distribution against its message digest.

Unpack and change into the top-level ImageMagick directory:

-
    $ tar xvzf ImageMagick-6.9.12-93.tar.gz$ cd ImageMagick-6.9.12-93

Configure ImageMagick:

+
tar xvzf ImageMagick-6.9.13-22.tar.gz
+cd ImageMagick-6.9.13-22
+

Configure ImageMagick:

./configure --prefix=/opt --with-quantum-depth=16 \
   --disable-dependency-tracking --with-x=yes \
   --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib/ \
@@ -578,9 +638,16 @@ $ sudo port -v install graphviz +gs +wmf +jbig +jpeg2 +lcms
 
 

MinGW-specific Build instructions

-

Although you can download and install delegate libraries yourself, many are already available in the GnuWin32 distribution. Download and install whichever delegate libraries you require such as JPEG, PNG, TIFF, etc. Make sure you specify the development headers when you install a package. Next type,

+

Although you can download and install delegate libraries yourself, many are already available in the GnuWin32 distribution. Download and install whichever delegate libraries you require such as JPEG, PNG, TIFF, etc. Make sure you specify the development headers when you install a package. Next type,

+ +
tar jxvf ImageMagick-6.9.13-?.tar.bz2
+cd ImageMagick-6.9.13-22
+export CPPFLAGS="-Ic:/Progra~1/GnuWin32/include"
+export LDFLAGS="-Lc:/Progra~1/GnuWin32/lib"
+./configure --without-perl
+make
+sudo make install
-
    $ tar jxvf ImageMagick-6.9.12-?.tar.bz2
    $ cd ImageMagick-6.9.12-93
    $ export CPPFLAGS="-Ic:/Progra~1/GnuWin32/include"
    $ export LDFLAGS="-Lc:/Progra~1/GnuWin32/lib"
    $ ./configure --without-perl
    $ make
    $ sudo make install

Dealing with Unexpected Problems

Chances are the download, configure, build, and install of ImageMagick went flawlessly as it is intended, however, certain systems and environments may cause one or more steps to fail. We discuss a few problems we've run across and how to take corrective action to ensure you have a working release of ImageMagick

@@ -627,12 +694,12 @@ no encode delegate for this image format
-
- + + \ No newline at end of file diff --git a/www/advanced-unix-installation.html b/www/advanced-unix-installation.html index 4e74f5ecb88af89c23f3682200b90441d1d0328b..864d92fe74bed52924ce849d2f2b72b756f7dc57 100644 --- a/www/advanced-unix-installation.html +++ b/www/advanced-unix-installation.html @@ -22,9 +22,9 @@ - + - + @@ -66,7 +66,7 @@ -
+
@@ -643,7 +643,7 @@ no encode delegate for this image format SponsorCitePublic Key • - Contact Us + Contact Us
GitHubTwitter diff --git a/www/advanced-windows-installation.html b/www/advanced-windows-installation.html index 76edff85457872205ea63305d172833d29a18f29..b7788f6a542082398478fa7268d436bbd3311d6b 100644 --- a/www/advanced-windows-installation.html +++ b/www/advanced-windows-installation.html @@ -1,18 +1,17 @@ - - - + + - ImageMagick (legacy) – Advanced Windows Source Installation + ImageMagick – Advanced Windows Source Installation - + - - + + @@ -22,19 +21,82 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

Advanced Windows Source Installation

+
+
-
-
+

Advanced Windows Installation

-

This document describes the requirements and instructions to build ImageMagick for Windows on your own machine.

+

This document describes the requirements and instructions to build ImageMagick for Windows on your own machine.

Requirements

    @@ -128,12 +182,12 @@
-
- + + \ No newline at end of file diff --git a/www/animate.html b/www/animate.html index 96df41eaa1fc4695fda70d2cba668ee5cb7113a9..c1cc5a8b9b8a15bef2ca2ee78aa1fe303bc04e00 100644 --- a/www/animate.html +++ b/www/animate.html @@ -1,18 +1,17 @@ - - - + + - ImageMagick (legacy) – Command-line Tools: Animate + ImageMagick – Command-line Tools: Animate - + - - + + @@ -22,19 +21,82 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

Command-line Tools: Animate

+
+
-
-
+

Animation Viewer

-

Example UsageOption Summary

+

Example UsageOption Summary

-

Use the animate program to animate an image sequence on any X server. See Command Line Processing for advice on how to structure your animate command or see below for example usages of the command.

+

Use the animate program to animate an image sequence on any X server. See Command Line Processing for advice on how to structure your animate command or see below for example usages of the command.

Example Usage

@@ -105,7 +159,7 @@
animate *.jpg
 
-

You can find additional examples of using animate in Examples of ImageMagick Usage.

+

You can find additional examples of using animate in Examples of ImageMagick Usage.

Option Summary

@@ -545,12 +599,12 @@ transparent, extract, background, or shape the alpha channel
-
- + + \ No newline at end of file diff --git a/www/api/Image++.html b/www/api/Image++.html index 2101cc43e7f90b93c1fb2e458fd5f4fde412e0f4..2dc38db8c1f5066568eab314a25f4345ee3e55cc 100644 --- a/www/api/Image++.html +++ b/www/api/Image++.html @@ -24,19 +24,19 @@ - + - - + +
-
+
@@ -3221,7 +3221,7 @@ the region set by a preceding getPixels or getConstPixels call.

SecurityArchitecture - And Now a Touch of Magick + And Now a Touch of Magick RelatedSitemap diff --git a/www/api/animate.html b/www/api/animate.html index e18adb2597fefa4225db94533e8bbefb6d98282a..d62926a3116025daff058558d41922b1295d6fcc 100644 --- a/www/api/animate.html +++ b/www/api/animate.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Interactively Animate an Image Sequence + ImageMagick – MagickCore, C API: Interactively Animate an Image Sequence - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + +

+ + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Interactively Animate an Image Sequence

+
+
-
-
+

Animate

-
- + diff --git a/www/api/annotate.html b/www/api/annotate.html index 5154000138dd4484835cba83af17871f8b11efbc..6bcbd015e456530ed35b75dddaae9ebf53e7a78e 100644 --- a/www/api/annotate.html +++ b/www/api/annotate.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Annotate an Image + ImageMagick – MagickCore, C API: Annotate an Image - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Annotate an Image

+
+
-
-
+

Annotate



-

AnnotateImage

+

AnnotateImage

AnnotateImage() annotates an image with text.

@@ -126,7 +182,7 @@
-

FormatMagickCaption

+

FormatMagickCaption

FormatMagickCaption() formats a caption so that it fits within the image width. It returns the number of lines in the formatted caption.

@@ -153,7 +209,7 @@
caption

the caption.

-

GetMultilineTypeMetrics

+

GetMultilineTypeMetrics

GetMultilineTypeMetrics() returns the following information for the specified font and text:

@@ -202,7 +258,7 @@
-

GetTypeMetrics

+

GetTypeMetrics

GetTypeMetrics() returns the following information for the specified font and text:

@@ -252,12 +308,12 @@
-
- + diff --git a/www/api/attribute.html b/www/api/attribute.html index 834895db3c96b62d0662acf1ba212567306e1df3..f863be83162a03dcb9304b90ed1ad38e8a7ff801 100644 --- a/www/api/attribute.html +++ b/www/api/attribute.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Set Text Attributes + ImageMagick – MagickCore, C API: Set Text Attributes - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Set Text Attributes

+
+
-
-
+

Attribute



-

GetImageChannelDepth

+

GetImageChannelDepth

GetImageChannelDepth() returns the depth of a particular image channel.

@@ -138,7 +194,7 @@ size_t GetImageChannelDepth(const Image *image,
-

GetImageQuantumDepth

+

GetImageQuantumDepth

GetImageQuantumDepth() returns the depth of the image rounded to a legal quantum depth: 8, 16, or 32.

@@ -164,7 +220,7 @@ size_t GetImageChannelDepth(const Image *image,
-

GetImageType

+

GetImageType

GetImageType() returns the potential type of image:

@@ -196,7 +252,7 @@ size_t GetImageChannelDepth(const Image *image,
-

IdentifyImageMonochrome

+

IdentifyImageMonochrome

IdentifyImageMonochrome() returns MagickTrue if all the pixels in the image have the same red, green, and blue intensities and the intensity is either 0 or QuantumRange.

@@ -222,7 +278,7 @@ size_t GetImageChannelDepth(const Image *image,
-

IdentifyImageType

+

IdentifyImageType

IdentifyImageType() returns the potential type of image:

@@ -254,7 +310,7 @@ size_t GetImageChannelDepth(const Image *image,
-

IsGrayImage

+

IsGrayImage

IsGrayImage() returns MagickTrue if the type of the image is grayscale or bi-level.

@@ -280,7 +336,7 @@ size_t GetImageChannelDepth(const Image *image,
-

IsMonochromeImage

+

IsMonochromeImage

IsMonochromeImage() returns MagickTrue if type of the image is bi-level.

@@ -306,7 +362,7 @@ size_t GetImageChannelDepth(const Image *image,
-

IsOpaqueImage

+

IsOpaqueImage

IsOpaqueImage() returns MagickTrue if none of the pixels in the image have an opacity value other than opaque (0).

@@ -332,7 +388,7 @@ size_t GetImageChannelDepth(const Image *image,
-

SetImageChannelDepth

+

SetImageChannelDepth

SetImageChannelDepth() sets the depth of the image.

@@ -363,7 +419,7 @@ MagickBooleanType SetImageChannelDepth(Image *image,
-

SetImageType

+

SetImageType

SetImageType() sets the type of image. Choose from these types:

@@ -393,12 +449,12 @@ MagickBooleanType SetImageChannelDepth(Image *image,
-
+
SecurityNews - And Now a Touch of Magick + And Now a Touch of Magick RelatedSitemap @@ -414,8 +470,9 @@ MagickBooleanType SetImageChannelDepth(Image *image, Copyright © 1999 ImageMagick Studio LLC
+
- + diff --git a/www/api/blob.html b/www/api/blob.html index eaed09d260810f97fdcb3f668b2071e91b1c4130..c4edc908c541eed3e215babdac7fa5f2f4440e71 100644 --- a/www/api/blob.html +++ b/www/api/blob.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Read or Write Binary Large OBjects + ImageMagick – MagickCore, C API: Read or Write Binary Large OBjects - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Read or Write Binary Large OBjects

+
+
-
-
+

Blob



-

BlobToImage

+

BlobToImage

BlobToImage() implements direct to memory image formats. It returns the blob as an image.

@@ -141,7 +197,7 @@
-

FileToBlob

+

FileToBlob

FileToBlob() returns the contents of a file as a buffer terminated with the '\0' character. The length of the buffer (not including the extra terminating '\0' character) is returned via the 'length' parameter. Free the buffer with RelinquishMagickMemory().

@@ -179,7 +235,7 @@
-

FileToImage

+

FileToImage

FileToImage() write the contents of a file to an image.

@@ -204,7 +260,7 @@
-

GetBlobProperties

+

GetBlobProperties

GetBlobProperties() returns information about an image blob.

@@ -225,7 +281,7 @@
-

ImageToBlob

+

ImageToBlob

ImageToBlob() implements direct to memory image formats. It returns the image as a formatted blob and its length. The magick member of the Image structure determines the format of the returned blob (GIF, JPEG, PNG, etc.). This method is the equivalent of WriteImage(), but writes the formatted "file" to a memory buffer rather than to an actual file.

@@ -259,7 +315,7 @@
-

ImageToFile

+

ImageToFile

ImageToFile() writes an image to a file. It returns MagickFalse if an error occurs otherwise MagickTrue.

@@ -289,7 +345,7 @@
-

ImagesToBlob

+

ImagesToBlob

ImagesToBlob() implements direct to memory image formats. It returns the image sequence as a blob and its length. The magick member of the ImageInfo structure determines the format of the returned blob (GIF, JPEG, PNG, etc.)

@@ -325,7 +381,7 @@
-

InjectImageBlob

+

InjectImageBlob

InjectImageBlob() injects the image with a copy of itself in the specified format (e.g. inject JPEG into a PDF image).

@@ -364,7 +420,7 @@
-

IsBlobExempt

+

IsBlobExempt

IsBlobExempt() returns true if the blob is exempt.

@@ -385,7 +441,7 @@
-

IsBlobTemporary

+

IsBlobTemporary

IsBlobTemporary() returns true if the blob is temporary.

@@ -409,12 +465,12 @@
-
- + diff --git a/www/api/cache-view.html b/www/api/cache-view.html index cb0e891a47036db7f464e73df895dd832c2ac5c3..06b318b8bd720422146793fba890aef96e73a4b1 100644 --- a/www/api/cache-view.html +++ b/www/api/cache-view.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Cache Views + ImageMagick – MagickCore, C API: Cache Views - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Cache Views

+
+
-
-
+

Cache-view



-

AcquireAuthenticCacheView

+

AcquireAuthenticCacheView

AcquireAuthenticCacheView() acquires an authentic view into the pixel cache.

@@ -144,7 +200,7 @@
-

AcquireVirtualCacheView

+

AcquireVirtualCacheView

AcquireVirtualCacheView() acquires a virtual view into the pixel cache, using the VirtualPixelMethod that is defined within the given image itself.

@@ -170,7 +226,7 @@
-

CloneCacheView

+

CloneCacheView

CloneCacheView() makes an exact copy of the specified cache view.

@@ -191,7 +247,7 @@
-

DestroyCacheView

+

DestroyCacheView

DestroyCacheView() destroys the specified view returned by a previous call to AcquireVirtualCacheView().

@@ -212,7 +268,7 @@
-

GetCacheViewChannels

+

GetCacheViewChannels

GetCacheViewChannels() returns the image pixel channels associated with the specified view.

@@ -233,7 +289,7 @@
-

GetCacheViewColorspace

+

GetCacheViewColorspace

GetCacheViewColorspace() returns the image colorspace associated with the specified view.

@@ -254,7 +310,7 @@
-

GetCacheViewException

+

GetCacheViewException

GetCacheViewException() returns the image exception associated with the specified view.

@@ -275,7 +331,7 @@
-

GetCacheViewStorageClass

+

GetCacheViewStorageClass

GetCacheViewStorageClass() returns the image storage class associated with the specified view.

@@ -296,7 +352,7 @@
-

GetCacheViewAuthenticPixels

+

GetCacheViewAuthenticPixels

GetCacheViewAuthenticPixels() gets pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

@@ -323,7 +379,7 @@
-

GetOneCacheViewAuthenticPixel

+

GetOneCacheViewAuthenticPixel

GetOneCacheViewAuthenticPixel() returns a single pixel at the specified (x,y) location. The image background color is returned if an error occurs.

@@ -358,7 +414,7 @@
-

GetCacheViewAuthenticIndexQueue

+

GetCacheViewAuthenticIndexQueue

GetCacheViewAuthenticIndexQueue() returns the indexes associated with the last call to SetCacheViewIndexes() or GetCacheViewAuthenticIndexQueue(). The indexes are authentic and can be updated.

@@ -379,7 +435,7 @@
-

GetCacheViewAuthenticPixelQueue

+

GetCacheViewAuthenticPixelQueue

GetCacheViewAuthenticPixelQueue() returns the pixels associated with the last call to QueueCacheViewAuthenticPixels() or GetCacheViewAuthenticPixels(). The pixels are authentic and therefore can be updated.

@@ -400,7 +456,7 @@
-

GetCacheViewVirtualIndexQueue

+

GetCacheViewVirtualIndexQueue

GetCacheViewVirtualIndexQueue() returns the indexes associated with the last call to GetCacheViewVirtualIndexQueue(). The indexes are virtual and therefore cannot be updated.

@@ -422,7 +478,7 @@
-

GetCacheViewVirtualPixelQueue

+

GetCacheViewVirtualPixelQueue

GetCacheViewVirtualPixelQueue() returns the pixels associated with the last call to GetCacheViewVirtualPixels(). The pixels are virtual and therefore cannot be updated.

@@ -444,7 +500,7 @@
-

GetCacheViewVirtualPixels

+

GetCacheViewVirtualPixels

GetCacheViewVirtualPixels() gets virtual pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

@@ -475,7 +531,7 @@
-

GetOneCacheViewVirtualPixel

+

GetOneCacheViewVirtualPixel

GetOneCacheViewVirtualPixel() returns a single pixel at the specified (x,y) location. The image background color is returned if an error occurs. If you plan to modify the pixel, use GetOneCacheViewAuthenticPixel() instead.

@@ -510,7 +566,7 @@
-

GetOneCacheViewVirtualMethodPixel

+

GetOneCacheViewVirtualMethodPixel

GetOneCacheViewVirtualMethodPixel() returns a single virtual pixel at the specified (x,y) location. The image background color is returned if an error occurs. If you plan to modify the pixel, use GetOneCacheViewAuthenticPixel() instead.

@@ -550,7 +606,7 @@
-

QueueCacheViewAuthenticPixels

+

QueueCacheViewAuthenticPixels

QueueCacheViewAuthenticPixels() queues authentic pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

@@ -581,7 +637,7 @@
-

SetCacheViewStorageClass

+

SetCacheViewStorageClass

SetCacheViewStorageClass() sets the image storage class associated with the specified view.

@@ -607,7 +663,7 @@
-

SetCacheViewVirtualPixelMethod

+

SetCacheViewVirtualPixelMethod

SetCacheViewVirtualPixelMethod() sets the virtual pixel method associated with the specified cache view.

@@ -633,7 +689,7 @@
-

SyncCacheViewAuthenticPixels

+

SyncCacheViewAuthenticPixels

SyncCacheViewAuthenticPixels() saves the cache view pixels to the in-memory or disk cache. It returns MagickTrue if the pixel region is flushed, otherwise MagickFalse.

@@ -662,12 +718,12 @@
-
- + diff --git a/www/api/cache.html b/www/api/cache.html index 95921a439a289059e710111efd9bd27b5ca0bba4..101c2200a994275524efbadd5af44a9823160362 100644 --- a/www/api/cache.html +++ b/www/api/cache.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Get or Set Image Pixels + ImageMagick – MagickCore, C API: Get or Set Image Pixels - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Get or Set Image Pixels

+
+
-
-
+

Cache



-

AcquirePixelCacheNexus

+

AcquirePixelCacheNexus

AcquirePixelCacheNexus() allocates the NexusInfo structure.

@@ -133,7 +189,7 @@
-

AcquirePixelCachePixels

+

AcquirePixelCachePixels

AcquirePixelCachePixels() returns the pixels associated with the specified image.

@@ -163,7 +219,7 @@
-

GetAuthenticIndexQueue

+

GetAuthenticIndexQueue

GetAuthenticIndexQueue() returns the authentic black channel or the colormap indexes associated with the last call to QueueAuthenticPixels() or GetVirtualPixels(). NULL is returned if the black channel or colormap indexes are not available.

@@ -184,7 +240,7 @@
-

GetAuthenticPixelQueue

+

GetAuthenticPixelQueue

GetAuthenticPixelQueue() returns the authentic pixels associated with the last call to QueueAuthenticPixels() or GetAuthenticPixels().

@@ -205,7 +261,7 @@
-

GetAuthenticPixels

+

GetAuthenticPixels

GetAuthenticPixels() obtains a pixel region for read/write access. If the region is successfully accessed, a pointer to a PixelPacket array representing the region is returned, otherwise NULL is returned.

@@ -240,7 +296,7 @@
-

GetOneAuthenticPixel

+

GetOneAuthenticPixel

GetOneAuthenticPixel() returns a single pixel at the specified (x,y) location. The image background color is returned if an error occurs.

@@ -274,7 +330,7 @@
-

GetOneVirtualMagickPixel

+

GetOneVirtualMagickPixel

GetOneVirtualMagickPixel() returns a single pixel at the specified (x,y) location. The image background color is returned if an error occurs. If you plan to modify the pixel, use GetOneAuthenticPixel() instead.

@@ -309,7 +365,7 @@
-

GetOneVirtualMethodPixel

+

GetOneVirtualMethodPixel

GetOneVirtualMethodPixel() returns a single pixel at the specified (x,y) location as defined by specified pixel method. The image background color is returned if an error occurs. If you plan to modify the pixel, use GetOneAuthenticPixel() instead.

@@ -348,7 +404,7 @@
-

GetOneVirtualPixel

+

GetOneVirtualPixel

GetOneVirtualPixel() returns a single virtual pixel at the specified (x,y) location. The image background color is returned if an error occurs. If you plan to modify the pixel, use GetOneAuthenticPixel() instead.

@@ -382,7 +438,7 @@
-

GetVirtualIndexQueue

+

GetVirtualIndexQueue

GetVirtualIndexQueue() returns the virtual black channel or the colormap indexes associated with the last call to QueueAuthenticPixels() or GetVirtualPixels(). NULL is returned if the black channel or colormap indexes are not available.

@@ -403,7 +459,7 @@
-

GetVirtualPixelQueue

+

GetVirtualPixelQueue

GetVirtualPixelQueue() returns the virtual pixels associated with the last call to QueueAuthenticPixels() or GetVirtualPixels().

@@ -424,7 +480,7 @@
-

GetVirtualPixels

+

GetVirtualPixels

GetVirtualPixels() returns an immutable pixel region. If the region is successfully accessed, a pointer to it is returned, otherwise NULL is returned. The returned pointer may point to a temporary working copy of the pixels or it may point to the original pixels in memory. Performance is maximized if the selected region is part of one row, or one or more full rows, since there is opportunity to access the pixels in-place (without a copy) if the image is in memory, or in a memory-mapped file. The returned pointer must *never* be deallocated by the user.

@@ -461,7 +517,7 @@
-

QueueAuthenticPixels

+

QueueAuthenticPixels

QueueAuthenticPixels() queues a mutable pixel region. If the region is successfully initialized a pointer to a PixelPacket array representing the region is returned, otherwise NULL is returned. The returned pointer may point to a temporary working buffer for the pixels or it may point to the final location of the pixels in memory.

@@ -498,7 +554,7 @@
-

SetPixelCacheVirtualMethod

+

SetPixelCacheVirtualMethod

SetPixelCacheVirtualMethod() sets the "virtual pixels" method for the pixel cache and returns the previous setting. A virtual pixel is any pixel access that is outside the boundaries of the image cache.

@@ -524,7 +580,7 @@
-

SyncAuthenticPixels

+

SyncAuthenticPixels

SyncAuthenticPixels() saves the image pixels to the in-memory or disk cache. The method returns MagickTrue if the pixel region is flushed, otherwise MagickFalse.

@@ -553,12 +609,12 @@
-
- + diff --git a/www/api/channel.html b/www/api/channel.html index 7f13b180bdb4a36da3b1a1c7a86043143062a7b7..7191a226ffa69b3940524fdc7e8fd15267ab78da 100644 --- a/www/api/channel.html +++ b/www/api/channel.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Get or Set Image Channels + ImageMagick – MagickCore, C API: Get or Set Image Channels - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Get or Set Image Channels

+
+
-
-
+

Channel



-

CombineImages

+

CombineImages

CombineImages() combines one or more images into a single image. The grayscale value of the pixels of each image in the sequence is assigned in order to the specified channels of the combined image. The typical ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.

@@ -128,7 +184,7 @@
-

GetImageAlphaChannel

+

GetImageAlphaChannel

GetImageAlphaChannel() returns MagickFalse if the image alpha channel is not activated. That is, the image is RGB rather than RGBA or CMYK rather than CMYKA.

@@ -149,7 +205,7 @@
-

SeparateImageChannel

+

SeparateImageChannel

SeparateImageChannel() separates a channel from the image and returns it as a grayscale image. A channel is a particular color component of each pixel in the image.

@@ -175,7 +231,7 @@
-

SeparateImages

+

SeparateImages

SeparateImages() returns a separate grayscale image for each channel specified.

@@ -205,7 +261,7 @@
-

SetImageAlphaChannel

+

SetImageAlphaChannel

SetImageAlphaChannel() activates, deactivates, resets, or sets the alpha channel.

@@ -234,12 +290,12 @@
-
- + diff --git a/www/api/cipher.html b/www/api/cipher.html index 759ff4431c032d015a8929debcb87298bb17c411..48e28b06fd8c35edd86b9d90f51179c32e9f9481 100644 --- a/www/api/cipher.html +++ b/www/api/cipher.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Convert to and from Cipher Pixels + ImageMagick – MagickCore, C API: Convert to and from Cipher Pixels - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Convert to and from Cipher Pixels

+
+
-
-
+

Cipher



-

AcquireAESInfo

+

AcquireAESInfo

AcquireAESInfo() allocate the AESInfo structure.

@@ -114,7 +170,7 @@
AESInfo *AcquireAESInfo(void)
 
-

DestroyAESInfo

+

DestroyAESInfo

DestroyAESInfo() zeros memory associated with the AESInfo structure.

@@ -135,7 +191,7 @@
-

EncipherAESBlock

+

EncipherAESBlock

EncipherAESBlock() enciphers a single block of plaintext to produce a block of ciphertext.

@@ -165,7 +221,7 @@
-

PasskeyDecipherImage

+

PasskeyDecipherImage

PasskeyDecipherImage() converts cipher pixels to plain pixels.

@@ -201,7 +257,7 @@ MagickBooleanType DecipherImage(Image *image,const char *passphrase,
-

PasskeyEncipherImage

+

PasskeyEncipherImage

PasskeyEncipherImage() converts pixels to cipher-pixels.

@@ -237,7 +293,7 @@ MagickBooleanType EncipherImage(Image *image,const char *passphrase,
-

SetAESKey

+

SetAESKey

SetAESKey() sets the key for the AES cipher. The key length is specified in bits. Valid values are 128, 192, or 256 requiring a key buffer length in bytes of 16, 24, and 32 respectively.

@@ -262,7 +318,7 @@ MagickBooleanType EncipherImage(Image *image,const char *passphrase,
-

PasskeyDecipherImage

+

PasskeyDecipherImage

PasskeyDecipherImage() converts cipher pixels to plain pixels.

@@ -298,7 +354,7 @@ MagickBooleanType DecipherImage(Image *image,const char *passphrase,
-

PasskeyEncipherImage

+

PasskeyEncipherImage

PasskeyEncipherImage() converts pixels to cipher-pixels.

@@ -333,12 +389,12 @@ MagickBooleanType EncipherImage(Image *image,const char *passphrase,
-
+
SecurityNews - And Now a Touch of Magick + And Now a Touch of Magick RelatedSitemap @@ -354,8 +410,9 @@ MagickBooleanType EncipherImage(Image *image,const char *passphrase, Copyright © 1999 ImageMagick Studio LLC
+
- + diff --git a/www/api/color.html b/www/api/color.html index 6e2ae92c089cedfb3478fd667eccf7eea19f5d18..ef7f21dddf8dfadd66a59a03727dd0334eb4b9ee 100644 --- a/www/api/color.html +++ b/www/api/color.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Count the Colors in an Image + ImageMagick – MagickCore, C API: Count the Colors in an Image - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Count the Colors in an Image

+
+
-
-
+

Color



-

AcquireColorCache

+

AcquireColorCache

AcquireColorCache() caches one or more color configurations which provides a mapping between color attributes and a color name.

@@ -133,7 +189,7 @@
-

GetColorInfoList

+

GetColorInfoList

GetColorInfoList() returns any colors that match the specified pattern.

@@ -163,7 +219,7 @@
-

GetColorList

+

GetColorList

GetColorList() returns any colors that match the specified pattern.

@@ -193,7 +249,7 @@
-

ListColorInfo

+

ListColorInfo

ListColorInfo() lists color names to the specified file. Color names are a convenience. Rather than defining a color by its red, green, and blue intensities just use a color name such as white, blue, or yellow.

@@ -210,7 +266,7 @@
exception

return any errors or warnings in this structure.

-

QueryColorCompliance

+

QueryColorCompliance

QueryColorCompliance() returns the red, green, blue, and opacity intensities for a given color name.

@@ -245,7 +301,7 @@
-

QueryColorDatabase

+

QueryColorDatabase

QueryColorDatabase() returns the red, green, blue, and opacity intensities for a given color name.

@@ -275,7 +331,7 @@
-

QueryColorname

+

QueryColorname

QueryColorname() returns a named color for the given color intensity. If an exact match is not found, a rgb() color is returned instead.

@@ -303,7 +359,7 @@
exception

return any errors or warnings in this structure.

-

QueryMagickColorCompliance

+

QueryMagickColorCompliance

QueryMagickColorCompliance() returns the red, green, blue, and opacity intensities for a given color name and standards compliance.

@@ -338,7 +394,7 @@
-

QueryMagickColor

+

QueryMagickColor

QueryMagickColor() returns the red, green, blue, and opacity intensities for a given color name.

@@ -368,7 +424,7 @@
-

QueryMagickColorname

+

QueryMagickColorname

QueryMagickColorname() returns a named color for the given color intensity. If an exact match is not found, a hex value is returned instead. For example an intensity of rgb:(0,0,0) returns black whereas rgb:(223,223,223) returns #dfdfdf.

@@ -399,12 +455,12 @@
-
- + diff --git a/www/api/colormap.html b/www/api/colormap.html index 9bdd8cac1da36ead93be497149a557d7c55141ae..721fb2001e84671164c4387ef48a3e3db40e7eb6 100644 --- a/www/api/colormap.html +++ b/www/api/colormap.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Colormap Methods + ImageMagick – MagickCore, C API: Colormap Methods - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Colormap Methods

+
+
-
-
+

Colormap



-

AcquireImageColormap

+

AcquireImageColormap

AcquireImageColormap() allocates an image colormap and initializes it to a linear gray colorspace. If the image already has a colormap, it is replaced. AcquireImageColormap() returns MagickTrue if successful, otherwise MagickFalse if there is not enough memory.

@@ -124,7 +180,7 @@
-

CycleColormap

+

CycleColormap

CycleColormap() displaces an image's colormap by a given number of positions. If you cycle the colormap a number of times you can produce a psychodelic effect.

@@ -152,12 +208,12 @@
-
- + diff --git a/www/api/colorspace.html b/www/api/colorspace.html index 1bc719e2e4910c0cf9087a2ddda20a15e20999ad..009f25f67cd58072f869629379acf150454be0c4 100644 --- a/www/api/colorspace.html +++ b/www/api/colorspace.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Dealing with Image Colorspaces + ImageMagick – MagickCore, C API: Dealing with Image Colorspaces - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Dealing with Image Colorspaces

+
+
-
-
+

Colorspace



-

GetImageColorspaceType

+

GetImageColorspaceType

GetImageColorspaceType() returns the potential colorspace of image: sRGBColorspaceType, RGBColorspaceType, GRAYColorspaceType, etc.

@@ -134,7 +190,7 @@ exception);
-

SetImageColorspace

+

SetImageColorspace

SetImageColorspace() sets the colorspace member of the Image structure.

@@ -160,7 +216,7 @@ exception);
-

SetImageGray

+

SetImageGray

SetImageGray() returns MagickTrue if all the pixels in the image have the same red, green, and blue intensities and changes the type of the image to bi-level or grayscale.

@@ -186,7 +242,7 @@ exception);
-

SetImageMonochrome

+

SetImageMonochrome

SetImageMonochrome() returns MagickTrue if all the pixels in the image have the same red, green, and blue intensities and the intensity is either 0 or QuantumRange and changes the type of the image to bi-level.

@@ -212,7 +268,7 @@ exception);
-

TransformImageColorspace

+

TransformImageColorspace

TransformImageColorspace() transforms an image colorspace.

@@ -241,12 +297,12 @@ exception);
-
- + diff --git a/www/api/compare.html b/www/api/compare.html index db6fa94296b707c3c8787157bdca266c725eb82b..e81611510dc411195372a4bd2d1c1fe191e9ad36 100644 --- a/www/api/compare.html +++ b/www/api/compare.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Compare an Image to a Reconstructed Image + ImageMagick – MagickCore, C API: Compare an Image to a Reconstructed Image - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Compare an Image to a Reconstructed Image

+
+
-
-
+

Compare

-
- + diff --git a/www/api/composite.html b/www/api/composite.html index 4b83c75a5e4456116c0b00306ecb60156b5c31a9..47f422ea4f90a1c3c29c2a5f84e40ee413cb4315 100644 --- a/www/api/composite.html +++ b/www/api/composite.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Composite an Image + ImageMagick – MagickCore, C API: Composite an Image - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Composite an Image

+
+
-
-
+

Composite

-
- + diff --git a/www/api/constitute.html b/www/api/constitute.html index 03794fa628c366a1c4424e8a566f0f5b14a19dfa..7e73e9c67977256fff75025bbd184ee65f265aa5 100644 --- a/www/api/constitute.html +++ b/www/api/constitute.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Constitute an Image + ImageMagick – MagickCore, C API: Constitute an Image - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Constitute an Image

+
+
-
-
+

Constitute



-

ConstituteImage

+

ConstituteImage

ConstituteImage() returns an image from the pixel data you supply. The pixel data must be in scanline order top-to-bottom. The data can be char, short int, int, float, or double. Float and double require the pixels to be normalized [0..1], otherwise [0..QuantumRange]. For example, to create a 640x480 image from unsigned red-green-blue character data, use:

@@ -150,7 +206,7 @@
-

PingImage

+

PingImage

PingImage() returns all the properties of an image or image sequence except for the pixels. It is much faster and consumes far less memory than ReadImage(). On failure, a NULL image is returned and exception describes the reason for the failure.

@@ -175,7 +231,7 @@
-

PingImages

+

PingImages

PingImages() pings one or more images and returns them as an image list.

@@ -200,7 +256,7 @@
-

ReadImage

+

ReadImage

ReadImage() reads an image or image sequence from a file or file handle. The method returns a NULL if there is a memory shortage or if the image cannot be read. On failure, a NULL image is returned and exception describes the reason for the failure.

@@ -225,7 +281,7 @@
-

ReadImages

+

ReadImages

ReadImages() reads one or more images and returns them as an image list.

@@ -250,7 +306,7 @@
-

WriteImage

+

WriteImage

WriteImage() writes an image or an image sequence to a file or file handle. If writing to a file is on disk, the name is defined by the filename member of the image structure. WriteImage() returns MagickFalse is there is a memory shortage or if the image cannot be written. Check the exception member of image to determine the cause for any failure.

@@ -275,7 +331,7 @@
-

WriteImages

+

WriteImages

WriteImages() writes an image sequence into one or more files. While WriteImage() can write an image sequence, it is limited to writing the sequence into a single file using a format which supports multiple frames. WriteImages(), however, does not have this limitation, instead it generates multiple output files if necessary (or when requested). When ImageInfo's adjoin flag is set to MagickFalse, the file name is expected to include a printf-style formatting string for the frame number (e.g. "image02d.png").

@@ -312,12 +368,12 @@
-
- + diff --git a/www/api/decorate.html b/www/api/decorate.html index a3cf97b622b902899e30de24c478cce10e12ca26..8607a8347f85bde00acbdb57b87c5bb866a8d7bc 100644 --- a/www/api/decorate.html +++ b/www/api/decorate.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Decorate an Image + ImageMagick – MagickCore, C API: Decorate an Image - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Decorate an Image

+
+
-
-
+

Decorate



-

BorderImage

+

BorderImage

BorderImage() surrounds the image with a border of the color defined by the bordercolor member of the image structure. The width and height of the border are defined by the corresponding members of the border_info structure.

@@ -130,7 +186,7 @@
-

FrameImage

+

FrameImage

FrameImage() adds a simulated three-dimensional border around the image. The color of the border is defined by the matte_color member of image. Members width and height of frame_info specify the border width of the vertical and horizontal sides of the frame. Members inner and outer indicate the width of the inner and outer shadows of the frame.

@@ -160,7 +216,7 @@
-

RaiseImage

+

RaiseImage

RaiseImage() creates a simulated three-dimensional button-like effect by lightening and darkening the edges of the image. Members width and height of raise_info define the width of the vertical and horizontal edge of the effect.

@@ -193,12 +249,12 @@
-
- + diff --git a/www/api/deprecate.html b/www/api/deprecate.html index 770cce5d6be1b82c4387ecc20c2a6b7bda3afb41..ca3d68bad129eca8c97293d9be06bedc9629bf01 100644 --- a/www/api/deprecate.html +++ b/www/api/deprecate.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Deprecated Methods + ImageMagick – MagickCore, C API: Deprecated Methods - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Deprecated Methods

+
+
-
-
+

Deprecate



-

MagickAverageImages

+

MagickAverageImages

MagickAverageImages() average a set of images.

@@ -173,7 +229,7 @@
-

ClonePixelView

+

ClonePixelView

ClonePixelView() makes a copy of the specified pixel view.

@@ -194,7 +250,7 @@
-

DestroyPixelView

+

DestroyPixelView

DestroyPixelView() deallocates memory associated with a pixel view.

@@ -224,7 +280,7 @@
-

DuplexTransferPixelViewIterator

+

DuplexTransferPixelViewIterator

DuplexTransferPixelViewIterator() iterates over three pixel views in parallel and calls your transfer method for each scanline of the view. The source and duplex pixel region is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension. However, the destination pixel view is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted.

@@ -270,7 +326,7 @@
-

GetPixelViewException

+

GetPixelViewException

GetPixelViewException() returns the severity, reason, and description of any error that occurs when utilizing a pixel view.

@@ -296,7 +352,7 @@
-

GetPixelViewHeight

+

GetPixelViewHeight

GetPixelViewHeight() returns the pixel view height.

@@ -317,7 +373,7 @@
-

GetPixelViewIterator

+

GetPixelViewIterator

GetPixelViewIterator() iterates over the pixel view in parallel and calls your get method for each scanline of the view. The pixel region is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension. Any updates to the pixels in your callback are ignored.

@@ -354,7 +410,7 @@
-

GetPixelViewPixels

+

GetPixelViewPixels

GetPixelViewPixels() returns the pixel view pixel_wands.

@@ -375,7 +431,7 @@
-

GetPixelViewWand

+

GetPixelViewWand

GetPixelViewWand() returns the magick wand associated with the pixel view.

@@ -396,7 +452,7 @@
-

GetPixelViewWidth

+

GetPixelViewWidth

GetPixelViewWidth() returns the pixel view width.

@@ -417,7 +473,7 @@
-

GetPixelViewX

+

GetPixelViewX

GetPixelViewX() returns the pixel view x offset.

@@ -438,7 +494,7 @@
-

GetPixelViewY

+

GetPixelViewY

GetPixelViewY() returns the pixel view y offset.

@@ -459,7 +515,7 @@
-

IsPixelView

+

IsPixelView

IsPixelView() returns MagickTrue if the parameter is verified as a pixel view container.

@@ -480,7 +536,7 @@
-

MagickClipPathImage

+

MagickClipPathImage

MagickClipPathImage() clips along the named paths from the 8BIM profile, if present. Later operations take effect inside the path. Id may be a number if preceded with #, to work on a numbered path, e.g., "#1" to use the first path.

@@ -510,7 +566,7 @@
-

DrawGetFillAlpha

+

DrawGetFillAlpha

DrawGetFillAlpha() returns the alpha used when drawing using the fill color or fill texture. Fully opaque is 1.0.

@@ -531,7 +587,7 @@
-

DrawGetStrokeAlpha

+

DrawGetStrokeAlpha

DrawGetStrokeAlpha() returns the alpha of stroked object outlines.

@@ -550,7 +606,7 @@
wand
the drawing wand.
-

DrawPeekGraphicWand

+

DrawPeekGraphicWand

DrawPeekGraphicWand() returns the current drawing wand.

@@ -571,7 +627,7 @@
-

DrawPopGraphicContext

+

DrawPopGraphicContext

DrawPopGraphicContext() destroys the current drawing wand and returns to the previously pushed drawing wand. Multiple drawing wands may exist. It is an error to attempt to pop more drawing wands than have been pushed, and it is proper form to pop all drawing wands which have been pushed.

@@ -592,7 +648,7 @@
-

DrawPushGraphicContext

+

DrawPushGraphicContext

DrawPushGraphicContext() clones the current drawing wand to create a new drawing wand. The original drawing wand(s) may be returned to by invoking PopDrawingWand(). The drawing wands are stored on a drawing wand stack. For every Pop there must have already been an equivalent Push.

@@ -613,7 +669,7 @@
-

DrawSetFillAlpha

+

DrawSetFillAlpha

DrawSetFillAlpha() sets the alpha to use when drawing using the fill color or fill texture. Fully opaque is 1.0.

@@ -638,7 +694,7 @@
-

DrawSetStrokeAlpha

+

DrawSetStrokeAlpha

DrawSetStrokeAlpha() specifies the alpha of stroked object outlines.

@@ -663,7 +719,7 @@
-

MagickColorFloodfillImage

+

MagickColorFloodfillImage

MagickColorFloodfillImage() changes the color value of any pixel that matches target and is an immediate neighbor. If the method FillToBorderMethod is specified, the color value is changed for any neighbor pixel that does not match the bordercolor member of image.

@@ -702,7 +758,7 @@
-

MagickDescribeImage

+

MagickDescribeImage

MagickDescribeImage() identifies an image by printing its attributes to the file. Attributes include the image width, height, size, and others.

@@ -723,7 +779,7 @@
-

MagickFlattenImages

+

MagickFlattenImages

MagickFlattenImages() merges a sequence of images. This useful for combining Photoshop layers into a single image.

@@ -744,7 +800,7 @@
-

MagickGetImageAttribute

+

MagickGetImageAttribute

MagickGetImageAttribute() returns a value associated with the specified property. Use MagickRelinquishMemory() to free the value when you are finished with it.

@@ -769,7 +825,7 @@
-

MagickGetImageMatte

+

MagickGetImageMatte

MagickGetImageMatte() returns MagickTrue if the image has a matte channel otherwise MagickFalse.

@@ -790,7 +846,7 @@
-

MagickGetImagePixels

+

MagickGetImagePixels

MagickGetImagePixels() extracts pixel data from an image and returns it to you. The method returns MagickTrue on success otherwise MagickFalse if an error is encountered. The data is returned as char, short int, int, ssize_t, float, or double in the order specified by map.

@@ -835,7 +891,7 @@
-

MagickGetImageSize

+

MagickGetImageSize

MagickGetImageSize() returns the image length in bytes.

@@ -861,7 +917,7 @@
-

MagickMapImage

+

MagickMapImage

MagickMapImage() replaces the colors of an image with the closest color from a reference image.

@@ -891,7 +947,7 @@
-

MagickMatteFloodfillImage

+

MagickMatteFloodfillImage

MagickMatteFloodfillImage() changes the transparency value of any pixel that matches target and is an immediate neighbor. If the method FillToBorderMethod is specified, the transparency value is changed for any neighbor pixel that does not match the bordercolor member of image.

@@ -930,7 +986,7 @@
-

MagickMedianFilterImage

+

MagickMedianFilterImage

MagickMedianFilterImage() applies a digital filter that improves the quality of a noisy image. Each pixel is replaced by the median in a set of neighboring pixels as defined by radius.

@@ -956,7 +1012,7 @@
-

MagickMinimumImages

+

MagickMinimumImages

MagickMinimumImages() returns the minimum intensity of an image sequence.

@@ -977,7 +1033,7 @@
-

MagickModeImage

+

MagickModeImage

MagickModeImage() makes each pixel the 'predominant color' of the neighborhood of the specified radius.

@@ -1003,7 +1059,7 @@
-

MagickMosaicImages

+

MagickMosaicImages

MagickMosaicImages() inlays an image sequence to form a single coherent picture. It returns a wand with each image in the sequence composited at the location defined by the page offset of the image.

@@ -1024,7 +1080,7 @@
-

MagickOpaqueImage

+

MagickOpaqueImage

MagickOpaqueImage() changes any pixel that matches color with the color defined by fill.

@@ -1062,7 +1118,7 @@
-

MagickPaintFloodfillImage

+

MagickPaintFloodfillImage

MagickPaintFloodfillImage() changes the color value of any pixel that matches target and is an immediate neighbor. If the method FillToBorderMethod is specified, the color value is changed for any neighbor pixel that does not match the bordercolor member of image.

@@ -1105,7 +1161,7 @@
-

MagickPaintOpaqueImage

+

MagickPaintOpaqueImage

MagickPaintOpaqueImage() changes any pixel that matches color with the color defined by fill.

@@ -1146,7 +1202,7 @@ MagickBooleanType MagickPaintOpaqueImageChannel(MagickWand *wand,
-

MagickPaintTransparentImage

+

MagickPaintTransparentImage

MagickPaintTransparentImage() changes any pixel that matches color with the color defined by fill.

@@ -1180,7 +1236,7 @@ MagickBooleanType MagickPaintOpaqueImageChannel(MagickWand *wand,
-

MagickRadialBlurImage

+

MagickRadialBlurImage

MagickRadialBlurImage() radial blurs an image.

@@ -1212,7 +1268,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

MagickRecolorImage

+

MagickRecolorImage

MagickRecolorImage() apply color transformation to an image. The method permits saturation changes, hue rotation, luminance to alpha, and various other effects. Although variable-sized transformation matrices can be used, typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA (or RGBA with offsets). The matrix is similar to those used by Adobe Flash except offsets are in column 6 rather than 5 (in support of CMYKA images) and offsets are normalized (divide Flash offset by 255).

@@ -1242,7 +1298,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

MagickReduceNoiseImage

+

MagickReduceNoiseImage

MagickReduceNoiseImage() smooths the contours of an image while still preserving edge information. The algorithm works by replacing each pixel with its neighbor closest in value. A neighbor is defined by radius. Use a radius of 0 and ReduceNoise() selects a suitable radius for you.

@@ -1268,7 +1324,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

MagickMaximumImages

+

MagickMaximumImages

MagickMaximumImages() returns the maximum intensity of an image sequence.

@@ -1289,7 +1345,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

MagickSetImageAttribute

+

MagickSetImageAttribute

MagickSetImageAttribute() associates a property with an image.

@@ -1319,7 +1375,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

MagickSetImageIndex

+

MagickSetImageIndex

MagickSetImageIndex() set the current image to the position of the list specified with the index parameter.

@@ -1345,7 +1401,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

MagickTransparentImage

+

MagickTransparentImage

MagickTransparentImage() changes any pixel that matches color with the color defined by fill.

@@ -1379,7 +1435,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

MagickRegionOfInterestImage

+

MagickRegionOfInterestImage

MagickRegionOfInterestImage() extracts a region of the image and returns it as a new wand.

@@ -1418,7 +1474,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

MagickSetImagePixels

+

MagickSetImagePixels

MagickSetImagePixels() accepts pixel datand stores it in the image at the location you specify. The method returns MagickFalse on success otherwise MagickTrue if an error is encountered. The pixel data can be either char, short int, int, ssize_t, float, or double in the order specified by map.

@@ -1463,7 +1519,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

MagickWriteImageBlob

+

MagickWriteImageBlob

MagickWriteImageBlob() implements direct to memory image formats. It returns the image as a blob and its length. Use MagickSetFormat() to set the format of the returned blob (GIF, JPEG, PNG, etc.).

@@ -1490,7 +1546,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

NewPixelView

+

NewPixelView

NewPixelView() returns a pixel view required for all other methods in the Pixel View API.

@@ -1511,7 +1567,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

NewPixelViewRegion

+

NewPixelViewRegion

NewPixelViewRegion() returns a pixel view required for all other methods in the Pixel View API.

@@ -1537,7 +1593,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

PixelGetNextRow

+

PixelGetNextRow

PixelGetNextRow() returns the next row as an array of pixel wands from the pixel iterator.

@@ -1563,7 +1619,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

PixelIteratorGetException

+

PixelIteratorGetException

PixelIteratorGetException() returns the severity, reason, and description of any error that occurs when using other methods in this API.

@@ -1589,7 +1645,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

SetPixelViewIterator

+

SetPixelViewIterator

SetPixelViewIterator() iterates over the pixel view in parallel and calls your set method for each scanline of the view. The pixel region is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension. The pixels are initiallly undefined and any settings you make in the callback method are automagically synced back to your image.

@@ -1626,7 +1682,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

TransferPixelViewIterator

+

TransferPixelViewIterator

TransferPixelViewIterator() iterates over two pixel views in parallel and calls your transfer method for each scanline of the view. The source pixel region is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension. However, the destination pixel view is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted.

@@ -1667,7 +1723,7 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-

UpdatePixelViewIterator

+

UpdatePixelViewIterator

UpdatePixelViewIterator() iterates over the pixel view in parallel and calls your update method for each scanline of the view. The pixel region is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted. Updates to pixels in your callback are automagically synced back to the image.

@@ -1707,12 +1763,12 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-
+
SecurityNews - And Now a Touch of Magick + And Now a Touch of Magick RelatedSitemap @@ -1728,8 +1784,9 @@ MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand, Copyright © 1999 ImageMagick Studio LLC
+
- + diff --git a/www/api/display.html b/www/api/display.html index 0f93c672d805bbfd25372d11dc0c367c87b1c31d..1d0f39627ab21c4b153d4e4547fdb577fcccd232 100644 --- a/www/api/display.html +++ b/www/api/display.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Interactively Display and Edit an Image + ImageMagick – MagickCore, C API: Interactively Display and Edit an Image - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Interactively Display and Edit an Image

+
+
-
-
+

Display

-
- + diff --git a/www/api/distort.html b/www/api/distort.html index 0d0c1405c15f7ec06b3a1add1d7c407bcaff9fe4..8cbd3a34108610b85140218e32d196f9764299fe 100644 --- a/www/api/distort.html +++ b/www/api/distort.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Image Distortions + ImageMagick – MagickCore, C API: Image Distortions - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Image Distortions

+
+
-
-
+

Distort



-

AffineTransformImage

+

AffineTransformImage

AffineTransformImage() transforms an image as dictated by the affine matrix. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

@@ -131,7 +187,7 @@
-

DistortImage

+

DistortImage

DistortImage() distorts an image using various distortion methods, by mapping color lookups of the source image to a new destination image usually of the same size as the source image, unless 'bestfit' is set to true.

@@ -198,7 +254,7 @@
-

RotateImage

+

RotateImage

RotateImage() creates a new image that is a rotated copy of an existing one. Positive angles rotate counter-clockwise (right-hand rule), while negative angles rotate clockwise. Rotated images are usually larger than the originals and have 'empty' triangular corners. X axis. Empty triangles left over from shearing the image are filled with the background color defined by member 'background_color' of the image. RotateImage allocates the memory necessary for the new Image structure and returns a pointer to the new image.

@@ -219,7 +275,7 @@
exception

return any errors or warnings in this structure.

-

SparseColorImage

+

SparseColorImage

SparseColorImage(), given a set of coordinates, interpolates the colors found at those coordinates, across the whole image, using various methods.

@@ -267,12 +323,12 @@
-
- + diff --git a/www/api/draw.html b/www/api/draw.html index 93517d7cc487b6381e06506a4dad92c7388b82aa..c8d1e4a88ba4180739260a6bd5c679a85bbfe457 100644 --- a/www/api/draw.html +++ b/www/api/draw.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Draw on an Image + ImageMagick – MagickCore, C API: Draw on an Image - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Draw on an Image

+
+
-
-
+

Draw



-

AcquireDrawInfo

+

AcquireDrawInfo

AcquireDrawInfo() returns a DrawInfo structure properly initialized.

@@ -118,7 +174,7 @@
DrawInfo *AcquireDrawInfo(void)
 
-

CloneDrawInfo

+

CloneDrawInfo

CloneDrawInfo() makes a copy of the given draw_info structure. If NULL is specified, a new DrawInfo structure is created initialized to default values.

@@ -144,7 +200,7 @@
-

DestroyDrawInfo

+

DestroyDrawInfo

DestroyDrawInfo() deallocates memory associated with an DrawInfo structure.

@@ -165,7 +221,7 @@
-

DrawAffineImage

+

DrawAffineImage

DrawAffineImage() composites the source over the destination image as dictated by the affine transform.

@@ -195,7 +251,7 @@
-

DrawClipPath

+

DrawClipPath

DrawClipPath() draws the clip path on the image mask.

@@ -225,7 +281,7 @@
-

DrawClippingMask

+

DrawClippingMask

DrawClippingMask() draws the clip path and returns it as an image clipping mask.

@@ -263,7 +319,7 @@
-

DrawCompositeMask

+

DrawCompositeMask

DrawCompositeMask() draws the mask path and returns it as an image mask.

@@ -301,7 +357,7 @@
-

DrawGradientImage

+

DrawGradientImage

DrawGradientImage() draws a linear gradient on the image.

@@ -327,7 +383,7 @@
-

DrawImage

+

DrawImage

DrawImage() draws a graphic primitive on your image. The primitive may be represented as a string or filename. Precede the filename with an "at" sign (@) and the contents of the file are drawn on the image. You can affect how text is drawn by setting one or more members of the draw info structure.

@@ -352,7 +408,7 @@
-

DrawPatternPath

+

DrawPatternPath

DrawPatternPath() draws a pattern.

@@ -386,7 +442,7 @@
-

DrawPrimitive

+

DrawPrimitive

DrawPrimitive() draws a primitive (line, rectangle, ellipse) on the image.

@@ -416,7 +472,7 @@
-

GetAffineMatrix

+

GetAffineMatrix

GetAffineMatrix() returns an AffineMatrix initialized to the identity matrix.

@@ -440,12 +496,12 @@
-
- + diff --git a/www/api/drawing-wand.html b/www/api/drawing-wand.html index bec2be53d81a2491c8eb6668a6dff5cd72a3749c..675f4bd5f3703b011ece87305722c18978b90f35 100644 --- a/www/api/drawing-wand.html +++ b/www/api/drawing-wand.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickWand, C API: Drawing Wand Methods + ImageMagick – MagickWand, C API: Drawing Wand Methods - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickWand, C API: Drawing Wand Methods

+
+
-
-
+

Drawing-wand



-

ClearDrawingWand

+

ClearDrawingWand

ClearDrawingWand() clears resources associated with the drawing wand.

@@ -253,7 +309,7 @@
-

CloneDrawingWand

+

CloneDrawingWand

CloneDrawingWand() makes an exact copy of the specified wand.

@@ -274,7 +330,7 @@
-

DestroyDrawingWand

+

DestroyDrawingWand

DestroyDrawingWand() frees all resources associated with the drawing wand. Once the drawing wand has been freed, it should not be used and further unless it re-allocated.

@@ -295,7 +351,7 @@
-

DrawAffine

+

DrawAffine

DrawAffine() adjusts the current affine transformation matrix with the specified affine transformation matrix. Note that the current affine transform is adjusted rather than replaced.

@@ -320,7 +376,7 @@
-

DrawAnnotation

+

DrawAnnotation

DrawAnnotation() draws text on the image.

@@ -354,7 +410,7 @@
-

DrawArc

+

DrawArc

DrawArc() draws an arc falling within a specified bounding rectangle on the image.

@@ -400,7 +456,7 @@
-

DrawBezier

+

DrawBezier

DrawBezier() draws a bezier curve through a set of points on the image.

@@ -430,7 +486,7 @@
-

DrawCircle

+

DrawCircle

DrawCircle() draws a circle on the image.

@@ -468,7 +524,7 @@
-

DrawClearException

+

DrawClearException

DrawClearException() clear any exceptions associated with the wand.

@@ -489,7 +545,7 @@
-

DrawComposite

+

DrawComposite

DrawComposite() composites an image onto the current image, using the specified composition operator, specified position, and at the specified size.

@@ -537,7 +593,7 @@
-

DrawColor

+

DrawColor

DrawColor() draws color on image using the current fill color, starting at specified position, and using specified paint method. The available paint methods are:

@@ -577,7 +633,7 @@
-

DrawComment

+

DrawComment

DrawComment() adds a comment to a vector output stream.

@@ -602,7 +658,7 @@
-

DrawEllipse

+

DrawEllipse

DrawEllipse() draws an ellipse on the image.

@@ -648,7 +704,7 @@
-

DrawGetBorderColor

+

DrawGetBorderColor

DrawGetBorderColor() returns the border color used for drawing bordered objects.

@@ -674,7 +730,7 @@
-

DrawGetClipPath

+

DrawGetClipPath

DrawGetClipPath() obtains the current clipping path ID. The value returned must be deallocated by the user when it is no longer needed.

@@ -695,7 +751,7 @@
-

DrawGetClipRule

+

DrawGetClipRule

DrawGetClipRule() returns the current polygon fill rule to be used by the clipping path.

@@ -716,7 +772,7 @@
-

DrawGetClipUnits

+

DrawGetClipUnits

DrawGetClipUnits() returns the interpretation of clip path units.

@@ -737,7 +793,7 @@
-

DrawGetDensity

+

DrawGetDensity

DrawGetDensity() obtains the vertical and horizontal resolution. The value returned must be deallocated by the user when it is no longer needed.

@@ -758,7 +814,7 @@
-

DrawGetException

+

DrawGetException

DrawGetException() returns the severity, reason, and description of any error that occurs when using other methods in this API.

@@ -784,7 +840,7 @@
-

DrawGetExceptionType

+

DrawGetExceptionType

DrawGetExceptionType() the exception type associated with the wand. If no exception has occurred, UndefinedExceptionType is returned.

@@ -805,7 +861,7 @@
-

DrawGetFillColor

+

DrawGetFillColor

DrawGetFillColor() returns the fill color used for drawing filled objects.

@@ -831,7 +887,7 @@
-

DrawGetFillOpacity

+

DrawGetFillOpacity

DrawGetFillOpacity() returns the opacity used when drawing using the fill color or fill texture. Fully opaque is 1.0.

@@ -852,7 +908,7 @@
-

DrawGetFillRule

+

DrawGetFillRule

DrawGetFillRule() returns the fill rule used while drawing polygons.

@@ -873,7 +929,7 @@
-

DrawGetFont

+

DrawGetFont

DrawGetFont() returns a null-terminated string specifying the font used when annotating with text. The value returned must be freed by the user when no longer needed.

@@ -894,7 +950,7 @@
-

DrawGetFontFamily

+

DrawGetFontFamily

DrawGetFontFamily() returns the font family to use when annotating with text. The value returned must be freed by the user when it is no longer needed.

@@ -915,7 +971,7 @@
-

DrawGetFontResolution

+

DrawGetFontResolution

DrawGetFontResolution() gets the image X and Y resolution.

@@ -945,7 +1001,7 @@
-

DrawGetFontSize

+

DrawGetFontSize

DrawGetFontSize() returns the font pointsize used when annotating with text.

@@ -966,7 +1022,7 @@
-

DrawGetFontStretch

+

DrawGetFontStretch

DrawGetFontStretch() returns the font stretch used when annotating with text.

@@ -987,7 +1043,7 @@
-

DrawGetFontStyle

+

DrawGetFontStyle

DrawGetFontStyle() returns the font style used when annotating with text.

@@ -1008,7 +1064,7 @@
-

DrawGetFontWeight

+

DrawGetFontWeight

DrawGetFontWeight() returns the font weight used when annotating with text.

@@ -1029,7 +1085,7 @@
-

DrawGetGravity

+

DrawGetGravity

DrawGetGravity() returns the text placement gravity used when annotating with text.

@@ -1050,7 +1106,7 @@
-

DrawGetOpacity

+

DrawGetOpacity

DrawGetOpacity() returns the opacity used when drawing with the fill or stroke color or texture. Fully opaque is 1.0.

@@ -1071,7 +1127,7 @@
-

DrawGetStrokeAntialias

+

DrawGetStrokeAntialias

DrawGetStrokeAntialias() returns the current stroke antialias setting. Stroked outlines are antialiased by default. When antialiasing is disabled stroked pixels are thresholded to determine if the stroke color or underlying canvas color should be used.

@@ -1092,7 +1148,7 @@
-

DrawGetStrokeColor

+

DrawGetStrokeColor

DrawGetStrokeColor() returns the color used for stroking object outlines.

@@ -1118,7 +1174,7 @@
-

DrawGetStrokeDashArray

+

DrawGetStrokeDashArray

DrawGetStrokeDashArray() returns an array representing the pattern of dashes and gaps used to stroke paths (see DrawSetStrokeDashArray). The array must be freed once it is no longer required by the user.

@@ -1144,7 +1200,7 @@
-

DrawGetStrokeDashOffset

+

DrawGetStrokeDashOffset

DrawGetStrokeDashOffset() returns the offset into the dash pattern to start the dash.

@@ -1165,7 +1221,7 @@
-

DrawGetStrokeLineCap

+

DrawGetStrokeLineCap

DrawGetStrokeLineCap() returns the shape to be used at the end of open subpaths when they are stroked. Values of LineCap are UndefinedCap, ButtCap, RoundCap, and SquareCap.

@@ -1186,7 +1242,7 @@
-

DrawGetStrokeLineJoin

+

DrawGetStrokeLineJoin

DrawGetStrokeLineJoin() returns the shape to be used at the corners of paths (or other vector shapes) when they are stroked. Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.

@@ -1207,7 +1263,7 @@
-

DrawGetStrokeMiterLimit

+

DrawGetStrokeMiterLimit

DrawGetStrokeMiterLimit() returns the miter limit. When two line segments meet at a sharp angle and miter joins have been specified for 'lineJoin', it is possible for the miter to extend far beyond the thickness of the line stroking the path. The miterLimit' imposes a limit on the ratio of the miter length to the 'lineWidth'.

@@ -1228,7 +1284,7 @@
-

DrawGetStrokeOpacity

+

DrawGetStrokeOpacity

DrawGetStrokeOpacity() returns the opacity of stroked object outlines.

@@ -1249,7 +1305,7 @@
-

DrawGetStrokeWidth

+

DrawGetStrokeWidth

DrawGetStrokeWidth() returns the width of the stroke used to draw object outlines.

@@ -1270,7 +1326,7 @@
-

DrawGetTextAlignment

+

DrawGetTextAlignment

DrawGetTextAlignment() returns the alignment applied when annotating with text.

@@ -1291,7 +1347,7 @@
-

DrawGetTextAntialias

+

DrawGetTextAntialias

DrawGetTextAntialias() returns the current text antialias setting, which determines whether text is antialiased. Text is antialiased by default.

@@ -1312,7 +1368,7 @@
-

DrawGetTextDecoration

+

DrawGetTextDecoration

DrawGetTextDecoration() returns the decoration applied when annotating with text.

@@ -1333,7 +1389,7 @@
-

DrawGetTextDirection

+

DrawGetTextDirection

DrawGetTextDirection() returns the direction that will be used when annotating with text.

@@ -1354,7 +1410,7 @@
-

DrawGetTextEncoding

+

DrawGetTextEncoding

DrawGetTextEncoding() returns a null-terminated string which specifies the code set used for text annotations. The string must be freed by the user once it is no longer required.

@@ -1375,7 +1431,7 @@
-

DrawGetTextKerning

+

DrawGetTextKerning

DrawGetTextKerning() gets the spacing between characters in text.

@@ -1396,7 +1452,7 @@
-

DrawGetTextInterlineSpacing

+

DrawGetTextInterlineSpacing

DrawGetTextInterlineSpacing() gets the spacing between lines in text.

@@ -1417,7 +1473,7 @@
-

DrawGetTextInterwordSpacing

+

DrawGetTextInterwordSpacing

DrawGetTextInterwordSpacing() gets the spacing between words in text.

@@ -1438,7 +1494,7 @@
-

DrawGetVectorGraphics

+

DrawGetVectorGraphics

DrawGetVectorGraphics() returns a null-terminated string which specifies the vector graphics generated by any graphics calls made since the wand was instantiated. The string must be freed by the user once it is no longer required.

@@ -1459,7 +1515,7 @@
-

DrawGetTextUnderColor

+

DrawGetTextUnderColor

DrawGetTextUnderColor() returns the color of a background rectangle to place under text annotations.

@@ -1485,7 +1541,7 @@
-

DrawLine

+

DrawLine

DrawLine() draws a line on the image using the current stroke color, stroke opacity, and stroke width.

@@ -1523,7 +1579,7 @@
-

DrawMatte

+

DrawMatte

DrawMatte() paints on the image's opacity channel in order to set effected pixels to transparent. to influence the opacity of pixels. The available paint methods are:

@@ -1565,7 +1621,7 @@ border color.
-

DrawPathClose

+

DrawPathClose

DrawPathClose() adds a path element to the current path which closes the current subpath by drawing a straight line from the current point to the current subpath's most recent starting point (usually, the most recent moveto point).

@@ -1586,7 +1642,7 @@ border color.
-

DrawPathCurveToAbsolute

+

DrawPathCurveToAbsolute

DrawPathCurveToAbsolute() draws a cubic Bezier curve from the current point to (x,y) using (x1,y1) as the control point at the beginning of the curve and (x2,y2) as the control point at the end of the curve using absolute coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier.

@@ -1633,7 +1689,7 @@ border color.
-

DrawPathCurveToRelative

+

DrawPathCurveToRelative

DrawPathCurveToRelative() draws a cubic Bezier curve from the current point to (x,y) using (x1,y1) as the control point at the beginning of the curve and (x2,y2) as the control point at the end of the curve using relative coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier.

@@ -1680,7 +1736,7 @@ border color.
-

DrawPathCurveToQuadraticBezierAbsolute

+

DrawPathCurveToQuadraticBezierAbsolute

DrawPathCurveToQuadraticBezierAbsolute() draws a quadratic Bezier curve from the current point to (x,y) using (x1,y1) as the control point using absolute coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier.

@@ -1718,7 +1774,7 @@ border color.
-

DrawPathCurveToQuadraticBezierRelative

+

DrawPathCurveToQuadraticBezierRelative

DrawPathCurveToQuadraticBezierRelative() draws a quadratic Bezier curve from the current point to (x,y) using (x1,y1) as the control point using relative coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier.

@@ -1756,7 +1812,7 @@ border color.
-

DrawPathCurveToQuadraticBezierSmoothAbsolute

+

DrawPathCurveToQuadraticBezierSmoothAbsolute

DrawPathCurveToQuadraticBezierSmoothAbsolute() draws a quadratic Bezier curve (using absolute coordinates) from the current point to (x,y). The control point is assumed to be the reflection of the control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not a DrawPathCurveToQuadraticBezierAbsolute, DrawPathCurveToQuadraticBezierRelative, DrawPathCurveToQuadraticBezierSmoothAbsolute or DrawPathCurveToQuadraticBezierSmoothRelative, assume the control point is coincident with the current point.). At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier.

@@ -1786,7 +1842,7 @@ border color.
-

DrawPathCurveToQuadraticBezierSmoothRelative

+

DrawPathCurveToQuadraticBezierSmoothRelative

DrawPathCurveToQuadraticBezierSmoothRelative() draws a quadratic Bezier curve (using relative coordinates) from the current point to (x,y). The control point is assumed to be the reflection of the control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not a DrawPathCurveToQuadraticBezierAbsolute, DrawPathCurveToQuadraticBezierRelative, DrawPathCurveToQuadraticBezierSmoothAbsolute or DrawPathCurveToQuadraticBezierSmoothRelative, assume the control point is coincident with the current point.). At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier.

@@ -1816,7 +1872,7 @@ border color.
-

DrawPathCurveToSmoothAbsolute

+

DrawPathCurveToSmoothAbsolute

DrawPathCurveToSmoothAbsolute() draws a cubic Bezier curve from the current point to (x,y) using absolute coordinates. The first control point is assumed to be the reflection of the second control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not an DrawPathCurveToAbsolute, DrawPathCurveToRelative, DrawPathCurveToSmoothAbsolute or DrawPathCurveToSmoothRelative, assume the first control point is coincident with the current point.) (x2,y2) is the second control point (i.e., the control point at the end of the curve). At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier.

@@ -1854,7 +1910,7 @@ border color.
-

DrawPathCurveToSmoothRelative

+

DrawPathCurveToSmoothRelative

DrawPathCurveToSmoothRelative() draws a cubic Bezier curve from the current point to (x,y) using relative coordinates. The first control point is assumed to be the reflection of the second control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not an DrawPathCurveToAbsolute, DrawPathCurveToRelative, DrawPathCurveToSmoothAbsolute or DrawPathCurveToSmoothRelative, assume the first control point is coincident with the current point.) (x2,y2) is the second control point (i.e., the control point at the end of the curve). At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier.

@@ -1892,7 +1948,7 @@ border color.
-

DrawPathEllipticArcAbsolute

+

DrawPathEllipticArcAbsolute

DrawPathEllipticArcAbsolute() draws an elliptical arc from the current point to (x, y) using absolute coordinates. The size and orientation of the ellipse are defined by two radii (rx, ry) and an xAxisRotation, which indicates how the ellipse as a whole is rotated relative to the current coordinate system. The center (cx, cy) of the ellipse is calculated automagically to satisfy the constraints imposed by the other parameters. largeArcFlag and sweepFlag contribute to the automatic calculations and help determine how the arc is drawn. If largeArcFlag is true then draw the larger of the available arcs. If sweepFlag is true, then draw the arc matching a clock-wise rotation.

@@ -1938,7 +1994,7 @@ border color.
-

DrawPathEllipticArcRelative

+

DrawPathEllipticArcRelative

DrawPathEllipticArcRelative() draws an elliptical arc from the current point to (x, y) using relative coordinates. The size and orientation of the ellipse are defined by two radii (rx, ry) and an xAxisRotation, which indicates how the ellipse as a whole is rotated relative to the current coordinate system. The center (cx, cy) of the ellipse is calculated automagically to satisfy the constraints imposed by the other parameters. largeArcFlag and sweepFlag contribute to the automatic calculations and help determine how the arc is drawn. If largeArcFlag is true then draw the larger of the available arcs. If sweepFlag is true, then draw the arc matching a clock-wise rotation.

@@ -1982,7 +2038,7 @@ border color.
-

DrawPathFinish

+

DrawPathFinish

DrawPathFinish() terminates the current path.

@@ -2003,7 +2059,7 @@ border color.
-

DrawPathLineToAbsolute

+

DrawPathLineToAbsolute

DrawPathLineToAbsolute() draws a line path from the current point to the given coordinate using absolute coordinates. The coordinate then becomes the new current point.

@@ -2033,7 +2089,7 @@ border color.
-

DrawPathLineToRelative

+

DrawPathLineToRelative

DrawPathLineToRelative() draws a line path from the current point to the given coordinate using relative coordinates. The coordinate then becomes the new current point.

@@ -2063,7 +2119,7 @@ border color.
-

DrawPathLineToHorizontalAbsolute

+

DrawPathLineToHorizontalAbsolute

DrawPathLineToHorizontalAbsolute() draws a horizontal line path from the current point to the target point using absolute coordinates. The target point then becomes the new current point.

@@ -2089,7 +2145,7 @@ border color.
-

DrawPathLineToHorizontalRelative

+

DrawPathLineToHorizontalRelative

DrawPathLineToHorizontalRelative() draws a horizontal line path from the current point to the target point using relative coordinates. The target point then becomes the new current point.

@@ -2115,7 +2171,7 @@ border color.
-

DrawPathLineToVerticalAbsolute

+

DrawPathLineToVerticalAbsolute

DrawPathLineToVerticalAbsolute() draws a vertical line path from the current point to the target point using absolute coordinates. The target point then becomes the new current point.

@@ -2141,7 +2197,7 @@ border color.
-

DrawPathLineToVerticalRelative

+

DrawPathLineToVerticalRelative

DrawPathLineToVerticalRelative() draws a vertical line path from the current point to the target point using relative coordinates. The target point then becomes the new current point.

@@ -2167,7 +2223,7 @@ border color.
-

DrawPathMoveToAbsolute

+

DrawPathMoveToAbsolute

DrawPathMoveToAbsolute() starts a new sub-path at the given coordinate using absolute coordinates. The current point then becomes the specified coordinate.

@@ -2197,7 +2253,7 @@ border color.
-

DrawPathMoveToRelative

+

DrawPathMoveToRelative

DrawPathMoveToRelative() starts a new sub-path at the given coordinate using relative coordinates. The current point then becomes the specified coordinate.

@@ -2227,7 +2283,7 @@ border color.
-

DrawPathStart

+

DrawPathStart

DrawPathStart() declares the start of a path drawing list which is terminated by a matching DrawPathFinish() command. All other DrawPath commands must be enclosed between a DrawPathStart() and a DrawPathFinish() command. This is because path drawing commands are subordinate commands and they do not function by themselves.

@@ -2248,7 +2304,7 @@ border color.
-

DrawPoint

+

DrawPoint

DrawPoint() draws a point using the current fill color.

@@ -2277,7 +2333,7 @@ border color.
-

DrawPolygon

+

DrawPolygon

DrawPolygon() draws a polygon using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates.

@@ -2307,7 +2363,7 @@ border color.
-

DrawPolyline

+

DrawPolyline

DrawPolyline() draws a polyline using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates.

@@ -2337,7 +2393,7 @@ border color.
-

DrawPopClipPath

+

DrawPopClipPath

DrawPopClipPath() terminates a clip path definition.

@@ -2358,7 +2414,7 @@ border color.
-

DrawPopDefs

+

DrawPopDefs

DrawPopDefs() terminates a definition list.

@@ -2379,7 +2435,7 @@ border color.
-

DrawPopPattern

+

DrawPopPattern

DrawPopPattern() terminates a pattern definition.

@@ -2400,7 +2456,7 @@ border color.
-

DrawPushClipPath

+

DrawPushClipPath

DrawPushClipPath() starts a clip path definition which is comprized of any number of drawing commands and terminated by a DrawPopClipPath() command.

@@ -2425,7 +2481,7 @@ border color.
-

DrawPushDefs

+

DrawPushDefs

DrawPushDefs() indicates that commands up to a terminating DrawPopDefs() command create named elements (e.g. clip-paths, textures, etc.) which may safely be processed earlier for the sake of efficiency.

@@ -2446,7 +2502,7 @@ border color.
-

DrawPushPattern

+

DrawPushPattern

DrawPushPattern() indicates that subsequent commands up to a DrawPopPattern() command comprise the definition of a named pattern. The pattern space is assigned top left corner coordinates, a width and height, and becomes its own drawing space. Anything which can be drawn may be used in a pattern definition. Named patterns may be used as stroke or brush definitions.

@@ -2489,7 +2545,7 @@ border color.
-

DrawRectangle

+

DrawRectangle

DrawRectangle() draws a rectangle given two coordinates and using the current stroke, stroke width, and fill settings.

@@ -2523,7 +2579,7 @@ border color.
-

DrawResetVectorGraphics

+

DrawResetVectorGraphics

DrawResetVectorGraphics() resets the vector graphics associated with the specified wand.

@@ -2544,7 +2600,7 @@ border color.
-

DrawRotate

+

DrawRotate

DrawRotate() applies the specified rotation to the current coordinate space.

@@ -2569,7 +2625,7 @@ border color.
-

DrawRoundRectangle

+

DrawRoundRectangle

DrawRoundRectangle() draws a rounded rectangle given two coordinates, x & y corner radiuses and using the current stroke, stroke width, and fill settings.

@@ -2615,7 +2671,7 @@ border color.
-

DrawScale

+

DrawScale

DrawScale() adjusts the scaling factor to apply in the horizontal and vertical directions to the current coordinate space.

@@ -2644,7 +2700,7 @@ border color.
-

DrawSetBorderColor

+

DrawSetBorderColor

DrawSetBorderColor() sets the border color to be used for drawing bordered objects.

@@ -2669,7 +2725,7 @@ border color.
-

DrawSetClipPath

+

DrawSetClipPath

DrawSetClipPath() associates a named clipping path with the image. Only the areas drawn on by the clipping path will be modified as ssize_t as it remains in effect.

@@ -2695,7 +2751,7 @@ border color.
-

DrawSetClipRule

+

DrawSetClipRule

DrawSetClipRule() set the polygon fill rule to be used by the clipping path.

@@ -2720,7 +2776,7 @@ border color.
-

DrawSetClipUnits

+

DrawSetClipUnits

DrawSetClipUnits() sets the interpretation of clip path units.

@@ -2746,7 +2802,7 @@ border color.
-

DrawSetDensity

+

DrawSetDensity

DrawSetDensity() sets the vertical and horizontal resolution.

@@ -2772,7 +2828,7 @@ border color.
-

DrawSetFillColor

+

DrawSetFillColor

DrawSetFillColor() sets the fill color to be used for drawing filled objects.

@@ -2797,7 +2853,7 @@ border color.
-

DrawSetFillOpacity

+

DrawSetFillOpacity

DrawSetFillOpacity() sets the opacity to use when drawing using the fill color or fill texture. Fully opaque is 1.0.

@@ -2822,7 +2878,7 @@ border color.
-

DrawSetFontResolution

+

DrawSetFontResolution

DrawSetFontResolution() sets the image resolution.

@@ -2852,7 +2908,7 @@ border color.
-

DrawSetOpacity

+

DrawSetOpacity

DrawSetOpacity() sets the opacity to use when drawing using the fill or stroke color or texture. Fully opaque is 1.0.

@@ -2877,7 +2933,7 @@ border color.
-

DrawSetFillPatternURL

+

DrawSetFillPatternURL

DrawSetFillPatternURL() sets the URL to use as a fill pattern for filling objects. Only local URLs ("#identifier") are supported at this time. These local URLs are normally created by defining a named fill pattern with DrawPushPattern/DrawPopPattern.

@@ -2903,7 +2959,7 @@ border color.
-

DrawSetFillRule

+

DrawSetFillRule

DrawSetFillRule() sets the fill rule to use while drawing polygons.

@@ -2928,7 +2984,7 @@ border color.
-

DrawSetFont

+

DrawSetFont

DrawSetFont() sets the fully-specified font to use when annotating with text.

@@ -2953,7 +3009,7 @@ border color.
-

DrawSetFontFamily

+

DrawSetFontFamily

DrawSetFontFamily() sets the font family to use when annotating with text.

@@ -2979,7 +3035,7 @@ border color.
-

DrawSetFontSize

+

DrawSetFontSize

DrawSetFontSize() sets the font pointsize to use when annotating with text.

@@ -3004,7 +3060,7 @@ border color.
-

DrawSetFontStretch

+

DrawSetFontStretch

DrawSetFontStretch() sets the font stretch to use when annotating with text. The AnyStretch enumeration acts as a wild-card "don't care" option.

@@ -3030,7 +3086,7 @@ border color.
-

DrawSetFontStyle

+

DrawSetFontStyle

DrawSetFontStyle() sets the font style to use when annotating with text. The AnyStyle enumeration acts as a wild-card "don't care" option.

@@ -3055,7 +3111,7 @@ border color.
-

DrawSetFontWeight

+

DrawSetFontWeight

DrawSetFontWeight() sets the font weight to use when annotating with text.

@@ -3081,7 +3137,7 @@ border color.
-

DrawSetGravity

+

DrawSetGravity

DrawSetGravity() sets the text placement gravity to use when annotating with text.

@@ -3106,7 +3162,7 @@ border color.
-

DrawSetStrokeColor

+

DrawSetStrokeColor

DrawSetStrokeColor() sets the color used for stroking object outlines.

@@ -3132,7 +3188,7 @@ border color.
-

DrawSetStrokePatternURL

+

DrawSetStrokePatternURL

DrawSetStrokePatternURL() sets the pattern used for stroking object outlines.

@@ -3158,7 +3214,7 @@ border color.
-

DrawSetStrokeAntialias

+

DrawSetStrokeAntialias

DrawSetStrokeAntialias() controls whether stroked outlines are antialiased. Stroked outlines are antialiased by default. When antialiasing is disabled stroked pixels are thresholded to determine if the stroke color or underlying canvas color should be used.

@@ -3184,7 +3240,7 @@ border color.
-

DrawSetStrokeDashArray

+

DrawSetStrokeDashArray

DrawSetStrokeDashArray() specifies the pattern of dashes and gaps used to stroke paths. The stroke dash array represents an array of numbers that specify the lengths of alternating dashes and gaps in pixels. If an odd number of values is provided, then the list of values is repeated to yield an even number of values. To remove an existing dash array, pass a zero number_elements argument and null dasharray. A typical stroke dash array might contain the members 5 3 2.

@@ -3214,7 +3270,7 @@ border color.
-

DrawSetStrokeDashOffset

+

DrawSetStrokeDashOffset

DrawSetStrokeDashOffset() specifies the offset into the dash pattern to start the dash.

@@ -3240,7 +3296,7 @@ border color.
-

DrawSetStrokeLineCap

+

DrawSetStrokeLineCap

DrawSetStrokeLineCap() specifies the shape to be used at the end of open subpaths when they are stroked. Values of LineCap are UndefinedCap, ButtCap, RoundCap, and SquareCap.

@@ -3266,7 +3322,7 @@ border color.
-

DrawSetStrokeLineJoin

+

DrawSetStrokeLineJoin

DrawSetStrokeLineJoin() specifies the shape to be used at the corners of paths (or other vector shapes) when they are stroked. Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.

@@ -3292,7 +3348,7 @@ border color.
-

DrawSetStrokeMiterLimit

+

DrawSetStrokeMiterLimit

DrawSetStrokeMiterLimit() specifies the miter limit. When two line segments meet at a sharp angle and miter joins have been specified for 'lineJoin', it is possible for the miter to extend far beyond the thickness of the line stroking the path. The miterLimit' imposes a limit on the ratio of the miter length to the 'lineWidth'.

@@ -3318,7 +3374,7 @@ border color.
-

DrawSetStrokeOpacity

+

DrawSetStrokeOpacity

DrawSetStrokeOpacity() specifies the opacity of stroked object outlines.

@@ -3344,7 +3400,7 @@ border color.
-

DrawSetStrokeWidth

+

DrawSetStrokeWidth

DrawSetStrokeWidth() sets the width of the stroke used to draw object outlines.

@@ -3370,7 +3426,7 @@ border color.
-

DrawSetTextAlignment

+

DrawSetTextAlignment

DrawSetTextAlignment() specifies a text alignment to be applied when annotating with text.

@@ -3395,7 +3451,7 @@ border color.
-

DrawSetTextAntialias

+

DrawSetTextAntialias

DrawSetTextAntialias() controls whether text is antialiased. Text is antialiased by default.

@@ -3421,7 +3477,7 @@ border color.
-

DrawSetTextDecoration

+

DrawSetTextDecoration

DrawSetTextDecoration() specifies a decoration to be applied when annotating with text.

@@ -3447,7 +3503,7 @@ border color.
-

DrawSetTextDirection

+

DrawSetTextDirection

DrawSetTextDirection() specifies the direction to be used when annotating with text.

@@ -3473,7 +3529,7 @@ border color.
-

DrawSetTextEncoding

+

DrawSetTextEncoding

DrawSetTextEncoding() specifies the code set to use for text annotations. The only character encoding which may be specified at this time is "UTF-8" for representing Unicode as a sequence of bytes. Specify an empty string to set text encoding to the system's default. Successful text annotation using Unicode may require fonts designed to support Unicode.

@@ -3498,7 +3554,7 @@ border color.
-

DrawSetTextKerning

+

DrawSetTextKerning

DrawSetTextKerning() sets the spacing between characters in text.

@@ -3523,7 +3579,7 @@ border color.
-

DrawSetTextInterlineSpacing

+

DrawSetTextInterlineSpacing

DrawSetTextInterlineSpacing() sets the spacing between line in text.

@@ -3549,7 +3605,7 @@ border color.
-

DrawSetTextInterwordSpacing

+

DrawSetTextInterwordSpacing

DrawSetTextInterwordSpacing() sets the spacing between words in text.

@@ -3575,7 +3631,7 @@ border color.
-

DrawSetTextUnderColor

+

DrawSetTextUnderColor

DrawSetTextUnderColor() specifies the color of a background rectangle to place under text annotations.

@@ -3601,7 +3657,7 @@ border color.
-

DrawSetVectorGraphics

+

DrawSetVectorGraphics

DrawSetVectorGraphics() sets the vector graphics associated with the specified wand. Use this method with DrawGetVectorGraphics() as a method to persist the vector graphics state.

@@ -3627,7 +3683,7 @@ border color.
-

DrawSkewX

+

DrawSkewX

DrawSkewX() skews the current coordinate system in the horizontal direction.

@@ -3652,7 +3708,7 @@ border color.
-

DrawSkewY

+

DrawSkewY

DrawSkewY() skews the current coordinate system in the vertical direction.

@@ -3677,7 +3733,7 @@ border color.
-

DrawTranslate

+

DrawTranslate

DrawTranslate() applies a translation to the current coordinate system which moves the coordinate system origin to the specified coordinate.

@@ -3707,7 +3763,7 @@ border color.
-

DrawSetViewbox

+

DrawSetViewbox

DrawSetViewbox() sets the overall canvas size to be recorded with the drawing vector data. Usually this will be specified using the same size as the canvas image. When the vector data is saved to SVG or MVG formats, the viewbox is use to specify the size of the canvas image that a viewer will render the vector data on.

@@ -3745,7 +3801,7 @@ border color.
-

IsDrawingWand

+

IsDrawingWand

IsDrawingWand() returns MagickTrue if the wand is verified as a drawing wand.

@@ -3766,7 +3822,7 @@ border color.
-

NewDrawingWand

+

NewDrawingWand

NewDrawingWand() returns a drawing wand required for all other methods in the API.

@@ -3775,7 +3831,7 @@ border color.
DrawingWand *NewDrawingWand(void)
 
-

PeekDrawingWand

+

PeekDrawingWand

PeekDrawingWand() returns the current drawing wand.

@@ -3796,7 +3852,7 @@ border color.
-

PopDrawingWand

+

PopDrawingWand

PopDrawingWand() destroys the current drawing wand and returns to the previously pushed drawing wand. Multiple drawing wands may exist. It is an error to attempt to pop more drawing wands than have been pushed, and it is proper form to pop all drawing wands which have been pushed.

@@ -3817,7 +3873,7 @@ border color.
-

PushDrawingWand

+

PushDrawingWand

PushDrawingWand() clones the current drawing wand to create a new drawing wand. The original drawing wand(s) may be returned to by invoking PopDrawingWand(). The drawing wands are stored on a drawing wand stack. For every Pop there must have already been an equivalent Push.

@@ -3841,12 +3897,12 @@ border color.
-
- + diff --git a/www/api/effect.html b/www/api/effect.html index 16bd9659a3e88e8ab97d62724041d957a86e74f9..205d7a70137cb694e00b25f92e1ef894b99aab93 100644 --- a/www/api/effect.html +++ b/www/api/effect.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Add an Effect + ImageMagick – MagickCore, C API: Add an Effect - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Add an Effect

+
+
-
-
+

Effect



-

AdaptiveBlurImage

+

AdaptiveBlurImage

AdaptiveBlurImage() adaptively blurs the image by blurring less intensely near image edges and more intensely far from edges. We blur the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and AdaptiveBlurImage() selects a suitable radius for you.

@@ -156,7 +212,7 @@ Image *AdaptiveBlurImageChannel(const Image *image,
-

AdaptiveSharpenImage

+

AdaptiveSharpenImage

AdaptiveSharpenImage() adaptively sharpens the image by sharpening more intensely near image edges and less intensely far from edges. We sharpen the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and AdaptiveSharpenImage() selects a suitable radius for you.

@@ -197,7 +253,7 @@ Image *AdaptiveSharpenImageChannel(const Image *image,
-

BlurImage

+

BlurImage

BlurImage() blurs an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and BlurImage() selects a suitable radius for you.

@@ -237,7 +293,7 @@ Image *BlurImageChannel(const Image *image,const ChannelType channel,
-

ConvolveImage

+

ConvolveImage

ConvolveImage() applies a custom convolution kernel to the image.

@@ -277,7 +333,7 @@ Image *ConvolveImageChannel(const Image *image,const ChannelType channel,
-

DespeckleImage

+

DespeckleImage

DespeckleImage() reduces the speckle noise in an image while preserving the edges of the original image. A speckle removing filter uses a complementary hulling technique (raising pixels that are darker than their surrounding neighbors, then complementarily lowering pixels that are brighter than their surrounding neighbors) to reduce the speckle index of that image (reference Crimmins speckle removal).

@@ -302,7 +358,7 @@ Image *ConvolveImageChannel(const Image *image,const ChannelType channel,
-

EdgeImage

+

EdgeImage

EdgeImage() finds edges in an image. Radius defines the radius of the convolution filter. Use a radius of 0 and EdgeImage() selects a suitable radius for you.

@@ -332,7 +388,7 @@ Image *ConvolveImageChannel(const Image *image,const ChannelType channel,
-

EmbossImage

+

EmbossImage

EmbossImage() returns a grayscale image with a three-dimensional effect. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and Emboss() selects a suitable radius for you.

@@ -366,7 +422,7 @@ Image *ConvolveImageChannel(const Image *image,const ChannelType channel,
-

FilterImage

+

FilterImage

FilterImage() applies a custom convolution kernel to the image.

@@ -402,7 +458,7 @@ Image *FilterImageChannel(const Image *image,const ChannelType channel,
-

GaussianBlurImage

+

GaussianBlurImage

GaussianBlurImage() blurs an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and GaussianBlurImage() selects a suitable radius for you.

@@ -443,7 +499,7 @@ Image *GaussianBlurImageChannel(const Image *image,
-

MotionBlurImage

+

MotionBlurImage

MotionBlurImage() simulates motion blur. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and MotionBlurImage() selects a suitable radius for you. Angle gives the angle of the blurring motion.

@@ -490,7 +546,7 @@ ExceptionInfo *exception)
-

KuwaharaImage

+

KuwaharaImage

KuwaharaImage() is an edge preserving noise reduction filter.

@@ -530,7 +586,7 @@ Image *KuwaharaImageChannel(const Image *image,const ChannelType channel,
-

PreviewImage

+

PreviewImage

PreviewImage() tiles 9 thumbnails of the specified image with an image processing operation applied with varying parameters. This may be helpful pin-pointing an appropriate parameter for a particular image processing operation.

@@ -560,7 +616,7 @@ Image *KuwaharaImageChannel(const Image *image,const ChannelType channel,
-

RotationalBlurImage

+

RotationalBlurImage

RotationalBlurImage() applies a rotational blur to the image.

@@ -598,7 +654,7 @@ const ChannelType channel,const double angle,ExceptionInfo *exception)
-

SelectiveBlurImage

+

SelectiveBlurImage

SelectiveBlurImage() selectively blur pixels within a contrast threshold. It is similar to the unsharpen mask that sharpens everything with contrast above a certain threshold.

@@ -643,7 +699,7 @@ Image *SelectiveBlurImageChannel(const Image *image,
-

ShadeImage

+

ShadeImage

ShadeImage() shines a distant light on an image to create a three-dimensional effect. You control the positioning of the light with azimuth and elevation; azimuth is measured in degrees off the x axis and elevation is measured in pixels above the Z axis.

@@ -677,7 +733,7 @@ Image *SelectiveBlurImageChannel(const Image *image,
-

SharpenImage

+

SharpenImage

SharpenImage() sharpens the image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and SharpenImage() selects a suitable radius for you.

@@ -719,7 +775,7 @@ const double radius,const double sigma,ExceptionInfo *exception)
-

SpreadImage

+

SpreadImage

SpreadImage() is a special effects method that randomly displaces each pixel in a block defined by the radius parameter.

@@ -749,7 +805,7 @@ const double radius,const double sigma,ExceptionInfo *exception)
-

UnsharpMaskImage

+

UnsharpMaskImage

UnsharpMaskImage() sharpens one or more image channels. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and UnsharpMaskImage() selects a suitable radius for you.

@@ -802,12 +858,12 @@ const double gain,const double threshold,ExceptionInfo *exception)
-
+
SecurityNews - And Now a Touch of Magick + And Now a Touch of Magick RelatedSitemap @@ -823,8 +879,9 @@ const double gain,const double threshold,ExceptionInfo *exception) Copyright © 1999 ImageMagick Studio LLC
+
- + diff --git a/www/api/enhance.html b/www/api/enhance.html index c849ee448114adbb85ca0f3d5a5a988206b38269..9976a81df3491f0a58c7ff7ddefe3cf47873a8eb 100644 --- a/www/api/enhance.html +++ b/www/api/enhance.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Enhance an Image + ImageMagick – MagickCore, C API: Enhance an Image - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Enhance an Image

+
+
-
-
+

Enhance



-

AutoGammaImage

+

AutoGammaImage

AutoGammaImage() extract the 'mean' from the image and adjust the image to try make set its gamma appropriatally.

@@ -145,7 +201,7 @@ MagickBooleanType AutoGammaImageChannel(Image *image,
-

AutoLevelImage

+

AutoLevelImage

AutoLevelImage() adjusts the levels of a particular image channel by scaling the minimum and maximum values to the full quantum range.

@@ -172,7 +228,7 @@ MagickBooleanType AutoLevelImageChannel(Image *image,
-

BrightnessContrastImage

+

BrightnessContrastImage

BrightnessContrastImage() changes the brightness and/or contrast of an image. It converts the brightness and contrast parameters into slope and intercept and calls a polynomial function to apply to the image.

@@ -209,7 +265,7 @@ MagickBooleanType BrightnessContrastImageChannel(Image *image,
-

ColorDecisionListImage

+

ColorDecisionListImage

ColorDecisionListImage() accepts a lightweight Color Correction Collection (CCC) file which solely contains one or more color corrections and applies the correction to the image. Here is a sample CCC file:

@@ -251,7 +307,7 @@ MagickBooleanType BrightnessContrastImageChannel(Image *image,
-

ClutImage

+

ClutImage

ClutImage() replaces each color value in the given image, by using it as an index to lookup a replacement color value in a Color Look UP Table in the form of an image. The values are extracted along a diagonal of the CLUT image so either a horizontal or vertical gradient image can be used.

@@ -286,7 +342,7 @@ MagickBooleanType ClutImageChannel(Image *image,
-

ContrastImage

+

ContrastImage

ContrastImage() enhances the intensity differences between the lighter and darker elements of the image. Set sharpen to a MagickTrue to increase the image contrast otherwise the contrast is reduced.

@@ -312,7 +368,7 @@ MagickBooleanType ClutImageChannel(Image *image,
-

ContrastStretchImage

+

ContrastStretchImage

ContrastStretchImage() is a simple image enhancement technique that attempts to improve the contrast in an image by `stretching' the range of intensity values it contains to span a desired range of values. It differs from the more sophisticated histogram equalization in that it can only apply a linear scaling function to the image pixel values. As a result the `enhancement' is less harsh.

@@ -353,7 +409,7 @@ MagickBooleanType ContrastStretchImageChannel(Image *image,
-

EnhanceImage

+

EnhanceImage

EnhanceImage() applies a digital filter that improves the quality of a noisy image.

@@ -378,7 +434,7 @@ MagickBooleanType ContrastStretchImageChannel(Image *image,
-

EqualizeImage

+

EqualizeImage

EqualizeImage() applies a histogram equalization to the image.

@@ -405,7 +461,7 @@ MagickBooleanType EqualizeImageChannel(Image *image,
-

GammaImage

+

GammaImage

GammaImage() gamma-corrects a particular image channel. The same image viewed on different devices will have perceptual differences in the way the image's intensities are represented on the screen. Specify individual gamma levels for the red, green, and blue channels, or adjust all three with the gamma parameter. Values typically range from 0.8 to 2.3.

@@ -442,7 +498,7 @@ MagickBooleanType GammaImageChannel(Image *image,
-

GrayscaleImage

+

GrayscaleImage

GrayscaleImage() converts the colors in the reference image to gray.

@@ -468,7 +524,7 @@ MagickBooleanType GammaImageChannel(Image *image,
-

HaldClutImage

+

HaldClutImage

HaldClutImage() applies a Hald color lookup table to the image. A Hald color lookup table is a 3-dimensional color cube mapped to 2 dimensions. Create it with the HALD coder. You can apply any color transformation to the Hald image and then use this method to apply the transform to the image.

@@ -499,7 +555,7 @@ MagickBooleanType HaldClutImageChannel(Image *image,
-

LevelImage

+

LevelImage

LevelImage() adjusts the levels of a particular image channel by scaling the colors falling between specified white and black points to the full available quantum range.

@@ -530,7 +586,7 @@ MagickBooleanType HaldClutImageChannel(Image *image,
-

LevelImage

+

LevelImage

LevelImage() applies the normal level operation to the image, spreading out the values between the black and white points over the entire range of values. Gamma correction is also applied after the values has been mapped.

@@ -573,7 +629,7 @@ MagickBooleanType LevelImageChannel(Image *image,
-

LevelizeImageChannel

+

LevelizeImageChannel

LevelizeImageChannel() applies the reversed LevelImage() operation to just the specific channels specified. It compresses the full range of color values, so that they lie between the given black and white points. Gamma is applied before the values are mapped.

@@ -615,7 +671,7 @@ MagickBooleanType LevelImageChannel(Image *image,
-

LevelImageColor

+

LevelImageColor

LevelImageColor() maps the given color to "black" and "white" values, linearly spreading out the colors, and level values on a channel by channel bases, as per LevelImage(). The given colors allows you to specify different level ranges for each of the color channels separately.

@@ -659,7 +715,7 @@ const MagickPixelPacket *white_color,const MagickBooleanType invert)
-

LinearStretchImage

+

LinearStretchImage

LinearStretchImage() discards any pixels below the black point and above the white point and levels the remaining pixels.

@@ -689,7 +745,7 @@ const MagickPixelPacket *white_color,const MagickBooleanType invert)
-

ModulateImage

+

ModulateImage

ModulateImage() lets you control the brightness, saturation, and hue of an image. Modulate represents the brightness, saturation, and hue as one parameter (e.g. 90,150,100). If the image colorspace is HSL, the modulation is lightness, saturation, and hue. For HWB, use blackness, whiteness, and hue. And for HCL, use chrome, luma, and hue.

@@ -714,7 +770,7 @@ const MagickPixelPacket *white_color,const MagickBooleanType invert)
-

NegateImage

+

NegateImage

NegateImage() negates the colors in the reference image. The grayscale option means that only grayscale values within the image are negated.

@@ -746,7 +802,7 @@ MagickBooleanType NegateImageChannel(Image *image,
-

The NormalizeImage

+

The NormalizeImage

The NormalizeImage() method enhances the contrast of a color image by mapping the darkest 2 percent of all pixel to black and the brightest 1 percent to white.

@@ -773,7 +829,7 @@ MagickBooleanType NormalizeImageChannel(Image *image,
-

SigmoidalContrastImage

+

SigmoidalContrastImage

SigmoidalContrastImage() adjusts the contrast of an image with a non-linear sigmoidal contrast algorithm. Increase the contrast of the image using a sigmoidal transfer function without saturating highlights or shadows. Contrast indicates how much to increase the contrast (0 is none; 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in the resultant image (0 is white; 50 is middle-gray; 100 is black). Set sharpen to MagickTrue to increase the image contrast otherwise the contrast is reduced.

@@ -817,12 +873,12 @@ MagickBooleanType SigmoidalContrastImageChannel(Image *image,
-
+
SecurityNews - And Now a Touch of Magick + And Now a Touch of Magick RelatedSitemap @@ -838,8 +894,9 @@ MagickBooleanType SigmoidalContrastImageChannel(Image *image, Copyright © 1999 ImageMagick Studio LLC
+
- + diff --git a/www/api/exception.html b/www/api/exception.html index 32d53251c98a4e298ae5fe887b4146a56201cbfa..2e377a04ec3522089294b4ec9a4ecad14ef16a39 100644 --- a/www/api/exception.html +++ b/www/api/exception.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Dealing with Exceptions + ImageMagick – MagickCore, C API: Dealing with Exceptions - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Dealing with Exceptions

+
+
-
-
+

Exception



-

AcquireExceptionInfo

+

AcquireExceptionInfo

AcquireExceptionInfo() allocates the ExceptionInfo structure.

@@ -122,7 +178,7 @@
ExceptionInfo *AcquireExceptionInfo(void)
 
-

ClearMagickException

+

ClearMagickException

ClearMagickException() clears any exception that may not have been caught yet.

@@ -143,7 +199,7 @@
-

CatchException

+

CatchException

CatchException() returns if no exceptions is found otherwise it reports the exception as a warning, error, or fatal depending on the severity.

@@ -164,7 +220,7 @@
-

CloneExceptionInfo

+

CloneExceptionInfo

CloneExceptionInfo() clones the ExceptionInfo structure.

@@ -185,7 +241,7 @@
-

DestroyExceptionInfo

+

DestroyExceptionInfo

DestroyExceptionInfo() deallocates memory associated with an exception.

@@ -206,7 +262,7 @@
-

GetExceptionMessage

+

GetExceptionMessage

GetExceptionMessage() returns the error message defined by the specified error code.

@@ -227,7 +283,7 @@
-

GetLocaleExceptionMessage

+

GetLocaleExceptionMessage

GetLocaleExceptionMessage() converts a enumerated exception severity and tag to a message in the current locale.

@@ -253,7 +309,7 @@
-

InheritException

+

InheritException

InheritException() inherits an exception from a related exception.

@@ -278,7 +334,7 @@
-

InitializeExceptionInfo

+

InitializeExceptionInfo

InitializeExceptionInfo() initializes an exception to default values.

@@ -299,7 +355,7 @@
-

MagickError

+

MagickError

MagickError() calls the exception handler methods with an error reason.

@@ -329,7 +385,7 @@
-

MagickFatalError

+

MagickFatalError

MagickFatalError() calls the fatal exception handler methods with an error reason.

@@ -359,7 +415,7 @@
-

MagickWarning

+

MagickWarning

MagickWarning() calls the warning handler methods with a warning reason.

@@ -389,7 +445,7 @@
-

SetErrorHandler

+

SetErrorHandler

SetErrorHandler() sets the exception handler to the specified method and returns the previous exception handler.

@@ -410,7 +466,7 @@
-

SetFatalErrorHandler

+

SetFatalErrorHandler

SetFatalErrorHandler() sets the fatal exception handler to the specified method and returns the previous fatal exception handler.

@@ -431,7 +487,7 @@
-

SetWarningHandler

+

SetWarningHandler

SetWarningHandler() sets the warning handler to the specified method and returns the previous warning handler.

@@ -452,7 +508,7 @@
-

ThrowException

+

ThrowException

ThrowException() throws an exception with the specified severity code, reason, and optional description.

@@ -490,12 +546,12 @@
-
- + diff --git a/www/api/feature.html b/www/api/feature.html index 19285abe90661bb73a79c1c235cdf2ab9fa35b12..197b98ca7fee686b8bff5e01b4f95de4c0ef2257 100644 --- a/www/api/feature.html +++ b/www/api/feature.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Image Features + ImageMagick – MagickCore, C API: Image Features - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Image Features

+
+
-
-
+

Feature



-

CannyEdgeImage

+

CannyEdgeImage

CannyEdgeImage() uses a multi-stage algorithm to detect a wide range of edges in images.

@@ -144,7 +200,7 @@
-

GetImageChannelFeatures

+

GetImageChannelFeatures

GetImageChannelFeatures() returns features for each channel in the image in each of four directions (horizontal, vertical, left and right diagonals) for the specified distance. The features include the angular second moment, contrast, correlation, sum of squares: variance, inverse difference moment, sum average, sum varience, sum entropy, entropy, difference variance, difference entropy, information measures of correlation 1, information measures of correlation 2, and maximum correlation coefficient. You can access the red channel contrast, for example, like this:

@@ -180,7 +236,7 @@ contrast=channel_features[RedChannel].contrast[0];
-

Use HoughLineImage

+

Use HoughLineImage

Use HoughLineImage() in conjunction with any binary edge extracted image (we recommand Canny) to identify lines in the image. The algorithm accumulates counts for every white pixel for every possible orientation (for angles from 0 to 179 in 1 degree increments) and distance from the center of the image to the corner (in 1 px increments) and stores the counts in an accumulator matrix of angle vs distance. The size of the accumulator is 180x(diagonal/2). Next it searches this space for peaks in counts and converts the locations of the peaks to slope and intercept in the normal x,y input image space. Use the slope/intercepts to find the endpoints clipped to the bounds of the image. The lines are then drawn. The counts are a measure of the length of the lines.

@@ -214,7 +270,7 @@ contrast=channel_features[RedChannel].contrast[0];
-

MeanShiftImage

+

MeanShiftImage

MeanShiftImage() delineate arbitrarily shaped clusters in the image. For each pixel, it visits all the pixels in the neighborhood specified by the window centered at the pixel and excludes those that are outside the radius=(window-1)/2 surrounding the pixel. From those pixels, it finds those that are within the specified color distance from the current mean, and computes a new x,y centroid from those coordinates and a new mean. This new x,y centroid is used as the center for a new window. This process iterates until it converges and the final mean is replaces the (original window center) pixel value. It repeats this process for the next pixel, etc., until it processes all pixels in the image. Results are typically better with colorspaces other than sRGB. We recommend YIQ, YUV or YCbCr.

@@ -252,12 +308,12 @@ contrast=channel_features[RedChannel].contrast[0];
-
+
SecurityNews - And Now a Touch of Magick + And Now a Touch of Magick RelatedSitemap @@ -273,8 +329,9 @@ contrast=channel_features[RedChannel].contrast[0]; Copyright © 1999 ImageMagick Studio LLC
+
- + diff --git a/www/api/fourier.html b/www/api/fourier.html index 7ed60f900df562be296fa0d65825c4577f99c65d..3c0cebe91234aaf893db5ffa7d304a7b8c066b85 100644 --- a/www/api/fourier.html +++ b/www/api/fourier.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Fourier Transform + ImageMagick – MagickCore, C API: Fourier Transform - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Fourier Transform

+
+
-
-
+

Fourier



-

ComplexImages

+

ComplexImages

ComplexImages() performs complex mathematics on an image sequence.

@@ -130,7 +186,7 @@
-

ForwardFourierTransformImage

+

ForwardFourierTransformImage

ForwardFourierTransformImage() implements the discrete Fourier transform (DFT) of the image either as a magnitude / phase or real / imaginary image pair.

@@ -160,7 +216,7 @@
-

InverseFourierTransformImage

+

InverseFourierTransformImage

InverseFourierTransformImage() implements the inverse discrete Fourier transform (DFT) of the image either as a magnitude / phase or real / imaginary image pair.

@@ -198,12 +254,12 @@
-
- + diff --git a/www/api/fx.html b/www/api/fx.html index 5517f905caec939b29a780b57ad75b1bde3587ef..2a609ec4df3aec0bfaca2f6a25b882e67c1c3b4f 100644 --- a/www/api/fx.html +++ b/www/api/fx.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Add a Special Effect + ImageMagick – MagickCore, C API: Add a Special Effect - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Add a Special Effect

+
+
-
-
+

Fx

-
+
SecurityNews - And Now a Touch of Magick + And Now a Touch of Magick RelatedSitemap @@ -158,8 +214,9 @@ Image *FxImageChannel(const Image *image,const ChannelType channel, Copyright © 1999 ImageMagick Studio LLC
+
- + diff --git a/www/api/histogram.html b/www/api/histogram.html index e01c5dde611b5a21bd1bcae41f95362a60edca05..74143d50866b7ddee2b5f7c7573d51db6b536ff6 100644 --- a/www/api/histogram.html +++ b/www/api/histogram.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Image Histograms + ImageMagick – MagickCore, C API: Image Histograms - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Image Histograms

+
+
-
-
+

Histogram



-

GetImageHistogram

+

GetImageHistogram

GetImageHistogram() returns the unique colors in an image.

@@ -125,7 +181,7 @@
exception

return any errors or warnings in this structure.

-

IdentifyPaletteImage

+

IdentifyPaletteImage

IdentifyPaletteImage() returns MagickTrue if the image has 256 unique colors or less.

@@ -143,7 +199,7 @@
exception

return any errors or warnings in this structure.

-

IsHistogramImage

+

IsHistogramImage

IsHistogramImage() returns MagickTrue if the image has 1024 unique colors or less.

@@ -161,7 +217,7 @@
exception

return any errors or warnings in this structure.

-

IsPaletteImage

+

IsPaletteImage

IsPaletteImage() returns MagickTrue if the image is PseudoClass and has 256 unique colors or less.

@@ -179,7 +235,7 @@
exception

return any errors or warnings in this structure.

-

MinMaxStretchImage

+

MinMaxStretchImage

MinMaxStretchImage() uses the exact minimum and maximum values found in each of the channels given, as the BlackPoint and WhitePoint to linearly stretch the colors (and histogram) of the image. The stretch points are also moved further inward by the adjustment values given.

@@ -218,7 +274,7 @@
-

GetNumberColors

+

GetNumberColors

GetNumberColors() returns the number of unique colors in an image.

@@ -239,7 +295,7 @@
exception

return any errors or warnings in this structure.

-

UniqueImageColors

+

UniqueImageColors

UniqueImageColors() returns the unique colors of an image.

@@ -259,12 +315,12 @@
-
- + diff --git a/www/api/image-view.html b/www/api/image-view.html index b0f3d151b46f07cfb47c0bf70cf526adc2845083..6dcee259f8234ea3ca237b2b9949af88a051e75a 100644 --- a/www/api/image-view.html +++ b/www/api/image-view.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Image View Methods + ImageMagick – MagickCore, C API: Image View Methods - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Image View Methods

+
+
-
-
+

Image-view



-

CloneImageView

+

CloneImageView

CloneImageView() makes a copy of the specified image view.

@@ -137,7 +193,7 @@
-

DestroyImageView

+

DestroyImageView

DestroyImageView() deallocates memory associated with a image view.

@@ -158,7 +214,7 @@
-

DuplexTransferImageViewIterator

+

DuplexTransferImageViewIterator

DuplexTransferImageViewIterator() iterates over three image views in parallel and calls your transfer method for each scanline of the view. The source and duplex pixel extent is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension. However, the destination image view is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted.

@@ -211,7 +267,7 @@
-

GetImageViewAuthenticIndexes

+

GetImageViewAuthenticIndexes

GetImageViewAuthenticIndexes() returns the image view authentic indexes.

@@ -232,7 +288,7 @@
-

GetImageViewAuthenticPixels

+

GetImageViewAuthenticPixels

GetImageViewAuthenticPixels() returns the image view authentic pixels.

@@ -253,7 +309,7 @@
-

GetImageViewException

+

GetImageViewException

GetImageViewException() returns the severity, reason, and description of any error that occurs when utilizing a image view.

@@ -279,7 +335,7 @@
-

GetImageViewExtent

+

GetImageViewExtent

GetImageViewExtent() returns the image view extent.

@@ -300,7 +356,7 @@
-

GetImageViewImage

+

GetImageViewImage

GetImageViewImage() returns the image associated with the image view.

@@ -321,7 +377,7 @@
-

GetImageViewIterator

+

GetImageViewIterator

GetImageViewIterator() iterates over the image view in parallel and calls your get method for each scanline of the view. The pixel extent is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension. Any updates to the pixels in your callback are ignored.

@@ -364,7 +420,7 @@
-

GetImageViewVirtualIndexes

+

GetImageViewVirtualIndexes

GetImageViewVirtualIndexes() returns the image view virtual indexes.

@@ -386,7 +442,7 @@
-

GetImageViewVirtualPixels

+

GetImageViewVirtualPixels

GetImageViewVirtualPixels() returns the image view virtual pixels.

@@ -407,7 +463,7 @@
-

IsImageView

+

IsImageView

IsImageView() returns MagickTrue if the parameter is verified as a image view object.

@@ -428,7 +484,7 @@
-

NewImageView

+

NewImageView

NewImageView() returns a image view required for all other methods in the Image View API.

@@ -449,7 +505,7 @@
-

NewImageViewRegion

+

NewImageViewRegion

NewImageViewRegion() returns a image view required for all other methods in the Image View API.

@@ -475,7 +531,7 @@
-

SetImageViewDescription

+

SetImageViewDescription

SetImageViewDescription() associates a description with an image view.

@@ -501,7 +557,7 @@
-

SetImageViewIterator

+

SetImageViewIterator

SetImageViewIterator() iterates over the image view in parallel and calls your set method for each scanline of the view. The pixel extent is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension. The pixels are initially undefined and any settings you make in the callback method are automagically synced back to your image.

@@ -544,7 +600,7 @@
-

SetImageViewThreads

+

SetImageViewThreads

SetImageViewThreads() sets the number of threads in a thread team.

@@ -570,7 +626,7 @@
-

TransferImageViewIterator

+

TransferImageViewIterator

TransferImageViewIterator() iterates over two image views in parallel and calls your transfer method for each scanline of the view. The source pixel extent is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension. However, the destination image view is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted.

@@ -618,7 +674,7 @@
-

UpdateImageViewIterator

+

UpdateImageViewIterator

UpdateImageViewIterator() iterates over the image view in parallel and calls your update method for each scanline of the view. The pixel extent is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted. Updates to pixels in your callback are automagically synced back to the image.

@@ -664,12 +720,12 @@
-
- + diff --git a/www/api/image.html b/www/api/image.html index 23609c2246a88c56918fca49d27e417cdbe170d4..9b4eb52b6a957b30ff726e9bf8e16d8d0719823f 100644 --- a/www/api/image.html +++ b/www/api/image.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Image Methods + ImageMagick – MagickCore, C API: Image Methods - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Image Methods

+
+
-
-
+

Image



-

AcquireImage

+

AcquireImage

AcquireImage() returns a pointer to an image structure initialized to default values.

@@ -159,7 +215,7 @@
-

AcquireImageInfo

+

AcquireImageInfo

AcquireImageInfo() allocates the ImageInfo structure.

@@ -168,7 +224,7 @@
ImageInfo *AcquireImageInfo(void)
 
-

AcquireNextImage

+

AcquireNextImage

AcquireNextImage() initializes the next image in a sequence to default values. The next member of image points to the newly allocated image. If there is a memory shortage, next is assigned NULL.

@@ -193,7 +249,7 @@
-

AppendImages

+

AppendImages

AppendImages() takes all images from the current image pointer to the end of the image list and appends them to each other top-to-bottom if the stack parameter is true, otherwise left-to-right.

@@ -225,7 +281,7 @@
-

CatchImageException

+

CatchImageException

CatchImageException() returns if no exceptions are found in the image sequence, otherwise it determines the most severe exception and reports it as a warning or error depending on the severity.

@@ -246,7 +302,7 @@
-

ClipImagePath

+

ClipImagePath

ClipImagePath() sets the image clip mask based any clipping path information if it exists.

@@ -276,7 +332,7 @@
-

CloneImage

+

CloneImage

CloneImage() copies an image and returns the copy as a new image object.

@@ -317,7 +373,7 @@
-

CloneImageInfo

+

CloneImageInfo

CloneImageInfo() makes a copy of the given image info structure. If NULL is specified, a new image info structure is created initialized to default values.

@@ -338,7 +394,7 @@
-

CopyImagePixels

+

CopyImagePixels

CopyImagePixels() copies pixels from the source image as defined by the geometry the destination image at the specified offset.

@@ -377,7 +433,7 @@
-

DestroyImage

+

DestroyImage

DestroyImage() dereferences an image, deallocating memory associated with the image if the reference count becomes zero.

@@ -398,7 +454,7 @@
-

DestroyImageInfo

+

DestroyImageInfo

DestroyImageInfo() deallocates memory associated with an ImageInfo structure.

@@ -419,7 +475,7 @@
-

GetImageClipMask

+

GetImageClipMask

GetImageClipMask() returns the clip path associated with the image.

@@ -440,7 +496,7 @@
-

GetImageException

+

GetImageException

GetImageException() traverses an image sequence and returns any error more severe than noted by the exception parameter.

@@ -465,7 +521,7 @@
-

GetImageInfo

+

GetImageInfo

GetImageInfo() initializes image_info to default values.

@@ -486,7 +542,7 @@
-

GetImageInfoFile

+

GetImageInfoFile

GetImageInfoFile() returns the image info file member.

@@ -507,7 +563,7 @@
-

GetImageMask

+

GetImageMask

GetImageMask() returns the mask associated with the image.

@@ -528,7 +584,7 @@
-

GetImageChannels

+

GetImageChannels

GetImageChannels() returns the number of pixel channels associated with the specified image.

@@ -549,7 +605,7 @@
-

GetImageVirtualPixelMethod

+

GetImageVirtualPixelMethod

GetImageVirtualPixelMethod() gets the "virtual pixels" method for the image. A virtual pixel is any pixel access that is outside the boundaries of the image cache.

@@ -570,7 +626,7 @@
-

InterpretImageFilename

+

InterpretImageFilename

InterpretImageFilename() interprets embedded characters in an image filename. The filename length is returned.

@@ -597,7 +653,7 @@
filename

return the formatted filename in this character buffer.

-

IsHighDynamicRangeImage

+

IsHighDynamicRangeImage

IsHighDynamicRangeImage() returns MagickTrue if any pixel component is non-integer or exceeds the bounds of the quantum depth (e.g. for Q16 0..65535.

@@ -623,7 +679,7 @@
-

IsImageObject

+

IsImageObject

IsImageObject() returns MagickTrue if the image sequence contains a valid set of image objects.

@@ -644,7 +700,7 @@
-

IsTaintImage

+

IsTaintImage

IsTaintImage() returns MagickTrue any pixel in the image has been altered since it was first constituted.

@@ -665,7 +721,7 @@
-

ModifyImage

+

ModifyImage

ModifyImage() ensures that there is only a single reference to the image to be modified, updating the provided image pointer to point to a clone of the original image if necessary.

@@ -690,7 +746,7 @@
-

NewMagickImage

+

NewMagickImage

NewMagickImage() creates a blank image canvas of the specified size and background color.

@@ -724,7 +780,7 @@
-

ReferenceImage

+

ReferenceImage

ReferenceImage() increments the reference count associated with an image returning a pointer to the image.

@@ -745,7 +801,7 @@
-

ResetImagePage

+

ResetImagePage

ResetImagePage() resets the image page canvas and position.

@@ -770,7 +826,7 @@
-

ResetImagePixels

+

ResetImagePixels

ResetImagePixels() reset the image pixels, that is, all the pixel components are zeroed.

@@ -796,7 +852,7 @@
-

SetImageBackgroundColor

+

SetImageBackgroundColor

SetImageBackgroundColor() initializes the image pixels to the image background color. The background color is defined by the background_color member of the image structure.

@@ -817,7 +873,7 @@
-

SetImageChannels

+

SetImageChannels

SetImageChannels() sets the number of pixels channels associated with the image.

@@ -842,7 +898,7 @@
-

SetImageColor

+

SetImageColor

SetImageColor() set the entire image canvas to the specified color.

@@ -868,7 +924,7 @@
-

SetImageStorageClass

+

SetImageStorageClass

SetImageStorageClass() sets the image class: DirectClass for true color images or PseudoClass for colormapped images.

@@ -894,7 +950,7 @@
-

SetImageClipMask

+

SetImageClipMask

SetImageClipMask() associates a clip path with the image. The clip path must be the same dimensions as the image. Set any pixel component of the clip path to TransparentOpacity to prevent that corresponding image pixel component from being updated when SyncAuthenticPixels() is applied.

@@ -919,7 +975,7 @@
-

SetImageExtent

+

SetImageExtent

SetImageExtent() sets the image size (i.e. columns & rows).

@@ -949,7 +1005,7 @@
-

SetImageInfoBlob

+

SetImageInfoBlob

SetImageInfoBlob() sets the image info blob member.

@@ -979,7 +1035,7 @@
-

SetImageInfoFile

+

SetImageInfoFile

SetImageInfoFile() sets the image info file member.

@@ -1004,7 +1060,7 @@
-

SetImageMask

+

SetImageMask

SetImageMask() associates a mask with the image. The mask must be the same dimensions as the image.

@@ -1029,7 +1085,7 @@
-

SetImageOpacity

+

SetImageOpacity

SetImageOpacity() sets the opacity levels of the image.

@@ -1054,7 +1110,7 @@
-

SetImageVirtualPixelMethod

+

SetImageVirtualPixelMethod

SetImageVirtualPixelMethod() sets the "virtual pixels" method for the image and returns the previous setting. A virtual pixel is any pixel access that is outside the boundaries of the image cache.

@@ -1080,7 +1136,7 @@
-

SmushImages

+

SmushImages

SmushImages() takes all images from the current image pointer to the end of the image list and smushes them to each other top-to-bottom if the stack parameter is true, otherwise left-to-right.

@@ -1116,7 +1172,7 @@
-

StripImage

+

StripImage

StripImage() strips an image of all profiles and comments.

@@ -1137,7 +1193,7 @@
-

SyncImageSettings

+

SyncImageSettings

SyncImageSettings() syncs image_info options into per-image attributes.

@@ -1168,12 +1224,12 @@ MagickBooleanType SyncImagesSettings(const ImageInfo *image_info,
-
+
SecurityNews - And Now a Touch of Magick + And Now a Touch of Magick RelatedSitemap @@ -1189,8 +1245,9 @@ MagickBooleanType SyncImagesSettings(const ImageInfo *image_info, Copyright © 1999 ImageMagick Studio LLC
+
- + diff --git a/www/api/layer.html b/www/api/layer.html index 9832d25efefbfb93da92a19f6d88808ad4978766..6f99c1ae1d6fb8d147cfa305fdf8ab7f46540a94 100644 --- a/www/api/layer.html +++ b/www/api/layer.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Dealing with Image Layers + ImageMagick – MagickCore, C API: Dealing with Image Layers - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Dealing with Image Layers

+
+
-
-
+

Layer



-

CoalesceImages

+

CoalesceImages

CoalesceImages() composites a set of images while respecting any page offsets and disposal methods. GIF, MIFF, and MNG animation sequences typically start with an image background and each subsequent image varies in size and offset. A new image sequence is returned with all images the same size as the first images virtual canvas and composited with the next image in the sequence.

@@ -133,7 +189,7 @@
-

DisposeImages

+

DisposeImages

DisposeImages() returns the coalesced frames of a GIF animation as it would appear after the GIF dispose method of that frame has been applied. That is it returned the appearance of each frame before the next is overlaid.

@@ -158,7 +214,7 @@
-

CompareImageLayers

+

CompareImageLayers

CompareImageLayers() compares each image with the next in a sequence and returns the minimum bounding region of all the pixel differences (of the ImageLayerMethod specified) it discovers.

@@ -192,7 +248,7 @@
-

DeconstructImages

+

DeconstructImages

DeconstructImages() compares each image with the next in a sequence and returns the minimum bounding region of all differences from the first image.

@@ -219,7 +275,7 @@
-

OptimizeImageLayers

+

OptimizeImageLayers

OptimizeImageLayers() compares each image the GIF disposed forms of the previous image in the sequence. From this it attempts to select the smallest cropped image to replace each frame, while preserving the results of the GIF animation.

@@ -245,7 +301,7 @@
-

OptimizeImagePlusLayers

+

OptimizeImagePlusLayers

OptimizeImagePlusLayers() is exactly as OptimizeImageLayers(), but may also add or even remove extra frames in the animation, if it improves the total number of pixels in the resulting GIF animation.

@@ -271,7 +327,7 @@
-

OptimizeImageTransparency

+

OptimizeImageTransparency

OptimizeImageTransparency() takes a frame optimized GIF animation, and compares the overlayed pixels against the disposal image resulting from all the previous frames in the animation. Any pixel that does not change the disposal image (and thus does not effect the outcome of an overlay) is made transparent.

@@ -298,7 +354,7 @@
-

RemoveDuplicateLayers

+

RemoveDuplicateLayers

RemoveDuplicateLayers() removes any image that is exactly the same as the next image in the given image list. Image size and virtual canvas offset must also match, though not the virtual canvas size itself.

@@ -325,7 +381,7 @@
-

RemoveZeroDelayLayers

+

RemoveZeroDelayLayers

RemoveZeroDelayLayers() removes any image that as a zero delay time. Such images generally represent intermediate or partial updates in GIF animations used for file optimization. They are not ment to be displayed to users of the animation. Viewable images in an animation should have a time delay of 3 or more centi-seconds (hundredths of a second).

@@ -356,7 +412,7 @@
-

CompositeLayers

+

CompositeLayers

CompositeLayers() compose the source image sequence over the destination image sequence, starting with the current image in both lists.

@@ -403,7 +459,7 @@
-

MergeImageLayers

+

MergeImageLayers

MergeImageLayers() composes all the image layers from the current given image onward to produce a single image of the merged layers.

@@ -448,12 +504,12 @@
-
- + diff --git a/www/api/list.html b/www/api/list.html index faf83017d2c7b0740d1cbd628a67ae7ebb0c6be9..fd1cea28a2b0234225a0a7dd42366285a8b65c6f 100644 --- a/www/api/list.html +++ b/www/api/list.html @@ -3,16 +3,17 @@ - + + - ImageMagick (legacy) – MagickCore, C API: Working with Image Lists + ImageMagick – MagickCore, C API: Working with Image Lists - + - - + + @@ -22,22 +23,85 @@ - - - + + + + + + - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + Color Modes + + + -
- - - - -
+
+
+ +

MagickCore, C API: Working with Image Lists

+
+
-
-
+

List



-

AppendImageToList

+

AppendImageToList

AppendImageToList() appends the second image list to the end of the first list. The given image list pointer is left unchanged, unless it was empty.

@@ -148,7 +204,7 @@
-

CloneImageList

+

CloneImageList

CloneImageList() returns a duplicate of the image list.

@@ -173,7 +229,7 @@
-

CloneImages

+

CloneImages

CloneImages() clones one or more images from an image sequence, using a comma separated list of image numbers or ranges.

@@ -207,7 +263,7 @@
-

DeleteImageFromList

+

DeleteImageFromList

DeleteImageFromList() deletes an image from the list. List pointer is moved to the next image, if one is present. See RemoveImageFromList().

@@ -228,7 +284,7 @@
-

DeleteImages

+

DeleteImages

DeleteImages() deletes one or more images from an image sequence, using a comma separated list of image numbers or ranges.

@@ -261,7 +317,7 @@
-

DestroyImageList

+

DestroyImageList

DestroyImageList() destroys an image list.

@@ -282,7 +338,7 @@
-

DuplicateImages

+

DuplicateImages

DuplicateImages() duplicates one or more images from an image sequence, using a count and a comma separated list of image numbers or ranges.

@@ -318,7 +374,7 @@
-

GetFirstImageInList

+

GetFirstImageInList

GetFirstImageInList() returns a pointer to the first image in the list.

@@ -339,7 +395,7 @@
-

GetImageFromList

+

GetImageFromList

GetImageFromList() returns an image at the specified index from the image list. Starting with 0 as the first image in the list.

@@ -368,7 +424,7 @@
-

GetImageIndexInList

+

GetImageIndexInList

GetImageIndexInList() returns the offset in the list of the specified image.

@@ -389,7 +445,7 @@
-

GetImageListLength

+

GetImageListLength

GetImageListLength() returns the length of the list (the number of images in the list).

@@ -410,7 +466,7 @@
-

GetLastImageInList

+

GetLastImageInList

GetLastImageInList() returns a pointer to the last image in the list.

@@ -431,7 +487,7 @@
-

GetNextImageInList

+

GetNextImageInList

GetNextImageInList() returns the next image in the list.

@@ -452,7 +508,7 @@
-

GetPreviousImageInList

+

GetPreviousImageInList

GetPreviousImageInList() returns the previous image in the list.

@@ -473,7 +529,7 @@
-

ImageListToArray

+

ImageListToArray

ImageListToArray() is a convenience method that converts an image list to a sequential array, with a NULL image pointer at the end of the array.

@@ -502,7 +558,7 @@
-

InsertImageInList

+

InsertImageInList

InsertImageInList() insert the given image or image list, into the first image list, immediately AFTER the image pointed to. The given image list pointer is left unchanged unless previously empty.

@@ -527,7 +583,7 @@
-

NewImageList

+

NewImageList

NewImageList() creates an empty image list.

@@ -536,7 +592,7 @@
Image *NewImageList(void)
 
-

PrependImageToList

+

PrependImageToList

PrependImageToList() prepends the image to the beginning of the list.

@@ -561,7 +617,7 @@
-

RemoveImageFromList

+

RemoveImageFromList

RemoveImageFromList() removes and returns the image pointed to.

@@ -584,7 +640,7 @@
-

RemoveFirstImageFromList

+

RemoveFirstImageFromList

RemoveFirstImageFromList() removes and returns the first image in the list.

@@ -607,7 +663,7 @@
-

RemoveLastImageFromList

+

RemoveLastImageFromList

RemoveLastImageFromList() removes and returns the last image from the list.

@@ -630,7 +686,7 @@
-

ReplaceImageInList

+

ReplaceImageInList

ReplaceImageInList() replaces an image in the list with the given image, or list of images. Old image is destroyed.

@@ -657,7 +713,7 @@
-

ReplaceImageInListReturnLast

+

ReplaceImageInListReturnLast

ReplaceImageInListReturnLast() is exactly as ReplaceImageInList() except the images pointer is set to the last image in the list of replacement images.

@@ -684,7 +740,7 @@
-

ReverseImageList

+

ReverseImageList

ReverseImageList() reverses the order of an image list. The list pointer is reset to that start of the re-ordered list.

@@ -705,7 +761,7 @@
-

SpliceImageIntoList

+

SpliceImageIntoList

SpliceImageIntoList() removes 'length' images from the list and replaces them with the specified splice. Removed images are returned.

@@ -735,7 +791,7 @@
-

SplitImageList

+

SplitImageList

SplitImageList() splits an image into two lists, after given image The list that was split off is returned, which may be empty.

@@ -759,12 +815,12 @@
-
- + diff --git a/www/api/magick++-classes.html b/www/api/magick++-classes.html index 8623cdb697cad6cca6fbcc79946e9450e035c6c7..13dc0fd4af3b4a878f88145ceede45b440823572 100644 --- a/www/api/magick++-classes.html +++ b/www/api/magick++-classes.html @@ -24,19 +24,19 @@ - + - - + +
-
+
@@ -149,7 +149,7 @@ containers of image frames.

SecurityResources - And Now a Touch of Magick + And Now a Touch of Magick RelatedSitemap diff --git a/www/api/magick-deprecate.html b/www/api/magick-deprecate.html index 5a96f1c322487fe83825c5d127d8a68a88442400..aeae3c8518197548ffa9e8a3aa739d83843df105 100644 --- a/www/api/magick-deprecate.html +++ b/www/api/magick-deprecate.html @@ -2,1734 +2,169 @@ - - + + - - - ImageMagick - MagickWand, C API: Deprecated Methods + + + + ImageMagick – MagickWand, C API: Deprecated Methods + + - - - - - - - - - - - - - - - + + + + + + + - + - - - + + + + + + -

+ +
+
+ +

MagickWand, C API: Deprecated Methods

+
+
-
-

MagickAverageImagesClonePixelViewDestroyPixelViewDuplexTransferPixelViewIteratorGetPixelViewExceptionGetPixelViewHeightGetPixelViewIteratorGetPixelViewPixelsGetPixelViewWandGetPixelViewWidthGetPixelViewXGetPixelViewYIsPixelViewMagickClipPathImageDrawGetFillAlphaDrawGetStrokeAlphaDrawPeekGraphicWandDrawPopGraphicContextDrawPushGraphicContextDrawSetFillAlphaDrawSetStrokeAlphaMagickColorFloodfillImageMagickDescribeImageMagickFlattenImagesMagickGetImageAttributeMagickGetImageMatteMagickGetImagePixelsMagickGetImageSizeMagickMapImageMagickMatteFloodfillImageMagickMedianFilterImageMagickMinimumImagesMagickModeImageMagickMosaicImagesMagickOpaqueImageMagickPaintFloodfillImageMagickPaintOpaqueImageMagickPaintTransparentImageMagickRadialBlurImageMagickRecolorImageMagickReduceNoiseImageMagickMaximumImagesMagickSetImageAttributeMagickSetImageIndexMagickTransparentImageMagickRegionOfInterestImageMagickSetImagePixelsMagickWriteImageBlobNewPixelViewNewPixelViewRegionPixelGetNextRowPixelIteratorGetExceptionSetPixelViewIteratorTransferPixelViewIteratorUpdatePixelViewIterator

- -

MagickAverageImages

- -

MagickAverageImages() average a set of images.

- -

The format of the MagickAverageImages method is:

- -
-MagickWand *MagickAverageImages(MagickWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
-

ClonePixelView

- -

ClonePixelView() makes a copy of the specified pixel view.

- -

The format of the ClonePixelView method is:

- -
-PixelView *ClonePixelView(const PixelView *pixel_view)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
pixel_view
-
the pixel view.
- -
-
-

DestroyPixelView

- -

DestroyPixelView() deallocates memory associated with a pixel view.

- -

The format of the DestroyPixelView method is:

- -
-PixelView *DestroyPixelView(PixelView *pixel_view,
-  const size_t number_wands,const size_t number_threads)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
pixel_view
-
the pixel view.
- -
-
number_wand
-
the number of pixel wands.
- -
-
number_threads
-
number of threads.
- -
-
-

DuplexTransferPixelViewIterator

- -

DuplexTransferPixelViewIterator() iterates over three pixel views in parallel and calls your transfer method for each scanline of the view. The source and duplex pixel region is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension. However, the destination pixel view is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted.

- -

Use this pragma:

- -
-    #pragma omp critical
-
- -

to define a section of code in your callback transfer method that must be executed by a single thread at a time.

- -

The format of the DuplexTransferPixelViewIterator method is:

- -
-MagickBooleanType DuplexTransferPixelViewIterator(PixelView *source,
-  PixelView *duplex,PixelView *destination,
-  DuplexTransferPixelViewMethod transfer,void *context)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
source
-
the source pixel view.
- -
-
duplex
-
the duplex pixel view.
- -
-
destination
-
the destination pixel view.
- -
-
transfer
-
the transfer callback method.
- -
-
context
-
the user defined context.
- -
-
-

GetPixelViewException

- -

GetPixelViewException() returns the severity, reason, and description of any error that occurs when utilizing a pixel view.

- -

The format of the GetPixelViewException method is:

- -
-char *GetPixelViewException(const PixelWand *pixel_view,
-  ExceptionType *severity)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
pixel_view
-
the pixel pixel_view.
- -
-
severity
-
the severity of the error is returned here.
- -
-
-

GetPixelViewHeight

- -

GetPixelViewHeight() returns the pixel view height.

- -

The format of the GetPixelViewHeight method is:

- -
-size_t GetPixelViewHeight(const PixelView *pixel_view)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
pixel_view
-
the pixel view.
- -
-
-

GetPixelViewIterator

- -

GetPixelViewIterator() iterates over the pixel view in parallel and calls your get method for each scanline of the view. The pixel region is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension. Any updates to the pixels in your callback are ignored.

- -

Use this pragma:

- -
-    #pragma omp critical
-
- -

to define a section of code in your callback get method that must be executed by a single thread at a time.

- -

The format of the GetPixelViewIterator method is:

- -
-MagickBooleanType GetPixelViewIterator(PixelView *source,
-  GetPixelViewMethod get,void *context)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
source
-
the source pixel view.
- -
-
get
-
the get callback method.
- -
-
context
-
the user defined context.
- -
-
-

GetPixelViewPixels

- -

GetPixelViewPixels() returns the pixel view pixel_wands.

- -

The format of the GetPixelViewPixels method is:

- -
-PixelWand *GetPixelViewPixels(const PixelView *pixel_view)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
pixel_view
-
the pixel view.
- -
-
-

GetPixelViewWand

- -

GetPixelViewWand() returns the magick wand associated with the pixel view.

- -

The format of the GetPixelViewWand method is:

- -
-MagickWand *GetPixelViewWand(const PixelView *pixel_view)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
pixel_view
-
the pixel view.
- -
-
-

GetPixelViewWidth

- -

GetPixelViewWidth() returns the pixel view width.

- -

The format of the GetPixelViewWidth method is:

- -
-size_t GetPixelViewWidth(const PixelView *pixel_view)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
pixel_view
-
the pixel view.
- -
-
-

GetPixelViewX

- -

GetPixelViewX() returns the pixel view x offset.

- -

The format of the GetPixelViewX method is:

- -
-ssize_t GetPixelViewX(const PixelView *pixel_view)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
pixel_view
-
the pixel view.
- -
-
-

GetPixelViewY

- -

GetPixelViewY() returns the pixel view y offset.

- -

The format of the GetPixelViewY method is:

- -
-ssize_t GetPixelViewY(const PixelView *pixel_view)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
pixel_view
-
the pixel view.
- -
-
-

IsPixelView

- -

IsPixelView() returns MagickTrue if the the parameter is verified as a pixel view container.

- -

The format of the IsPixelView method is:

- -
-MagickBooleanType IsPixelView(const PixelView *pixel_view)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
pixel_view
-
the pixel view.
- -
-
-

MagickClipPathImage

- -

MagickClipPathImage() clips along the named paths from the 8BIM profile, if present. Later operations take effect inside the path. Id may be a number if preceded with #, to work on a numbered path, e.g., "#1" to use the first path.

- -

The format of the MagickClipPathImage method is:

- -
-MagickBooleanType MagickClipPathImage(MagickWand *wand,
-  const char *pathname,const MagickBooleanType inside)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
pathname
-
name of clipping path resource. If name is preceded by #, use clipping path numbered by name.
- -
-
inside
-
if non-zero, later operations take effect inside clipping path. Otherwise later operations take effect outside clipping path.
- -
-
-

DrawGetFillAlpha

- -

DrawGetFillAlpha() returns the alpha used when drawing using the fill color or fill texture. Fully opaque is 1.0.

- -

The format of the DrawGetFillAlpha method is:

- -
-double DrawGetFillAlpha(const DrawingWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the drawing wand.
- -
-
-

DrawGetStrokeAlpha

- -

DrawGetStrokeAlpha() returns the alpha of stroked object outlines.

- -

The format of the DrawGetStrokeAlpha method is:

- -
-double DrawGetStrokeAlpha(const DrawingWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the drawing wand.
-
-

DrawPeekGraphicWand

- -

DrawPeekGraphicWand() returns the current drawing wand.

- -

The format of the PeekDrawingWand method is:

- -
-DrawInfo *DrawPeekGraphicWand(const DrawingWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the drawing wand.
- -
-
-

DrawPopGraphicContext

- -

DrawPopGraphicContext() destroys the current drawing wand and returns to the previously pushed drawing wand. Multiple drawing wands may exist. It is an error to attempt to pop more drawing wands than have been pushed, and it is proper form to pop all drawing wands which have been pushed.

- -

The format of the DrawPopGraphicContext method is:

- -
-MagickBooleanType DrawPopGraphicContext(DrawingWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the drawing wand.
- -
-
-

DrawPushGraphicContext

- -

DrawPushGraphicContext() clones the current drawing wand to create a new drawing wand. The original drawing wand(s) may be returned to by invoking PopDrawingWand(). The drawing wands are stored on a drawing wand stack. For every Pop there must have already been an equivalent Push.

- -

The format of the DrawPushGraphicContext method is:

- -
-MagickBooleanType DrawPushGraphicContext(DrawingWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the drawing wand.
- -
-
-

DrawSetFillAlpha

- -

DrawSetFillAlpha() sets the alpha to use when drawing using the fill color or fill texture. Fully opaque is 1.0.

- -

The format of the DrawSetFillAlpha method is:

- -
-void DrawSetFillAlpha(DrawingWand *wand,const double fill_alpha)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the drawing wand.
- -
-
fill_alpha
-
fill alpha
- -
-
-

DrawSetStrokeAlpha

- -

DrawSetStrokeAlpha() specifies the alpha of stroked object outlines.

- -

The format of the DrawSetStrokeAlpha method is:

- -
-void DrawSetStrokeAlpha(DrawingWand *wand,const double stroke_alpha)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the drawing wand.
- -
-
stroke_alpha
-
stroke alpha. The value 1.0 is opaque.
- -
-
-

MagickColorFloodfillImage

- -

MagickColorFloodfillImage() changes the color value of any pixel that matches target and is an immediate neighbor. If the method FillToBorderMethod is specified, the color value is changed for any neighbor pixel that does not match the bordercolor member of image.

- -

The format of the MagickColorFloodfillImage method is:

- -
-MagickBooleanType MagickColorFloodfillImage(MagickWand *wand,
-  const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
-  const ssize_t x,const ssize_t y)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
fill
-
the floodfill color pixel wand.
- -
-
fuzz
-
By default target must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color for the purposes of the floodfill.
- -
-
bordercolor
-
the border color pixel wand.
- -
-
x,y
-
the starting location of the operation.
- -
-
-

MagickDescribeImage

- -

MagickDescribeImage() identifies an image by printing its attributes to the file. Attributes include the image width, height, size, and others.

- -

The format of the MagickDescribeImage method is:

- -
-const char *MagickDescribeImage(MagickWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
-

MagickFlattenImages

- -

MagickFlattenImages() merges a sequence of images. This useful for combining Photoshop layers into a single image.

- -

The format of the MagickFlattenImages method is:

- -
-MagickWand *MagickFlattenImages(MagickWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
-

MagickGetImageAttribute

- -

MagickGetImageAttribute() returns a value associated with the specified property. Use MagickRelinquishMemory() to free the value when you are finished with it.

- -

The format of the MagickGetImageAttribute method is:

- -
-char *MagickGetImageAttribute(MagickWand *wand,const char *property)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
property
-
the property.
- -
-
-

MagickGetImageMatte

- -

MagickGetImageMatte() returns MagickTrue if the image has a matte channel otherwise MagickFalse.

- -

The format of the MagickGetImageMatte method is:

- -
-size_t MagickGetImageMatte(MagickWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
-

MagickGetImagePixels

- -

MagickGetImagePixels() extracts pixel data from an image and returns it to you. The method returns MagickTrue on success otherwise MagickFalse if an error is encountered. The data is returned as char, short int, int, ssize_t, float, or double in the order specified by map.

- -

Suppose you want to extract the first scanline of a 640x480 image as character data in red-green-blue order:

- -
-MagickGetImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
-
- -

The format of the MagickGetImagePixels method is:

- -
-MagickBooleanType MagickGetImagePixels(MagickWand *wand,
-  const ssize_t x,const ssize_t y,const size_t columns,
-  const size_t rows,const char *map,const StorageType storage,
-  void *pixels)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
x, y, columns, rows
-
These values define the perimeter of a region of pixels you want to extract.
- -
-
map
-
This string reflects the expected ordering of the pixel array. It can be any combination or order of R = red, G = green, B = blue, A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, M = magenta, K = black, I = intensity (for grayscale), P = pad.
- -
-
storage
-
Define the data type of the pixels. Float and double types are expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel, LongPixel, QuantumPixel, or ShortPixel.
- -
-
pixels
-
This array of values contain the pixel components as defined by map and type. You must preallocate this array where the expected length varies depending on the values of width, height, map, and type.
- -
-
-

MagickGetImageSize

- -

MagickGetImageSize() returns the image length in bytes.

- -

The format of the MagickGetImageSize method is:

- -
-MagickBooleanType MagickGetImageSize(MagickWand *wand,
-  MagickSizeType *length)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
length
-
the image length in bytes.
- -
-
-

MagickMapImage

- -

MagickMapImage() replaces the colors of an image with the closest color from a reference image.

- -

The format of the MagickMapImage method is:

- -
-MagickBooleanType MagickMapImage(MagickWand *wand,
-  const MagickWand *map_wand,const MagickBooleanType dither)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
map
-
the map wand.
- -
-
dither
-
Set this integer value to something other than zero to dither the mapped image.
- -
-
-

MagickMatteFloodfillImage

- -

MagickMatteFloodfillImage() changes the transparency value of any pixel that matches target and is an immediate neighbor. If the method FillToBorderMethod is specified, the transparency value is changed for any neighbor pixel that does not match the bordercolor member of image.

+

-

The format of the MagickMatteFloodfillImage method is:

- -
-MagickBooleanType MagickMatteFloodfillImage(MagickWand *wand,
-  const double alpha,const double fuzz,const PixelWand *bordercolor,
-  const ssize_t x,const ssize_t y)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
alpha
-
the level of transparency: 1.0 is fully opaque and 0.0 is fully transparent.
- -
-
fuzz
-
By default target must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color for the purposes of the floodfill.
- -
-
bordercolor
-
the border color pixel wand.
- -
-
x,y
-
the starting location of the operation.
- -
-
-

MagickMedianFilterImage

- -

MagickMedianFilterImage() applies a digital filter that improves the quality of a noisy image. Each pixel is replaced by the median in a set of neighboring pixels as defined by radius.

- -

The format of the MagickMedianFilterImage method is:

- -
-MagickBooleanType MagickMedianFilterImage(MagickWand *wand,
-  const double radius)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
radius
-
the radius of the pixel neighborhood.
- -
-
-

MagickMinimumImages

- -

MagickMinimumImages() returns the minimum intensity of an image sequence.

- -

The format of the MagickMinimumImages method is:

- -
-MagickWand *MagickMinimumImages(MagickWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
-

MagickModeImage

- -

MagickModeImage() makes each pixel the 'predominant color' of the neighborhood of the specified radius.

- -

The format of the MagickModeImage method is:

- -
-MagickBooleanType MagickModeImage(MagickWand *wand,
-  const double radius)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
radius
-
the radius of the pixel neighborhood.
- -
-
-

MagickMosaicImages

- -

MagickMosaicImages() inlays an image sequence to form a single coherent picture. It returns a wand with each image in the sequence composited at the location defined by the page offset of the image.

- -

The format of the MagickMosaicImages method is:

- -
-MagickWand *MagickMosaicImages(MagickWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
-

MagickOpaqueImage

- -

MagickOpaqueImage() changes any pixel that matches color with the color defined by fill.

- -

The format of the MagickOpaqueImage method is:

- -
-MagickBooleanType MagickOpaqueImage(MagickWand *wand,
-  const PixelWand *target,const PixelWand *fill,const double fuzz)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
channel
-
the channel(s).
- -
-
target
-
Change this target color to the fill color within the image.
- -
-
fill
-
the fill pixel wand.
- -
-
fuzz
-
By default target must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color for the purposes of the floodfill.
- -
-
-

MagickPaintFloodfillImage

- -

MagickPaintFloodfillImage() changes the color value of any pixel that matches target and is an immediate neighbor. If the method FillToBorderMethod is specified, the color value is changed for any neighbor pixel that does not match the bordercolor member of image.

- -

The format of the MagickPaintFloodfillImage method is:

- -
-MagickBooleanType MagickPaintFloodfillImage(MagickWand *wand,
-  const ChannelType channel,const PixelWand *fill,const double fuzz,
-  const PixelWand *bordercolor,const ssize_t x,const ssize_t y)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
channel
-
the channel(s).
- -
-
fill
-
the floodfill color pixel wand.
- -
-
fuzz
-
By default target must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color for the purposes of the floodfill.
- -
-
bordercolor
-
the border color pixel wand.
- -
-
x,y
-
the starting location of the operation.
- -
-
-

MagickPaintOpaqueImage

- -

MagickPaintOpaqueImage() changes any pixel that matches color with the color defined by fill.

- -

The format of the MagickPaintOpaqueImage method is:

- -
-MagickBooleanType MagickPaintOpaqueImage(MagickWand *wand,
-  const PixelWand *target,const PixelWand *fill,const double fuzz)
-MagickBooleanType MagickPaintOpaqueImageChannel(MagickWand *wand,
-  const ChannelType channel,const PixelWand *target,
-  const PixelWand *fill,const double fuzz)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
channel
-
the channel(s).
- -
-
target
-
Change this target color to the fill color within the image.
- -
-
fill
-
the fill pixel wand.
- -
-
fuzz
-
By default target must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color for the purposes of the floodfill.
- -
-
-

MagickPaintTransparentImage

- -

MagickPaintTransparentImage() changes any pixel that matches color with the color defined by fill.

- -

The format of the MagickPaintTransparentImage method is:

- -
-MagickBooleanType MagickPaintTransparentImage(MagickWand *wand,
-  const PixelWand *target,const double alpha,const double fuzz)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
target
-
Change this target color to specified opacity value within the image.
- -
-
alpha
-
the level of transparency: 1.0 is fully opaque and 0.0 is fully transparent.
- -
-
fuzz
-
By default target must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color for the purposes of the floodfill.
- -
-
-

MagickRadialBlurImage

- -

MagickRadialBlurImage() radial blurs an image.

- -

The format of the MagickRadialBlurImage method is:

- -
-MagickBooleanType MagickRadialBlurImage(MagickWand *wand,
-  const double angle)
-MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
-  const ChannelType channel,const double angle)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
channel
-
the image channel(s).
- -
-
angle
-
the angle of the blur in degrees.
- -
-
-

MagickRecolorImage

- -

MagickRecolorImage() apply color transformation to an image. The method permits saturation changes, hue rotation, luminance to alpha, and various other effects. Although variable-sized transformation matrices can be used, typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA (or RGBA with offsets). The matrix is similar to those used by Adobe Flash except offsets are in column 6 rather than 5 (in support of CMYKA images) and offsets are normalized (divide Flash offset by 255).

- -

The format of the MagickRecolorImage method is:

- -
-MagickBooleanType MagickRecolorImage(MagickWand *wand,
-  const size_t order,const double *color_matrix)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
order
-
the number of columns and rows in the color matrix.
- -
-
color_matrix
-
An array of doubles representing the color matrix.
- -
-
-

MagickReduceNoiseImage

- -

MagickReduceNoiseImage() smooths the contours of an image while still preserving edge information. The algorithm works by replacing each pixel with its neighbor closest in value. A neighbor is defined by radius. Use a radius of 0 and ReduceNoise() selects a suitable radius for you.

- -

The format of the MagickReduceNoiseImage method is:

- -
-MagickBooleanType MagickReduceNoiseImage(MagickWand *wand,
-  const double radius)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
radius
-
the radius of the pixel neighborhood.
- -
-
-

MagickMaximumImages

- -

MagickMaximumImages() returns the maximum intensity of an image sequence.

- -

The format of the MagickMaximumImages method is:

- -
-MagickWand *MagickMaximumImages(MagickWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
-

MagickSetImageAttribute

- -

MagickSetImageAttribute() associates a property with an image.

- -

The format of the MagickSetImageAttribute method is:

- -
-MagickBooleanType MagickSetImageAttribute(MagickWand *wand,
-  const char *property,const char *value)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
property
-
the property.
- -
-
value
-
the value.
- -
-
-

MagickSetImageIndex

- -

MagickSetImageIndex() set the current image to the position of the list specified with the index parameter.

- -

The format of the MagickSetImageIndex method is:

- -
-MagickBooleanType MagickSetImageIndex(MagickWand *wand,
-  const ssize_t index)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
index
-
the scene number.
- -
-
-

MagickTransparentImage

- -

MagickTransparentImage() changes any pixel that matches color with the color defined by fill.

- -

The format of the MagickTransparentImage method is:

- -
-MagickBooleanType MagickTransparentImage(MagickWand *wand,
-  const PixelWand *target,const double alpha,const double fuzz)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
target
-
Change this target color to specified opacity value within the image.
- -
-
alpha
-
the level of transparency: 1.0 is fully opaque and 0.0 is fully transparent.
- -
-
fuzz
-
By default target must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color for the purposes of the floodfill.
- -
-
-

MagickRegionOfInterestImage

- -

MagickRegionOfInterestImage() extracts a region of the image and returns it as a new wand.

- -

The format of the MagickRegionOfInterestImage method is:

- -
-MagickWand *MagickRegionOfInterestImage(MagickWand *wand,
-  const size_t width,const size_t height,const ssize_t x,
-  const ssize_t y)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
width
-
the region width.
- -
-
height
-
the region height.
- -
-
x
-
the region x offset.
- -
-
y
-
the region y offset.
- -
-
-

MagickSetImagePixels

- -

MagickSetImagePixels() accepts pixel datand stores it in the image at the location you specify. The method returns MagickFalse on success otherwise MagickTrue if an error is encountered. The pixel data can be either char, short int, int, ssize_t, float, or double in the order specified by map.

- -

Suppose your want to upload the first scanline of a 640x480 image from character data in red-green-blue order:

- -
-MagickSetImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
-
- -

The format of the MagickSetImagePixels method is:

- -
-MagickBooleanType MagickSetImagePixels(MagickWand *wand,
-  const ssize_t x,const ssize_t y,const size_t columns,
-  const size_t rows,const char *map,const StorageType storage,
-  const void *pixels)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
x, y, columns, rows
-
These values define the perimeter of a region of pixels you want to define.
- -
-
map
-
This string reflects the expected ordering of the pixel array. It can be any combination or order of R = red, G = green, B = blue, A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan, Y = yellow, M = magenta, K = black, I = intensity (for grayscale), P = pad.
- -
-
storage
-
Define the data type of the pixels. Float and double types are expected to be normalized [0..1] otherwise [0..QuantumRange]. Choose from these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel, or DoublePixel.
- -
-
pixels
-
This array of values contain the pixel components as defined by map and type. You must preallocate this array where the expected length varies depending on the values of width, height, map, and type.
- -
-
-

MagickWriteImageBlob

- -

MagickWriteImageBlob() implements direct to memory image formats. It returns the image as a blob and its length. Use MagickSetFormat() to set the format of the returned blob (GIF, JPEG, PNG, etc.).

- -

Use MagickRelinquishMemory() to free the blob when you are done with it.

- -

The format of the MagickWriteImageBlob method is:

- -
-unsigned char *MagickWriteImageBlob(MagickWand *wand,size_t *length)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
length
-
the length of the blob.
- -
-
-

NewPixelView

- -

NewPixelView() returns a pixel view required for all other methods in the Pixel View API.

- -

The format of the NewPixelView method is:

- -
-PixelView *NewPixelView(MagickWand *wand)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the wand.
- -
-
-

NewPixelViewRegion

- -

NewPixelViewRegion() returns a pixel view required for all other methods in the Pixel View API.

- -

The format of the NewPixelViewRegion method is:

- -
-PixelView *NewPixelViewRegion(MagickWand *wand,const ssize_t x,
-  const ssize_t y,const size_t width,const size_t height)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
wand
-
the magick wand.
- -
-
x,y,columns,rows
-
These values define the perimeter of a region of pixel_wands view.
- -
-
-

PixelGetNextRow

- -

PixelGetNextRow() returns the next row as an array of pixel wands from the pixel iterator.

- -

The format of the PixelGetNextRow method is:

- -
-PixelWand **PixelGetNextRow(PixelIterator *iterator,
-  size_t *number_wands)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
iterator
-
the pixel iterator.
- -
-
number_wands
-
the number of pixel wands.
- -
-
-

PixelIteratorGetException

- -

PixelIteratorGetException() returns the severity, reason, and description of any error that occurs when using other methods in this API.

- -

The format of the PixelIteratorGetException method is:

- -
-char *PixelIteratorGetException(const Pixeliterator *iterator,
-  ExceptionType *severity)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
iterator
-
the pixel iterator.
- -
-
severity
-
the severity of the error is returned here.
- -
-
-

SetPixelViewIterator

- -

SetPixelViewIterator() iterates over the pixel view in parallel and calls your set method for each scanline of the view. The pixel region is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension. The pixels are initiallly undefined and any settings you make in the callback method are automagically synced back to your image.

- -

Use this pragma:

- -
-    #pragma omp critical
-
- -

to define a section of code in your callback set method that must be executed by a single thread at a time.

- -

The format of the SetPixelViewIterator method is:

- -
-MagickBooleanType SetPixelViewIterator(PixelView *destination,
-  SetPixelViewMethod set,void *context)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
destination
-
the pixel view.
- -
-
set
-
the set callback method.
- -
-
context
-
the user defined context.
- -
-
-

TransferPixelViewIterator

- -

TransferPixelViewIterator() iterates over two pixel views in parallel and calls your transfer method for each scanline of the view. The source pixel region is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension. However, the destination pixel view is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted.

- -

Use this pragma:

- -
-    #pragma omp critical
-
- -

to define a section of code in your callback transfer method that must be executed by a single thread at a time.

- -

The format of the TransferPixelViewIterator method is:

- -
-MagickBooleanType TransferPixelViewIterator(PixelView *source,
-  PixelView *destination,TransferPixelViewMethod transfer,void *context)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
source
-
the source pixel view.
- -
-
destination
-
the destination pixel view.
- -
-
transfer
-
the transfer callback method.
- -
-
context
-
the user defined context.
- -
-
-

UpdatePixelViewIterator

- -

UpdatePixelViewIterator() iterates over the pixel view in parallel and calls your update method for each scanline of the view. The pixel region is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted. Updates to pixels in your callback are automagically synced back to the image.

- -

Use this pragma:

- -
-    #pragma omp critical
-
- -

to define a section of code in your callback update method that must be executed by a single thread at a time.

- -

The format of the UpdatePixelViewIterator method is:

- -
-MagickBooleanType UpdatePixelViewIterator(PixelView *source,
-  UpdatePixelViewMethod update,void *context)
-
- -

A description of each parameter follows:

- -
-
- -
-
-
source
-
the source pixel view.
- -
-
update
-
the update callback method.
- -
-
context
-
the user defined context.
- -
-
-
+
-