From: backto.kim Date: Mon, 6 Dec 2021 04:15:35 +0000 (+0900) Subject: Imported Upstream version 1.3.36 X-Git-Tag: upstream/1.3.36^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cdc6b7097f011782b30d005f812fb288fd367f34;p=platform%2Fupstream%2FGraphicsMagick.git Imported Upstream version 1.3.36 Change-Id: I0a995e609889f9b2d75340bcda6a6294ac41803a --- diff --git a/ChangeLog b/ChangeLog index 2186f10..f99bc64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,923 @@ +2020-12-26 Bob Friesenhahn + + * version.sh: Updates in preparation for the 1.3.36 release. + + * bootstrap: Fix config.guess and config.sub download URLs. + +2020-12-25 Bob Friesenhahn + + * design/pixel-cache.dot: Fix reported syntax errors. + + * coders/mpc.c (ReadMPCImage): Report correct exception reason. + + * coders/miff.c (ReadMIFFImage): Arbitrarily limit the number of + header keywords to avoid DOS attempts. + (ReadMIFFImage): Finish updates to use resource-limited memory + allocator. + (WriteMIFFImage): Finish updates to use resource-limited memory + allocator. + + * coders/mpc.c (ReadMPCImage): Arbitrarily limit the number of + header keywords to avoid DOS attempts. Fixes oss-fuzz 28956 + "Timeout - coder_MPC_fuzzer". + +2020-12-24 Bob Friesenhahn + + * magick/render.c (AffineEdge): Use MagickDoubleToLong(); + + * magick/utility.c (MagickDoubleToLong): New private function to + convert a 'double' to a 'long' with the minimum amount of harm. + + * magick/segment.c (Classify): Remove variables from function + global scope that don't need outer scope. + + * coders/jp2.c: JasPer changed its jas_stream_ops_t callback + interfaces in releases 2.0.19 and 2.0.20. Revert to providing the + older interfaces by default, but use a + MAGICK_JP2_NEW_STREAM_INTERFACE pre-processor definition to + support selecting the new interfaces. We don't know how to + usefully tell the JasPer version at compile time! Luckily, using + the older interfaces only causes a compiler warning rather than a + run-time issue. + + * coders/mac.c (ReadMACImage): Use size_t type for 'ldblk' to + avoid possible overflow. + +2020-12-23 Bob Friesenhahn + + * NEWS.txt: Update the news to the date December 23, 2020. + +2020-12-22 Bob Friesenhahn + + * magick/image.c (AllocateImage): Satisfy conditions for + DestroyImage() as soon as possible and use it for clean-up on + error. Added more error checks. + (CloneImage): Satisfy conditions for DestroyImage() as soon as + possible and use it for clean-up on error. Don't attempt to copy + colormap if colors is zero. Added more error checks. + (DestroyImage): Assure that we can destroy a partially-constructed + Image. + + * magick/effect.c (BlurImage): Fix null pointer dereference if + image failed to be created. + (DespeckleImage): Fix null pointer dereference if image failed to + be created. + (EnhanceImage): Fix null pointer dereference if image failed to be + created. + (GaussianBlurImage): Fix null pointer dereference if image failed + to be created. + (MedianFilterImage): Fix null pointer dereference if image failed + to be created. + (MotionBlurImage): Fix null pointer dereference if image failed to + be created. + (ReduceNoiseImage): Fix null pointer dereference if image failed to + be created. + (ShadeImage): Fix null pointer dereference if image failed to be + created. + (SharpenImage): Fix null pointer dereference if image failed to be + created. + (SpreadImage): Fix null pointer dereference if image failed to be + created. + +2020-12-21 Bob Friesenhahn + + * coders/jp2.c (BlobWrite): Update Jasper stream OPs callback + function signatures to exactly match latest jas_stream_ops_t + definition. This avoids an annoying warning when using Jasper + 2.0.23 but now causes annoying warnings when using 2.0.12 or + 1.900.1. There does not appear to be a useful way to determine the + Jasper numeric version (only a C string is available) from its + header files. + + * magick/decorate.c (FrameImage): Skip attempting to render top or + bottom of ornamental border if its height is zero. + + * magick/image.c (CloneImage): Set image signature right away in + case it needs to be destroyed while it is being constructed. + + * wand/drawtest.c (main): MagickGetFilename() allocates a new + string so make sure to free it. + + * tests/constitute.c (main): Destroy ExceptionInfo to avoid memory + leak if an exception was thrown. + + * magick/effect.c (EdgeImage): Fix null pointer dereference if + edge image failed to be created. + + * magick/compress.c (HuffmanEncode2Image): Fix error handling + issues. + + * magick/command.c (CompareImageCommand): Fix memory leaks when an + input image failed to be read. + (CompositeImageCommand): Fix memory leaks when an input image + failed to be read. + + * coders/fax.c (WriteFAXImage): Fix error handling. + + * coders/mpc.c (ReadMPCImage): Use correct deallocator for page + geometry. Fixes oss-fuzz 28853 "Heap-buffer-overflow READ {*} - + _MagickReallocateResourceLimitedMemory". + +2020-12-20 Bob Friesenhahn + + * coders/yuv.c: Use resource-limited memory allocator. + + * coders/xwd.c: Use resource-limited memory allocator. + + * coders/xpm.c: Use resource-limited memory allocator. + + * coders/xcf.c: Use resource-limited memory allocator. + + * coders/xbm.c: Use resource-limited memory allocator. + + * coders/wpg.c: Use resource-limited memory allocator. + + * coders/viff.c: Use resource-limited memory allocator. + + * coders/vicar.c: Use resource-limited memory allocator. + + * coders/uil.c: Use resource-limited memory allocator. + + * coders/txt.c: Use resource-limited memory allocator. + + * coders/topol.c: Use resource-limited memory allocator. + + * coders/tim.c: Use resource-limited memory allocator. + + * coders/tiff.c: Use resource-limited memory allocator. + + * coders/tga.c: Use resource-limited memory allocator. + + * coders/sun.c: Use resource-limited memory allocator. + + * coders/sgi.c: Use resource-limited memory allocator. + + * coders/sfw.c: Use resource-limited memory allocator. + + * coders/rle.c: Use resource-limited memory allocator. + + * coders/rla.c: Use resource-limited memory allocator. + + * coders/rgb.c: Use resource-limited memory allocator. + + * coders/psd.c: Use resource-limited memory allocator. + + * coders/ps3.c: Use resource-limited memory allocator. + + * coders/ps2.c: Use resource-limited memory allocator. + + * coders/pnm.c: Use resource-limited memory allocator. + + * coders/pdf.c: Use resource-limited memory allocator. + + * coders/pdb.c: Use resource-limited memory allocator. + + * coders/pcl.c: Use resource-limited memory allocator. + + * coders/pcd.c: Use resource-limited memory allocator. + + * coders/palm.c: Use resource-limited memory allocator. + + * coders/mtv.c: Use resource-limited memory allocator. + + * coders/mpc.c: Use resource-limited memory allocator. + + * coders/meta.c: Use resource-limited memory allocator. + + * coders/map.c: Use resource-limited memory allocator. + + * coders/jpeg.c: Use resource-limited memory allocator. + + * coders/jp2.c: Use resource-limited memory allocator. + + * coders/jnx.c: Use resource-limited memory allocator. + + * coders/icon.c: Use resource-limited memory allocator. + + * coders/hrz.c: Use resource-limited memory allocator. + + * coders/histogram.c: Use resource-limited memory allocator. + + * coders/gray.c: Use resource-limited memory allocator. + + * coders/fpx.c: Use resource-limited memory allocator. + + * coders/emf.c: Use resource-limited memory allocator. + + * coders/dpx.c: Use resource-limited memory allocator. + + * coders/dps.c: Use resource-limited memory allocator. + + * coders/dcm.c: Use resource-limited memory allocator. + + * coders/cut.c: Use resource-limited memory allocator. + + * coders/cmyk.c: Use resource-limited memory allocator. + + * coders/cineon.c: Use resource-limited memory allocator. + + * coders/avs.c: Use resource-limited memory allocator. + + * coders/art.c: Use resource-limited memory allocator. + + * coders/pcx.c: Use resource-limited memory allocator. + + * coders/mac.c: Use resource-limited memory allocator. + + * coders/pict.c: Use resource-limited memory allocator. + + * magick/memory.c (_MagickReallocateResourceLimitedMemory): Add a + 'clear' parameter which indicates that freshly allocated memory + should be zeroed. Added "Cleared" versions of the private managed + memory macros and updated all managed memory macros to exclusively + use this function. + +2020-12-19 Bob Friesenhahn + + * Update Automake to 1.16.3 and bootstrap to pick up latest + config.guess and config.sub. + +2020-12-17 Bob Friesenhahn + + * coders/miff.c (ImportRLEPixels): Change from C assertion to + exception report. Fixes oss-fuzz 28703 "ASSERT · ((quantum_type + == IndexQuantum) && (image->storage_class ...". + (ReadMIFFImage): Read Gray DirectClass image as PseudoClass so it + has a colormap, and we have a RLE decode implementation for it. + +2020-12-15 Bob Friesenhahn + + * magick/paint.c (OpaqueImage): Changing the image storage class + is not required. + +2020-12-14 Bob Friesenhahn + + * magick/paint.c (OpaqueImage): Assure that image type is promoted + as required based on fill color. Fixes unexpected results + discovered by Stuart McDonagh and reported via the + graphicsmagick-help mailing list on December 14, 2020. + +2020-12-13 Bob Friesenhahn + + * magick/render.c (DrawImage): Set '[MVG]' image attribute at + appropriate places outside of DrawImage() since DrawImage() + sometimes recurses into itself, trashing the image attribute. One + example of recursion is in the text annotation code. + + * coders/svg.c (ReadSVGImage): Properly support 'ping' mode so + 'identify' works as expected. + + * magick/render.c (InsertAttributeIntoInputStream): Provide a more + useful diagnostic for when a "use" or "class" argument id is not + defined. + +2020-12-12 Bob Friesenhahn + + * magick/render.c (DrawImage): Fix regression when parsing "mask" + which was added by changeset 16305:f33a0fb3d8e4 on July 15, 2020 + since the last formal release. This impacts MVG and SVG. + +2020-12-08 Bob Friesenhahn + + * www/INSTALL-unix.rst: Document the '--disable-compressed-files' + configure option, which was added on July 15th. + +2020-12-06 Bob Friesenhahn + + * magick/magic.c: Don't send files which test positive for PCL to + the HPGL delegate, which is normally 'hp2xx'. Fixes SourceForge + bug 607 "Slow to convert HP PCL printer data". + +2020-12-05 Bob Friesenhahn + + * magick/render.c (DrawImage): Use unique image attribute space + for MVG symbols. Fixes oss-fuzz 28111 "Timeout - + coder_MVG_fuzzer", oss-fuzz 28170 "Stack-overflow - DrawImage", + and oss-fuzz 28292 "Integer-overflow - DrawPolygonPrimitive". + +2020-12-04 Bob Friesenhahn + + * magick/render.c (DrawImage): Verify that affine scaling factors + are not zero. Fixes oss-fuzz 28293 "Divide-by-zero - + InverseAffineMatrix". + (DrawPolygonPrimitive): Thread error status check was at wrong + scope, resulting in code executing when it should have quit. + +2020-12-03 Bob Friesenhahn + + * magick/magick_types.h.in: Stop trying to define PTRDIFF_MAX. + +2020-11-29 Bob Friesenhahn + + * magick/magick_types.h.in: Provide PTRDIFF_MAX for Visual Studio + if it is missing. + + * fuzzing/oss-fuzz-build.sh: Disable old JPEG support in libtiff. + + * coders/mat.c (ReadMATImage): Use resource-limited memory + allocator. + (WriteMATLABImage): Use resource-limited memory allocator. + +2020-11-28 Bob Friesenhahn + + * NEWS.txt: Update the news to the date November 28, 2020. + + * coders/png.c (ReadOneJNGImage): Verify and enforce + Alpha_compression_method values. Request that color and alpha + decoders return just one frame. Force decoder format to disable + auto-detection. Assume that coder messed up and might have + returned more than one frame. Fixes oss-fuzz 28013 "Indirect-leak + . MagickMalloc". + + * magick/memory-private.h (MagickReallocateResourceLimitedMemory): + Fix typo in macro definition which resulted in a memory + reallocation leak! + + * Magick++/lib/Magick++/Drawable.h: Decided to continue using + std::unary_function if C++ version is less than C++'17 since + otherwise it may be changing an interface. + +2020-11-27 Bob Friesenhahn + + * coders/gif.c (ReadGIFImage): Use resource-limited memory + allocator when reading the comment extension. + + * Magick++/lib/Magick++/Drawable.h: Remove inheritance from + std::unary_function, which was removed in C++'17. + + * coders/webp.c (ReadWEBPImage): Use resource-limited memory + allocator. + (WriteWEBPImage): Use resource-limited memory allocator. + + * coders/jbig.c (WriteJBIGImage): Use resource-limited memory + allocator. + + * coders/fits.c (ReadFITSImage): Use resource-limited memory + allocator. + (WriteFITSImage): Use resource-limited memory allocator. + + * coders/dib.c (ReadDIBImage): Use resource-limited memory + allocator. + (WriteDIBImage): Use resource-limited memory allocator. + + * coders/bmp.c (ReadBMPImage): Use resource-limited memory + allocator. + (WriteBMPImage): Use resource-limited memory allocator. + +2020-11-26 Bob Friesenhahn + + * coders/tiff.c (ReadTIFFImage): Improve RGBATiledMethod progress + monitor so it reports more steps. + (ReadTIFFImage): Improve TiledMethod progress monitor so it + reports more steps. + + * fuzzing/utils.cc (class MagickState): Enable tracing of + exception events in order to help discover the origin of errors. + If too much output comes out, then this will be removed. + + * magick/render.c (ConvertPathToPolygon): Attempt to fix leak of + 'points' on memory allocation failure. + +2020-11-25 Bob Friesenhahn + + * magick/render.c (ConvertPathToPolygon): Make sure not to leak + points from added Edge. Fixes oss-fuzz 27608 "Direct-leak in + _MagickReallocateResourceLimitedMemory". + (DrawDashPolygon): Place an aribrary limit on stroke dash polygon + unit maximum length in order to avoid possibly rendering + "forever". Addresses oss-fuzz 24236 "Timeout in + coder_MVG_fuzzer". + +2020-11-23 Bob Friesenhahn + + * magick/render.c (DrawPolygonPrimitive): Try to minimize the + impact of too many threads due to replicated data until such time + as the data structures can be re-designed to directly support + threading. + +2020-11-21 Bob Friesenhahn + + * www/Hg.rst: Describe how to clone the repository from + SourceForge using the ssh protocol rather than https. + + * coders/ps.c (WritePSImage): Fix problem when writing PseudoClass + image with a colormap larger than two entries as bilevel. + Previous implementation was assuming that the colormap would only + include two entries for a monochrome image, but many entries may + exist in the colormap which were never used. Fixes SourceForge + issue #635 "gm convert failure from .pgm to .eps". + +2020-11-20 Bob Friesenhahn + + * fuzzing/utils.cc (class MagickState): Set DiskResource limit to + zero so that pixel cache won't spill over to using temporary + files. + +2020-11-16 Bob Friesenhahn + + * NEWS.txt: Update the news to the date November 16, 2020. + +2020-11-15 Bob Friesenhahn + + * coders/svg.c (ReadSVGImage): Fix memory leak due to CDATA block, + and some other possible small leaks. + + * magick/magick.c (InitializeMagickEx): Set C pre-processor + definition USE_GLIBC_MTRACE to 1 in order to enable Linux mtrace + support. + + * magick/render.c (ConvertPathToPolygon): Fix memory leak upon + memory reallocation failure. Addresses oss-fuzz 27351 + "Direct-leak in _MagickReallocateResourceLimitedMemory". + + * magick/memory.c (_MagickReallocateResourceLimitedMemory): Return + pointer to the allocation similar to realloc() and do not + automatically free existing memory upon allocation failure. + +2020-11-08 Bob Friesenhahn + + * common.shi.in: Apply some resource limits while running the test + suite. + (Q8_MEMORY_LIMIT): Set the test suite memory limit to 128MB for + Q8, or 256MB for Q16, or 512MB for the Q32 build. + (MAGICK_LIMIT_DISK): Set the test suite disk space limit to 0 to + avoid spilling over into disk files when the memory limit runs + out. + + * coders/miff.c (WriteMIFFImage): Update to use resource-limit + respecting memory allocators. + +2020-11-07 Bob Friesenhahn + + * coders/miff.c (ReadMIFFImage): Update to use resource-limit + respecting memory allocators. + + * magick/render.c (DrawImage): Update to use resource-limit + respecting memory allocators. + + * magick/memory.c (_MagickReallocateResourceLimitedMemory): Add + new private interfaces for allocating private memory while + respecting resource limits. + +2020-10-25 Bob Friesenhahn + + * magick/render.c (DrawImage): Reject pattern image with a + dimension of zero. Fixes oss-fuzz issue 26382 + "graphicsmagick:coder_MVG_fuzzer: Floating-point-exception in + DrawPrimitive". + +2020-10-15 Bob Friesenhahn + + * magick/constitute.c (ConstituteImage): Set image depth + appropriately based on the storage size specified by StorageType + and QuantumDepth. + +2020-10-11 Bob Friesenhahn + + * magick/render.c (DrawPrimitive): Use DestroyImageList() to + destroy composite_image since it may be a list. Fixes oss-fuzz + 25247 "Indirect-leak in MagickMalloc". + (DrawPrimitive): Add ImageInfo properties to request only + returning the first frame if the in-line image is a list. Also, + add a missing DestroyImageList() request if multiple-frames were + returned. + + * magick/transform.c (TransformImage): Use ReplaceImageInList() + replace transformed image in list. + + * magick/list.c (ReplaceImageInList): Remove previous and next + references from removed image before destroying it. + + * magick/render.c (DrawClipPath): Remove break statement so that + added clip-mask image is initialized properly and rendered-on as + expected. Thanks to László Böszörményi for reporting this problem + prior to release. + +2020-10-03 Bob Friesenhahn + + * configure.ac (AC_PROG_CC_STDC): AC_PROG_CC_STDC is no longer + required since AC_PROG_CC now provides its useful function. + AC_PROG_CC_STDC is marked as obsolete after Autoconf 2.69. + Quote all arguments to m4 macros. + +2020-09-28 Bob Friesenhahn + + * configure.ac: Update syntax to avoid using deprecated syntax + according to Autoconf 2.69. + +2020-09-21 Bob Friesenhahn + + * coders/webp.c (ReadWEBPImage): Use SetImageProfile() rather than + AppendImageProfile(). + +2020-09-20 Bob Friesenhahn + + * wand/magick_wand.c (MagickSetSamplingFactors): Correct + formatting of sampling factors string. Fixes SourceForge issue + 633 "MagickSetSamplingFactors() API mismatch - comma separated + values instead of 1x1 ". + +2020-09-14 Bob Friesenhahn + + * magick/render.c (DrawPrimitive): Improve error checking related + to ImagePrimitive. + + * magick/resize.c (ResizeImage): If CloneImage() of resize_image + to source_image fails then free source_image allocation before + returning in order to prevent memory leak. + + * magick/image.c (CloneImage): Free clone_image allocation if + ImgExtra allocation fails in order to prevent memory leak. Fixes + oss-fuzz 25342 "Indirect-leak in MagickMalloc". + (SetImageOpacity): SetImageOpacity() now returns error status + since it is possible for it to fail. + +2020-09-13 Bob Friesenhahn + + * coders/tiff.c (ReadTIFFImage): Ignore corrupt whitepoint and + primary chromaticities tags. Fixes oss-fuzz issue 25507 + "Divide-by-zero in DoubleToRational". The divide by zero is + actually in libtiff, but the bad values from the input file were + propagated through GraphicsMagick. + +2020-09-09 Bob Friesenhahn + + * magick/analyze.c (GetImageBoundingBox): Use solution proposed by + Troy Patteson to solve SourceForge issue 345 "MagickTrimImage with + extreme fuzz can produce image with negative width". + +2020-08-16 Bob Friesenhahn + + * coders/tiff.c (ReadTIFFImage): Apply the same resource limits to + TIFF tile sizes as apply to the image itself. Fixes oss-fuzz + issues 24523 "Timeout in coder_TIFF_fuzzer" and 24810 "Timeout in + coder_PTIF_fuzzer". + +2020-08-13 Bob Friesenhahn + + * configure.ac: Add --without-gdi32 configure option to support + disabling use of the Microsoft Windows gdi32 library if it is not + wanted. + +2020-08-12 Bob Friesenhahn + + * configure.ac: Remove the assumption that a native Windows build + means that Ghostscript may be available so that MinGW tests which + depend on Ghostcript are attributed proper XFAIL status by the + test suite. + +2020-08-10 Bob Friesenhahn + + * magick/magick.c (MagickCondSignal): Explicitly initialize 'oact' + prior to calling sigaction() in order to attempt to surmount + apparent oss-fuzz framework issue. + +2020-08-09 Bob Friesenhahn + + * magick/delegate.c, magick/magick.c, magick/nt_base.c: Fix + compilation errors under MinGW when Ghostscript support is + disabled. + +2020-08-08 Bob Friesenhahn + + * magick/nt_base.c: Fix compilation issue noticed under MinGW. + + * magick/render.c (DrawImage): Handle the case that + ExtractTokensBetweenPushPop() can return NULL. Fixes oss-fuzz + 24659 "Null-dereference READ in DrawImage". + + * magick/magick.c (MagickCondSignal): Re-implement to handle the + case where a new-style 'siginfo' signal handler was previously + registered, as well as the legacy type. This may address oss-fuzz + 24690 "Use-of-uninitialized-value in MagickCondSignal". + +2020-07-26 Bob Friesenhahn + + * wand/drawtest.c: Use structured error handling and report all + output to stderr so it does not screw up TAP tests. + + * magick/render.c (DTOLONG_MIN): Correct 32-bit definition of + DTOLONG_MIN. + + * wand/wandtests.tap: Wand drawtest requires FreeType. + + * NEWS.txt: Update with changes up to 2020-07-26. + + * VisualMagick/magick/magick_config.h.in (HasGS): Default HasGS to + enabled. + + * configure.ac: Add a --without-gs configure option to disable + reading PS, EPS, and PDF formats via an external Ghostscript + delegate program. This is intended as an absolute security + measure for sites that want to be assured to avoid executing + Ghostscript even though it is installed on the system. Removal of + PS and PDF reading support breaks reading other formats which are + handled by executing an external program to first convert to PS or + PDF formats. + + * magick/delegate.c (InvokePostscriptDelegate): Use HasGS to + enable use of the Ghostscript delegate. Change the existing + legacy HasGS ifdefs to HasGSLIB. + +2020-07-23 Bob Friesenhahn + + * coders/tiff.c (WriteTIFFImage): Fix compilation error when + COMPRESSION_WEBP is not defined. + +2020-07-20 Bob Friesenhahn + + * configure.ac: Fix enableval syntax for + --disable-compressed-files. + +2020-07-19 Bob Friesenhahn + + * magick/command.c (CompareImageCommand): Merge changeset by + 谢致邦 (XIE Zhibang) which adds 'matte' support to the compare + command. However, substantially reduce the amount of changes + by avoiding adding a new public function. Documentation + regarding how 'compare' uses this option is also added. + + * magick/command.c: Merge changeset by谢致邦 (XIE Zhibang) + regarding Some duplicate "verbose" should be "version". + + * configure.ac, magick/blob.c: Merge changeset by Przemysław + Sobala regarding "Configure: add --with(out)-compressed-files + option". The configure option was changed to + --disable-compressed-files during the merge since it is more + appropriate. + +2020-07-15 Bob Friesenhahn + + * NEWS.txt: Update with changes up to 2020-07-15. + + * magick/render.c (DrawImage): Improve error handling so errors + are returned when they should be. Fixes oss-fuzz 24117 + "Stack-overflow in DrawImage" and oss-fuzz 24126 "Timeout in + coder_MVG_fuzzer". Restore the original behavior of + DrawClipPath() when there is no matching clip-path attribute. + +2020-07-12 Bob Friesenhahn + + * NEWS.txt: Update with changes up to 2020-07-12. + +2020-07-11 Bob Friesenhahn + + * magick/xwindow.c (MagickXVisualColormapSize): Fix UBSAN integer + overflow warning. + + * magick/render.c (DrawClipPath): Report only a warning if there + is no clip mask. + (ExtractTokensBetweenPushPop): Verify that the expected/required + pop statement is indeed found. Fixes oss-fuzz 23498 "Timeout in + coder_MVG_fuzzer". + +2020-06-14 Bob Friesenhahn + + * magick/constitute.c (ReadImage): Improve error handling related + to ImageToFile(). + + * magick/image.c (SetImageInfo): Improve error handling related to + ImageToFile(). + + * coders/mat.c: Check MagickFindRawImageMinMax() return status. + + * magick/constitute.c (MagickFindRawImageMinMax): Verify that the + original seek position was restored. + +2020-06-13 Bob Friesenhahn + + * magick/render.c (DrawImage): Apply stricter range limits when + converting a double to a long in order to avoid integer overflow. + Fixes oss-fuzz 23304 "Integer-overflow in DrawImage". + (DrawClipPath): If there is no matching clip-path attribute then + return an informative error. Fixes oss-fuzz 23187 "Stack-overflow + in DrawImage" which is actually a case of DrawImage() / + DrawClipPath() recursion. + +2020-06-06 Bob Friesenhahn + + * coders/wpg.c (UnpackWPGRaster): Fix oss-fuzz 23042 + "Heap-buffer-overflow in ImportGrayQuantumType" and oss-fuzz + "Heap-buffer-overflow in InsertRow" which are both from the same + cause. + +2020-06-01 Bob Friesenhahn + + * magick/pixel_cache.c (ClipCacheNexus): Change x and y variables + to unsigned type. + +2020-05-31 Bob Friesenhahn + + * coders/tiff.c (WriteTIFFImage): WebP compression only supports a + depth of 8. Fixes oss-fuzz 22560 "Use-of-uninitialized-value in + GammaToLinear". + +2020-05-30 Bob Friesenhahn + + * coders/wpg.c (ReadWPGImage): Terminate reading when a pixel + cache resource limit is hit rather than moving on to heap buffer + overflow. Fixes oss-fuzz 20045, 20318, 21956 + + * coders/png.c (ReadMNGImage): If the image width is 1, then X + magnification is done by by simple pixel replication. If the + image height is 1, then Y magnification is done by simple pixel + replication. Fixes oss-fuzz issue 19025 "Heap-buffer-overflow in + ReadMNGImage" and oss-fuzz issue 19026 "ASSERT: yy < (long) + large_image->rows". It appears that CERT has assigned + CVE-2020-12672 for oss-fuzz issue 19025. Note that the heap + overwrite is only one byte. + +2020-05-01 Bob Friesenhahn + + * NEWS.txt: Update with changes up to 2020-04-23. + +2020-04-23 Bob Friesenhahn + + * coders/dpx.c (ReadDPXImage): Support dpx:swap-samples-read + define which behaves similar to dpx:swap-samples, but is only + applied when reading. This provides for use when there is both + reading and writing in the same operation. + (WriteDPXImage): Support dpx:swap-samples-write define which + behaves similar to dpx:swap-samples, but is only applied when + writing. This provides for use when there is both reading and + writing in the same operation. + +2020-04-18 Bob Friesenhahn + + * magick: Fix remaining GCC 10 warnings. + +2020-04-17 Bob Friesenhahn + + * magick/transform.c (GetImageMosaicDimensions): Mark function as pure. + + * magick/effect.c (GetNonpeakMedianList): Mark function as pure. + + * coders/fits.c (InsertRowHDU): Fix scary-sounding GCC 10 warning, + which is actually benign. + + * config/config.sub: Update to latest config.sub + + * config/config.guess: Update to latest config.guess. + + * Makefile.am: Update to Automake 1.16.2 + +2020-04-04 Bob Friesenhahn + + * coders/dpx.c (ReadRowSamples): Simplify 10-bit packed decoding. + (WriteRowSamples): Simplify 10-bit packed encoding. + + * coders/locale.c (ReadConfigureFile): Ignore comment element if + it was not found or is too short. + + * magick/pixel_cache.c (ReadCacheIndexes): If SetNexus() has + previously failed to allocate the staging buffer and thus reported + an exception to the user, then ReadCacheIndexes() should report an + error rather than blundering into copying indexes data to a null + pointer. + + * magick/effect.c (AdaptiveThresholdImage): Assure that we don't + attempt to write to output pixels if they have not been selected + yet. + + * magick/utility.c (ExpandFilenames): Properly handle NULL + filelist and NULL filelist entries. + (GetGeometry): Assure that there is no one-character stack read + overflow when reading the geometry buffer. + +2020-03-29 Bob Friesenhahn + + * fuzzing/oss-fuzz-build.sh: Restore xz to oss-fuzz build due to + build problems getting worked out. + +2020-03-28 Bob Friesenhahn + + * fuzzing/oss-fuzz-build.sh (MAGICK_LIBS): Remove mention of + liblzma.a in the oss-fuzz build until its build problems get + worked out. + +2020-03-27 Bob Friesenhahn + + * fuzzing/oss-fuzz-build.sh: Skip building xz in the oss-fuzz + build until its build problems get worked out. + +2020-03-25 Bob Friesenhahn + + * magick/log.c (InitializeLogInfoPost): Don't load log.mgk if + logging is already configured to use MethodOutput. + +2020-03-24 Bob Friesenhahn + + * magick/log.c (InitializeLogInfoPost): Mark that logging is + configured, regardless of if "log.mgk" was discovered. + +2020-03-23 Bob Friesenhahn + + * VisualMagick/magick/magick_config.h.in: ProvideDllMain is now + disabled by default since it causes InitializeMagick() to be + invoked prior to when the program's main() routine is called, + thereby blocking configuration activities or use of + InitializeMagickEx(). With this change it is even more imperative + that InitializeMagick() be explicitly invoked by all programs + using GraphicsMagick. + + * magick/log.c (LogMagickEventList): Always use/respect the + configured log format as might be obtained from "log.mgk" or + SetLogDefaultFormat(). + + * magick/utility.c (MagickFormatString): Return the size of the + formatted string. + (MagickFormatStringList): Return the size of the formatted string. + (FormatString): Return the size of the formatted string. + (FormatStringList): Return the size of the formatted string. + +2020-03-22 Bob Friesenhahn + + * www/api/types.rst: Improved types documentation and added more + hyperlinks. + + * scripts/format_c_api_doc.py: Add hyperlinks for 'LogMethod' and + 'LogOutputType' type documentation. + + * Magick++/lib/Image.cpp (SetLogDefaultEventType): New C++ function to + forward to C interface. + (SetLogDefaultGenerations): New C++ function to forward to C + interface. + (SetLogDefaultLimit): New C++ function to forward to C interface. + (SetLogDefaultFormat(): New C++ function to forward to C + interface. + (SetLogDefaultLogMethod): New C++ function to forward to C + interface. + (SetLogDefaultFileName): New C++ function to forward to C + interface. + (SetLogDefaultOutputType): New C++ function to forward to C + interface. + + * magick/log.c (SetLogDefaultEventType): New function to support + setting the default set of events which will result in a log + event. + (SetLogDefaultGenerations): New function to specify the maximum + number of log files maintain before circulating back to overwrite + the first name. + (SetLogDefaultLimit): New function to specify the maximum number + of logging events which may occur before creating a new log file. + (SetLogDefaultLogMethod): New function to provide a call-back + function to be invoked for each log event when the logging method + type is MethodOutput. + (SetLogDefaultOutputType): New function to set the logging output + destination. + (SetLogDefaultFormat): New function to provide the format of the + logging output. + (SetLogDefaultFileName): New function to provide the file name, + or file path, to be written to for each log event. + (InitializeLogInfo): If a default logging callback was provided + via SetLogDefaultLogMethod() then skip searching for "log.mgk". + In this case it is assumed that the API user has already changed + any other logging default which would have been updated by + "log.mgk" so it would be harmful to search for it, or read from + it. + +2020-03-10 Troy Patteson + + * coders/png.c (WriteOnePNGImage): Don't skip optional Exif + identifier code if it isn't present. + +2020-03-08 Bob Friesenhahn + + * magick/pixel_cache.c (ModifyCache): Destroy clone_image.cache if + ClonePixelCache() reports failure. Fixes oss-fuzz 20871 + "graphicsmagick:coder_MVG_fuzzer: Direct-leak in + MagickMallocAligned". + + * magick/log.c (LogMagickEventList): Prepare source module base + name more efficiently. Move MethodOutput implementation to the + front so it is not filtered by other active blocks. + (LogMagickEventList): Cache broken-down time structure in LogInfo + and recompute only when needed. + +2020-03-07 Bob Friesenhahn + + * magick/resize.c (HorizontalFilter): Improve tracing. + (VerticalFilter): Improve tracing. + (ResizeImage): Improve tracing. + + * www/api/api.rst: Add functions from log.c and render.c. + + * magick/log.c (DestroyLogInfo): DestroyLogInfo is no longer + marked MagickExport. + +2020-03-04 Bob Friesenhahn + + * magick/api.h: Add "magick/enum_strings.h" to API headers. + Requested by Przemysław Sobala via posting to the + graphicsmagick-help mailing list on 2020-02-27. + + * scripts/html_fragments.py: Automatically generate HTML footer + content and include commented HTML fragment which may be + substituted with SF tracker for SourceForge web site. + 2020-02-23 Bob Friesenhahn * version.sh: Updates in preparation for the 1.3.35 release. - Merge changes for 1.3.35 into GraphicsMagick-1_3 branch. * www/INSTALL-windows.rst: Update Windows installation and build documentation. diff --git a/Copyright.txt b/Copyright.txt index 9035890..c902652 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -277,9 +277,3 @@ The licenses which components of this software fall under are as follows. GraphicsMagick license. For convenience, when GraphicsMagick is bundled with (or compiled with) "delegate" libraries, a copy of the licenses for these libraries is provided in a "licenses" directory. - --------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2018 diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index d56e3e5..f818f92 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -1,6 +1,6 @@ // This may look like C code, but it is really -*- C++ -*- // -// Copyright Bob Friesenhahn, 1999-2017 +// Copyright Bob Friesenhahn, 1999-2020 // // Implementation of Image // @@ -4146,6 +4146,56 @@ void Magick::MagickPlusPlusDestroyMagick(void) } } + // + // Logging defaults initialization routines. These are + // pass-throughs into the equivalent C library functions. The + // purpose of these routines is to provide a program with an + // alternative to the default "log.mgk" based initialization. + // + +// Specify default events which will result in a log event (comma-comma-separated list) +void MagickDLLDecl Magick::SetLogDefaultEventType(const std::string &events_) +{ + MagickLib::SetLogDefaultEventType(events_.c_str()); +} + +// Specify default maximum log file generations before overwriting the first name. +void MagickDLLDecl Magick::SetLogDefaultGenerations(const unsigned int generations_) +{ + MagickLib::SetLogDefaultGenerations(generations_); +} + +// Specify default maximum number of logging events before creating a new log file. +void MagickDLLDecl Magick::SetLogDefaultLimit(const unsigned int limit_) +{ + MagickLib::SetLogDefaultLimit(limit_); +} + +// Specify the file name, or file path, to be written to for each log event +void MagickDLLDecl Magick::SetLogDefaultFileName(const std::string &filename_) +{ + MagickLib::SetLogDefaultFileName(filename_.c_str()); +} + +// Specify default log format using special format characters as used by "log.mgk" +void MagickDLLDecl Magick::SetLogDefaultFormat(const std::string &format_) +{ + MagickLib::SetLogDefaultFormat(format_.c_str()); +} + +// Specify default C-language call-back function to be invoked for each log event +// FIXME: Develop an improved interface more suitable for C++ +void MagickDLLDecl Magick::SetLogDefaultLogMethod(const Magick::LogMethod method_) +{ + MagickLib::SetLogDefaultLogMethod(method_); +} + +// Specify default logging output type/destination. +void MagickDLLDecl Magick::SetLogDefaultOutputType(const Magick::LogOutputType output_type_) +{ + MagickLib::SetLogDefaultOutputType(output_type_); +} + // C library initialization routine void MagickDLLDecl Magick::InitializeMagick(const char *path_) { diff --git a/Magick++/lib/Magick++/Drawable.h b/Magick++/lib/Magick++/Drawable.h index 8517879..55946dd 100644 --- a/Magick++/lib/Magick++/Drawable.h +++ b/Magick++/lib/Magick++/Drawable.h @@ -121,11 +121,16 @@ namespace Magick const Coordinate& right_ ); // - // Base class for all drawable objects + // Base class for all drawable objects (used to inherit from + // std::unary_function, but it was removed in C++'17). // - //struct MagickDLLDecl std::unary_function; - class MagickDLLDecl DrawableBase: - public std::unary_function + // https://en.cppreference.com/w/cpp/utility/functional/unary_function + // https://en.cppreference.com/w/cpp/utility/functional/function + // + class MagickDLLDecl DrawableBase +#if __cplusplus < 201703L + : public std::unary_function +#endif // if __cplusplus < 201703L { public: // Constructor diff --git a/Magick++/lib/Magick++/Image.h b/Magick++/lib/Magick++/Image.h index c49d309..77ef8d6 100644 --- a/Magick++/lib/Magick++/Image.h +++ b/Magick++/lib/Magick++/Image.h @@ -1,6 +1,6 @@ // This may look like C code, but it is really -*- C++ -*- // -// Copyright Bob Friesenhahn, 1999 - 2017 +// Copyright Bob Friesenhahn, 1999 - 2020 // // Definition of Image, the representation of a single image in Magick++ // @@ -46,6 +46,35 @@ namespace Magick int MagickDLLDecl operator <= ( const Magick::Image& left_, const Magick::Image& right_ ); + // + // Logging defaults initialization routines. These are + // pass-throughs into the equivalent C library functions. The + // purpose of these routines is to provide a program with an + // alternative to the default "log.mgk" based initialization. + // + + // Specify default events which will result in a log event (comma-separated list) + void MagickDLLDecl SetLogDefaultEventType(const std::string &events_); + + // Specify default maximum log file generations before overwriting the first name. + void MagickDLLDecl SetLogDefaultGenerations(const unsigned int generations_); + + // Specify default maximum number of logging events before creating a new log file. + void MagickDLLDecl SetLogDefaultLimit(const unsigned int limit_); + + // Specify the file name, or file path, to be written to for each log event + void MagickDLLDecl SetLogDefaultFileName(const std::string &filename_); + + // Specify default log format using special format characters as used by "log.mgk" + void MagickDLLDecl SetLogDefaultFormat(const std::string &format_); + + // Specify default C-language call-back function to be invoked for each log event + // FIXME: Develop an improved interface more suitable for C++ + void MagickDLLDecl SetLogDefaultLogMethod(const Magick::LogMethod method_); + + // Specify default logging output type/destination. + void MagickDLLDecl SetLogDefaultOutputType(const Magick::LogOutputType output_type_); + // C library initialization routine void MagickDLLDecl InitializeMagick(const char *path_); diff --git a/Magick++/lib/Magick++/Include.h b/Magick++/lib/Magick++/Include.h index 08ee533..370a921 100644 --- a/Magick++/lib/Magick++/Include.h +++ b/Magick++/lib/Magick++/Include.h @@ -1,6 +1,6 @@ // This may look like C code, but it is really -*- C++ -*- // -// Copyright Bob Friesenhahn, 1999 - 2018 +// Copyright Bob Friesenhahn, 1999 - 2020 // // Inclusion of GraphicsMagick headers (with namespace magic) @@ -205,7 +205,7 @@ namespace MagickLib #if defined(MAGICK_IMPLEMENTATION) namespace MagickLib -{ +{ // This header is now also included by magick/api.h # include "magick/enum_strings.h" } #endif @@ -744,6 +744,10 @@ namespace Magick using MagickLib::MirrorVirtualPixelMethod; using MagickLib::TileVirtualPixelMethod; + // Logging related types + using MagickLib::LogMethod; + using MagickLib::LogOutputType; + #if defined(MAGICK_IMPLEMENTATION) // // GraphicsMagick symbols used in implementation code @@ -913,6 +917,7 @@ namespace Magick using MagickLib::EnhanceImage; using MagickLib::EqualizeImage; using MagickLib::ExceptionInfo; + using MagickLib::ExceptionType; using MagickLib::ExecuteModuleProcess; using MagickLib::ExportImagePixelArea; using MagickLib::ExtentImage; diff --git a/Magick++/lib/Options.cpp b/Magick++/lib/Options.cpp index f19e09e..640ab5c 100644 --- a/Magick++/lib/Options.cpp +++ b/Magick++/lib/Options.cpp @@ -167,10 +167,10 @@ double Magick::Options::colorFuzz ( void ) const return _imageInfo->fuzz; } -// Enable printing of debug messages from ImageMagick +// Enable printing of debug messages from GraphicsMagick void Magick::Options::debug ( bool flag_ ) { - if(flag_) + if (flag_) { SetLogEventMask("All"); } @@ -181,7 +181,7 @@ void Magick::Options::debug ( bool flag_ ) } bool Magick::Options::debug ( void ) const { - if( IsEventLogging() ) + if ( IsEventLogging() ) { return true; } diff --git a/Magick++/tests/exceptions.cpp b/Magick++/tests/exceptions.cpp index 9cb81e6..ef6eca7 100644 --- a/Magick++/tests/exceptions.cpp +++ b/Magick++/tests/exceptions.cpp @@ -15,6 +15,9 @@ using namespace Magick; int main( int /*argc*/, char ** argv) { + // Trace exception events to help diagnose issues. + SetLogDefaultEventType("exception"); + // Initialize GraphicsMagick InitializeMagick(*argv); diff --git a/Makefile.in b/Makefile.in index 7d05bb9..6572b6e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -2307,6 +2307,7 @@ am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) @WITH_MAGICK_PLUS_PLUS_TRUE@am__EXEEXT_6 = \ @WITH_MAGICK_PLUS_PLUS_TRUE@ $(MAGICKPP_TEST_SCRIPTS_OPT) @@ -2378,6 +2379,8 @@ am__remove_distdir = \ else :; fi am__post_remove_distdir = $(am__remove_distdir) GZIP_ENV = --best +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -3897,6 +3900,7 @@ MAGICK_INCLUDE_HDRS = \ magick/draw.h \ magick/effect.h \ magick/enhance.h \ + magick/enum_strings.h \ magick/error.h \ magick/forward.h \ magick/fx.h \ @@ -4598,6 +4602,7 @@ WWWAPI_HTML_TARGETS = \ $(WWWAPIDIR)/image.html \ $(WWWAPIDIR)/import.html \ $(WWWAPIDIR)/list.html \ + $(WWWAPIDIR)/log.html \ $(WWWAPIDIR)/magick.html \ $(WWWAPIDIR)/memory.html \ $(WWWAPIDIR)/monitor.html \ @@ -4651,6 +4656,7 @@ WWWWAPI_FILES = \ www/api/image.html \ www/api/import.html \ www/api/list.html \ + www/api/log.html \ www/api/magick.html \ www/api/memory.html \ www/api/monitor.html \ @@ -9803,7 +9809,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ @@ -9966,6 +9972,8 @@ distcheck: dist eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -9981,7 +9989,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -10047,7 +10055,8 @@ installdirs: done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -10860,7 +10869,8 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-man: uninstall-man1 uninstall-man4 uninstall-man5 -.MAKE: all check check-am install install-am install-strip +.MAKE: all check check-am install install-am install-exec \ + install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local am--depfiles am--refresh \ check check-TESTS check-am check-local clean clean-binPROGRAMS \ @@ -10869,7 +10879,7 @@ uninstall-man: uninstall-man1 uninstall-man4 uninstall-man5 clean-libtool clean-local clean-noinstLTLIBRARIES cscope \ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-compile \ + dist-zip dist-zstd distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-local distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ diff --git a/NEWS.txt b/NEWS.txt index c1d0589..4d6a0b4 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -6,7 +6,7 @@ GraphicsMagick News =================== -This file was last updated to reflect changes up to February 23, 2020 +This file was last updated to reflect changes up to December 26, 2020 Please note that this file records news for the associated development branch and that each development branch has its own NEWS file. See the @@ -19,6 +19,196 @@ release and not attempt to patch older releases. .. contents:: :local: +1.3.36 (December 26, 2020) +========================== + +Special Issues: + +* None + +Security Fixes: + +* GraphicsMagick is participating in Google's oss-fuzz project due to + the contributions and assistance of Alex Gaynor. Since February 4 + 2018, 454 issues have been opened by oss-fuzz (some of which were + benign build issues such as SourceForge Mercurial not working + correctly) and 7 issues remain open (all of which are marked in an + "unreproducible" state). The issues list is available at + https://bugs.chromium.org/p/oss-fuzz/issues/list under search term + "graphicsmagick". Issues are available for anyone to view and + duplicate if they have been in "Verified" status for 30 days, or if + they have been in "New" status for 90 days. Please consult the + GraphicsMagick ChangeLog file, Mercurial repository commit log, and + the oss-fuzz issues list for details. + +* WPG: Fixes for heap buffer overflow. + +Bug fixes: + +* ConstituteImage(): Set image depth appropriately based on the + storage size specified by StorageType and QuantumDepth. + +* GetImageBoundingBox(): Fix problem that MagickTrimImage with extreme + fuzz values could produce an image with negative width. + +* ImageToFile(): Improve error handling to avoid possible deferred + deletion of temporary files, causing unexpected excessive use of + temporary file space. + +* JNG: Add validations for alpha compression method values and use + this information to enforce decoding using the appropriate + sub-format (rather than auto-detecting the format). Also, address + memory leaks which may occur if the sub-decoder does something other + than was expected. + +* MagickCondSignal(): Improvements to conditional signal handler + registration (which avoids over-riding signal handlers previously + registered by an API user). + +* ModifyCache(): Fix memory leak. + +* ReadCacheIndexes(): Don't blunder into accessing a null pointer if + the using code has ignored a previous error report bubled-up from + SetNexus(). + +* MNG: When doing image scaling and the image width or height is 1 + then always use simple pixel replication as per the MNG + specification. + +* MVG: Fixes to 'push clip-path foo' and 'pop clip-path foo' parsing + to eliminate a class of malign behavior. + +* MVG: Place an aribrary limit on stroke dash polygon unit maximum + length in order to avoid possibly rendering "forever". + +* PCL: No longer attempt to handle reading HP PCL format via the + external 'hp2xx' program since it seems worthless for that task. + +* PS: Fix corrupt image when writing PseudoClass image with a colormap + larger than two entries as bilevel. + +* SVG: Memory leak fixes. + +* SVG reader: Now support 'ping' support so the identify command works + as expected. + +* TIFF: WEBP compression only supports a depth of 8 so force that + value. + +* Wand MagickSetSamplingFactors(): Correct formatting of sampling + factors string. + +New Features: + +* Logging is now fully programmable. + +* DPX format: Support dpx:swap-samples-read define which behaves + similar to dpx:swap-samples, but is only applied when reading, as + well as dpx:swap-samples-write, which is only applied when + writing. This provides for use when there is both reading and + writing in the same operation (otherwise the final result was no + effect!). + +API Updates: + +* magick/api.h: Add "magick/enum_strings.h" to API headers. + +* New log settings accessor C functions: SetLogDefaultFileName(), + SetLogDefaultFormat(), SetLogDefaultOutputType(), + SetLogDefaultLogMethod(), SetLogDefaultLimit(), + SetLogDefaultGenerations(), SetLogDefaultEventType(). These + functions allow a program to set the same parameters which may be + set by loading a "log.mgk" function. If a default logging callback + was provided via SetLogDefaultLogMethod() such that MethodOutput is + used, then the search for a "log.mgk" is avoided entirely. + +* New log settings accessor C++ functions: SetLogDefaultFileName(), + SetLogDefaultFormat(), SetLogDefaultOutputType(), + SetLogDefaultLogMethod(), SetLogDefaultLimit(), + SetLogDefaultGenerations(), SetLogDefaultEventType(). These C++ + functions just pass through to the equivalent C functions and + provide the same benefits. + +Feature improvements: + +* A simple resource-limit respecting memory allocator has been + developed for internal use wherever arbitrarily-large amounts of + memory might be requested. This will gradually be added wherever it + appears to be needed. The memory resource limits are at the overall + process level. The MVG/SVG rendering code is updated to use this + new allocator. Almost all of the coders (image format + readers/writers) have now been updated to use this new allocator. + This means that '-limit memory 300MB' would be more complete and + meaningful now. Temporary allocations by the image processing + algorithms (other than for the images themselves) are still not + accounted for in the resource limiting. + +* MVG Renderer / DrawImage(): Use resource-limit respecting memory + allocators for remaining large memory allocations. + +* PNG writer: Don't skip optional Exif identifier code if it isn't present. + +* DPX reader/writer: decode/encode of 10-bit packed DPX is now twice + as fast due to code simplification. + +* TIFF reader: Apply the same resource limits to TIFF tile sizes as + apply to the image itself. + +Windows Delegate Updates/Additions: + +* None + +Build Changes: + +* configure.ac: Update syntax to avoid using deprecated syntax + according to Autoconf 2.69. Also added copious m4 quoting. + +* Magick++ Drawable base class no longer uses std::unary_function when + compiled using C++'17 or later, since this feature has been removed + from the language. + +* Support the configure option --disable-compressed-files to disable + automatic decompress of gzip and bzip2 compressed files (e.g. files + with extension 'gz' or 'bz2', and sometimes 'svgz', but sometimes + posing as some other format). It turns out that there are some + extremely compressed files (e.g. over 1000x compression ratio) which + can take a long time to decompress and produce large temporary + files. We currently normally wait for the whole file to be + decompressed before decoding it. The only exception is for coders + with native 'blob' support and which do not require seeking, and + that the user forced forced the format by adding a magick prefix + like "DPX:file.dpx" to avoid the automatic file format detection. + +* Support the configure option --without-gs to disable reading PS, + EPS, and PDF formats via an external Ghostscript delegate program. + This corresponds to the HasGS definition in the source code. + +* Support the configure option --without-gdi32 to support disabling + use of the Microsoft Windows gdi32 library if it is not wanted. + +* The Automake-based test suite now applies a memory limit of 128MB + for the Q8, or 256MB for the Q16, or 512MB for the Q32 build, as + well as setting a disk space limit of 0. The limits place an upper + bound on the resources required, while assuring that tests do pass + with resource limits applied, while also assuring that disk-based + pixel-cache files are not used. + +Behavior Changes: + +* Previously the formatting settings from "log.mgk" were only used + when writing to a file, or to the console, via a file handle. Now + the log formatting has been normalized so that the settings provided + by "log.mgk" (or SetLogDefaultFormat()) will always be used. It is + possible this may result in some formatting changes. + +* In the Windows Visual Studio build, the ProvideDllMain option is now + disabled by default (can still be enabled) since it causes + InitializeMagick() to be invoked prior to when the program's main() + routine is called, thereby blocking configuration activities or use + of InitializeMagickEx(). With this change it is even more + imperative that InitializeMagick() be explicitly invoked by all + programs using GraphicsMagick. + 1.3.35 (February 23, 2020) ========================== @@ -4720,10 +4910,3 @@ The objectives of GraphicsMagick are to: * Improve memory efficiency. * Use a release process which assures a working product. * Maintain an accurate ChangeLog. - - ---------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2018 diff --git a/PerlMagick/Magick.pm b/PerlMagick/Magick.pm index 4052188..1a69071 100644 --- a/PerlMagick/Magick.pm +++ b/PerlMagick/Magick.pm @@ -40,7 +40,7 @@ require AutoLoader; ); # This version identifier must match the package version. -($VERSION) = '1.3.35' =~ /^([\d.]+)/g; +($VERSION) = '1.3.36' =~ /^([\d.]+)/g; sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant() diff --git a/README.txt b/README.txt index 3210bf9..5d60a02 100644 --- a/README.txt +++ b/README.txt @@ -385,10 +385,3 @@ building under Microsoft Windows: to read or write Zstd compressed TIFF images. In the future it is likely that other purposes will be found for Zstd. - - --------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/TclMagick/debian/README.Debian b/TclMagick/debian/README.Debian deleted file mode 100644 index a958b65..0000000 --- a/TclMagick/debian/README.Debian +++ /dev/null @@ -1,24 +0,0 @@ -tclmagick for Debian --------------------- - -If, at some point in the future, GraphicsMagick were to be packaged, -this could depend on that instead. - - -- David N. Welton , Sun Sep 19 20:45:49 2004 - -How to build and test a Debian package --------------------------------------- - -Build the package: - - dpkg-buildpackage -us -uc -b -rfakeroot - sudo dpkg -i ~/usrc/tclmagick_0.45-1_i386.deb - -Test the package: - - cd ~/usrc/TclMagick/tests/ - tclsh test-bmp-compare.tcl - tclsh test-draw.tcl - tclsh test-pixel.tcl - tclsh test-wand.tcl - tclsh tkmagick.tcl diff --git a/TclMagick/debian/changelog b/TclMagick/debian/changelog deleted file mode 100644 index b32b77f..0000000 --- a/TclMagick/debian/changelog +++ /dev/null @@ -1,39 +0,0 @@ -tclmagick (0.45-1) unstable; urgency=low - - * New upstream version. - * tclmagick_0.44-1(hppa/unstable): FTBFS: cannot find install-sh - - -- David N. Welton Sat, 22 Jan 2005 22:31:58 +0100 - -tclmagick (0.44-2) unstable; urgency=low - - * Use release tarball to generate .deb with. - - -- David N. Welton Sat, 22 Jan 2005 12:15:49 +0100 - -tclmagick (0.44-1) unstable; urgency=low - - * New version. - - -- David N. Welton Mon, 17 Jan 2005 23:08:03 +0100 - -tclmagick (0.42-1.1) unstable; urgency=low - - * NMU - * Add dependency on tk8.4-dev (Closes: #274668) - * Remove NEWS file from package, it's empty. - - -- Baruch Even Tue, 4 Jan 2005 01:08:19 +0000 - -tclmagick (0.42-1) unstable; urgency=low - - * New upstream release. - - -- David N. Welton Tue, 21 Sep 2004 11:09:38 +0200 - -tclmagick (0.41-1) unstable; urgency=low - - * Initial Release. - - -- David N. Welton Sun, 19 Sep 2004 20:31:33 +0200 - diff --git a/TclMagick/debian/compat b/TclMagick/debian/compat deleted file mode 100644 index b8626c4..0000000 --- a/TclMagick/debian/compat +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/TclMagick/debian/control b/TclMagick/debian/control deleted file mode 100644 index 672f0ea..0000000 --- a/TclMagick/debian/control +++ /dev/null @@ -1,15 +0,0 @@ -Source: tclmagick -Section: graphics -Priority: optional -Maintainer: David N. Welton -Build-Depends: debhelper (>= 4.0.0), fakeroot, libmagick9-dev, tcl8.4-dev, tk8.4-dev -Standards-Version: 3.6.0 - -Package: tclmagick -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Tcl bindings for ImageMagick - TclMagick is a Tcl extension that works with both the GraphicsMagick - and ImageMagick image manipulation libraries. TkMagick is a small, - simple extension that lets you pass images back and forth between Tk - and the TclMagick extension. diff --git a/TclMagick/debian/copyright b/TclMagick/debian/copyright deleted file mode 100644 index 3ca8c40..0000000 --- a/TclMagick/debian/copyright +++ /dev/null @@ -1,49 +0,0 @@ -This package was debianized by David N. Welton on -Sun, 19 Sep 2004 20:31:33 +0200. - -It was downloaded from http://tclmagick.sf.net - -Upstream Authors: Rolf Schrödter , David -Welton - -Copyright: - -This software is copyrighted 2004 by Rolf Schrödter - and David N. Welton . The -following terms apply to all files associated with the software unless -explicitly disclaimed in individual files. - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - -IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -MODIFICATIONS. - -GOVERNMENT USE: If you are acquiring this software on behalf of the -U.S. government, the Government shall have only "Restricted Rights" -in the software and related documentation as defined in the Federal -Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you -are acquiring the software on behalf of the Department of Defense, the -software shall be classified as "Commercial Computer Software" and the -Government shall have only "Restricted Rights" as defined in Clause -252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the -authors grant the U.S. Government and others acting in its behalf -permission to use and distribute the software in accordance with the -terms specified in this license. diff --git a/TclMagick/debian/dirs b/TclMagick/debian/dirs deleted file mode 100644 index ca882bb..0000000 --- a/TclMagick/debian/dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/bin -usr/sbin diff --git a/TclMagick/debian/docs b/TclMagick/debian/docs deleted file mode 100644 index e845566..0000000 --- a/TclMagick/debian/docs +++ /dev/null @@ -1 +0,0 @@ -README diff --git a/TclMagick/debian/rules b/TclMagick/debian/rules deleted file mode 100755 index 8492073..0000000 --- a/TclMagick/debian/rules +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -# -# Tcl version. Using 8.4 but 8.5 already available -# -TCLVERSION=8.4 - -# -# GraphicsMagick/ImageMagick Wand library selection. - -# GraphicsMagick -#WAND=GraphicsMagickWand - -# ImageMagick -WAND=Wand - -CFLAGS = -Wall -g - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - - ./configure --with-tcl=/usr/lib/tcl${TCLVERSION}/ --with-tk=/usr/lib/tk${TCLVERSION}/ --with-magick=/usr/bin/${WAND}-config --enable-threads --with-tclinclude=/usr/include/tcl${TCLVERSION}/ --with-tkinclude=/usr/include/tcl${TCLVERSION}/ - touch configure-stamp - - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - - # Add here commands to compile the package. - $(MAKE) - #/usr/bin/docbook-to-man debian/tclmagick.sgml > tclmagick.1 - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - -$(MAKE) clean - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/tclmagick. - $(MAKE) install DESTDIR=$(CURDIR)/debian/tclmagick - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs ChangeLog - dh_installdocs doc/* - dh_installexamples -# dh_install -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_python - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/aclocal.m4 b/aclocal.m4 index 5b43242..fdda58e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.3 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ 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'.])]) -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], +m4_if([$1], [1.16.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl +[AM_AUTOMAKE_VERSION([1.16.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -371,7 +371,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + 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).]) fi @@ -398,7 +400,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -595,7 +597,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -616,7 +618,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# Copyright (C) 2003-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -638,7 +640,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -673,7 +675,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -716,7 +718,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -737,12 +739,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -755,7 +752,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -784,7 +781,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -831,7 +828,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -850,7 +847,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -931,7 +928,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -991,7 +988,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1019,7 +1016,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# Copyright (C) 2006-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1038,7 +1035,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# Copyright (C) 2004-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/coders/art.c b/coders/art.c index c0b00cf..6ffd59b 100644 --- a/coders/art.c +++ b/coders/art.c @@ -124,7 +124,7 @@ static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception) /* If ping is true, then only set image size and colors without reading any image data. */ if (image_info->ping) goto DONE_READING; - BImgBuff=MagickAllocateMemory(unsigned char *,((size_t) ldblk)); /*Ldblk was set in the check phase*/ + BImgBuff=MagickAllocateResourceLimitedMemory(unsigned char *,((size_t) ldblk)); /*Ldblk was set in the check phase*/ if (BImgBuff==NULL) NoMemory: ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); @@ -141,7 +141,7 @@ static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception) (void)ImportImagePixelArea(image,GrayQuantum,1,BImgBuff,NULL,0); if (!SyncImagePixelsEx(image,exception)) break; } - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); if (i != height) ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); @@ -206,7 +206,7 @@ static MagickPassFail WriteARTImage(const ImageInfo *image_info,Image *image) DataSize = (long)((image->columns+7) / 8); Padding = (unsigned char)((-(long) DataSize) & 0x01); - pixels=MagickAllocateMemory(unsigned char *,(size_t) (DataSize)); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) (DataSize)); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -247,7 +247,7 @@ static MagickPassFail WriteARTImage(const ImageInfo *image_info,Image *image) } CloseBlob(image); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),"return ART"); diff --git a/coders/avs.c b/coders/avs.c index 224a761..dcbd1f4 100644 --- a/coders/avs.c +++ b/coders/avs.c @@ -85,7 +85,7 @@ static unsigned int #define AVS_HEIGHT_LIMIT 65536UL /* Artificially limit height to 64K pixels */ #define ThrowAVSReaderException(code_,reason_,image_) \ { \ - MagickFreeMemory(pixels); \ + MagickFreeResourceLimitedMemory(pixels); \ ThrowReaderException(code_,reason_,image_); \ } static Image *ReadAVSImage(const ImageInfo *image_info,ExceptionInfo *exception) @@ -160,7 +160,7 @@ static Image *ReadAVSImage(const ImageInfo *image_info,ExceptionInfo *exception) break; if (CheckImagePixelLimits(image, exception) != MagickPass) ThrowAVSReaderException(ResourceLimitError,ImagePixelLimitExceeded,image); - pixels=MagickAllocateArray(unsigned char *,image->columns,4); + pixels=MagickAllocateResourceLimitedArray(unsigned char *,image->columns,4); if (pixels == (unsigned char *) NULL) ThrowAVSReaderException(ResourceLimitError,MemoryAllocationFailed,image); row_bytes=(size_t) 4*image->columns; @@ -199,7 +199,7 @@ static Image *ReadAVSImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (MagickFail == status) break; @@ -383,7 +383,7 @@ static unsigned int WriteAVSImage(const ImageInfo *image_info,Image *image) /* Allocate memory for pixels. */ - pixels=MagickAllocateMemory(unsigned char *,image->columns*sizeof(PixelPacket)); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,image->columns*sizeof(PixelPacket)); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -412,7 +412,7 @@ static unsigned int WriteAVSImage(const ImageInfo *image_info,Image *image) image->columns,image->rows)) break; } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (image->next == (Image *) NULL) break; image=SyncNextImageInList(image); diff --git a/coders/bmp.c b/coders/bmp.c index b6d25c0..51ff9cc 100644 --- a/coders/bmp.c +++ b/coders/bmp.c @@ -542,8 +542,8 @@ static unsigned int IsBMP(const unsigned char *magick,const size_t length) */ #define ThrowBMPReaderException(code_,reason_,image_) \ do { \ - MagickFreeMemory(bmp_colormap); \ - MagickFreeMemory(pixels); \ + MagickFreeResourceLimitedMemory(bmp_colormap); \ + MagickFreeResourceLimitedMemory(pixels); \ ThrowReaderException(code_,reason_,image_); \ } while (0); @@ -1006,7 +1006,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) if (!AllocateImageColormap(image,image->colors)) ThrowBMPReaderException(ResourceLimitError,MemoryAllocationFailed, image); - bmp_colormap=MagickAllocateArray(unsigned char *,4,image->colors); + bmp_colormap=MagickAllocateResourceLimitedArray(unsigned char *,4,image->colors); if (bmp_colormap == (unsigned char *) NULL) ThrowBMPReaderException(ResourceLimitError,MemoryAllocationFailed, image); @@ -1034,7 +1034,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) if (packet_size == 4) p++; } - MagickFreeMemory(bmp_colormap); + MagickFreeResourceLimitedMemory(bmp_colormap); } if (image_info->ping && (image_info->subrange != 0)) @@ -1127,7 +1127,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) (MAGICK_SIZE_T) pixels_size); if (pixels_size == 0) ThrowBMPReaderException(CoderError,ArithmeticOverflow,image); - pixels=MagickAllocateMemory(unsigned char *, pixels_size); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *, pixels_size); if (pixels == (unsigned char *) NULL) ThrowBMPReaderException(ResourceLimitError,MemoryAllocationFailed,image); if ((bmp_info.compression == BI_RGB) || @@ -1465,7 +1465,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) default: ThrowBMPReaderException(CorruptImageError,ImproperImageHeader,image) } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (EOFBlob(image)) { ThrowException(exception,CorruptImageError,UnexpectedEndOfFile, @@ -1878,7 +1878,7 @@ static unsigned int WriteBMPImage(const ImageInfo *image_info,Image *image) /* Convert MIFF to BMP raster pixels. */ - pixels=MagickAllocateMemory(unsigned char *,bmp_info.image_size); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,bmp_info.image_size); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); switch (bmp_info.bits_per_pixel) @@ -2046,18 +2046,18 @@ static unsigned int WriteBMPImage(const ImageInfo *image_info,Image *image) Convert run-length encoded raster pixels. */ length=2*(bytes_per_line+2)*(image->rows+2)+2; - bmp_data=MagickAllocateMemory(unsigned char *,length); + bmp_data=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (bmp_data == (unsigned char *) NULL) { - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); ThrowWriterException(ResourceLimitError,MemoryAllocationFailed, - image) - } + image); + } bmp_info.file_size-=bmp_info.image_size; bmp_info.image_size=EncodeImage(image,bytes_per_line,pixels, bmp_data); bmp_info.file_size+=bmp_info.image_size; - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); pixels=bmp_data; bmp_info.compression=BI_RLE8; } @@ -2239,11 +2239,11 @@ static unsigned int WriteBMPImage(const ImageInfo *image_info,Image *image) if (logging) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Colormap: %u entries",image->colors); - bmp_colormap=MagickAllocateArray(unsigned char *,4, - (size_t) (1L << bmp_info.bits_per_pixel)); + bmp_colormap=MagickAllocateResourceLimitedArray(unsigned char *,4, + (size_t) (1L << bmp_info.bits_per_pixel)); if (bmp_colormap == (unsigned char *) NULL) { - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); ThrowWriterException(ResourceLimitError,MemoryAllocationFailed, image); } @@ -2270,14 +2270,14 @@ static unsigned int WriteBMPImage(const ImageInfo *image_info,Image *image) else (void) WriteBlob(image,4*(1UL << bmp_info.bits_per_pixel), (char *) bmp_colormap); - MagickFreeMemory(bmp_colormap); + MagickFreeResourceLimitedMemory(bmp_colormap); } if (logging) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Pixels: %" MAGICK_SIZE_T_F "u bytes", (MAGICK_SIZE_T) bmp_info.image_size); (void) WriteBlob(image,bmp_info.image_size,(char *) pixels); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (image->next == (Image *) NULL) { if (logging) diff --git a/coders/cineon.c b/coders/cineon.c index 93daec9..e7b65f7 100644 --- a/coders/cineon.c +++ b/coders/cineon.c @@ -717,13 +717,18 @@ static Image *ReadCINEONImage(const ImageInfo *image_info, user_data=(unsigned char *) NULL; while (user_data_length < cin_file_info.user_defined_length) { + unsigned char *new_user_data; read_size=Min(block_size,cin_file_info.user_defined_length-user_data_length); - MagickReallocMemory(unsigned char *,user_data,user_data_length+read_size); - if (user_data == (unsigned char *) NULL) - ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); + new_user_data=MagickReallocateResourceLimitedMemory(unsigned char *,user_data,user_data_length+read_size); + if (new_user_data == (unsigned char *) NULL) + { + MagickFreeResourceLimitedMemory(user_data); + ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); + } + user_data=new_user_data; if (ReadBlob(image,read_size,user_data+user_data_length) != read_size) { - MagickFreeMemory(user_data); + MagickFreeResourceLimitedMemory(user_data); ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } user_data_length += read_size; @@ -731,10 +736,10 @@ static Image *ReadCINEONImage(const ImageInfo *image_info, } if (!SetImageProfile(image,"CINEONUSERDATA",user_data,user_data_length)) { - MagickFreeMemory(user_data); + MagickFreeResourceLimitedMemory(user_data); ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); } - MagickFreeMemory(user_data); + MagickFreeResourceLimitedMemory(user_data); } if (image_info->ping) @@ -796,7 +801,7 @@ static Image *ReadCINEONImage(const ImageInfo *image_info, { scandata_bytes=4; scale_to_short=64; - scandata=MagickAllocateMemory(unsigned char *,scandata_bytes); + scandata=MagickAllocateResourceLimitedMemory(unsigned char *,scandata_bytes); if (scandata == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); scanline=scandata; @@ -838,14 +843,14 @@ static Image *ReadCINEONImage(const ImageInfo *image_info, image->columns,image->rows)) break; } - MagickFreeMemory(scandata); + MagickFreeResourceLimitedMemory(scandata); break; } case 3: { scandata_bytes=MagickArraySize(image->columns,4); scale_to_short=64; - scandata=MagickAllocateMemory(unsigned char *,scandata_bytes); + scandata=MagickAllocateResourceLimitedMemory(unsigned char *,scandata_bytes); if (scandata == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); for (y=0; y < image->rows; y++) @@ -891,7 +896,7 @@ static Image *ReadCINEONImage(const ImageInfo *image_info, image->columns,image->rows)) break; } - MagickFreeMemory(scandata); + MagickFreeResourceLimitedMemory(scandata); break; } default: @@ -1476,7 +1481,7 @@ static unsigned int WriteCINEONImage(const ImageInfo *image_info,Image *image) scale_from_short=(65535U / (65535U >> (16-bits_per_sample))); scanline_bytes=MagickArraySize(image->columns,4); - scanline=MagickAllocateMemory(unsigned char *,scanline_bytes); + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,scanline_bytes); if (scanline == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); (void) memset(scanline,0,scanline_bytes); @@ -1519,7 +1524,7 @@ static unsigned int WriteCINEONImage(const ImageInfo *image_info,Image *image) image->columns,image->rows)) break; } - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); } if ((magick_off_t) cin_file_info.file_size != TellBlob(image)) diff --git a/coders/cmyk.c b/coders/cmyk.c index fb3d2d0..63e5a15 100644 --- a/coders/cmyk.c +++ b/coders/cmyk.c @@ -84,7 +84,7 @@ static unsigned int */ #define ThrowCMYKReaderException(code_,reason_,image_) \ { \ - MagickFreeMemory(scanline); \ + MagickFreeResourceLimitedMemory(scanline); \ ThrowReaderException(code_,reason_,image_); \ } static Image *ReadCMYKImage(const ImageInfo *image_info, @@ -185,7 +185,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info, image->matte=True; packet_size=(quantum_size*5)/8; } - scanline=MagickAllocateArray(unsigned char *, + scanline=MagickAllocateResourceLimitedArray(unsigned char *, packet_size,image->columns); if (scanline == (unsigned char *) NULL) ThrowCMYKReaderException(ResourceLimitError,MemoryAllocationFailed,image); @@ -553,7 +553,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info, break; } } while (count != 0); - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); while (image->previous != (Image *) NULL) image=image->previous; CloseBlob(image); @@ -730,10 +730,17 @@ static unsigned int WriteCMYKImage(const ImageInfo *image_info,Image *image) /* Allocate memory for pixels. */ - MagickReallocMemory(unsigned char *,pixels, - MagickArraySize(packet_size,image->columns)); - if (pixels == (unsigned char *) NULL) - ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); + unsigned char + *new_pixels; + + new_pixels=MagickReallocateResourceLimitedArray(unsigned char *,pixels, + packet_size,image->columns); + if (new_pixels == (unsigned char *) NULL) + { + MagickFreeResourceLimitedMemory(pixels); + ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); + } + pixels=new_pixels; /* Initialize export options. @@ -961,7 +968,7 @@ static unsigned int WriteCMYKImage(const ImageInfo *image_info,Image *image) if (status == False) break; } while (image_info->adjoin); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (image_info->adjoin) while (image->previous != (Image *) NULL) image=image->previous; diff --git a/coders/cut.c b/coders/cut.c index af623b3..a278b4f 100644 --- a/coders/cut.c +++ b/coders/cut.c @@ -510,7 +510,7 @@ static Image *ReadCUTImage(const ImageInfo *image_info,ExceptionInfo *exception) /* ----- Load RLE compressed raster ----- */ - BImgBuff=MagickAllocateMemory(unsigned char *,(size_t) (ldblk)); /*Ldblk was set in the check phase*/ + BImgBuff=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) (ldblk)); /*Ldblk was set in the check phase*/ if (BImgBuff==NULL) goto NoMemory; (void) SeekBlob(image,6 /*sizeof(Header)*/,SEEK_SET); @@ -595,7 +595,7 @@ static Image *ReadCUTImage(const ImageInfo *image_info,ExceptionInfo *exception) } Finish: - if (BImgBuff!=NULL) MagickFreeMemory(BImgBuff); + if (BImgBuff!=NULL) MagickFreeResourceLimitedMemory(BImgBuff); if (palette!=NULL) { DestroyImage(palette); diff --git a/coders/dcm.c b/coders/dcm.c index d0c6270..ddf2245 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -5533,12 +5533,12 @@ static MagickPassFail DCM_InitDCM(DicomStream *dcm,int verbose) static void DCM_DestroyDCM(DicomStream *dcm) { - MagickFreeMemory(dcm->offset_arr); - MagickFreeMemory(dcm->data); + MagickFreeResourceLimitedMemory(dcm->offset_arr); + MagickFreeResourceLimitedMemory(dcm->data); #if defined(USE_GRAYMAP) - MagickFreeMemory(dcm->graymap); + MagickFreeResourceLimitedMemory(dcm->graymap); #endif - MagickFreeMemory(dcm->rescale_map); + MagickFreeResourceLimitedMemory(dcm->rescale_map); } /* @@ -5940,7 +5940,7 @@ static MagickPassFail funcDCM_LUT(Image *image,DicomStream *dcm,ExceptionInfo *e colors=dcm->length/dcm->bytes_per_pixel; dcm->datum=(long) colors; - dcm->graymap=MagickAllocateArray(unsigned short *,colors,sizeof(unsigned short)); + dcm->graymap=MagickAllocateResourceLimitedArray(unsigned short *,colors,sizeof(unsigned short)); if (dcm->graymap == (unsigned short *) NULL) { ThrowException(exception,ResourceLimitError,MemoryAllocationFailed,image->filename); @@ -6322,7 +6322,7 @@ static MagickPassFail DCM_ReadElement(Image *image, DicomStream *dcm,ExceptionIn ThrowException(exception,CorruptImageError,ImproperImageHeader,image->filename); return MagickFail; } - dcm->data=MagickAllocateArray(unsigned char *,(dcm->length+1),dcm->quantum); + dcm->data=MagickAllocateResourceLimitedArray(unsigned char *,(dcm->length+1),dcm->quantum); if (dcm->data == (unsigned char *) NULL) { ThrowException(exception,ResourceLimitError,MemoryAllocationFailed,image->filename); @@ -6456,7 +6456,7 @@ static MagickPassFail DCM_SetupRescaleMap(Image *image,DicomStream *dcm,Exceptio if (dcm->rescale_map == (Quantum *) NULL) { size_t num_entries = Max((size_t) MaxMap+1,(size_t) dcm->max_value_in+1); - dcm->rescale_map=MagickAllocateArray(Quantum *,num_entries,sizeof(Quantum)); + dcm->rescale_map=MagickAllocateResourceLimitedArray(Quantum *,num_entries,sizeof(Quantum)); if (dcm->rescale_map == NULL) { ThrowException(exception,ResourceLimitError,MemoryAllocationFailed,image->filename); @@ -7141,7 +7141,7 @@ static MagickPassFail DCM_ReadOffsetTable(Image *image,DicomStream *dcm,Exceptio return MagickFail; } - dcm->offset_arr=MagickAllocateArray(magick_uint32_t *,dcm->offset_ct,sizeof(magick_uint32_t)); + dcm->offset_arr=MagickAllocateResourceLimitedArray(magick_uint32_t *,dcm->offset_ct,sizeof(magick_uint32_t)); if (dcm->offset_arr == (magick_uint32_t *) NULL) { ThrowException(exception,ResourceLimitError,MemoryAllocationFailed,image->filename); @@ -7449,7 +7449,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) pfunc=parse_funcs[dicom_info[dcm.index].funce]; if (pfunc != (DicomElemParseFunc *)NULL) status=pfunc(image,&dcm,exception); - MagickFreeMemory(dcm.data); + MagickFreeResourceLimitedMemory(dcm.data); dcm.data = NULL; dcm.length = 0; if (status == MagickPass) diff --git a/coders/dib.c b/coders/dib.c index 4a191f4..4a755d5 100644 --- a/coders/dib.c +++ b/coders/dib.c @@ -696,7 +696,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) */ if (!AllocateImageColormap(image,image->colors)) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); - dib_colormap=MagickAllocateArray(unsigned char *,image->colors,4); + dib_colormap=MagickAllocateResourceLimitedArray(unsigned char *,image->colors,4); if (dib_colormap == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); packet_size=4; @@ -709,7 +709,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) " (expected %" MAGICK_SIZE_T_F "u bytes)", (MAGICK_SIZE_T) count, (MAGICK_SIZE_T) packet_size*image->colors); - MagickFreeMemory(dib_colormap); + MagickFreeResourceLimitedMemory(dib_colormap); ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } p=dib_colormap; @@ -721,7 +721,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) if (packet_size == 4) p++; } - MagickFreeMemory(dib_colormap); + MagickFreeResourceLimitedMemory(dib_colormap); } /* Read image data. @@ -770,7 +770,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) pixels_size=MagickArraySize(image->rows,Max(bytes_per_line,(size_t) image->columns+1)); if (pixels_size == 0) ThrowReaderException(CoderError,ArithmeticOverflow,image); - pixels=MagickAllocateMemory(unsigned char *,pixels_size); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,pixels_size); if (pixels == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); if ((dib_info.compression == 0) || (dib_info.compression == 3)) @@ -783,7 +783,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) " (expected %" MAGICK_SIZE_T_F "u bytes)", (MAGICK_SIZE_T) count, (MAGICK_SIZE_T) length); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } } @@ -799,7 +799,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) (size_t) image->rows*image->columns); if (status == False) { - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); ThrowReaderException(CorruptImageError,UnableToRunlengthDecodeImage, image); } @@ -1037,11 +1037,11 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) } default: { - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); ThrowReaderException(CorruptImageError,ImproperImageHeader,image); } } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (EOFBlob(image)) ThrowException(exception,CorruptImageError,UnexpectedEndOfFile, image->filename); @@ -1370,7 +1370,7 @@ static unsigned int WriteDIBImage(const ImageInfo *image_info,Image *image) /* Convert MIFF to DIB raster pixels. */ - pixels=MagickAllocateMemory(unsigned char *,dib_info.image_size); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,dib_info.image_size); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); switch (dib_info.bits_per_pixel) @@ -1497,16 +1497,16 @@ static unsigned int WriteDIBImage(const ImageInfo *image_info,Image *image) Convert run-length encoded raster pixels. */ length=2*((size_t) bytes_per_line+2)*((size_t) image->rows+2)+2; - dib_data=MagickAllocateMemory(unsigned char *,length); + dib_data=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (dib_data == (unsigned char *) NULL) { - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); ThrowWriterException(ResourceLimitError,MemoryAllocationFailed, - image) + image); } dib_info.image_size=(unsigned long) EncodeImage(image,bytes_per_line,pixels,dib_data); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); pixels=dib_data; dib_info.compression=1; } @@ -1532,11 +1532,11 @@ static unsigned int WriteDIBImage(const ImageInfo *image_info,Image *image) /* Dump colormap to file. */ - dib_colormap=MagickAllocateArray(unsigned char *, - (((size_t) 1U) << dib_info.bits_per_pixel),4); + dib_colormap=MagickAllocateResourceLimitedArray(unsigned char *, + (((size_t) 1U) << dib_info.bits_per_pixel),4); if (dib_colormap == (unsigned char *) NULL) { - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); } q=dib_colormap; @@ -1556,10 +1556,10 @@ static unsigned int WriteDIBImage(const ImageInfo *image_info,Image *image) } (void) WriteBlob(image, 4*(((size_t) 1U) << dib_info.bits_per_pixel), (char *) dib_colormap); - MagickFreeMemory(dib_colormap); + MagickFreeResourceLimitedMemory(dib_colormap); } (void) WriteBlob(image,dib_info.image_size,(char *) pixels); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); CloseBlob(image); return(True); } diff --git a/coders/dps.c b/coders/dps.c index 263483f..030b677 100644 --- a/coders/dps.c +++ b/coders/dps.c @@ -256,7 +256,7 @@ static Image *ReadDPSImage(const ImageInfo *image_info, /* Get the colormap colors. */ - colors=MagickAllocateMemory(XColor *, + colors=MagickAllocateResourceLimitedMemory(XColor *, visual_info->colormap_size*sizeof(XColor)); if (colors == (XColor *) NULL) { @@ -433,7 +433,7 @@ static Image *ReadDPSImage(const ImageInfo *image_info, if (!AllocateImageColormap(image,visual_info->colormap_size)) { DestroyImage(image); - MagickFreeMemory(colors); + MagickFreeResourceLimitedMemory(colors); XDestroyImage(dps_image); MagickXFreeResources(display,visual_info,map_info,(MagickXPixelInfo *) NULL, (XFontStruct *) NULL,&resource_info,(MagickXWindowInfo *) NULL); @@ -472,7 +472,7 @@ static Image *ReadDPSImage(const ImageInfo *image_info, break; } } - MagickFreeMemory(colors); + MagickFreeResourceLimitedMemory(colors); XDestroyImage(dps_image); if (image->storage_class == PseudoClass) (void) SyncImage(image); diff --git a/coders/dpx.c b/coders/dpx.c index 54e61fb..93c911a 100644 --- a/coders/dpx.c +++ b/coders/dpx.c @@ -1184,19 +1184,19 @@ DPXOrientationToOrientationType(const unsigned int orientation) } #define LSBOctetsToPackedU32Word(scanline,packed_u32) \ -{ \ +do { \ packed_u32 = (((magick_uint32_t) *scanline++)); \ packed_u32 |= (((magick_uint32_t) *scanline++) << 8); \ packed_u32 |= (((magick_uint32_t) *scanline++) << 16); \ packed_u32 |= (((magick_uint32_t) *scanline++) << 24); \ -} + } while(0) #define MSBOctetsToPackedU32Word(scanline,packed_u32) \ -{ \ +do { \ packed_u32 = (((magick_uint32_t) *scanline++) << 24); \ packed_u32 |= (((magick_uint32_t) *scanline++) << 16); \ packed_u32 |= (((magick_uint32_t) *scanline++) << 8); \ packed_u32 |= (((magick_uint32_t) *scanline++)); \ -} + } while(0) /* Scale from a video level to a full-range level. @@ -1292,7 +1292,7 @@ STATIC void ReadRowSamples(const unsigned char *scanline, if (bits_per_sample == 10) { register magick_uint32_t - packed_u32; + packed_u32 = 0; register unsigned int datum; @@ -1339,39 +1339,23 @@ STATIC void ReadRowSamples(const unsigned char *scanline, if (endian_type == MSBEndian) { - for (i=samples_per_row/3; i != 0; --i) + for (i=0; i < samples_per_row; i++) { - datum=0; - MSBOctetsToPackedU32Word(scanline,packed_u32); - *sp++=(packed_u32 >> shifts[datum++]) & 0x3FF; - *sp++=(packed_u32 >> shifts[datum++]) & 0x3FF; + datum = i % 3; + if (datum == 0) + MSBOctetsToPackedU32Word(scanline,packed_u32); *sp++=(packed_u32 >> shifts[datum]) & 0x3FF; } - if ((samples_per_row % 3)) - { - datum=0; - MSBOctetsToPackedU32Word(scanline,packed_u32); - for (i=(samples_per_row % 3); i != 0; --i) - *sp++=(packed_u32 >> shifts[datum++]) & 0x3FF; - } } else if (endian_type == LSBEndian) { - for (i=samples_per_row/3; i != 0; --i) + for (i=0; i < samples_per_row; i++) { - datum=0; - LSBOctetsToPackedU32Word(scanline,packed_u32); - *sp++=(packed_u32 >> shifts[datum++]) & 0x3FF; - *sp++=(packed_u32 >> shifts[datum++]) & 0x3FF; + datum = i % 3; + if (datum == 0) + LSBOctetsToPackedU32Word(scanline,packed_u32); *sp++=(packed_u32 >> shifts[datum]) & 0x3FF; } - if ((samples_per_row % 3)) - { - datum=0; - LSBOctetsToPackedU32Word(scanline,packed_u32); - for (i=(samples_per_row % 3); i != 0; --i) - *sp++=(packed_u32 >> shifts[datum++]) & 0x3FF; - } } return; } @@ -1564,8 +1548,8 @@ STATIC void TentUpsampleChroma(PixelPacket *pixels, unsigned long columns) #define ThrowDPXReaderException(code_,reason_,image_) \ { \ - MagickFreeMemory(map_Y); \ - MagickFreeMemory(map_CbCr); \ + MagickFreeResourceLimitedMemory(map_Y); \ + MagickFreeResourceLimitedMemory(map_CbCr); \ if (samples_set) \ DestroyThreadViewDataSet(samples_set); \ if (scanline_set) \ @@ -1894,13 +1878,20 @@ STATIC Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) while (user_data_length < dpx_file_info.user_defined_length) { + unsigned char + *new_user_data; + read_size=Min(block_size,dpx_file_info.user_defined_length-user_data_length); - MagickReallocMemory(unsigned char *,user_data,user_data_length+read_size); - if (user_data == (unsigned char *) NULL) - ThrowDPXReaderException(ResourceLimitError,MemoryAllocationFailed,image); + new_user_data=MagickReallocateResourceLimitedMemory(unsigned char *,user_data,user_data_length+read_size); + if (new_user_data == (unsigned char *) NULL) + { + MagickFreeResourceLimitedMemory(user_data); + ThrowDPXReaderException(ResourceLimitError,MemoryAllocationFailed,image); + } + user_data=new_user_data; if (ReadBlob(image,read_size,user_data+user_data_length) != read_size) { - MagickFreeMemory(user_data); + MagickFreeResourceLimitedMemory(user_data); ThrowDPXReaderException(CorruptImageError,UnexpectedEndOfFile,image); } user_data_length += read_size; @@ -1911,10 +1902,10 @@ STATIC Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) StringToAttribute(image,"DPX:user.data.id",dpx_user_data->user_id); if (!SetImageProfile(image,"DPXUSERDATA",user_data,user_data_length)) { - MagickFreeMemory(user_data); + MagickFreeResourceLimitedMemory(user_data); ThrowDPXReaderException(ResourceLimitError,MemoryAllocationFailed,image); } - MagickFreeMemory(user_data); + MagickFreeResourceLimitedMemory(user_data); } } /* @@ -2388,13 +2379,13 @@ STATIC Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Maximum number of bits per sample in any element: %u", max_bits_per_sample); - map_Y=MagickAllocateArray(Quantum *, + map_Y=MagickAllocateResourceLimitedArray(Quantum *, MaxValueGivenBits(max_bits_per_sample)+1, sizeof(Quantum)); if (map_Y == (Quantum *) NULL) ThrowDPXReaderException(ResourceLimitError,MemoryAllocationFailed,image); - map_CbCr=MagickAllocateArray(Quantum *, + map_CbCr=MagickAllocateResourceLimitedArray(Quantum *, MaxValueGivenBits(max_bits_per_sample)+1, sizeof(Quantum)); if (map_CbCr == (Quantum *) NULL) @@ -2534,7 +2525,8 @@ STATIC Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) if ((bits_per_sample == 10) && (packing_method != PackingMethodPacked)) swap_word_datums = MagickTrue; } - if ((definition_value=AccessDefinition(image_info,"dpx","swap-samples"))) + if ((definition_value=AccessDefinition(image_info,"dpx","swap-samples")) || + (definition_value=AccessDefinition(image_info,"dpx","swap-samples-read"))) { if (LocaleCompare(definition_value,"false") != 0) swap_word_datums = swap_word_datums ? MagickFalse : MagickTrue; @@ -3048,8 +3040,8 @@ STATIC Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) image->is_monochrome=is_monochrome; image->is_grayscale=is_grayscale; image->depth=Min(QuantumDepth,image->depth); - MagickFreeMemory(map_CbCr); - MagickFreeMemory(map_Y); + MagickFreeResourceLimitedMemory(map_CbCr); + MagickFreeResourceLimitedMemory(map_Y); DestroyThreadViewDataSet(scanline_set); DestroyThreadViewDataSet(samples_set); StopTimer(&image->timer); @@ -3218,19 +3210,19 @@ STATIC U16 OrientationTypeToDPXOrientation(const OrientationType orientation_typ } #define LSBPackedU32WordToOctets(packed_u32,scanline) \ -{ \ +do { \ *scanline++=(unsigned char) ((packed_u32) & 0xFF); \ *scanline++=(unsigned char) ((packed_u32 >> 8) & 0xFF); \ *scanline++=(unsigned char) ((packed_u32 >> 16) & 0xFF); \ *scanline++=(unsigned char) ((packed_u32 >> 24) & 0xFF); \ -} + } while(0) #define MSBPackedU32WordToOctets(packed_u32,scanline) \ -{ \ +do { \ *scanline++=(unsigned char) ((packed_u32 >> 24) & 0xFF); \ *scanline++=(unsigned char) ((packed_u32 >> 16) & 0xFF); \ *scanline++=(unsigned char) ((packed_u32 >> 8) & 0xFF); \ *scanline++=(unsigned char) ((packed_u32) & 0xFF); \ -} + } while(0) /* WordStreamLSBWrite support @@ -3358,47 +3350,37 @@ STATIC void WriteRowSamples(const sample_t *samples, } } + datum=0; + packed_u32=0; if (endian_type == MSBEndian) { - /* Standard specified datum order */ - for (i=(samples_per_row/3); i != 0; --i) + for (i=0; i < samples_per_row; i++) { - datum=0; - packed_u32=0; - packed_u32 |= (((magick_uint32_t) *samples++) << shifts[datum++]); - packed_u32 |= (((magick_uint32_t) *samples++) << shifts[datum++]); + if (datum == 2) + { + MSBPackedU32WordToOctets(packed_u32,scanline); + packed_u32=0; + } + datum = i % 3; packed_u32 |= (((magick_uint32_t) *samples++) << shifts[datum]); - MSBPackedU32WordToOctets(packed_u32,scanline); - } - if ((samples_per_row % 3)) - { - datum=0; - packed_u32=0; - for (i=(samples_per_row % 3); i != 0; --i) - packed_u32 |= ((magick_uint32_t) *samples++ << shifts[datum++]); - MSBPackedU32WordToOctets(packed_u32,scanline); } + if ((samples_per_row+1) % 3 ) + MSBPackedU32WordToOctets(packed_u32,scanline); } else if (endian_type == LSBEndian) { - /* Standard specified datum order */ - for (i=(samples_per_row/3); i != 0; --i) + for (i=0; i < samples_per_row; i++) { - datum=0; - packed_u32=0; - packed_u32 |= (((magick_uint32_t) *samples++) << shifts[datum++]); - packed_u32 |= (((magick_uint32_t) *samples++) << shifts[datum++]); + if (datum == 2) + { + LSBPackedU32WordToOctets(packed_u32,scanline); + packed_u32=0; + } + datum = i % 3; packed_u32 |= (((magick_uint32_t) *samples++) << shifts[datum]); - LSBPackedU32WordToOctets(packed_u32,scanline); - } - if ((samples_per_row % 3)) - { - datum=0; - packed_u32=0; - for (i=(samples_per_row % 3); i != 0; --i) - packed_u32 |= (((magick_uint32_t) *samples++) << shifts[datum++]); - LSBPackedU32WordToOctets(packed_u32,scanline); } + if ((samples_per_row+1) % 3 ) + LSBPackedU32WordToOctets(packed_u32,scanline); } return; } @@ -3675,10 +3657,10 @@ STATIC void WriteRowSamples(const sample_t *samples, #define ThrowDPXWriterException(code_,reason_,image_) \ { \ - MagickFreeMemory(map_CbCr); \ - MagickFreeMemory(map_Y); \ - MagickFreeMemory(samples); \ - MagickFreeMemory(scanline); \ + MagickFreeResourceLimitedMemory(map_CbCr); \ + MagickFreeResourceLimitedMemory(map_Y); \ + MagickFreeResourceLimitedMemory(samples); \ + MagickFreeResourceLimitedMemory(scanline); \ if (chroma_image) \ DestroyImage(chroma_image); \ ThrowWriterException(code_,reason_,image_); \ @@ -4352,7 +4334,7 @@ STATIC unsigned int WriteDPXImage(const ImageInfo *image_info,Image *image) /* Allocate row samples. */ - samples=MagickAllocateArray(sample_t *,image->columns, + samples=MagickAllocateResourceLimitedArray(sample_t *,image->columns, max_samples_per_pixel*sizeof(sample_t)); if (samples == (sample_t *) NULL) ThrowDPXWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -4361,7 +4343,7 @@ STATIC unsigned int WriteDPXImage(const ImageInfo *image_info,Image *image) /* Allocate row scanline. */ - scanline=MagickAllocateMemory(unsigned char *,row_octets); + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,row_octets); if (scanline == (unsigned char *) NULL) ThrowDPXWriterException(ResourceLimitError,MemoryAllocationFailed,image); (void) memset((void *) scanline,0,row_octets); @@ -4369,12 +4351,12 @@ STATIC unsigned int WriteDPXImage(const ImageInfo *image_info,Image *image) /* Allocate sample translation map storage. */ - map_Y=MagickAllocateArray(sample_t *,MaxMap+1,sizeof(sample_t)); + map_Y=MagickAllocateResourceLimitedArray(sample_t *,MaxMap+1,sizeof(sample_t)); if (map_Y == (sample_t *) NULL) ThrowDPXWriterException(ResourceLimitError,MemoryAllocationFailed,image); (void) memset((void *) map_Y,0,(MaxMap+1)*sizeof(sample_t)); - map_CbCr=MagickAllocateArray(sample_t *,MaxMap+1,sizeof(sample_t)); + map_CbCr=MagickAllocateResourceLimitedArray(sample_t *,MaxMap+1,sizeof(sample_t)); if (map_CbCr == (sample_t *) NULL) ThrowDPXWriterException(ResourceLimitError,MemoryAllocationFailed,image); (void) memset((void *) map_CbCr,0,(MaxMap+1)*sizeof(sample_t)); @@ -4544,12 +4526,12 @@ STATIC unsigned int WriteDPXImage(const ImageInfo *image_info,Image *image) if ((bits_per_sample == 10) && (packing_method != PackingMethodPacked)) swap_word_datums = MagickTrue; } - if ((definition_value=AccessDefinition(image_info,"dpx","swap-samples"))) + if ((definition_value=AccessDefinition(image_info,"dpx","swap-samples")) || + (definition_value=AccessDefinition(image_info,"dpx","swap-samples-write"))) { if (LocaleCompare(definition_value,"false") != 0) swap_word_datums = swap_word_datums ? MagickFalse : MagickTrue; } - /* Create a chroma image if we are subsampling YCbCr. */ @@ -4795,10 +4777,10 @@ STATIC unsigned int WriteDPXImage(const ImageInfo *image_info,Image *image) } } - MagickFreeMemory(map_CbCr); - MagickFreeMemory(map_Y); - MagickFreeMemory(samples); - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(map_CbCr); + MagickFreeResourceLimitedMemory(map_Y); + MagickFreeResourceLimitedMemory(samples); + MagickFreeResourceLimitedMemory(scanline); CloseBlob(image); if (chroma_image != (Image *) NULL) { diff --git a/coders/emf.c b/coders/emf.c index 16b9516..4b9ca52 100644 --- a/coders/emf.c +++ b/coders/emf.c @@ -150,7 +150,7 @@ static HENHMETAFILE ReadEnhMetaFile(const char *szFileName,long *width, DeleteMetaFile(hOld); return((HENHMETAFILE) NULL); } - pBits=MagickAllocateMemory(LPBYTE,dwSize); + pBits=MagickAllocateResourceLimitedMemory(LPBYTE,dwSize); if (pBits == (LPBYTE) NULL) { DeleteMetaFile(hOld); @@ -158,7 +158,7 @@ static HENHMETAFILE ReadEnhMetaFile(const char *szFileName,long *width, } if (GetMetaFileBitsEx(hOld,dwSize,pBits) == 0) { - MagickFreeMemory(pBits); + MagickFreeResourceLimitedMemory(pBits); DeleteMetaFile(hOld); return((HENHMETAFILE) NULL); } @@ -173,7 +173,7 @@ static HENHMETAFILE ReadEnhMetaFile(const char *szFileName,long *width, hTemp=SetWinMetaFileBits(dwSize,pBits,hDC,&mp); ReleaseDC(NULL,hDC); DeleteMetaFile(hOld); - MagickFreeMemory(pBits); + MagickFreeResourceLimitedMemory(pBits); GetEnhMetaFileHeader(hTemp,sizeof(ENHMETAHEADER),&emfh); *width=emfh.rclFrame.right-emfh.rclFrame.left; *height=emfh.rclFrame.bottom-emfh.rclFrame.top; @@ -187,7 +187,7 @@ static HENHMETAFILE ReadEnhMetaFile(const char *szFileName,long *width, if (hFile == INVALID_HANDLE_VALUE) return(NULL); dwSize=GetFileSize(hFile,NULL); - pBits=MagickAllocateMemory(LPBYTE,dwSize); + pBits=MagickAllocateResourceLimitedMemory(LPBYTE,dwSize); if (pBits == (LPBYTE) NULL) { CloseHandle(hFile); @@ -197,7 +197,7 @@ static HENHMETAFILE ReadEnhMetaFile(const char *szFileName,long *width, CloseHandle(hFile); if (((PAPMHEADER) pBits)->dwKey != 0x9ac6cdd7l) { - MagickFreeMemory(pBits); + MagickFreeResourceLimitedMemory(pBits); return((HENHMETAFILE) NULL); } /* @@ -214,7 +214,7 @@ static HENHMETAFILE ReadEnhMetaFile(const char *szFileName,long *width, hDC=GetDC(NULL); hTemp=SetWinMetaFileBits(dwSize,&(pBits[sizeof(APMHEADER)]),hDC,&mp); ReleaseDC(NULL,hDC); - MagickFreeMemory(pBits); + MagickFreeResourceLimitedMemory(pBits); return(hTemp); } @@ -308,31 +308,34 @@ static Image *ReadEMFImage(const ImageInfo *image_info, /* flags; */ geometry=GetPageGeometry(image_info->page); - p=strchr(geometry,'>'); - if (!p) + if (geometry != NULL) { - /*flags=*/ (void) GetMagickGeometry(geometry,&sans,&sans,&image->columns, - &image->rows); - if (image->x_resolution != 0.0) - image->columns=(unsigned int) - ((image->columns*image->x_resolution)+0.5); - if (image->y_resolution != 0.0) - image->rows=(unsigned int) - ((image->rows*image->y_resolution)+0.5); + p=strchr(geometry,'>'); + if (!p) + { + /*flags=*/ (void) GetMagickGeometry(geometry,&sans,&sans,&image->columns, + &image->rows); + if (image->x_resolution != 0.0) + image->columns=(unsigned int) + ((image->columns*image->x_resolution)+0.5); + if (image->y_resolution != 0.0) + image->rows=(unsigned int) + ((image->rows*image->y_resolution)+0.5); + } + else + { + *p='\0'; + /*flags=*/ (void) GetMagickGeometry(geometry,&sans,&sans,&image->columns, + &image->rows); + if (image->x_resolution != 0.0) + image->columns=(unsigned int) + (((image->columns*image->x_resolution)/72.0)+0.5); + if (image->y_resolution != 0.0) + image->rows=(unsigned int) + (((image->rows*image->y_resolution)/72.0)+0.5); + } + MagickFreeMemory(geometry); } - else - { - *p='\0'; - /*flags=*/ (void) GetMagickGeometry(geometry,&sans,&sans,&image->columns, - &image->rows); - if (image->x_resolution != 0.0) - image->columns=(unsigned int) - (((image->columns*image->x_resolution)/72.0)+0.5); - if (image->y_resolution != 0.0) - image->rows=(unsigned int) - (((image->rows*image->y_resolution)/72.0)+0.5); - } - MagickFreeMemory(geometry); } hDC=GetDC(NULL); if (!hDC) diff --git a/coders/ept.c b/coders/ept.c index 38c00c9..abbe7cc 100644 --- a/coders/ept.c +++ b/coders/ept.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 GraphicsMagick Group +% Copyright (C) 2003-2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -122,6 +122,7 @@ static unsigned int IsEPT(const unsigned char *magick,const size_t length) % % */ +#if defined(HasGS) static Image *ReadEPTImage(const ImageInfo *image_info, ExceptionInfo *exception) { @@ -390,16 +391,6 @@ static Image *ReadEPTImage(const ImageInfo *image_info, DestroyImageInfo(clone_info); } (void) LiberateTemporaryFile((char *) image_info->filename); -#if defined(HasDPS) - if (image == (Image *) NULL) - { - /* - Ghostscript has failed-- try the Display Postscript Extension. - */ - (void) FormatString((char *) image_info->filename,"dps:%.1024s",filename); - image=ReadImage(image_info,exception); - } -#endif /* defined(HasDPS) */ if (image == (Image *) NULL) if (UndefinedException == exception->severity) ThrowException(exception,DelegateError,PostscriptDelegateFailed,filename); @@ -418,6 +409,7 @@ static Image *ReadEPTImage(const ImageInfo *image_info, } return(image); } +#endif /* if defined(HasGS) */ /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -448,7 +440,9 @@ ModuleExport void RegisterEPTImage(void) *entry; entry=SetMagickInfo("EPT"); +#if defined(HasGS) entry->decoder=(DecoderHandler) ReadEPTImage; +#endif /* if defined(HasGS) */ entry->encoder=(EncoderHandler) WriteEPTImage; entry->magick=(MagickHandler) IsEPT; entry->adjoin=False; @@ -459,7 +453,9 @@ ModuleExport void RegisterEPTImage(void) (void) RegisterMagickInfo(entry); entry=SetMagickInfo("EPT2"); +#if defined(HasGS) entry->decoder=(DecoderHandler) ReadEPTImage; +#endif /* if defined(HasGS) */ entry->encoder=(EncoderHandler) WriteEPTImage; entry->magick=(MagickHandler) IsEPT; entry->adjoin=False; @@ -470,7 +466,9 @@ ModuleExport void RegisterEPTImage(void) (void) RegisterMagickInfo(entry); entry=SetMagickInfo("EPT3"); +#if defined(HasGS) entry->decoder=(DecoderHandler) ReadEPTImage; +#endif /* if defined(HasGS) */ entry->encoder=(EncoderHandler) WriteEPTImage; entry->magick=(MagickHandler) IsEPT; entry->adjoin=False; diff --git a/coders/fax.c b/coders/fax.c index 5e32a25..bcf1a45 100644 --- a/coders/fax.c +++ b/coders/fax.c @@ -273,8 +273,8 @@ ModuleExport void UnregisterFAXImage(void) % % A description of each parameter follows. % -% o status: Method WriteFAXImage return True if the image is written. -% False is returned is there is a memory shortage or if the image file +% o status: Method WriteFAXImage return MagickPass if the image is written. +% MagickFail is returned is there is a memory shortage or if the image file % fails to write. % % o image_info: Specifies a pointer to a ImageInfo structure. @@ -283,12 +283,12 @@ ModuleExport void UnregisterFAXImage(void) % % */ -static unsigned int WriteFAXImage(const ImageInfo *image_info,Image *image) +static MagickPassFail WriteFAXImage(const ImageInfo *image_info,Image *image) { ImageInfo *clone_info; - unsigned int + MagickPassFail status; unsigned long @@ -305,9 +305,9 @@ static unsigned int WriteFAXImage(const ImageInfo *image_info,Image *image) assert(image != (Image *) NULL); assert(image->signature == MagickSignature); status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception); - image_list_length=GetImageListLength(image); - if (status == False) + if (status == MagickFail) ThrowWriterException(FileOpenError,UnableToOpenFile,image); + image_list_length=GetImageListLength(image); clone_info=CloneImageInfo(image_info); (void) strcpy(clone_info->magick,"FAX"); scene=0; @@ -316,15 +316,19 @@ static unsigned int WriteFAXImage(const ImageInfo *image_info,Image *image) /* Convert MIFF to monochrome. */ - (void) TransformColorspace(image,RGBColorspace); - status=HuffmanEncodeImage(clone_info,image); + status &= TransformColorspace(image,RGBColorspace); + if (status != MagickPass) + break; + status &= HuffmanEncodeImage(clone_info,image); + if (status != MagickPass) + break; if (image->next == (Image *) NULL) break; image=SyncNextImageInList(image); - status=MagickMonitorFormatted(scene++,image_list_length, - &image->exception,SaveImagesText, - image->filename); - if (status == False) + status &= MagickMonitorFormatted(scene++,image_list_length, + &image->exception,SaveImagesText, + image->filename); + if (status != MagickPass) break; } while (clone_info->adjoin); DestroyImageInfo(clone_info); diff --git a/coders/fits.c b/coders/fits.c index 7ef62c2..57076e0 100644 --- a/coders/fits.c +++ b/coders/fits.c @@ -585,7 +585,7 @@ static Image *ReadFITSImage(const ImageInfo *image_info, } } - fits_pixels=MagickAllocateArray(unsigned char *, image->columns, packet_size); + fits_pixels=MagickAllocateResourceLimitedArray(unsigned char *, image->columns, packet_size); if (fits_pixels == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); @@ -654,7 +654,7 @@ static Image *ReadFITSImage(const ImageInfo *image_info, image->columns,image->rows)) break; } - MagickFreeMemory(fits_pixels); + MagickFreeResourceLimitedMemory(fits_pixels); if (EOFBlob(image)) { ThrowException(exception,CorruptImageError,UnexpectedEndOfFile, image->filename); @@ -761,8 +761,8 @@ ModuleExport void UnregisterFITSImage(void) This functions inserts one row into a HDU. Note that according to FITS spec a card image contains 80 bytes of ASCII data. - buffer - 2880 byte logical FITS record. - data - string data to append + buffer - 2880 byte logical FITS record (initially memset to 0). + data - string data to append at offset offset - offset into FITS record to write the data. */ int InsertRowHDU(char *buffer, const char *data, int offset) @@ -778,7 +778,7 @@ int InsertRowHDU(char *buffer, const char *data, int offset) if (len > (size_t) (((size_t)FITS_BLOCK_SIZE)-offset)) len = ((size_t) FITS_BLOCK_SIZE)-offset; - (void) strncpy(buffer+offset,data,len); + (void) memcpy(buffer+offset,data,len); return offset +80; } @@ -875,15 +875,15 @@ static MagickPassFail WriteFITSImage(const ImageInfo *image_info,Image *image) Allocate image memory. */ packet_size=quantum_size/8; - fits_info=MagickAllocateMemory(char *,FITS_BLOCK_SIZE); + fits_info=MagickAllocateResourceLimitedMemory(char *,FITS_BLOCK_SIZE); if (fits_info == (char *) NULL) { ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); } - pixels=MagickAllocateArray(unsigned char *,packet_size,image->columns); + pixels=MagickAllocateResourceLimitedArray(unsigned char *,packet_size,image->columns); if (pixels == (unsigned char *) NULL) { - MagickFreeMemory(fits_info); + MagickFreeResourceLimitedMemory(fits_info); ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); } @@ -949,9 +949,9 @@ static MagickPassFail WriteFITSImage(const ImageInfo *image_info,Image *image) memset(fits_info, 0, y); (void)WriteBlob(image,y,(char *) fits_info); } - MagickFreeMemory(fits_info); + MagickFreeResourceLimitedMemory(fits_info); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); CloseBlob(image); return(True); } diff --git a/coders/fpx.c b/coders/fpx.c index 0738732..e6d450f 100644 --- a/coders/fpx.c +++ b/coders/fpx.c @@ -267,7 +267,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Note image label. */ - label=MagickAllocateMemory(char *,summary_info.title.length+1); + label=MagickAllocateResourceLimitedMemory(char *,summary_info.title.length+1); if (label == (char *) NULL) { FPX_ClearSystem(); @@ -277,7 +277,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) strlcpy(label,(char *) summary_info.title.ptr, summary_info.title.length+1); (void) SetImageAttribute(image,"label",label); - MagickFreeMemory(label); + MagickFreeResourceLimitedMemory(label); } if (summary_info.comments_valid) if ((summary_info.comments.length != 0) && @@ -289,7 +289,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Note image comment. */ - comments=MagickAllocateMemory(char *,summary_info.comments.length+1); + comments=MagickAllocateResourceLimitedMemory(char *,summary_info.comments.length+1); if (comments == (char *) NULL) { FPX_ClearSystem(); @@ -299,7 +299,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) strlcpy(comments,(char *) summary_info.comments.ptr, summary_info.comments.length+1); (void) SetImageAttribute(image,"comment",comments); - MagickFreeMemory(comments); + MagickFreeResourceLimitedMemory(comments); } /* Determine resolution by subimage specification. @@ -352,7 +352,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Allocate memory for the image and pixel buffer. */ - scanline=MagickAllocateMemory(unsigned char *,colorspace.numberOfComponents* + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,colorspace.numberOfComponents* image->columns*(tile_height+1)); if (scanline == (unsigned char *) NULL) { @@ -409,7 +409,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) (long) tile_height,&fpx_info); if (fpx_status == FPX_LOW_MEMORY_ERROR) { - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); (void) FPX_CloseImage(flashpix); FPX_ClearSystem(); ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, @@ -453,7 +453,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) if (!MagickMonitor(LoadImageText,y,image->rows,exception)) break; } - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); (void) FPX_CloseImage(flashpix); FPX_ClearSystem(); StopTimer(&image->timer); @@ -906,7 +906,7 @@ static unsigned int WriteFPXImage(const ImageInfo *image_info,Image *image) /* Allocate pixels. */ - pixels=MagickAllocateMemory(unsigned char *, + pixels=MagickAllocateResourceLimitedMemory(unsigned char *, colorspace.numberOfComponents*image->columns); if (pixels == (unsigned char *) NULL) { @@ -1081,7 +1081,7 @@ static unsigned int WriteFPXImage(const ImageInfo *image_info,Image *image) } (void) FPX_CloseImage(flashpix); FPX_ClearSystem(); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); return(True); } #else diff --git a/coders/gif.c b/coders/gif.c index 8fac9e9..cfe60f3 100644 --- a/coders/gif.c +++ b/coders/gif.c @@ -980,17 +980,24 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) header[count]='\0'; if (count+offset+1 >= allocation_length) { + char *comments_new; allocation_length=allocation_length+count+1; MagickRoundUpStringLength(allocation_length); - MagickReallocMemory(char *,comments,allocation_length); - if (comments == (char *) NULL) - ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); + comments_new=MagickReallocateResourceLimitedMemory(char *, + comments, + allocation_length); + if (comments_new == (char *) NULL) + { + MagickFreeResourceLimitedMemory(comments); + ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); + } + comments=comments_new; (void) strlcpy(&comments[offset],(char *)header,allocation_length-offset); } } (void) SetImageAttribute(image,"comment",NULL); (void) SetImageAttribute(image,"comment",comments); - MagickFreeMemory(comments); + MagickFreeResourceLimitedMemory(comments); break; } case 0xff: @@ -1497,7 +1504,7 @@ static MagickPassFail WriteGIFImage(const ImageInfo *image_info,Image *image) for (p=image->colormap, j=0; j < Max(image->colors-1,1); j++, p++) if (ColorMatch(&image->background_color,p)) break; - (void) WriteBlobByte(image,(long) j); /* background color */ + (void) WriteBlobByte(image,(magick_uint8_t) j); /* background color */ (void) WriteBlobByte(image,0x0); /* reserved */ (void) WriteBlob(image,3*(((size_t) 1) << bits_per_pixel),(char *) colormap); for (j=0; j < 768; j++) @@ -1541,7 +1548,7 @@ static MagickPassFail WriteGIFImage(const ImageInfo *image_info,Image *image) while (strlen(p) != 0) { count=Min(strlen(p),255); - (void) WriteBlobByte(image,(long) count); + (void) WriteBlobByte(image, (magick_uint8_t)count); for (i=0; i < count; i++) (void) WriteBlobByte(image,*p++); } diff --git a/coders/gray.c b/coders/gray.c index 62f4aed..0422858 100644 --- a/coders/gray.c +++ b/coders/gray.c @@ -248,7 +248,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, quantum_size=32; samples_per_pixel=MagickGetQuantumSamplesPerPixel(quantum_type); packet_size=(quantum_size*samples_per_pixel)/8; - scanline=MagickAllocateArray(unsigned char *,packet_size,image->tile_info.width); + scanline=MagickAllocateResourceLimitedArray(unsigned char *,packet_size,image->tile_info.width); if (scanline == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); tile_packets=(size_t) packet_size*image->tile_info.width; @@ -345,7 +345,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, AllocateNextImage(image_info,image); if (image->next == (Image *) NULL) { - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); } image=SyncNextImageInList(image); @@ -354,7 +354,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, break; } } while (count != 0); - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); while (image->previous != (Image *) NULL) image=image->previous; CloseBlob(image); @@ -621,7 +621,7 @@ static unsigned int WriteGRAYImage(const ImageInfo *image_info,Image *image) /* Allocate scanline */ - scanline=MagickAllocateArray(unsigned char *,packet_size,image->columns); + scanline=MagickAllocateResourceLimitedArray(unsigned char *,packet_size,image->columns); if (scanline == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -685,7 +685,7 @@ static unsigned int WriteGRAYImage(const ImageInfo *image_info,Image *image) image->columns,image->rows)) break; } - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); if (image->next == (Image *) NULL) break; image=SyncNextImageInList(image); diff --git a/coders/histogram.c b/coders/histogram.c index d24a3b9..a2e8676 100644 --- a/coders/histogram.c +++ b/coders/histogram.c @@ -223,18 +223,18 @@ static unsigned int WriteHISTOGRAMImage(const ImageInfo *image_info, Allocate histogram count arrays. */ length=Max(ScaleQuantumToChar(MaxRGB)+1,histogram_image->columns); - red=MagickAllocateArray(long *,length,sizeof(long)); - green=MagickAllocateArray(long *,length,sizeof(long)); - blue=MagickAllocateArray(long *,length,sizeof(long)); + red=MagickAllocateResourceLimitedArray(long *,length,sizeof(long)); + green=MagickAllocateResourceLimitedArray(long *,length,sizeof(long)); + blue=MagickAllocateResourceLimitedArray(long *,length,sizeof(long)); if ((red == (long *) NULL) || (green == (long *) NULL) || (blue == (long *) NULL)) { - MagickFreeMemory(red); - MagickFreeMemory(green); - MagickFreeMemory(blue); + MagickFreeResourceLimitedMemory(red); + MagickFreeResourceLimitedMemory(green); + MagickFreeResourceLimitedMemory(blue); DestroyImage(histogram_image); - ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image) - } + ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); + } (void) memset(red,0,length*sizeof(long)); (void) memset(green,0,length*sizeof(long)); (void) memset(blue,0,length*sizeof(long)); @@ -311,9 +311,9 @@ static unsigned int WriteHISTOGRAMImage(const ImageInfo *image_info, /* Free memory resources. */ - MagickFreeMemory(blue); - MagickFreeMemory(green); - MagickFreeMemory(red); + MagickFreeResourceLimitedMemory(blue); + MagickFreeResourceLimitedMemory(green); + MagickFreeResourceLimitedMemory(red); file=AcquireTemporaryFileStream(filename,BinaryFileIOMode); if (file == (FILE *) NULL) { diff --git a/coders/hrz.c b/coders/hrz.c index 1d92f33..cfdfab0 100644 --- a/coders/hrz.c +++ b/coders/hrz.c @@ -116,7 +116,7 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image_info->ping) goto DONE_READING; /* ----- Load RLE compressed raster ----- */ - BImgBuff=MagickAllocateMemory(unsigned char *,((size_t) ldblk)); /*Ldblk was set in the check phase*/ + BImgBuff=MagickAllocateResourceLimitedMemory(unsigned char *,((size_t) ldblk)); /*Ldblk was set in the check phase*/ if(BImgBuff==NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); @@ -136,7 +136,7 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception) } if(BImgBuff!=NULL) - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); if (EOFBlob(image)) ThrowException(exception, CorruptImageError, UnexpectedEndOfFile, image->filename); diff --git a/coders/icon.c b/coders/icon.c index eaa871c..c140c50 100644 --- a/coders/icon.c +++ b/coders/icon.c @@ -260,7 +260,7 @@ static Image *ReadIconImage(const ImageInfo *image_info, ThrowReaderException(CorruptImageError,ImproperImageHeader,image); data_alloc_size=Max(data_alloc_size,icon_file.directory[i].size); } - data=MagickAllocateMemory(unsigned char *,data_alloc_size); + data=MagickAllocateResourceLimitedMemory(unsigned char *,data_alloc_size); if (data == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); for (i=0; i < icon_file.count; i++) @@ -288,7 +288,7 @@ static Image *ReadIconImage(const ImageInfo *image_info, (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Failed to seek to offset %u", icon_file.directory[i].offset); - MagickFreeMemory(data); + MagickFreeResourceLimitedMemory(data); ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } if ((count=ReadBlob(image,icon_file.directory[i].size,data)) != icon_file.directory[i].size) @@ -299,7 +299,7 @@ static Image *ReadIconImage(const ImageInfo *image_info, " (expected %" MAGICK_SIZE_T_F "u bytes)", (MAGICK_SIZE_T) count, (MAGICK_SIZE_T) icon_file.directory[i].size); - MagickFreeMemory(data); + MagickFreeResourceLimitedMemory(data); ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } format[0]='\0'; @@ -309,7 +309,7 @@ static Image *ReadIconImage(const ImageInfo *image_info, (void) strcpy(format,"PNG"); if (format[0] == '\0') { - MagickFreeMemory(data); + MagickFreeResourceLimitedMemory(data); ThrowReaderException(CorruptImageError,ImproperImageHeader,image); } if (image->logging) @@ -335,7 +335,7 @@ static Image *ReadIconImage(const ImageInfo *image_info, } if (icon_image == (Image *) NULL) { - MagickFreeMemory(data); + MagickFreeResourceLimitedMemory(data); DestroyImageList(image); return((Image *) NULL); } @@ -373,7 +373,7 @@ static Image *ReadIconImage(const ImageInfo *image_info, while (image->previous != (Image *) NULL) image=image->previous; CloseBlob(image); - MagickFreeMemory(data); + MagickFreeResourceLimitedMemory(data); return(image); } diff --git a/coders/jbig.c b/coders/jbig.c index c39647e..1f75512 100644 --- a/coders/jbig.c +++ b/coders/jbig.c @@ -401,9 +401,6 @@ static unsigned int WriteJBIGImage(const ImageInfo *image_info,Image *image) unsigned int status; - size_t - number_packets; - unsigned long scene; @@ -433,8 +430,7 @@ static unsigned int WriteJBIGImage(const ImageInfo *image_info,Image *image) Allocate pixel data. */ bytes_per_row=((image->columns+7) >> 3); - number_packets=bytes_per_row*image->rows; - pixels=MagickAllocateMemory(unsigned char *,number_packets); + pixels=MagickAllocateResourceLimitedArray(unsigned char *,bytes_per_row,image->rows); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -504,7 +500,7 @@ static unsigned int WriteJBIGImage(const ImageInfo *image_info,Image *image) */ jbg_enc_out(&jbig_info); jbg_enc_free(&jbig_info); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (image->next == (Image *) NULL) break; image=SyncNextImageInList(image); diff --git a/coders/jnx.c b/coders/jnx.c index 1003adc..3fd8a2b 100644 --- a/coders/jnx.c +++ b/coders/jnx.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2012-2018 GraphicsMagick Group +% Copyright (C) 2012-2020 GraphicsMagick Group % % This program is covered by multiple licenses, which are described in % Copyright.txt. You should have received a copy of Copyright.txt with this @@ -109,7 +109,7 @@ ExtractTileJPG(Image * image, const ImageInfo * image_info, TileInfo->PicOffset, TileInfo->PicSize); if ((alloc_size > TileInfo->PicSize) && - (blob = MagickAllocateMemory(unsigned char *,alloc_size)) != NULL) + (blob = MagickAllocateResourceLimitedMemory(unsigned char *,alloc_size)) != NULL) { /* Add missing JPEG header bytes */ blob[0] = 0xFF; @@ -178,7 +178,7 @@ ExtractTileJPG(Image * image, const ImageInfo * image_info, ThrowException(exception,BlobError,UnableToSeekToOffset, image->filename); } - MagickFreeMemory(blob); + MagickFreeResourceLimitedMemory(blob); } else { @@ -389,7 +389,7 @@ ReadJNXImage(const ImageInfo * image_info, ExceptionInfo * exception) ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } - PositionList = MagickAllocateArray(TJNXTileInfo *, + PositionList = MagickAllocateResourceLimitedArray(TJNXTileInfo *, JNXLevelInfo[i].TileCount, sizeof(TJNXTileInfo)); if (PositionList == NULL) @@ -416,7 +416,7 @@ ReadJNXImage(const ImageInfo * image_info, ExceptionInfo * exception) PositionList[j].PicSize > file_size)) { (void) SetMagickResourceLimit(MapResource, SaveLimit); - MagickFreeMemory(PositionList); + MagickFreeResourceLimitedMemory(PositionList); ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } } @@ -442,7 +442,7 @@ ReadJNXImage(const ImageInfo * image_info, ExceptionInfo * exception) break; } - MagickFreeMemory(PositionList); + MagickFreeResourceLimitedMemory(PositionList); } CloseBlob(image); diff --git a/coders/jp2.c b/coders/jp2.c index 31fd32f..efb45ae 100644 --- a/coders/jp2.c +++ b/coders/jp2.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2019 GraphicsMagick Group +% Copyright (C) 2003-2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % % This program is covered by multiple licenses, which are described in @@ -276,7 +276,33 @@ typedef struct _StreamManager *image; } StreamManager; +/* + I/O read/write callbacks changed + + Cnt argument changed from 'int' to 'unsigned' on 6/29/20 (2.0.19). + + Write write buf pointer changed from 'char *' to 'const char *' on 8/14/20 + + Old interface: + int (*read_)(jas_stream_obj_t *obj, char *buf, int cnt); + int (*write_)(jas_stream_obj_t *obj, char *buf, int cnt); + + New interface: + int (*read_)(jas_stream_obj_t *obj, char *buf, unsigned cnt); + int (*write_)(jas_stream_obj_t *obj, const char *buf, unsigned cnt); + + We have yet to find a useful way to determine the version of the + JasPer library using the C pre-processor. + */ +#if !defined(MAGICK_JP2_NEW_STREAM_INTERFACE) +#define MAGICK_JP2_NEW_STREAM_INTERFACE 0 +#endif /* if !defined(MAGICK_JP2_NEW_STREAM_INTERFACE) */ + +#if MAGICK_JP2_NEW_STREAM_INTERFACE +static int BlobRead(jas_stream_obj_t *object,char *buffer,unsigned length) +#else static int BlobRead(jas_stream_obj_t *object,char *buffer,const int length) +#endif { size_t count; @@ -288,7 +314,11 @@ static int BlobRead(jas_stream_obj_t *object,char *buffer,const int length) return ((int) count); } +#if MAGICK_JP2_NEW_STREAM_INTERFACE +static int BlobWrite(jas_stream_obj_t *object,const char *buffer,unsigned length) +#else static int BlobWrite(jas_stream_obj_t *object,char *buffer,const int length) +#endif { size_t count; @@ -334,7 +364,10 @@ static jas_stream_t *JP2StreamManager(jas_stream_ops_t *stream_ops, Image *image stream->rwlimit_=(-1); stream->obj_=MagickAllocateMemory(jas_stream_obj_t *,sizeof(StreamManager)); if (stream->obj_ == (jas_stream_obj_t *) NULL) - return((jas_stream_t *) NULL); + { + MagickFreeMemory(stream); + return((jas_stream_t *) NULL); + } stream->ops_=stream_ops; stream->openmode_=JAS_STREAM_READ | JAS_STREAM_WRITE | JAS_STREAM_BINARY; stream->bufbase_=stream->tinybuf_; @@ -350,7 +383,7 @@ static jas_stream_t *JP2StreamManager(jas_stream_ops_t *stream_ops, Image *image #define ThrowJP2ReaderException(code_,reason_,image_) \ { \ for (component=0; component < (long) number_components; component++) \ - MagickFreeMemory(channel_lut[component]); \ + MagickFreeResourceLimitedMemory(channel_lut[component]); \ if (pixels) \ jas_matrix_destroy(pixels); \ if (jp2_stream) \ @@ -580,7 +613,7 @@ static Image *ReadJP2Image(const ImageInfo *image_info, scale_to_quantum=MaxRGBDouble/max_value; (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Channel %d scale is %g", component, scale_to_quantum); - channel_lut[component]=MagickAllocateArray(Quantum *, (size_t) max_value+1,sizeof(Quantum)); + channel_lut[component]=MagickAllocateResourceLimitedArray(Quantum *, (size_t) max_value+1,sizeof(Quantum)); if (channel_lut[component] == (Quantum *) NULL) ThrowJP2ReaderException(ResourceLimitError,MemoryAllocationFailed,image); for(i=0; i <= max_value; i++) @@ -703,7 +736,7 @@ static Image *ReadJP2Image(const ImageInfo *image_info, } for (component=0; component < (long) number_components; component++) - MagickFreeMemory(channel_lut[component]); + MagickFreeResourceLimitedMemory(channel_lut[component]); jas_matrix_destroy(pixels); (void) jas_stream_close(jp2_stream); jas_image_destroy(jp2_image); @@ -1010,7 +1043,7 @@ WriteJP2Image(const ImageInfo *image_info,Image *image) double scale_to_component; - lut=MagickAllocateArray(unsigned short *,MaxMap+1,sizeof(*lut)); + lut=MagickAllocateResourceLimitedArray(unsigned short *,MaxMap+1,sizeof(*lut)); if (lut == (unsigned short *) NULL) { jas_image_destroy(jp2_image); @@ -1073,7 +1106,7 @@ WriteJP2Image(const ImageInfo *image_info,Image *image) jp2_pixels=jas_matrix_create(1,(unsigned int) image->columns); if (jp2_pixels == (jas_matrix_t *) NULL) { - MagickFreeMemory(lut); + MagickFreeResourceLimitedMemory(lut); jas_image_destroy(jp2_image); ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); } @@ -1212,7 +1245,7 @@ WriteJP2Image(const ImageInfo *image_info,Image *image) status=jas_image_encode(jp2_image,jp2_stream,format,options); (void) jas_stream_close(jp2_stream); MagickFreeMemory(options); - MagickFreeMemory(lut); + MagickFreeResourceLimitedMemory(lut); jas_matrix_destroy(jp2_pixels); jas_image_destroy(jp2_image); if (status) diff --git a/coders/jpeg.c b/coders/jpeg.c index c1b7956..3ebd5af 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -1551,7 +1551,7 @@ static Image *ReadJPEGImage(const ImageInfo *image_info, } } - jpeg_pixels=MagickAllocateArray(JSAMPLE *, + jpeg_pixels=MagickAllocateResourceLimitedArray(JSAMPLE *, jpeg_info.output_components, MagickArraySize(image->columns, sizeof(JSAMPLE))); @@ -1570,7 +1570,7 @@ static Image *ReadJPEGImage(const ImageInfo *image_info, if (setjmp(error_manager.error_recovery)) { /* Error handling code executed if longjmp was invoked */ - MagickFreeMemory(jpeg_pixels); + MagickFreeResourceLimitedMemory(jpeg_pixels); jpeg_destroy_decompress(&jpeg_info); if (image->exception.severity > exception->severity) CopyException(exception,&image->exception); @@ -1714,7 +1714,7 @@ static Image *ReadJPEGImage(const ImageInfo *image_info, (void) jpeg_finish_decompress(&jpeg_info); } jpeg_destroy_decompress(&jpeg_info); - MagickFreeMemory(jpeg_pixels); + MagickFreeResourceLimitedMemory(jpeg_pixels); CloseBlob(image); /* @@ -1988,7 +1988,7 @@ static void WriteICCProfile(j_compress_ptr jpeg_info, length=Min(profile_length-i,65519); - profile=MagickAllocateMemory(unsigned char *,length+14); + profile=MagickAllocateResourceLimitedMemory(unsigned char *,length+14); if (profile == (unsigned char *) NULL) break; (void) strcpy((char *) profile,"ICC_PROFILE"); @@ -1997,7 +1997,7 @@ static void WriteICCProfile(j_compress_ptr jpeg_info, for (j=0; j < (long) length; j++) profile[j+14]=color_profile[i+j]; jpeg_write_marker(jpeg_info,ICC_MARKER,profile,(unsigned int) length+14); - MagickFreeMemory(profile); + MagickFreeResourceLimitedMemory(profile); } } @@ -2030,7 +2030,7 @@ static void WriteIPTCProfile(j_compress_ptr jpeg_info, length=Min(profile_length-i,65500); roundup=(length & 0x01); /* round up for Photoshop */ - profile=MagickAllocateMemory(unsigned char *,length+roundup+tag_length); + profile=MagickAllocateResourceLimitedMemory(unsigned char *,length+roundup+tag_length); if (profile == (unsigned char *) NULL) break; #ifdef GET_ONLY_IPTC_DATA @@ -2047,7 +2047,7 @@ static void WriteIPTCProfile(j_compress_ptr jpeg_info, profile[length+tag_length]=0; jpeg_write_marker(jpeg_info,IPTC_MARKER,profile,(unsigned int) (length+roundup+tag_length)); - MagickFreeMemory(profile); + MagickFreeResourceLimitedMemory(profile); } } @@ -2887,7 +2887,7 @@ static MagickPassFail WriteJPEGImage(const ImageInfo *image_info,Image *imagep) /* Convert MIFF to JPEG raster pixels. */ - jpeg_pixels=MagickAllocateArray(JSAMPLE *, + jpeg_pixels=MagickAllocateResourceLimitedArray(JSAMPLE *, jpeg_info.input_components*image->columns,sizeof(JSAMPLE)); if (jpeg_pixels == (JSAMPLE *) NULL) { @@ -3128,7 +3128,7 @@ static MagickPassFail WriteJPEGImage(const ImageInfo *image_info,Image *imagep) if (huffman_memory) LiberateMagickResource(MemoryResource,huffman_memory); jpeg_destroy_compress(&jpeg_info); - MagickFreeMemory(jpeg_pixels); + MagickFreeResourceLimitedMemory(jpeg_pixels); CloseBlob(image); return(True); } diff --git a/coders/locale.c b/coders/locale.c index c29137a..bc6d24b 100644 --- a/coders/locale.c +++ b/coders/locale.c @@ -153,6 +153,8 @@ static unsigned int ReadConfigureFile(Image *image,const char *basename, p=q; while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0')) MagickGetToken(q,&q,token,token_max_length); + if (!((q-p) > 2)) + continue; length=Min(q-p-2,MaxTextExtent-1); (void) strncpy(comment,p+1,length); comment[length]='\0'; diff --git a/coders/mac.c b/coders/mac.c index 16b221e..0ec78d7 100644 --- a/coders/mac.c +++ b/coders/mac.c @@ -78,7 +78,7 @@ static Image *ReadMACImage(const ImageInfo *image_info,ExceptionInfo *exception) Image *image; unsigned int y; unsigned char x8, rep, b; - long ldblk; + size_t ldblk; unsigned char *BImgBuff = NULL; unsigned char *DataPtr; unsigned int status; @@ -115,8 +115,8 @@ static Image *ReadMACImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image_info->ping) goto DONE_READING; /* ----- Load RLE compressed raster ----- */ - ldblk = (image->depth*image->columns) /8; - BImgBuff = MagickAllocateMemory(unsigned char *, ((size_t)ldblk)); + ldblk = (MagickArraySize(image->depth,image->columns)) /8; + BImgBuff = MagickAllocateResourceLimitedMemory(unsigned char *,ldblk); if (BImgBuff==NULL) NoMemory: ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); @@ -186,7 +186,7 @@ static Image *ReadMACImage(const ImageInfo *image_info,ExceptionInfo *exception) } } if (BImgBuff!=NULL) - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); if (EOFBlob(image)) ThrowException(exception,CorruptImageError,UnexpectedEndOfFile,image->filename); diff --git a/coders/map.c b/coders/map.c index 7be0c87..1ad6c6f 100644 --- a/coders/map.c +++ b/coders/map.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2017 GraphicsMagick Group +% Copyright (C) 2003-2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -82,8 +82,8 @@ static unsigned int */ #define ThrowMAPReaderException(code_,reason_,image_) \ do { \ - MagickFreeMemory(colormap); \ - MagickFreeMemory(pixels); \ + MagickFreeResourceLimitedMemory(colormap); \ + MagickFreeResourceLimitedMemory(pixels); \ ThrowReaderException(code_,reason_,image_); \ } while (0); static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception) @@ -140,7 +140,7 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception) if (!AllocateImageColormap(image,image->offset ? image->offset : 256)) ThrowMAPReaderException(ResourceLimitError,MemoryAllocationFailed,image); packet_size=image->colors > 256 ? 6 : 3; - colormap=MagickAllocateArray(unsigned char *,packet_size,image->colors); + colormap=MagickAllocateResourceLimitedArray(unsigned char *,packet_size,image->colors); if (colormap == (unsigned char *) NULL) ThrowMAPReaderException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -167,7 +167,7 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception) image->colormap[i].blue=(*p++ << 8U); image->colormap[i].blue|=(*p++); } - MagickFreeMemory(colormap); + MagickFreeResourceLimitedMemory(colormap); if (image_info->ping) { CloseBlob(image); @@ -177,7 +177,7 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception) Read image pixels. */ packet_size=image->depth > 8 ? 2 : 1; - pixels=MagickAllocateArray(unsigned char *,packet_size,image->columns); + pixels=MagickAllocateResourceLimitedArray(unsigned char *,packet_size,image->columns); if (pixels == (unsigned char *) NULL) ThrowMAPReaderException(ResourceLimitError,MemoryAllocationFailed,image); for (y=0; y < (long) image->rows; y++) @@ -202,7 +202,7 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception) if (!SyncImagePixelsEx(image,exception)) break; } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); CloseBlob(image); return(image); } @@ -303,8 +303,8 @@ ModuleExport void UnregisterMAPImage(void) */ #define ThrowMAPWriterException(code_,reason_,image_) \ do { \ - MagickFreeMemory(colormap); \ - MagickFreeMemory(pixels); \ + MagickFreeResourceLimitedMemory(colormap); \ + MagickFreeResourceLimitedMemory(pixels); \ ThrowWriterException(code_,reason_,image_); \ } while (0); static unsigned int WriteMAPImage(const ImageInfo *image_info,Image *image) @@ -352,11 +352,11 @@ static unsigned int WriteMAPImage(const ImageInfo *image_info,Image *image) if (SetImageType(image,PaletteType) == MagickFail) ThrowMAPWriterException(ResourceLimitError,MemoryAllocationFailed,image); packet_size=image->depth > 8 ? 2 : 1; - pixels=MagickAllocateArray(unsigned char *,image->columns,packet_size); + pixels=MagickAllocateResourceLimitedArray(unsigned char *,image->columns,packet_size); if (pixels == (unsigned char *) NULL) ThrowMAPWriterException(ResourceLimitError,MemoryAllocationFailed,image); packet_size=image->colors > 256 ? 6 : 3; - colormap=MagickAllocateArray(unsigned char *,packet_size,image->colors); + colormap=MagickAllocateResourceLimitedArray(unsigned char *,packet_size,image->colors); if (colormap == (unsigned char *) NULL) ThrowMAPWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -386,7 +386,7 @@ static unsigned int WriteMAPImage(const ImageInfo *image_info,Image *image) if (WriteBlob(image, (size_t) packet_size*image->colors,(char *) colormap) != (size_t) packet_size*image->colors) ThrowMAPWriterException(FileOpenError,UnableToWriteFile,image); - MagickFreeMemory(colormap); + MagickFreeResourceLimitedMemory(colormap); /* Write image pixels to file. */ @@ -408,7 +408,7 @@ static unsigned int WriteMAPImage(const ImageInfo *image_info,Image *image) if (WriteBlob(image,q-pixels,(char *) pixels) != (size_t) (q-pixels)) ThrowMAPWriterException(FileOpenError,UnableToWriteFile,image); } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); CloseBlob(image); return(status); } diff --git a/coders/mat.c b/coders/mat.c index 151f96c..8ec3401 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -343,20 +343,20 @@ magick_off_t TotalSize = 0; (void) unlink(clone_info->filename); } - cache_block = MagickAllocateMemory(unsigned char *,(size_t)((*Size<16384) ? *Size : 16384)); + cache_block = MagickAllocateResourceLimitedMemory(unsigned char *,(size_t)((*Size<16384) ? *Size : 16384)); if(cache_block==NULL) return NULL; - decompress_block = MagickAllocateMemory(unsigned char *,(size_t)(4096)); + decompress_block = MagickAllocateResourceLimitedMemory(unsigned char *,(size_t)(4096)); if(decompress_block==NULL) { - MagickFreeMemory(cache_block); + MagickFreeResourceLimitedMemory(cache_block); return NULL; } mat_file = AcquireTemporaryFileStream(clone_info->filename,BinaryFileIOMode); if(!mat_file) { - MagickFreeMemory(cache_block); - MagickFreeMemory(decompress_block); + MagickFreeResourceLimitedMemory(cache_block); + MagickFreeResourceLimitedMemory(decompress_block); (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Cannot create file stream for decompressed image"); return NULL; } @@ -369,8 +369,8 @@ magick_off_t TotalSize = 0; { (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Failed to initialize zlib"); ThrowException(exception,CorruptImageError, UnableToUncompressImage, orig->filename); - MagickFreeMemory(cache_block); - MagickFreeMemory(decompress_block); + MagickFreeResourceLimitedMemory(cache_block); + MagickFreeResourceLimitedMemory(decompress_block); (void)fclose(mat_file); LiberateTemporaryFile(clone_info->filename); return NULL; @@ -394,8 +394,8 @@ magick_off_t TotalSize = 0; { (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Corrupt inflate stream"); inflateEnd(&zip_info); - MagickFreeMemory(cache_block); - MagickFreeMemory(decompress_block); + MagickFreeResourceLimitedMemory(cache_block); + MagickFreeResourceLimitedMemory(decompress_block); (void)fclose(mat_file); LiberateTemporaryFile(clone_info->filename); ThrowException(exception,CorruptImageError, UnableToUncompressImage, orig->filename); @@ -415,8 +415,8 @@ DblBreak: inflateEnd(&zip_info); /* Release all caches used by zip. */ (void)fclose(mat_file); - MagickFreeMemory(cache_block); - MagickFreeMemory(decompress_block); + MagickFreeResourceLimitedMemory(cache_block); + MagickFreeResourceLimitedMemory(decompress_block); *Size = TotalSize; if((clone_info->file=fopen(clone_info->filename,"rb"))==NULL) goto UnlinkFile; @@ -455,7 +455,7 @@ UnlinkFile: } \ if(clone_info) \ DestroyImageInfo(clone_info); \ - MagickFreeMemory(BImgBuff); \ + MagickFreeResourceLimitedMemory(BImgBuff); \ ThrowReaderException(code_,reason_,image_); \ } @@ -596,22 +596,24 @@ size_t (*ReadBlobXXXFloats)(Image *image, size_t len, float *data); } /* ----- Load raster data ----- */ - BImgBuff = MagickAllocateMemory(unsigned char *,(size_t) (ldblk)); /* Ldblk was set in the check phase */ + BImgBuff = MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) (ldblk)); /* Ldblk was set in the check phase */ if(BImgBuff == NULL) RET_CHECK(image); if(HDR.Type[1]==0) /* Find Min and Max Values for doubles */ { - (void)MagickFindRawImageMinMax(image, import_options->endian, HDR.nRows, + if (MagickFindRawImageMinMax(image, import_options->endian, HDR.nRows, HDR.nCols, DoublePixel, ldblk, BImgBuff, &import_options->double_minvalue, - &import_options->double_maxvalue); + &import_options->double_maxvalue) != MagickPass) + goto skip_reading_current; } if(HDR.Type[1]==1) /* Find Min and Max Values for floats */ { - (void)MagickFindRawImageMinMax(image, import_options->endian, HDR.nRows, + if (MagickFindRawImageMinMax(image, import_options->endian, HDR.nRows, HDR.nCols, FloatPixel, ldblk, BImgBuff, &import_options->double_minvalue, - &import_options->double_maxvalue); + &import_options->double_maxvalue) != MagickPass) + goto skip_reading_current; } /* Main reader loop. */ @@ -654,9 +656,10 @@ size_t (*ReadBlobXXXFloats)(Image *image, size_t len, float *data); MinVal_c = MaxVal_c = 0; if(HDR.Type[1]==0) /* Find Min and Max Values for doubles */ { - (void)MagickFindRawImageMinMax(image, import_options->endian, HDR.nRows, - HDR.nCols, DoublePixel, ldblk, BImgBuff, - &MinVal_c, &MaxVal_c); + if (MagickFindRawImageMinMax(image, import_options->endian, HDR.nRows, + HDR.nCols, DoublePixel, ldblk, BImgBuff, + &MinVal_c, &MaxVal_c) != MagickPass) + goto skip_reading_current; for(i=0; i<(long)HDR.nCols; i++) { if(ReadBlobXXXDoubles(image, ldblk, (double *)BImgBuff) != (size_t) ldblk) @@ -670,9 +673,10 @@ size_t (*ReadBlobXXXFloats)(Image *image, size_t len, float *data); if(HDR.Type[1]==1) /* Find Min and Max Values for floats */ { - (void)MagickFindRawImageMinMax(image, import_options->endian, HDR.nRows, - HDR.nCols, FloatPixel, ldblk, BImgBuff, - &MinVal_c, &MaxVal_c); + if (MagickFindRawImageMinMax(image, import_options->endian, HDR.nRows, + HDR.nCols, FloatPixel, ldblk, BImgBuff, + &MinVal_c, &MaxVal_c) != MagickPass) + goto skip_reading_current; for(i=0; i<(long)HDR.nCols; i++) { if(ReadBlobXXXFloats(image, ldblk, (float *)BImgBuff) != (size_t) ldblk) @@ -718,14 +722,14 @@ skip_reading_current: image->colors=0; /* row scan buffer is no longer needed */ - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); BImgBuff = NULL; } ImportImagePixelAreaFailed: ExitLoop: - if(BImgBuff!=NULL) MagickFreeMemory(BImgBuff); + if(BImgBuff!=NULL) MagickFreeResourceLimitedMemory(BImgBuff); return image; } @@ -1111,27 +1115,29 @@ NoMemory: ThrowImg2MATReaderException(ResourceLimitError, MemoryAllocationFailed } /* ----- Load raster data ----- */ - BImgBuff = MagickAllocateArray(unsigned char *,(size_t) (ldblk),sizeof(double)); /* Ldblk was set in the check phase */ + BImgBuff = MagickAllocateResourceLimitedArray(unsigned char *,(size_t) (ldblk),sizeof(double)); /* Ldblk was set in the check phase */ if (BImgBuff == NULL) goto NoMemory; (void) memset(BImgBuff,0,ldblk*sizeof(double)); if (CellType==miDOUBLE) /* Find Min and Max Values for floats */ { - (void) MagickFindRawImageMinMax(image2, import_options.endian,MATLAB_HDR.SizeX, - MATLAB_HDR.SizeY,DoublePixel, ldblk, BImgBuff, - &import_options.double_minvalue, - &import_options.double_maxvalue); + if (MagickFindRawImageMinMax(image2, import_options.endian,MATLAB_HDR.SizeX, + MATLAB_HDR.SizeY,DoublePixel, ldblk, BImgBuff, + &import_options.double_minvalue, + &import_options.double_maxvalue) != MagickPass) + goto skip_reading_current; if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), "Double import options: Min=%g, Max=%g", import_options.double_minvalue, import_options.double_maxvalue); } if (CellType==miSINGLE) /* Find Min and Max Values for floats */ { - (void) MagickFindRawImageMinMax(image2, import_options.endian,MATLAB_HDR.SizeX, - MATLAB_HDR.SizeY,FloatPixel, ldblk, BImgBuff, - &import_options.double_minvalue, - &import_options.double_maxvalue); + if (MagickFindRawImageMinMax(image2, import_options.endian,MATLAB_HDR.SizeX, + MATLAB_HDR.SizeY,FloatPixel, ldblk, BImgBuff, + &import_options.double_minvalue, + &import_options.double_maxvalue) != MagickPass) + goto skip_reading_current; if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), "Float import options: Min=%g, Max=%g", import_options.double_minvalue, import_options.double_maxvalue); @@ -1211,15 +1217,17 @@ ExitLoop: if (CellType==miDOUBLE) { - (void) MagickFindRawImageMinMax(image2, import_options.endian, MATLAB_HDR.SizeX, - MATLAB_HDR.SizeY, DoublePixel, ldblk, BImgBuff, - &MinVal_c, &MaxVal_c); + if (MagickFindRawImageMinMax(image2, import_options.endian, MATLAB_HDR.SizeX, + MATLAB_HDR.SizeY, DoublePixel, ldblk, BImgBuff, + &MinVal_c, &MaxVal_c) != MagickPass) + ThrowImg2MATReaderException(CorruptImageError,UnexpectedEndOfFile,image); } if(CellType==miSINGLE) { - (void) MagickFindRawImageMinMax(image2, import_options.endian, MATLAB_HDR.SizeX, - MATLAB_HDR.SizeY, FloatPixel, ldblk, BImgBuff, - &MinVal_c, &MaxVal_c); + if (MagickFindRawImageMinMax(image2, import_options.endian, MATLAB_HDR.SizeX, + MATLAB_HDR.SizeY, FloatPixel, ldblk, BImgBuff, + &MinVal_c, &MaxVal_c) != MagickPass) + ThrowImg2MATReaderException(CorruptImageError,UnexpectedEndOfFile,image); } if (CellType==miDOUBLE) @@ -1281,7 +1289,7 @@ skip_reading_current: image->colors=0; /* row scan buffer is no longer needed */ - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); BImgBuff = NULL; if(--Frames>0) @@ -1311,7 +1319,7 @@ skip_reading_current: } END_OF_READING: - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); CloseBlob(image); { @@ -1444,7 +1452,7 @@ static MagickPassFail WriteMATLABImage(const ImageInfo *image_info,Image *image) pixels=(unsigned char *) NULL; while(image!=NULL) { - pixels=MagickAllocateMemory(unsigned char *,image->rows); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,image->rows); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -1519,13 +1527,13 @@ BreakAll: while(padding-->0) (void) WriteBlobByte(image,0); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if(status == MagickFail || image->next==NULL) break; image=SyncNextImageInList(image); } CloseBlob(image); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),"return MAT"); diff --git a/coders/meta.c b/coders/meta.c index 1bf3725..3284359 100644 --- a/coders/meta.c +++ b/coders/meta.c @@ -268,15 +268,22 @@ static char *super_fgets(char **b, size_t *blen, Image *file) break; if ((q-p+1) >= (int) len) { + unsigned char + *new_p; + int tlen; tlen=q-p; len<<=1; - MagickReallocMemory(unsigned char *,p,(len+2)); - *b=(char *) p; - if (p == (unsigned char *) NULL) - break; + new_p=MagickReallocateResourceLimitedMemory(unsigned char *,p,(len+2)); + *b=(char *) new_p; + if (new_p == (unsigned char *) NULL) + { + MagickFreeResourceLimitedMemory(p); + break; + } + p=new_p; q=p+tlen; } *q=(unsigned char) c; @@ -336,7 +343,7 @@ static long parse8BIM(Image *ifile, Image *ofile) dataset = 0; recnum = 0; - line = MagickAllocateMemory(char *,inputlen); + line = MagickAllocateResourceLimitedMemory(char *,inputlen); if (line == (char *) NULL) goto parse8BIM_failure; savedpos = 0; @@ -345,10 +352,10 @@ static long parse8BIM(Image *ifile, Image *ofile) state=0; next=0; - token = MagickAllocateMemory(char *,inputlen); + token = MagickAllocateResourceLimitedMemory(char *,inputlen); if (token == (char *) NULL) goto parse8BIM_failure; - newstr = MagickAllocateMemory(char *,inputlen); + newstr = MagickAllocateResourceLimitedMemory(char *,inputlen); if (newstr == (char *) NULL) goto parse8BIM_failure; while (Tokenizer(&token_info, 0, token, inputlen, line, @@ -382,7 +389,7 @@ static long parse8BIM(Image *ifile, Image *ofile) recnum = MagickAtoI(newstr); break; case 2: - name = MagickAllocateMemory(char *,strlen(newstr)+1); + name = MagickAllocateResourceLimitedMemory(char *,strlen(newstr)+1); if (name == (char *) NULL) goto parse8BIM_failure; (void) strcpy(name,newstr); @@ -509,11 +516,11 @@ static long parse8BIM(Image *ifile, Image *ofile) } state++; } - MagickFreeMemory(token); - MagickFreeMemory(newstr); - MagickFreeMemory(name); + MagickFreeResourceLimitedMemory(token); + MagickFreeResourceLimitedMemory(newstr); + MagickFreeResourceLimitedMemory(name); } - MagickFreeMemory(line); + MagickFreeResourceLimitedMemory(line); if (savedolen > 0) { long diff = outputlen - savedolen; @@ -530,10 +537,10 @@ static long parse8BIM(Image *ifile, Image *ofile) return outputlen; parse8BIM_failure: - MagickFreeMemory(token); - MagickFreeMemory(newstr); - MagickFreeMemory(name); - MagickFreeMemory(line); + MagickFreeResourceLimitedMemory(token); + MagickFreeResourceLimitedMemory(newstr); + MagickFreeResourceLimitedMemory(name); + MagickFreeResourceLimitedMemory(line); return 0L; } @@ -560,15 +567,22 @@ static char *super_fgets_w(char **b, size_t *blen, Image *file) break; if ((q-p+1) >= (int) len) { + unsigned char + *new_p; + int tlen; tlen=q-p; len<<=1; - MagickReallocMemory(unsigned char *,p,(len+2)); - *b=(char *) p; - if (p == (unsigned char *) NULL) - break; + new_p=MagickReallocateResourceLimitedMemory(unsigned char *,p,(len+2)); + *b=(char *) new_p; + if (new_p == (unsigned char *) NULL) + { + MagickFreeResourceLimitedMemory(p); + break; + } + p=new_p; q=p+tlen; } *q=(unsigned char) c; @@ -624,7 +638,7 @@ static long parse8BIMW(Image *ifile, Image *ofile) dataset = 0; recnum = 0; - line = MagickAllocateMemory(char *,inputlen); + line = MagickAllocateResourceLimitedMemory(char *,inputlen); if (line == (char *) NULL) goto parse8BIMW_failure; name = token = (char *)NULL; @@ -638,10 +652,10 @@ static long parse8BIMW(Image *ifile, Image *ofile) (void) LogMagickEvent(CoderEvent,GetMagickModule(), "META CODER Parse8BIM: %s (%lu)",line, (unsigned long) inputlen); - token = MagickAllocateMemory(char *,inputlen); + token = MagickAllocateResourceLimitedMemory(char *,inputlen); if (token == (char *) NULL) goto parse8BIMW_failure; - newstr = MagickAllocateMemory(char *,inputlen); + newstr = MagickAllocateResourceLimitedMemory(char *,inputlen); if (newstr == (char *) NULL) goto parse8BIMW_failure; while (Tokenizer(&token_info, 0, token, inputlen, line, @@ -675,7 +689,7 @@ static long parse8BIMW(Image *ifile, Image *ofile) recnum = MagickAtoI(newstr); break; case 2: - name = MagickAllocateMemory(char *,strlen(newstr)+1); + name = MagickAllocateResourceLimitedMemory(char *,strlen(newstr)+1); if (name == (char *) NULL) goto parse8BIMW_failure; (void) strcpy(name,newstr); @@ -802,11 +816,11 @@ static long parse8BIMW(Image *ifile, Image *ofile) } state++; } - MagickFreeMemory(token); - MagickFreeMemory(newstr); - MagickFreeMemory(name); + MagickFreeResourceLimitedMemory(token); + MagickFreeResourceLimitedMemory(newstr); + MagickFreeResourceLimitedMemory(name); } - MagickFreeMemory(line); + MagickFreeResourceLimitedMemory(line); if (savedolen > 0) { long diff = outputlen - savedolen; @@ -822,10 +836,10 @@ static long parse8BIMW(Image *ifile, Image *ofile) return outputlen; parse8BIMW_failure: - MagickFreeMemory(token); - MagickFreeMemory(newstr); - MagickFreeMemory(name); - MagickFreeMemory(line); + MagickFreeResourceLimitedMemory(token); + MagickFreeResourceLimitedMemory(newstr); + MagickFreeResourceLimitedMemory(name); + MagickFreeResourceLimitedMemory(line); return 0L; } @@ -1146,7 +1160,7 @@ static Image *ReadMETAImage(const ImageInfo *image_info, { DestroyImage(buff); ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, - image) + image); } (void) memset(blob,0,length); AttachBlob(buff->blob,blob,length); @@ -1214,7 +1228,7 @@ static Image *ReadMETAImage(const ImageInfo *image_info, { DestroyImage(buff); ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, - image) + image); } AttachBlob(buff->blob,blob,length); if (LocaleCompare(image_info->magick,"APP1JPEG") == 0) @@ -1285,7 +1299,7 @@ static Image *ReadMETAImage(const ImageInfo *image_info, i, length; - buffer=MagickAllocateMemory(char *,MaxBufferSize); + buffer=MagickAllocateResourceLimitedMemory(char *,MaxBufferSize); if (buffer != (char *) NULL) { i=0; @@ -1301,7 +1315,7 @@ static Image *ReadMETAImage(const ImageInfo *image_info, if (i < length) break; } - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(buffer); } #endif } @@ -1326,7 +1340,7 @@ static Image *ReadMETAImage(const ImageInfo *image_info, { DestroyImage(buff); ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, - image) + image); } AttachBlob(buff->blob,blob,length); for ( ; ; ) @@ -1986,7 +2000,7 @@ static int formatIPTC(Image *ifile, Image *ofile) } if (taglen < 0) return -1; /* make a buffer to hold the tag data and snag it from the input stream */ - str=MagickAllocateMemory(unsigned char *, (size_t) taglen+1); + str=MagickAllocateResourceLimitedMemory(unsigned char *, (size_t) taglen+1); if (str == (unsigned char *) NULL) { (void) printf("MemoryAllocationFailed"); @@ -1997,7 +2011,7 @@ static int formatIPTC(Image *ifile, Image *ofile) c=ReadBlobByte(ifile); if (c == EOF) { - MagickFreeMemory(str); + MagickFreeResourceLimitedMemory(str); return -1; } str[tagindx] = (unsigned char) c; @@ -2011,7 +2025,7 @@ static int formatIPTC(Image *ifile, Image *ofile) FormatString(temp, "%d#%d=",(unsigned int)dataset, (unsigned int) recnum); (void) WriteBlobString(ofile,temp); formatString( ofile, (char *)str, taglen ); - MagickFreeMemory(str); + MagickFreeResourceLimitedMemory(str); tagsfound++; @@ -2113,7 +2127,7 @@ static int formatIPTCfromBuffer(Image *ofile, char *s, long len) } if (taglen < 0) return -1; /* make a buffer to hold the tag data and snag it from the input stream */ - str=MagickAllocateMemory(unsigned char *,(size_t) taglen+1); + str=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) taglen+1); if (str == (unsigned char *) NULL) { (void) printf("MemoryAllocationFailed"); @@ -2124,7 +2138,7 @@ static int formatIPTCfromBuffer(Image *ofile, char *s, long len) c = *s++; len--; if (len < 0) { - MagickFreeMemory(str); + MagickFreeResourceLimitedMemory(str); return -1; } str[tagindx] = (unsigned char) c; @@ -2138,7 +2152,7 @@ static int formatIPTCfromBuffer(Image *ofile, char *s, long len) FormatString(temp, "%d#%d=",(unsigned int)dataset, (unsigned int) recnum); (void) WriteBlobString(ofile,temp); formatString( ofile, (char *)str, taglen ); - MagickFreeMemory(str); + MagickFreeResourceLimitedMemory(str); tagsfound++; } @@ -2148,8 +2162,8 @@ static int formatIPTCfromBuffer(Image *ofile, char *s, long len) #define Format8BIMLiberate() \ do \ { \ - MagickFreeMemory(PString); \ - MagickFreeMemory(str); \ + MagickFreeResourceLimitedMemory(PString); \ + MagickFreeResourceLimitedMemory(str); \ } while(0); static int format8BIM(Image *ifile, Image *ofile) @@ -2225,7 +2239,7 @@ static int format8BIM(Image *ifile, Image *ofile) goto format8BIMError; } plen = (unsigned char) c; - PString=MagickAllocateMemory(unsigned char *,(size_t) plen+1); + PString=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) plen+1); if (PString == (unsigned char *) NULL) { ThrowException(&ofile->exception,ResourceLimitError,MemoryAllocationFailed, @@ -2265,7 +2279,7 @@ static int format8BIM(Image *ifile, Image *ofile) goto format8BIMError; } /* make a buffer to hold the data and snag it from the input stream */ - str=MagickAllocateMemory(unsigned char *,(size_t) Size+1); + str=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) Size+1); if (str == (unsigned char *) NULL) { ThrowException(&ofile->exception,ResourceLimitError,MemoryAllocationFailed, diff --git a/coders/miff.c b/coders/miff.c index b270f56..146e70d 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -170,13 +170,29 @@ ImportRLEPixels(Image *image, assert(image != (Image *) NULL); assert(image->signature == MagickSignature); assert(source != (const unsigned char *) NULL); + + /* + FIXME: gray DirectClass pixels (quantum_type=GrayQuantum and + GrayAlphaQuantum ) should be properly supported with RLE since + modern ImageMagick supports it. For the moment we support it by + reading as PseudoClass using IndexQuantum. + */ assert((quantum_size == 8) || (quantum_size == 16) || (quantum_size == 32)); - assert(((quantum_type == IndexQuantum) && (image->storage_class == PseudoClass)) || - ((quantum_type == IndexAlphaQuantum) && (image->storage_class == PseudoClass)) || - ((quantum_type == CMYKAQuantum) && (image->storage_class == DirectClass) && image->matte) || - ((quantum_type == CMYKQuantum) && (image->storage_class == DirectClass) && !image->matte) || - ((quantum_type == RGBAQuantum) && (image->storage_class == DirectClass) && image->matte) || - ((quantum_type == RGBQuantum) && (image->storage_class == DirectClass) && !image->matte)); + if (!(((quantum_type == IndexQuantum) && (image->storage_class == PseudoClass)) || + ((quantum_type == IndexAlphaQuantum) && (image->storage_class == PseudoClass)) || + /* ((quantum_type == GrayQuantum) && (image->storage_class == DirectClass) && !image->matte) ||*/ + /* ((quantum_type == GrayAlphaQuantum) && (image->storage_class == DirectClass) && image->matte) ||*/ + ((quantum_type == CMYKAQuantum) && (image->storage_class == DirectClass) && image->matte) || + ((quantum_type == CMYKQuantum) && (image->storage_class == DirectClass) && !image->matte) || + ((quantum_type == RGBAQuantum) && (image->storage_class == DirectClass) && image->matte) || + ((quantum_type == RGBQuantum) && (image->storage_class == DirectClass) && !image->matte))) + { + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "RLE decompression not supported for QuantumType=%s, ClassType=%s, Matte=%s", + QuantumTypeToString(quantum_type),ClassTypeToString(image->storage_class), + image->matte ? "True" : "False"); + ThrowBinaryException(CoderError,RLECompressionNotSupported,image->filename); + } p=source; q=AccessMutablePixels(image); @@ -716,24 +732,26 @@ static void ZLIBFreeFunc(voidpf opaque, voidpf address) #define ThrowMIFFReaderException(code_,reason_,image_) \ do { \ - MagickFreeMemory(comment); \ - MagickFreeMemory(values); \ + MagickFreeResourceLimitedMemory(comment); \ + MagickFreeResourceLimitedMemory(values); \ if (number_of_profiles > 0) \ { \ unsigned int _index; \ for (_index=0; _index < number_of_profiles; _index++) \ { \ MagickFreeMemory(profiles[_index].name); \ - MagickFreeMemory(profiles[_index].info); \ + MagickFreeResourceLimitedMemory(profiles[_index].info); \ } \ - MagickFreeMemory(profiles); \ + MagickFreeResourceLimitedMemory(profiles); \ number_of_profiles=0; \ } \ - MagickFreeMemory(pixels); \ - MagickFreeMemory(compress_pixels); \ + MagickFreeResourceLimitedMemory(pixels); \ + MagickFreeResourceLimitedMemory(compress_pixels); \ ThrowReaderException(code_,reason_,image_); \ } while (0); +#define ReadMIFFMaxKeyWordCount 256 /* Arbitrary limit on keywords in one MIFF frame */ + static Image *ReadMIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { @@ -875,7 +893,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, Read comment-- any text between { }. */ comment_length=MaxTextExtent; - comment=MagickAllocateMemory(char *,comment_length); + comment=MagickAllocateResourceLimitedMemory(char *,comment_length); if (comment == (char *) NULL) ThrowMIFFReaderException(ResourceLimitError,MemoryAllocationFailed, image); @@ -887,11 +905,18 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, break; if ((size_t) (p-comment+1) >= comment_length) { + char + *new_comment; + *p='\0'; comment_length<<=1; - MagickReallocMemory(char *,comment,comment_length); - if (comment == (char *) NULL) - break; + new_comment=MagickReallocateResourceLimitedMemory(char *,comment,comment_length); + if (new_comment == (char *) NULL) + { + MagickFreeResourceLimitedMemory(comment); + break; + } + comment=new_comment; p=comment+strlen(comment); } *p=c; @@ -903,7 +928,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Comment: \"%s\"", comment); (void) SetImageAttribute(image,"comment",comment); comment_count++; - MagickFreeMemory(comment); + MagickFreeResourceLimitedMemory(comment); c=ReadBlobByte(image); } else @@ -940,7 +965,6 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, keyword); ThrowMIFFReaderException(CorruptImageError,ImproperImageHeader,image); } - /* Get values. @@ -949,7 +973,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, spaces and/or new-lines must be surrounded by braces. */ values_length=MaxTextExtent; - values=MagickAllocateMemory(char *,values_length); + values=MagickAllocateResourceLimitedMemory(char *,values_length); if (values == (char *) NULL) ThrowMIFFReaderException(ResourceLimitError,MemoryAllocationFailed,image); values[0]='\0'; @@ -964,11 +988,18 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, { if ((size_t) (p-values+1) >= values_length) { + char + *new_values; + *p='\0'; values_length<<=1; - MagickReallocMemory(char *,values,values_length); - if (values == (char *) NULL) - break; + new_values=MagickReallocateResourceLimitedMemory(char *,values,values_length); + if (new_values == (char *) NULL) + { + MagickFreeResourceLimitedMemory(values); + break; + } + values=new_values; p=values+strlen(values); } if (values == (char *) NULL) @@ -993,6 +1024,16 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, ThrowMIFFReaderException(CorruptImageError,ImproperImageHeader,image); } /* + Arbitrarily limit the number of header keywords to avoid DOS attempts. + */ + if (keyword_count > ReadMIFFMaxKeyWordCount) + { + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Excessive key word count %u" + " (Denial of service attempt?)",keyword_count); + ThrowMIFFReaderException(CorruptImageError,ImproperImageHeader,image); + } + /* Assign a value to the specified keyword. */ switch (*keyword) @@ -1039,15 +1080,26 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, /* Legacy ImageMagick 4.2.9 used keyword "color-profile" for ICC profile */ if (LocaleCompare(keyword,"color-profile") == 0) { + ProfileInfo + *new_profiles; + if (MagickAtoL(values) <= 0) ThrowMIFFReaderException(CorruptImageError,ImproperImageHeader,image); i=(long) number_of_profiles; - MagickReallocMemory(ProfileInfo *,profiles,(i+1)*sizeof(ProfileInfo)); - if (profiles == (ProfileInfo *) NULL) + new_profiles=MagickReallocateResourceLimitedArray(ProfileInfo *,profiles, + (size_t) i+1,sizeof(ProfileInfo)); + if (new_profiles == (ProfileInfo *) NULL) { - MagickFreeMemory(values); + for (i=0; i < number_of_profiles; i++) + { + MagickFreeMemory(profiles[i].name); + MagickFreeResourceLimitedMemory(profiles[i].info); + } + MagickFreeResourceLimitedMemory(profiles); + MagickFreeResourceLimitedMemory(values); ThrowMIFFReaderException(ResourceLimitError,MemoryAllocationFailed,image); } + profiles=new_profiles; profiles[i].name=AllocateString("icc"); profiles[i].length=MagickAtoL(values); profiles[i].info=(unsigned char *) NULL; @@ -1221,15 +1273,26 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, if ((LocaleNCompare(keyword,"profile-",8) == 0) || (LocaleNCompare(keyword,"profile:",8) == 0)) { + ProfileInfo + *new_profiles; + if (MagickAtoL(values) <= 0) ThrowMIFFReaderException(CorruptImageError,ImproperImageHeader,image); i=(long) number_of_profiles; - MagickReallocMemory(ProfileInfo *,profiles,(i+1)*sizeof(ProfileInfo)); - if (profiles == (ProfileInfo *) NULL) + new_profiles=MagickReallocateResourceLimitedArray(ProfileInfo *,profiles, + (size_t) i+1,sizeof(ProfileInfo)); + if (new_profiles == (ProfileInfo *) NULL) { - MagickFreeMemory(values); + for (i=0; i < number_of_profiles; i++) + { + MagickFreeMemory(profiles[i].name); + MagickFreeResourceLimitedMemory(profiles[i].info); + } + MagickFreeResourceLimitedMemory(profiles); + MagickFreeResourceLimitedMemory(values); ThrowMIFFReaderException(ResourceLimitError,MemoryAllocationFailed,image); } + profiles=new_profiles; profiles[i].name=AllocateString(keyword+8); profiles[i].length=MagickAtoL(values); profiles[i].info=(unsigned char *) NULL; @@ -1343,7 +1406,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, break; } } - MagickFreeMemory(values); + MagickFreeResourceLimitedMemory(values); } else { @@ -1452,9 +1515,9 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, (magick_off_t) profiles[i].length) || (profiles[i].length < 15*1024*1024))) { - profiles[i].info=MagickAllocateMemory(unsigned char *,profiles[i].length); + profiles[i].info=MagickAllocateResourceLimitedMemory(unsigned char *,profiles[i].length); if (profiles[i].info == (unsigned char *) NULL) - ThrowMIFFReaderException(CorruptImageError,UnableToReadGenericProfile, + ThrowMIFFReaderException(ResourceLimitError,MemoryAllocationFailed, image); if (ReadBlob(image,profiles[i].length,profiles[i].info) != profiles[i].length) @@ -1473,9 +1536,9 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, } } MagickFreeMemory(profiles[i].name); - MagickFreeMemory(profiles[i].info); + MagickFreeResourceLimitedMemory(profiles[i].info); } - MagickFreeMemory(profiles); + MagickFreeResourceLimitedMemory(profiles); number_of_profiles=0; } @@ -1500,7 +1563,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, Read image colormap from file. */ packet_size=3*depth/8; - colormap=MagickAllocateMemory(unsigned char *,packet_size*image->colors); + colormap=MagickAllocateResourceLimitedArray(unsigned char *,packet_size,image->colors); if (colormap == (unsigned char *) NULL) ThrowMIFFReaderException(ResourceLimitError,MemoryAllocationFailed, image); @@ -1559,7 +1622,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, } } } /* switch (depth) */ - MagickFreeMemory(colormap); + MagickFreeResourceLimitedMemory(colormap); } } if (image_info->ping && (image_info->subrange != 0)) @@ -1606,6 +1669,17 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, quantum_type=RGBAQuantum; } } + if ((quantum_type == GrayQuantum) && (MaxValueGivenBits(depth) <= MaxMap)) + { + /* + Create image colormap and read grey image as PseudoClass. + */ + if (!AllocateImageColormap(image,MaxValueGivenBits(depth)+1)) + ThrowMIFFReaderException(ResourceLimitError,MemoryAllocationFailed, + image); + quantum_type=IndexQuantum; + } + /* Allocate image pixels. */ @@ -1622,7 +1696,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, pixels_size=MagickArraySize(packet_size,image->columns); if (pixels_size == 0) ThrowMIFFReaderException(CoderError,ArithmeticOverflow,image); - pixels=MagickAllocateMemory(unsigned char *,pixels_size); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,pixels_size); if (pixels == (unsigned char *) NULL) ThrowMIFFReaderException(ResourceLimitError,MemoryAllocationFailed,image); length=(size_t) (1.01*pixels_size); @@ -1633,7 +1707,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, else ThrowMIFFReaderException(CoderError,ArithmeticOverflow,image); compressed_length = length; - compress_pixels=MagickAllocateMemory(unsigned char *,compressed_length); + compress_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,compressed_length); if (compress_pixels == (unsigned char *) NULL) ThrowMIFFReaderException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -1900,8 +1974,8 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, } } /* End switch (image->compression) */ - MagickFreeMemory(pixels); - MagickFreeMemory(compress_pixels); + MagickFreeResourceLimitedMemory(pixels); + MagickFreeResourceLimitedMemory(compress_pixels); if (EOFBlob(image)) { @@ -2239,8 +2313,8 @@ static void WriteRunlengthPacket(const Image *image, #define ThrowMIFFWriterException(code_,reason_,image_) \ { \ - MagickFreeMemory(compress_pixels) \ - MagickFreeMemory(pixels); \ + MagickFreeResourceLimitedMemory(compress_pixels) \ + MagickFreeResourceLimitedMemory(pixels); \ ThrowWriterException(code_,reason_,image_); \ } @@ -2383,12 +2457,12 @@ static unsigned int WriteMIFFImage(const ImageInfo *image_info,Image *image) if (compression == RLECompression) packet_size+=quantum_size/8; length=packet_size*image->columns; - pixels=MagickAllocateMemory(unsigned char *,length); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,length); length=(size_t) (1.01*packet_size*image->columns+600); if ((compression == BZipCompression) || (compression == ZipCompression)) if (length != (unsigned int) length) compression=NoCompression; - compress_pixels=MagickAllocateMemory(unsigned char *,length); + compress_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,length); if ((pixels == (unsigned char *) NULL) || (compress_pixels == (unsigned char *) NULL)) ThrowMIFFWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -2650,7 +2724,7 @@ static unsigned int WriteMIFFImage(const ImageInfo *image_info,Image *image) Allocate colormap. */ packet_size=3*depth/8; - colormap=MagickAllocateMemory(unsigned char *,packet_size*image->colors); + colormap=MagickAllocateResourceLimitedArray(unsigned char *,packet_size,image->colors); if (colormap == (unsigned char *) NULL) ThrowMIFFWriterException(ResourceLimitError,MemoryAllocationFailed, image); @@ -2708,7 +2782,7 @@ static unsigned int WriteMIFFImage(const ImageInfo *image_info,Image *image) #endif /* QuantumDepth > 16 */ } /* switch (depth) */ (void) WriteBlob(image,packet_size*image->colors,colormap); - MagickFreeMemory(colormap); + MagickFreeResourceLimitedMemory(colormap); } /* Write image pixels to file. @@ -2889,8 +2963,8 @@ static unsigned int WriteMIFFImage(const ImageInfo *image_info,Image *image) image->columns,image->rows)) break; } - MagickFreeMemory(pixels); - MagickFreeMemory(compress_pixels); + MagickFreeResourceLimitedMemory(pixels); + MagickFreeResourceLimitedMemory(compress_pixels); if (image->next == (Image *) NULL) break; image=SyncNextImageInList(image); diff --git a/coders/mpc.c b/coders/mpc.c index e486b90..2b770eb 100644 --- a/coders/mpc.c +++ b/coders/mpc.c @@ -128,21 +128,24 @@ static MagickBool IsMPC(const unsigned char *magick,const size_t length) #define ThrowMPCReaderException(code_,reason_,image_) \ do { \ - MagickFreeMemory(comment); \ - MagickFreeMemory(values); \ + MagickFreeResourceLimitedMemory(comment); \ + MagickFreeResourceLimitedMemory(values); \ if (number_of_profiles > 0) \ { \ unsigned int _index; \ for (_index=0; _index < number_of_profiles; _index++) \ { \ MagickFreeMemory(profiles[_index].name); \ - MagickFreeMemory(profiles[_index].info); \ + MagickFreeResourceLimitedMemory(profiles[_index].info); \ } \ - MagickFreeMemory(profiles); \ + MagickFreeResourceLimitedMemory(profiles); \ number_of_profiles=0; \ } \ ThrowReaderException(code_,reason_,image_); \ } while (0); + +#define ReadMPCMaxKeyWordCount 256 /* Arbitrary limit on number of keywords in MPC frame */ + static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) { char @@ -259,7 +262,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) Read comment-- any text between { }. */ comment_length=MaxTextExtent; - comment=MagickAllocateMemory(char *,comment_length); + comment=MagickAllocateResourceLimitedMemory(char *,comment_length); if (comment == (char *) NULL) ThrowMPCReaderException(ResourceLimitError,MemoryAllocationFailed, image); @@ -271,11 +274,18 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) break; if ((size_t) (p-comment+1) >= comment_length) { + char + *new_comment; + *p='\0'; comment_length<<=1; - MagickReallocMemory(char *,comment,comment_length); - if (comment == (char *) NULL) - break; + new_comment=MagickReallocateResourceLimitedMemory(char *,comment,comment_length); + if (new_comment == (char *) NULL) + { + MagickFreeResourceLimitedMemory(comment); + break; + } + comment=new_comment; p=comment+strlen(comment); } *p=c; @@ -286,7 +296,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) *p='\0'; (void) SetImageAttribute(image,"comment",comment); comment_count++; - MagickFreeMemory(comment); + MagickFreeResourceLimitedMemory(comment); c=ReadBlobByte(image); } else @@ -332,7 +342,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) spaces and/or new-lines must be surrounded by braces. */ values_length=MaxTextExtent; - values=MagickAllocateMemory(char *,values_length); + values=MagickAllocateResourceLimitedMemory(char *,values_length); if (values == (char *) NULL) ThrowMPCReaderException(ResourceLimitError,MemoryAllocationFailed,image); values[0]='\0'; @@ -347,11 +357,18 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) { if ((size_t) (p-values+1) >= values_length) { + char + *new_values; + *p='\0'; values_length<<=1; - MagickReallocMemory(char *,values,values_length); - if (values == (char *) NULL) - break; + new_values=MagickReallocateResourceLimitedMemory(char *,values,values_length); + if (new_values == (char *) NULL) + { + MagickFreeResourceLimitedMemory(values); + break; + } + values=new_values; p=values+strlen(values); } if (values == (char *) NULL) @@ -376,6 +393,16 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowMPCReaderException(CorruptImageError,ImproperImageHeader,image); } /* + Arbitrarily limit the number of header keywords to avoid DOS attempts. + */ + if (keyword_count > ReadMPCMaxKeyWordCount) + { + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Excessive key word count %u" + " (Denial of service attempt?)",keyword_count); + ThrowMPCReaderException(CorruptImageError,ImproperImageHeader,image); + } + /* Assign a value to the specified keyword. */ switch (*keyword) @@ -628,13 +655,25 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (LocaleNCompare(keyword,"profile-",8) == 0) { + ProfileInfo + *new_profiles; + i=(long) number_of_profiles; - MagickReallocMemory(ProfileInfo *,profiles,MagickArraySize((size_t) i+1,sizeof(ProfileInfo))); - if (profiles == (ProfileInfo *) NULL) + + new_profiles=MagickReallocateResourceLimitedArray(ProfileInfo *,profiles, + (size_t) i+1,sizeof(ProfileInfo)); + if (new_profiles == (ProfileInfo *) NULL) { - MagickFreeMemory(values); + for (i=0; i < number_of_profiles; i++) + { + MagickFreeMemory(profiles[i].name); + MagickFreeResourceLimitedMemory(profiles[i].info); + } + MagickFreeResourceLimitedMemory(profiles); + MagickFreeResourceLimitedMemory(values); ThrowMPCReaderException(ResourceLimitError,MemoryAllocationFailed,image); } + profiles=new_profiles; profiles[i].name=AllocateString(keyword+8); profiles[i].length=MagickAtoL(values); profiles[i].info=(unsigned char *) NULL; @@ -748,7 +787,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } - MagickFreeMemory(values); + MagickFreeResourceLimitedMemory(values); } else { @@ -831,15 +870,15 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) (magick_off_t) profiles[i].length) || (profiles[i].length < 15*1024*1024))) { - profiles[i].info=MagickAllocateMemory(unsigned char *,profiles[i].length); + profiles[i].info=MagickAllocateResourceLimitedMemory(unsigned char *,profiles[i].length); if (profiles[i].info == (unsigned char *) NULL) - ThrowMPCReaderException(CorruptImageError,UnableToReadGenericProfile, + ThrowMPCReaderException(ResourceLimitError,MemoryAllocationFailed, image); if (ReadBlob(image,profiles[i].length,profiles[i].info) != profiles[i].length) ThrowMPCReaderException(CorruptImageError, - UnexpectedEndOfFile, - image); + UnexpectedEndOfFile, + image); (void) SetImageProfile(image,profiles[i].name,profiles[i].info,profiles[i].length); } else @@ -852,9 +891,9 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) } } MagickFreeMemory(profiles[i].name); - MagickFreeMemory(profiles[i].info); + MagickFreeResourceLimitedMemory(profiles[i].info); } - MagickFreeMemory(profiles); + MagickFreeResourceLimitedMemory(profiles); number_of_profiles=0; } @@ -886,7 +925,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) Read image colormap from file. */ packet_size=image->depth > 8 ? 6 : 3; - colormap=MagickAllocateArray(unsigned char *,packet_size,image->colors); + colormap=MagickAllocateResourceLimitedArray(unsigned char *,packet_size,image->colors); if (colormap == (unsigned char *) NULL) ThrowMPCReaderException(ResourceLimitError,MemoryAllocationFailed, image); @@ -909,7 +948,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) image->colormap[i].blue=(*p++ << 8); image->colormap[i].blue|=(*p++); } - MagickFreeMemory(colormap); + MagickFreeResourceLimitedMemory(colormap); } } if (EOFBlob(image)) @@ -1391,7 +1430,7 @@ static MagickPassFail WriteMPCImage(const ImageInfo *image_info,Image *image) Allocate colormap. */ packet_size=image->depth > 8 ? 6 : 3; - colormap=MagickAllocateArray(unsigned char *,packet_size,image->colors); + colormap=MagickAllocateResourceLimitedArray(unsigned char *,packet_size,image->colors); if (colormap == (unsigned char *) NULL) return(MagickFail); /* @@ -1419,7 +1458,7 @@ static MagickPassFail WriteMPCImage(const ImageInfo *image_info,Image *image) #endif /* QuantumDepth > 8 */ (void) WriteBlob(image, (size_t) packet_size*image->colors,colormap); - MagickFreeMemory(colormap); + MagickFreeResourceLimitedMemory(colormap); } /* Initialize persistent pixel cache. diff --git a/coders/mtv.c b/coders/mtv.c index 4db7bf8..4f1073a 100644 --- a/coders/mtv.c +++ b/coders/mtv.c @@ -157,7 +157,7 @@ static Image *ReadMTVImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Convert MTV raster image to pixel packets. */ - pixels=MagickAllocateArray(unsigned char *,image->columns,3); + pixels=MagickAllocateResourceLimitedArray(unsigned char *,image->columns,3); if (pixels == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); row_size= (size_t) image->columns*3; @@ -185,7 +185,7 @@ static Image *ReadMTVImage(const ImageInfo *image_info,ExceptionInfo *exception) image->columns,image->rows)) break; } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (EOFBlob(image)) { ThrowException(exception,CorruptImageError,UnexpectedEndOfFile, @@ -366,7 +366,7 @@ static unsigned int WriteMTVImage(const ImageInfo *image_info,Image *image) Allocate memory for pixels. */ (void) TransformColorspace(image,RGBColorspace); - pixels=MagickAllocateMemory(unsigned char *, + pixels=MagickAllocateResourceLimitedMemory(unsigned char *, image->columns*sizeof(PixelPacket)); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -396,7 +396,7 @@ static unsigned int WriteMTVImage(const ImageInfo *image_info,Image *image) image->columns,image->rows)) break; } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (image->next == (Image *) NULL) break; image=SyncNextImageInList(image); diff --git a/coders/mvg.c b/coders/mvg.c index 36c64c6..ba889c0 100644 --- a/coders/mvg.c +++ b/coders/mvg.c @@ -234,6 +234,9 @@ static Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception) DestroyDrawInfo(draw_info); ThrowReaderException(CorruptImageError,ImproperImageHeader,image); } + /* SetImageAttribute concatenates values! Delete with NULL */ + (void) SetImageAttribute(image,"[MVG]",NULL); + (void) SetImageAttribute(image,"[MVG]",draw_info->primitive); (void) DrawImage(image,draw_info); DestroyDrawInfo(draw_info); CloseBlob(image); diff --git a/coders/palm.c b/coders/palm.c index 1e9df02..660c69b 100644 --- a/coders/palm.c +++ b/coders/palm.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2019 GraphicsMagick Group +% Copyright (C) 2003-2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % % This program is covered by multiple licenses, which are described in @@ -849,8 +849,8 @@ GetPalmPaletteGivenBits(const unsigned int bits, */ #define ThrowPALMReaderException(code_,reason_,image_) \ do { \ - MagickFreeMemory(one_row); \ - MagickFreeMemory(lastrow); \ + MagickFreeResourceLimitedMemory(one_row); \ + MagickFreeResourceLimitedMemory(lastrow); \ ThrowReaderException(code_,reason_,image_); \ } while (0); static Image *ReadPALMImage(const ImageInfo *image_info, @@ -1098,14 +1098,14 @@ static Image *ReadPALMImage(const ImageInfo *image_info, ThrowPALMReaderException(ResourceLimitError,ImagePixelLimitExceeded,image); alloc_size = Max(palm_header.bytes_per_row,MagickArraySize(2,image->columns)); - one_row = MagickAllocateMemory(unsigned char *,alloc_size); + one_row = MagickAllocateResourceLimitedMemory(unsigned char *,alloc_size); if (one_row == (unsigned char *) NULL) ThrowPALMReaderException(ResourceLimitError,MemoryAllocationFailed,image); (void) memset(one_row,0,alloc_size); if (palm_header.compression_type == PALM_COMPRESSION_SCANLINE) { alloc_size = Max(palm_header.bytes_per_row,MagickArraySize(2,image->columns)); - lastrow = MagickAllocateMemory(unsigned char *,alloc_size); + lastrow = MagickAllocateResourceLimitedMemory(unsigned char *,alloc_size); if (lastrow == (unsigned char *) NULL) ThrowPALMReaderException(ResourceLimitError,MemoryAllocationFailed,image); (void) memset(lastrow,0,alloc_size); @@ -1253,8 +1253,8 @@ static Image *ReadPALMImage(const ImageInfo *image_info, } } - MagickFreeMemory(one_row); - MagickFreeMemory(lastrow); + MagickFreeResourceLimitedMemory(one_row); + MagickFreeResourceLimitedMemory(lastrow); CloseBlob(image); StopTimer(&image->timer); return(image); @@ -1812,14 +1812,14 @@ static unsigned int WritePALMImage(const ImageInfo *image_info,Image *image) if (palm_image->compression == FaxCompression) { - lastrow = MagickAllocateMemory(unsigned char *,bytes_per_row); + lastrow = MagickAllocateResourceLimitedMemory(unsigned char *,bytes_per_row); if (lastrow == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); } - one_row = MagickAllocateMemory(unsigned char *,bytes_per_row); + one_row = MagickAllocateResourceLimitedMemory(unsigned char *,bytes_per_row); if (one_row == (unsigned char *) NULL) { - MagickFreeMemory(lastrow); + MagickFreeResourceLimitedMemory(lastrow); ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); } @@ -1953,8 +1953,8 @@ static unsigned int WritePALMImage(const ImageInfo *image_info,Image *image) CloseBlob(image); DestroyImage(palm_image); - MagickFreeMemory(one_row); - MagickFreeMemory(lastrow); + MagickFreeResourceLimitedMemory(one_row); + MagickFreeResourceLimitedMemory(lastrow); return(True); } #endif /* if ENABLE_PALM_WRITER */ diff --git a/coders/pcd.c b/coders/pcd.c index d2678bf..658d550 100644 --- a/coders/pcd.c +++ b/coders/pcd.c @@ -262,7 +262,7 @@ static MagickPassFail DecodeImage(Image *image,unsigned char *luma, (image->columns > 1536 ? 3U : 1U)); pcd_table[2]=pcd_table[1]=pcd_table[0]=(PCDTable *) NULL; pcd_length[2]=pcd_length[1]=pcd_length[0]=0; - buffer=MagickAllocateMemory(unsigned char *,0x800); + buffer=MagickAllocateResourceLimitedMemory(unsigned char *,0x800); if (buffer == (unsigned char *) NULL) ThrowBinaryException(ResourceLimitError,MemoryAllocationFailed, (char *) NULL); @@ -273,7 +273,7 @@ static MagickPassFail DecodeImage(Image *image,unsigned char *luma, { PCDGetBits(8); length=(sum & 0xff)+1; - pcd_table[i]=MagickAllocateArray(PCDTable *,length,sizeof(PCDTable)); + pcd_table[i]=MagickAllocateResourceLimitedArray(PCDTable *,length,sizeof(PCDTable)); if (pcd_table[i] == (PCDTable *) NULL) { ThrowException(&image->exception,ResourceLimitError, @@ -420,8 +420,8 @@ static MagickPassFail DecodeImage(Image *image,unsigned char *luma, Free memory. */ for (i=0; i < (image->columns > 1536 ? 3 : 1); i++) - MagickFreeMemory(pcd_table[i]); - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(pcd_table[i]); + MagickFreeResourceLimitedMemory(buffer); return(status); } @@ -530,9 +530,9 @@ static Image *OverviewImage(const ImageInfo *image_info,Image *images, #define ThrowPCDReaderException(code_,reason_,image_) \ { \ - MagickFreeMemory(chroma1); \ - MagickFreeMemory(chroma2); \ - MagickFreeMemory(luma); \ + MagickFreeResourceLimitedMemory(chroma1); \ + MagickFreeResourceLimitedMemory(chroma2); \ + MagickFreeResourceLimitedMemory(luma); \ ThrowReaderException(code_,reason_,image_); \ } @@ -660,9 +660,9 @@ static Image *ReadPCDImage(const ImageInfo *image_info,ExceptionInfo *exception) number_pixels=MagickArraySize(image->columns,image->rows); if (number_pixels == 0 || number_pixels+1 < number_pixels) ThrowPCDReaderException(ResourceLimitError,MemoryAllocationFailed,image); - chroma1=MagickAllocateMemory(unsigned char *,number_pixels+1); - chroma2=MagickAllocateMemory(unsigned char *,number_pixels+1); - luma=MagickAllocateMemory(unsigned char *,number_pixels+1); + chroma1=MagickAllocateResourceLimitedMemory(unsigned char *,number_pixels+1); + chroma2=MagickAllocateResourceLimitedMemory(unsigned char *,number_pixels+1); + luma=MagickAllocateResourceLimitedMemory(unsigned char *,number_pixels+1); if ((chroma1 == (unsigned char *) NULL) || (chroma2 == (unsigned char *) NULL) || (luma == (unsigned char *) NULL)) @@ -768,9 +768,9 @@ static Image *ReadPCDImage(const ImageInfo *image_info,ExceptionInfo *exception) image->columns,image->rows)) break; } - MagickFreeMemory(chroma2); - MagickFreeMemory(chroma1); - MagickFreeMemory(luma); + MagickFreeResourceLimitedMemory(chroma2); + MagickFreeResourceLimitedMemory(chroma1); + MagickFreeResourceLimitedMemory(luma); while (image->previous != (Image *) NULL) image=image->previous; CloseBlob(image); @@ -869,9 +869,9 @@ static Image *ReadPCDImage(const ImageInfo *image_info,ExceptionInfo *exception) image->columns,image->rows)) break; } - MagickFreeMemory(chroma2); - MagickFreeMemory(chroma1); - MagickFreeMemory(luma); + MagickFreeResourceLimitedMemory(chroma2); + MagickFreeResourceLimitedMemory(chroma1); + MagickFreeResourceLimitedMemory(luma); if (LocaleCompare(image_info->magick,"PCDS") == 0) image->colorspace=sRGBColorspace; else diff --git a/coders/pcl.c b/coders/pcl.c index a5e80c9..989b4fe 100644 --- a/coders/pcl.c +++ b/coders/pcl.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2018 GraphicsMagick Group +% Copyright (C) 2003-2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -960,7 +960,7 @@ static unsigned int WritePCLImage(const ImageInfo *image_info,Image *image) Assign row buffer */ bytes_per_line=(image->columns*bits_per_pixel+7)/8; - pixels=MagickAllocateMemory(unsigned char *,bytes_per_line); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,bytes_per_line); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -970,19 +970,19 @@ static unsigned int WritePCLImage(const ImageInfo *image_info,Image *image) last_row_compression = PCL_UndefinedCompression; if (image_info->compression != NoCompression) { - MagickFreeMemory(last_row_pixels); - last_row_pixels=MagickAllocateMemory(unsigned char *,bytes_per_line); + MagickFreeResourceLimitedMemory(last_row_pixels); + last_row_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,bytes_per_line); if (last_row_pixels == (unsigned char *) NULL) { - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); } - MagickFreeMemory(output_row); - output_row=MagickAllocateMemory(unsigned char *,bytes_per_line); + MagickFreeResourceLimitedMemory(output_row); + output_row=MagickAllocateResourceLimitedMemory(unsigned char *,bytes_per_line); if (output_row == (unsigned char *) NULL) { - MagickFreeMemory(pixels); - MagickFreeMemory(last_row_pixels); + MagickFreeResourceLimitedMemory(pixels); + MagickFreeResourceLimitedMemory(last_row_pixels); ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); } memset(last_row_pixels,0,bytes_per_line); @@ -1206,9 +1206,9 @@ static unsigned int WritePCLImage(const ImageInfo *image_info,Image *image) } (void) WriteBlobString(image,"\033*rB"); /* end graphics */ - MagickFreeMemory(pixels); - MagickFreeMemory(last_row_pixels); - MagickFreeMemory(output_row); + MagickFreeResourceLimitedMemory(pixels); + MagickFreeResourceLimitedMemory(last_row_pixels); + MagickFreeResourceLimitedMemory(output_row); if (image->next == (Image *) NULL) break; image=SyncNextImageInList(image); diff --git a/coders/pcx.c b/coders/pcx.c index b7fe16c..1a1f8d6 100644 --- a/coders/pcx.c +++ b/coders/pcx.c @@ -195,9 +195,9 @@ static unsigned int IsPCX(const unsigned char *magick,const size_t length) */ #define ThrowPCXReaderException(code_,reason_,image_) \ { \ - MagickFreeMemory(page_table) \ - MagickFreeMemory(pcx_pixels); \ - MagickFreeMemory(scanline); \ + MagickFreeResourceLimitedMemory(page_table) \ + MagickFreeResourceLimitedMemory(pcx_pixels); \ + MagickFreeResourceLimitedMemory(scanline); \ ThrowReaderException(code_,reason_,image_); \ } static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) @@ -282,7 +282,7 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) magic=ReadBlobLSBLong(image); if (magic != 987654321) ThrowPCXReaderException(CorruptImageError,ImproperImageHeader,image); - page_table=MagickAllocateArray(ExtendedSignedIntegralType *, + page_table=MagickAllocateResourceLimitedArray(ExtendedSignedIntegralType *, 1024,sizeof(ExtendedSignedIntegralType)); if (page_table == (ExtendedSignedIntegralType *) NULL) ThrowPCXReaderException(ResourceLimitError,MemoryAllocationFailed,image); @@ -523,13 +523,13 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) (((size_t) pcx_info.bits_per_pixel*pcx_info.planes*image->columns) > ((size_t) pcx_packets*8U))) ThrowPCXReaderException(CorruptImageError,ImproperImageHeader,image); - pcx_pixels=MagickAllocateMemory(unsigned char *,pcx_packets); + pcx_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,pcx_packets); if (pcx_pixels == (unsigned char *) NULL) ThrowPCXReaderException(ResourceLimitError,MemoryAllocationFailed,image); scanline_size=MagickArraySize(Max(image->columns, (size_t) pcx_info.bytes_per_line), Max(pcx_info.planes,8)); - scanline=MagickAllocateMemory(unsigned char *,scanline_size); + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,scanline_size); if (scanline == (unsigned char *) NULL) ThrowPCXReaderException(ResourceLimitError,MemoryAllocationFailed,image); (void) memset(scanline,0,scanline_size); @@ -773,8 +773,8 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) image->columns,image->rows)) break; } - MagickFreeMemory(scanline); - MagickFreeMemory(pcx_pixels); + MagickFreeResourceLimitedMemory(scanline); + MagickFreeResourceLimitedMemory(pcx_pixels); if (EOFBlob(image)) { ThrowException(exception,CorruptImageError,UnexpectedEndOfFile, @@ -814,7 +814,7 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) } } if (page_table != (ExtendedSignedIntegralType *) NULL) - MagickFreeMemory(page_table); + MagickFreeResourceLimitedMemory(page_table); while (image->previous != (Image *) NULL) image=image->previous; CloseBlob(image); @@ -977,9 +977,9 @@ static MagickPassFail WriteRLEPixels(Image *image, #define LiberatePCXAllocations() \ { \ - MagickFreeMemory(pcx_colormap); \ - MagickFreeMemory(pcx_pixels); \ - MagickFreeMemory(page_table); \ + MagickFreeResourceLimitedMemory(pcx_colormap); \ + MagickFreeResourceLimitedMemory(pcx_pixels); \ + MagickFreeResourceLimitedMemory(page_table); \ } #define ThrowPCXWriterException(code_,reason_,image_) \ @@ -1057,7 +1057,7 @@ static unsigned int WritePCXImage(const ImageInfo *image_info,Image *image) */ write_dcx=MagickTrue; (void) WriteBlobLSBLong(image,0x3ADE68B1L); - page_table=MagickAllocateMemory(ExtendedSignedIntegralType *, + page_table=MagickAllocateResourceLimitedMemory(ExtendedSignedIntegralType *, 1024*sizeof(ExtendedSignedIntegralType)); if (page_table == (ExtendedSignedIntegralType *) NULL) ThrowPCXWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -1156,7 +1156,7 @@ static unsigned int WritePCXImage(const ImageInfo *image_info,Image *image) /* Dump colormap to file. */ - pcx_colormap=MagickAllocateMemory(unsigned char *,3*256); + pcx_colormap=MagickAllocateResourceLimitedMemory(unsigned char *,3*256); if (pcx_colormap == (unsigned char *) NULL) ThrowPCXWriterException(ResourceLimitError,MemoryAllocationFailed,image); for (i=0; i < (3*256); i++) @@ -1177,7 +1177,7 @@ static unsigned int WritePCXImage(const ImageInfo *image_info,Image *image) for (i=0; i < 58; i++) (void) WriteBlobByte(image,'\0'); /* Allocate memory for one pixel row. */ - pcx_pixels=MagickAllocateArray(unsigned char *,bytes_per_line,pcx_info.planes); + pcx_pixels=MagickAllocateResourceLimitedArray(unsigned char *,bytes_per_line,pcx_info.planes); if (pcx_pixels == (unsigned char *) NULL) ThrowPCXWriterException(ResourceLimitError,MemoryAllocationFailed,image); q=pcx_pixels; @@ -1324,8 +1324,8 @@ static unsigned int WritePCXImage(const ImageInfo *image_info,Image *image) (void) WriteBlobByte(image,pcx_info.colormap_signature); (void) WriteBlob(image,3*256,(char *) pcx_colormap); - MagickFreeMemory(pcx_pixels); - MagickFreeMemory(pcx_colormap); + MagickFreeResourceLimitedMemory(pcx_pixels); + MagickFreeResourceLimitedMemory(pcx_colormap); if (image->next == (Image *) NULL) break; image=SyncNextImageInList(image); @@ -1350,7 +1350,7 @@ static unsigned int WritePCXImage(const ImageInfo *image_info,Image *image) (void) WriteBlobLSBLong(image,0x3ADE68B1L); for (i=0; i <= (long) scene; i++) (void) WriteBlobLSBLong(image,(unsigned long) page_table[i]); - MagickFreeMemory(page_table); + MagickFreeResourceLimitedMemory(page_table); } if (status == False) ThrowPCXWriterException(FileOpenError,UnableToWriteFile,image); diff --git a/coders/pdb.c b/coders/pdb.c index bc2ec62..a4068cb 100644 --- a/coders/pdb.c +++ b/coders/pdb.c @@ -344,7 +344,7 @@ static unsigned int IsPDB(const unsigned char *magick,const size_t length) */ #define ThrowPDBReaderException(code_,reason_,image_) \ { \ - MagickFreeMemory(pixels); \ + MagickFreeResourceLimitedMemory(pixels); \ ThrowReaderException(code_,reason_,image_); \ } @@ -506,7 +506,7 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception) packets=MagickArraySize(MagickArraySize(bits_per_pixel,image->columns)/8, image->rows); - pixels=MagickAllocateMemory(unsigned char *,packets + (packets != 0 ? 256 : 0)); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,packets + (packets != 0 ? 256 : 0)); if (pixels == (unsigned char *) NULL) ThrowPDBReaderException(ResourceLimitWarning,MemoryAllocationFailed,image); (void) memset(pixels,0,packets+256); @@ -517,7 +517,7 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception) image->compression=NoCompression; if (ReadBlob(image,packets,(char *) pixels) != packets) { - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } break; @@ -655,7 +655,7 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowPDBReaderException(CorruptImageError,ImproperImageHeader,image); } } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (EOFBlob(image)) ThrowException(exception,CorruptImageError,UnexpectedEndOfFile, image->filename); @@ -675,7 +675,7 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception) */ c=ReadBlobByte(image); length=MaxTextExtent; - comment=MagickAllocateMemory(char *,length+1); + comment=MagickAllocateResourceLimitedMemory(char *,length+1); if (comment != (char *) NULL) { register char @@ -686,11 +686,18 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception) { if ((size_t) (p-comment) >= length) { + char + *new_comment; + length<<=1; length+=MaxTextExtent; - MagickReallocMemory(char *,comment,length+1); - if (comment == (char *) NULL) - break; + new_comment=MagickReallocateResourceLimitedMemory(char *,comment,length+1); + if (new_comment == (char *) NULL) + { + MagickFreeResourceLimitedMemory(comment); + break; + } + comment=new_comment; p=comment+strlen(comment); } *p=c; @@ -701,7 +708,7 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception) if (comment == (char *) NULL) ThrowPDBReaderException(ResourceLimitError,MemoryAllocationFailed,image); (void) SetImageAttribute(image,"comment",comment); - MagickFreeMemory(comment); + MagickFreeResourceLimitedMemory(comment); } CloseBlob(image); StopTimer(&image->timer); @@ -817,9 +824,9 @@ static unsigned char *EncodeRLE(unsigned char *destination, #define ThrowPDBWriterException(code_,reason_,image_) \ { \ - MagickFreeMemory(buffer); \ - MagickFreeMemory(p); \ - MagickFreeMemory(scanline); \ + MagickFreeResourceLimitedMemory(buffer); \ + MagickFreeResourceLimitedMemory(p); \ + MagickFreeResourceLimitedMemory(scanline); \ ThrowWriterException(code_,reason_,image_); \ } @@ -945,15 +952,15 @@ static unsigned int WritePDBImage(const ImageInfo *image_info,Image *image) packets=MagickArraySize(MagickArraySize(MagickArraySize(bits_per_pixel, pdb_image.width)/8, pdb_image.height),2); - p=MagickAllocateMemory(unsigned char *,packets); + p=MagickAllocateResourceLimitedMemory(unsigned char *,packets); if (p == (unsigned char *) NULL) ThrowPDBWriterException(ResourceLimitWarning,MemoryAllocationFailed,image); - buffer=MagickAllocateMemory(unsigned char *,512); + buffer=MagickAllocateResourceLimitedMemory(unsigned char *,512); if (buffer == (unsigned char *) NULL) ThrowPDBWriterException(ResourceLimitWarning,MemoryAllocationFailed,image); (void) memset(buffer,0,512); packet_size=bits_per_pixel > 8 ? 2: 1; - scanline=MagickAllocateArray(unsigned char *,image->columns,packet_size); + scanline=MagickAllocateResourceLimitedArray(unsigned char *,image->columns,packet_size); if (scanline == (unsigned char *) NULL) ThrowPDBWriterException(ResourceLimitWarning,MemoryAllocationFailed,image); (void) TransformColorspace(image,RGBColorspace); @@ -1025,8 +1032,8 @@ static unsigned int WritePDBImage(const ImageInfo *image_info,Image *image) break; } q=EncodeRLE(q,buffer,literal,repeat); - MagickFreeMemory(scanline); - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(scanline); + MagickFreeResourceLimitedMemory(buffer); /* Write the Image record header. */ @@ -1063,7 +1070,7 @@ static unsigned int WritePDBImage(const ImageInfo *image_info,Image *image) (void) WriteBlobMSBShort(image,pdb_image.width); (void) WriteBlobMSBShort(image,pdb_image.height); (void) WriteBlob(image,q-p,p); - MagickFreeMemory(p); + MagickFreeResourceLimitedMemory(p); if ((comment != (ImageAttribute *) NULL) && (comment->value != (char *) NULL)) (void) WriteBlobString(image,comment->value); CloseBlob(image); diff --git a/coders/pdf.c b/coders/pdf.c index bf96656..f7da070 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -131,6 +131,7 @@ static unsigned int IsPDF(const unsigned char *magick,const size_t offset) % % */ +#if defined(HasGS) static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define MediaBox "/MediaBox" @@ -458,6 +459,7 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception) } return(image); } +#endif /* if defined(HasGS) */ /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -488,7 +490,9 @@ ModuleExport void RegisterPDFImage(void) *entry; entry=SetMagickInfo("EPDF"); +#if defined(HasGS) entry->decoder=(DecoderHandler) ReadPDFImage; +#endif /* if defined(HasGS) */ entry->encoder=(EncoderHandler) WritePDFImage; entry->adjoin=False; entry->blob_support=False; @@ -499,7 +503,9 @@ ModuleExport void RegisterPDFImage(void) (void) RegisterMagickInfo(entry); entry=SetMagickInfo("PDF"); +#if defined(HasGS) entry->decoder=(DecoderHandler) ReadPDFImage; +#endif /* if defined(HasGS) */ entry->encoder=(EncoderHandler) WritePDFImage; entry->magick=(MagickHandler) IsPDF; entry->blob_support=False; @@ -592,17 +598,17 @@ static char *EscapeParenthesis(const char *text, char *paren_buffer) return(paren_buffer); } -#define ThrowPDFWriterException(code_,reason_,image_) \ - { \ - MagickFreeMemory(fax_blob); \ - MagickFreeMemory(xref); \ - ThrowWriterException(code_,reason_,image_); \ +#define ThrowPDFWriterException(code_,reason_,image_) \ + { \ + MagickFreeMemory(fax_blob); \ + MagickFreeResourceLimitedMemory(xref); \ + ThrowWriterException(code_,reason_,image_); \ } -#define ThrowPDFWriterException2(code_,reason_,image_) \ - { \ - MagickFreeMemory(fax_blob); \ - MagickFreeMemory(xref); \ - ThrowWriterException2(code_,reason_,image_); \ +#define ThrowPDFWriterException2(code_,reason_,image_) \ + { \ + MagickFreeMemory(fax_blob); \ + MagickFreeResourceLimitedMemory(xref); \ + ThrowWriterException2(code_,reason_,image_); \ } static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) { @@ -707,7 +713,7 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) /* Allocate X ref memory. */ - xref=MagickAllocateMemory(ExtendedSignedIntegralType *, + xref=MagickAllocateResourceLimitedMemory(ExtendedSignedIntegralType *, 2048*sizeof(ExtendedSignedIntegralType)); if (xref == (ExtendedSignedIntegralType *) NULL) ThrowPDFWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -777,6 +783,9 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) Image *kid_image; + ExtendedSignedIntegralType + *new_xref; + /* Predict page object id's. */ @@ -787,10 +796,14 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) (void) WriteBlobString(image,buffer); kid_image=kid_image->next; } - MagickReallocMemory(ExtendedSignedIntegralType *,xref, - MagickArraySize((size_t) count+2048,sizeof(ExtendedSignedIntegralType))); - if (xref == (ExtendedSignedIntegralType *) NULL) - ThrowPDFWriterException(ResourceLimitError,MemoryAllocationFailed,image); + new_xref=MagickReallocateResourceLimitedArray(ExtendedSignedIntegralType *,xref, + (size_t) count+2048,sizeof(ExtendedSignedIntegralType)); + if (new_xref == (ExtendedSignedIntegralType *) NULL) + { + MagickFreeResourceLimitedMemory(xref); + ThrowPDFWriterException(ResourceLimitError,MemoryAllocationFailed,image); + } + xref=new_xref; } (void) WriteBlobString(image,"]\n"); FormatString(buffer,"/Count %lu\n",(count-pages_id)/ObjectsPerImage); @@ -1032,9 +1045,9 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) FormatString(buffer,"(%.1024s) Tj\n",labels[i]); (void) WriteBlobString(image,buffer); (void) WriteBlobString(image,"ET\n"); - MagickFreeMemory(labels[i]); + MagickFreeResourceLimitedMemory(labels[i]); } - MagickFreeMemory(labels); + MagickFreeResourceLimitedMemory(labels); } FormatString(buffer,"%g 0 0 %g %ld %ld cm\n",x_scale,y_scale,geometry.x, geometry.y); @@ -1217,7 +1230,7 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) Allocate pixel array. */ length=number_pixels; - pixels=MagickAllocateMemory(unsigned char *,length); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (pixels == (unsigned char *) NULL) ThrowPDFWriterException(ResourceLimitError,MemoryAllocationFailed, image); @@ -1257,11 +1270,11 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) status=LZWEncodeImage(image,length,pixels); else status=PackbitsEncodeImage(image,length,pixels); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (!status) { CloseBlob(image); - MagickFreeMemory(xref); + MagickFreeResourceLimitedMemory(xref); return(MagickFail); } break; @@ -1328,7 +1341,7 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) Allocate pixel array. */ length=(size_t) (image->colorspace == CMYKColorspace ? 4 : 3)*number_pixels; - pixels=MagickAllocateMemory(unsigned char *,length); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (pixels == (unsigned char *) NULL) ThrowPDFWriterException(ResourceLimitError,MemoryAllocationFailed, image); @@ -1380,11 +1393,11 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) status=LZWEncodeImage(image,length,pixels); else status=PackbitsEncodeImage(image,length,pixels); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (!status) { CloseBlob(image); - MagickFreeMemory(xref); + MagickFreeResourceLimitedMemory(xref); return(False); } break; @@ -1447,7 +1460,7 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) Allocate pixel array. */ length=number_pixels; - pixels=MagickAllocateMemory(unsigned char *,length); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (pixels == (unsigned char *) NULL) ThrowPDFWriterException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -1484,11 +1497,11 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) status=LZWEncodeImage(image,length,pixels); else status=PackbitsEncodeImage(image,length,pixels); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (!status) { CloseBlob(image); - MagickFreeMemory(xref); + MagickFreeResourceLimitedMemory(xref); return(False); } break; @@ -1656,7 +1669,7 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) FormatString(buffer,"%lu\n",(unsigned long) offset); (void) WriteBlobString(image,buffer); (void) WriteBlobString(image,"%%EOF\n"); - MagickFreeMemory(xref); + MagickFreeResourceLimitedMemory(xref); CloseBlob(image); MagickFreeMemory(fax_blob); return(MagickPass); @@ -1733,7 +1746,7 @@ static unsigned int ZLIBEncodeImage(Image *image,const size_t length, assert(image != (Image *) NULL); assert(image->signature == MagickSignature); compressed_packets=(unsigned long) (1.001*length+12); - compressed_pixels=MagickAllocateMemory(unsigned char *,compressed_packets); + compressed_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,compressed_packets); if (compressed_pixels == (unsigned char *) NULL) ThrowBinaryException(ResourceLimitError,MemoryAllocationFailed, (char *) NULL); @@ -1760,7 +1773,7 @@ static unsigned int ZLIBEncodeImage(Image *image,const size_t length, else for (i=0; i < (long) compressed_packets; i++) (void) WriteBlobByte(image,compressed_pixels[i]); - MagickFreeMemory(compressed_pixels); + MagickFreeResourceLimitedMemory(compressed_pixels); return(!status); } #endif diff --git a/coders/pict.c b/coders/pict.c index 3e15ea9..642f917 100644 --- a/coders/pict.c +++ b/coders/pict.c @@ -881,7 +881,7 @@ static unsigned char *DecodeImage(const ImageInfo *image_info, Allocate pixel and scanline buffer. */ allocated_pixels=MagickArraySize(image->rows,row_bytes); - pixels=MagickAllocateClearedMemory(unsigned char *,allocated_pixels); + pixels=MagickAllocateResourceLimitedClearedMemory(unsigned char *,allocated_pixels); if (pixels == (unsigned char *) NULL) { ThrowException(&image->exception,ResourceLimitError,MemoryAllocationFailed, @@ -896,7 +896,7 @@ static unsigned char *DecodeImage(const ImageInfo *image_info, else scanline_alloc = 65536U+256U; /* Allocate extra for RLE over-run */ - scanline=MagickAllocateClearedMemory(unsigned char *,scanline_alloc); + scanline=MagickAllocateResourceLimitedClearedMemory(unsigned char *,scanline_alloc); if (scanline == (unsigned char *) NULL) { ThrowException(&image->exception,ResourceLimitError,MemoryAllocationFailed, @@ -922,7 +922,7 @@ static unsigned char *DecodeImage(const ImageInfo *image_info, p=ExpandBuffer(expand_buffer,scanline,&number_pixels,bits_per_pixel); (void) memcpy(q,p,number_pixels); } - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); return(pixels); } /* @@ -990,13 +990,13 @@ static unsigned char *DecodeImage(const ImageInfo *image_info, j+=bytes_per_pixel+1; } } - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); return (pixels); decode_error_exit: - MagickFreeMemory(scanline); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(scanline); + MagickFreeResourceLimitedMemory(pixels); return (unsigned char *) NULL; } @@ -1690,7 +1690,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, image->columns,image->rows)) break; } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (tile_image->exception.severity > image->exception.severity) CopyException(&image->exception,&tile_image->exception); if ((tile_image->exception.severity < ErrorException) && (jpeg == False)) @@ -1732,7 +1732,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, length-=Min(4,length); if (length == 0) break; - info=MagickAllocateMemory(unsigned char *,length); + info=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (info == (unsigned char *) NULL) break; (void) ReadBlob(image,length,info); @@ -1744,7 +1744,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, break; if (SetImageProfile(image,"ICM",info,length) == MagickFail) ThrowPICTReaderException(ResourceLimitError,MemoryAllocationFailed,image); - MagickFreeMemory(info); + MagickFreeResourceLimitedMemory(info); break; } case 0x1f2: @@ -1753,13 +1753,13 @@ static Image *ReadPICTImage(const ImageInfo *image_info, break; if (SetImageProfile(image,"IPTC",info,length) == MagickFail) ThrowPICTReaderException(ResourceLimitError,MemoryAllocationFailed,image); - MagickFreeMemory(info); + MagickFreeResourceLimitedMemory(info); break; } default: break; } - MagickFreeMemory(info); + MagickFreeResourceLimitedMemory(info); break; } default: @@ -1814,7 +1814,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, for (i=0; i < 122; i++) if (ReadBlobByte(image) == EOF) ThrowPICTReaderException(CorruptImageError,UnexpectedEndOfFile,image); - if ((blob_alloc=MagickAllocateMemory(void *,blob_alloc_size)) == (void *) NULL) + if ((blob_alloc=MagickAllocateResourceLimitedMemory(void *,blob_alloc_size)) == (void *) NULL) ThrowPICTReaderException(ResourceLimitError,MemoryAllocationFailed,image); blob=blob_alloc; clone_info=CloneImageInfo(image_info); @@ -1823,7 +1823,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, (void) strlcpy(clone_info->filename,"JPEG:",sizeof(clone_info->filename)); if (ReadBlobZC(image,blob_alloc_size,&blob) != blob_alloc_size) { - MagickFreeMemory(blob_alloc); + MagickFreeResourceLimitedMemory(blob_alloc); ThrowPICTReaderException(CorruptImageError,UnexpectedEndOfFile,image); } if (blob != blob_alloc) @@ -1835,7 +1835,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, tile_image=BlobToImage(clone_info, blob, blob_alloc_size, &image->exception ); DestroyImageInfo(clone_info); clone_info=(ImageInfo *) NULL; - MagickFreeMemory(blob_alloc); + MagickFreeResourceLimitedMemory(blob_alloc); } if (tile_image == (Image *) NULL) continue; @@ -2021,9 +2021,9 @@ ModuleExport void UnregisterPICTImage(void) */ #define LiberatePICTAllocations() \ { \ - MagickFreeMemory(buffer); \ - MagickFreeMemory(packed_scanline); \ - MagickFreeMemory(scanline); \ + MagickFreeResourceLimitedMemory(buffer); \ + MagickFreeResourceLimitedMemory(packed_scanline); \ + MagickFreeResourceLimitedMemory(scanline); \ } #define ThrowPICTWriterException(code_,reason_,image_) \ { \ @@ -2173,20 +2173,12 @@ static unsigned int WritePICTImage(const ImageInfo *image_info,Image *image) bytes_per_line=(size_t) image->columns; if (storage_class == DirectClass) bytes_per_line = MagickArraySize(bytes_per_line, image->matte ? 4 : 3); - if ((bytes_per_line == 0) || (bytes_per_line > 0x7FFFU) || ((row_bytes+MaxCount*2U) >= 0x7FFFU)) + if ((row_bytes >= (size_t) SIZE_MAX/2) || (bytes_per_line == 0) || + (bytes_per_line > 0x7FFFU) || ((row_bytes+MaxCount*2U) >= 0x7FFFU)) ThrowPICTWriterException(CoderError,UnsupportedNumberOfColumns,image); -#if defined(PTRDIFF_MAX) - /* - Without this limit check we get the following warning from GCC when allocating row_bytes: - - warning: argument 1 value ‘18446744073709551488’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] - */ - if (!(row_bytes <= PTRDIFF_MAX)) - ThrowPICTWriterException(ResourceLimitError,MemoryAllocationFailed,image); -#endif /* if defined(PTRDIFF_MAX) */ - buffer=MagickAllocateMemory(unsigned char *,PictInfoSize); - packed_scanline=MagickAllocateMemory(unsigned char *,row_bytes+MaxCount*2U); - scanline=MagickAllocateMemory(unsigned char *,row_bytes); + buffer=MagickAllocateResourceLimitedMemory(unsigned char *,PictInfoSize); + packed_scanline=MagickAllocateResourceLimitedMemory(unsigned char *,(row_bytes+MaxCount*2U)); + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,row_bytes); if ((buffer == (unsigned char *) NULL) || (packed_scanline == (unsigned char *) NULL) || (scanline == (unsigned char *) NULL)) @@ -2336,7 +2328,7 @@ static unsigned int WritePICTImage(const ImageInfo *image_info,Image *image) (void) WriteBlob(image,length,blob); if (length & 0x01) (void) WriteBlobByte(image,'\0'); - MagickFreeMemory(blob); + MagickFreeResourceLimitedMemory(blob); } /* Write picture opcode, row bytes, and picture bounding box, and version. @@ -2481,9 +2473,9 @@ static unsigned int WritePICTImage(const ImageInfo *image_info,Image *image) offset=TellBlob(image); (void) SeekBlob(image,512,SEEK_SET); (void) WriteBlobMSBShort(image,(unsigned long) offset); - MagickFreeMemory(scanline); - MagickFreeMemory(packed_scanline); - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(scanline); + MagickFreeResourceLimitedMemory(packed_scanline); + MagickFreeResourceLimitedMemory(buffer); CloseBlob(image); return(True); } diff --git a/coders/png.c b/coders/png.c index 60ce8dc..9895a68 100644 --- a/coders/png.c +++ b/coders/png.c @@ -3047,12 +3047,12 @@ DestroyJNG(unsigned char *chunk,Image **color_image, } if (*color_image) { - DestroyImage(*color_image); + DestroyImageList(*color_image); *color_image = (Image *)NULL; } if (*alpha_image) { - DestroyImage(*alpha_image); + DestroyImageList(*alpha_image); *alpha_image = (Image *)NULL; } } @@ -3433,6 +3433,20 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, if (!image_info->ping && jng_color_type >= 12) { + if ((jng_alpha_compression_method != 0) && + (jng_alpha_compression_method != 8)) + { + if (logging) + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Unsupported Alpha_compression_method: %u", + jng_alpha_compression_method); + DestroyJNG(chunk,&color_image,&color_image_info, + &alpha_image,&alpha_image_info); + ThrowException(exception,CorruptImageError,ImproperImageHeader, + image->filename); + return ((Image *)NULL); + } + alpha_image_info=MagickAllocateMemory(ImageInfo *, sizeof(ImageInfo)); if (alpha_image_info == (ImageInfo *) NULL) @@ -3743,7 +3757,7 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, ThrowException(exception,CorruptImageError, ImageFileDoesNotContainAnyImageData,image->filename); } - DestroyImage(color_image); + DestroyImageList(color_image); color_image=(Image *) NULL; return (Image *) NULL; } @@ -3758,6 +3772,9 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, FormatString(color_image_info->filename,"JPEG:%.1024s",color_image->filename); color_image_info->ping=MagickFalse; /* To do: avoid this */ + color_image_info->subimage=0; + color_image_info->subrange=1; + jng_image=ReadImage(color_image_info,exception); (void) LiberateUniqueFileResource(color_image->filename); DestroyImage(color_image); @@ -3842,6 +3859,17 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, { if (jng_color_type >= 12) { + /* + Alpha is stored in PNG or JPEG format: + Alpha_compression_method: + 1 byte. + 0: PNG grayscale IDAT format. + 8: JNG 8-bit grayscale JDAA format + */ + const char *jng_alpha_magick= + (jng_alpha_compression_method == 0 ? "PNG" : + (jng_alpha_compression_method == 8 ? "JPEG" : + "UNKNOWN")); if (jng_alpha_compression_method == 0) { png_byte @@ -3855,10 +3883,12 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, CloseBlob(alpha_image); if (logging) (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " Reading opacity from alpha_blob."); - - FormatString(alpha_image_info->filename,"%.1024s", - alpha_image->filename); + " Reading opacity from %s alpha_blob.", + jng_alpha_magick); + FormatString(alpha_image_info->filename,"%s:%.1024s", + jng_alpha_magick, alpha_image->filename); + alpha_image_info->subimage=0; + alpha_image_info->subrange=1; jng_image=ReadImage(alpha_image_info,exception); @@ -3875,7 +3905,7 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, if (logging) { (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " Read jng_image."); + " Read jng_image (%s)",image->magick); (void) LogMagickEvent(CoderEvent,GetMagickModule(), " jng_image->width=%lu, jng_image->height=%lu", (unsigned long)jng_width,(unsigned long)jng_height); @@ -3919,7 +3949,7 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, &alpha_image,&alpha_image_info); (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Destroy the JNG image"); - DestroyImage(jng_image); + DestroyImageList(jng_image); jng_image = (Image *)NULL; } } @@ -5679,6 +5709,8 @@ static Image *ReadMNGImage(const ImageInfo *image_info, /* If magnifying and a supported method is requested then magnify the image. + + http://www.libpng.org/pub/mng/spec/mng-1.0-20010209-pdg.html#mng-MAGN */ if (((mng_info->magn_methx > 0) && (mng_info->magn_methx <= 5)) && ((mng_info->magn_methy > 0) && (mng_info->magn_methy <= 5))) @@ -5689,7 +5721,28 @@ static Image *ReadMNGImage(const ImageInfo *image_info, if (logging) (void) LogMagickEvent(CoderEvent,GetMagickModule(), - " Processing MNG MAGN chunk"); + " Processing MNG MAGN chunk: MB=%u, ML=%u," + " MR=%u, MT=%u, MX=%u, MY=%u," + " X_method=%u, Y_method=%u", + mng_info->magn_mb,mng_info->magn_ml, + mng_info->magn_mr,mng_info->magn_mt, + mng_info->magn_mx,mng_info->magn_my, + mng_info->magn_methx, + mng_info->magn_methy); + + /* + If the image width is 1, then X magnification is done + by simple pixel replication. + */ + if (image->columns == 1) + mng_info->magn_methx = 1; + + /* + If the image height is 1, then Y magnification is done + by simple pixel replication. + */ + if (image->rows == 1) + mng_info->magn_methy = 1; if (mng_info->magn_methx == 1) { @@ -5734,12 +5787,10 @@ static Image *ReadMNGImage(const ImageInfo *image_info, Image *large_image; - int - yy; - long m, - y; + y, + yy; register long x; @@ -6955,14 +7006,14 @@ static MagickPassFail WriteOnePNGImage(MngInfo *mng_info, /* Define these outside of the following "if logging()" block so they will * show in debuggers. */ - gm_vers=MagickLibVersionText; + gm_vers=MagickLibVersionText; #ifdef HasLCMS - (void) sprintf(lcms_vers,"%.4d",LCMS_VERSION); + (void) sprintf(lcms_vers,"%.4d",LCMS_VERSION); #endif - libpng_runv=png_get_libpng_ver(NULL); - libpng_vers=PNG_LIBPNG_VER_STRING; - zlib_runv=zlib_version; - zlib_vers=ZLIB_VERSION; + libpng_runv=png_get_libpng_ver(NULL); + libpng_vers=PNG_LIBPNG_VER_STRING; + zlib_runv=zlib_version; + zlib_vers=ZLIB_VERSION; if (logging != MagickFalse) { @@ -8536,17 +8587,22 @@ static MagickPassFail WriteOnePNGImage(MngInfo *mng_info, PNGType(chunk,mng_eXIf); if (length < 7) - break; /* othewise crashes */ + break; /* otherwise crashes */ - /* skip the "Exif\0\0" JFIF Exif Header ID */ - length -= 6; + if (data[0] == 'E' && data[1] == 'x' && data[2] == 'i' && + data[3] == 'f' && data[4] == '\0' && data[5] == '\0') + { + /* skip the optional Exif identifier code ("Exif\0\0") */ + length -= 6; + data += 6; + } LogPNGChunk(logging,chunk,length); (void) WriteBlobMSBULong(image,length); (void) WriteBlob(image,4,chunk); - (void) WriteBlob(image,length,data+6); + (void) WriteBlob(image,length,data); (void) WriteBlobMSBULong(image,crc32(crc32(0,chunk,4), - data+6, (uInt) length)); + data, (uInt) length)); break; } } diff --git a/coders/pnm.c b/coders/pnm.c index cf4aacb..ed8c715 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -179,7 +179,7 @@ static unsigned int PNMInteger(Image *image,const unsigned int base) } } length=MaxTextExtent; - comment=MagickAllocateMemory(char *,length+sizeof(P7Comment)); + comment=MagickAllocateResourceLimitedMemory(char *,length+sizeof(P7Comment)); p=comment; offset=p-comment; if (comment != (char *) NULL) @@ -190,12 +190,19 @@ static unsigned int PNMInteger(Image *image,const unsigned int base) size_t text_length; + char + *new_comment; + text_length=(size_t) (p-comment); length<<=1; length+=MaxTextExtent; - MagickReallocMemory(char *,comment,length+sizeof(P7Comment)); - if (comment == (char *) NULL) - break; + new_comment=MagickReallocateResourceLimitedMemory(char *,comment,length+sizeof(P7Comment)); + if (new_comment == (char *) NULL) + { + MagickFreeResourceLimitedMemory(comment); + break; + } + comment=new_comment; p=comment+text_length; } c=ReadBlobByte(image); @@ -212,7 +219,7 @@ static unsigned int PNMInteger(Image *image,const unsigned int base) can span multiple lines. */ (void) SetImageAttribute(image,"comment",comment); - MagickFreeMemory(comment); + MagickFreeResourceLimitedMemory(comment); continue; } } while (!isdigit(c)); @@ -1954,7 +1961,7 @@ static unsigned int WritePNMImage(const ImageInfo *image_info,Image *image) /* Allocate memory for pixels. */ - pixels=MagickAllocateMemory(unsigned char *,bytes_per_row); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,bytes_per_row); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed, image); @@ -2036,7 +2043,7 @@ static unsigned int WritePNMImage(const ImageInfo *image_info,Image *image) image->columns,image->rows)) break; } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); break; } @@ -2082,11 +2089,11 @@ static unsigned int WritePNMImage(const ImageInfo *image_info,Image *image) for (i=0; i < 2; i++) for (j=0; j < 16; j++) { - red_map[i][j]=MagickAllocateMemory(unsigned short *, + red_map[i][j]=MagickAllocateResourceLimitedMemory(unsigned short *, 256*sizeof(unsigned short)); - green_map[i][j]=MagickAllocateMemory(unsigned short *, + green_map[i][j]=MagickAllocateResourceLimitedMemory(unsigned short *, 256*sizeof(unsigned short)); - blue_map[i][j]=MagickAllocateMemory(unsigned short *, + blue_map[i][j]=MagickAllocateResourceLimitedMemory(unsigned short *, 256*sizeof(unsigned short)); if ((red_map[i][j] == (unsigned short *) NULL) || (green_map[i][j] == (unsigned short *) NULL) || @@ -2095,9 +2102,9 @@ static unsigned int WritePNMImage(const ImageInfo *image_info,Image *image) for (i=0; i < 2; i++) for (j=0; j < 16; j++) { - MagickFreeMemory(green_map[i][j]); - MagickFreeMemory(blue_map[i][j]); - MagickFreeMemory(red_map[i][j]); + MagickFreeResourceLimitedMemory(green_map[i][j]); + MagickFreeResourceLimitedMemory(blue_map[i][j]); + MagickFreeResourceLimitedMemory(red_map[i][j]); } ThrowWriterException(ResourceLimitError,MemoryAllocationFailed, image); @@ -2174,9 +2181,9 @@ static unsigned int WritePNMImage(const ImageInfo *image_info,Image *image) for (i=0; i < 2; i++) for (j=0; j < 16; j++) { - MagickFreeMemory(green_map[i][j]); - MagickFreeMemory(blue_map[i][j]); - MagickFreeMemory(red_map[i][j]); + MagickFreeResourceLimitedMemory(green_map[i][j]); + MagickFreeResourceLimitedMemory(blue_map[i][j]); + MagickFreeResourceLimitedMemory(red_map[i][j]); } break; } diff --git a/coders/preview.c b/coders/preview.c index 32fbedd..e20ee3e 100644 --- a/coders/preview.c +++ b/coders/preview.c @@ -643,12 +643,7 @@ static unsigned int WritePreviewImage(const ImageInfo *image_info,Image *image) Free image directory. */ MagickFreeMemory(montage_image->montage); - montage_image->montage=(char *) NULL; - if (image->directory != (char *) NULL) - { - MagickFreeMemory(montage_image->directory); - montage_image->directory=(char *) NULL; - } + MagickFreeMemory(montage_image->directory); } FormatString(montage_image->filename,"miff:%.1024s",image_info->filename); status=WriteImage(image_info,montage_image); diff --git a/coders/ps.c b/coders/ps.c index a20214a..987e796 100644 --- a/coders/ps.c +++ b/coders/ps.c @@ -126,6 +126,7 @@ static unsigned int IsPS(const unsigned char *magick,const size_t length) % % */ +#if defined(HasGS) static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define BoundingBox "%%BoundingBox:" @@ -382,16 +383,6 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception) DestroyImageInfo(clone_info); } (void) LiberateTemporaryFile((char *) image_info->filename); -#if defined(HasDPS) - if (image == (Image *) NULL) - { - /* - Ghostscript has failed-- try the Display Postscript Extension. - */ - (void) FormatString((char *) image_info->filename,"dps:%.1024s",filename); - image=ReadImage(image_info,exception); - } -#endif /* defined(HasDPS) */ if (image == (Image *) NULL) { if (UndefinedException == exception->severity) @@ -422,6 +413,7 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception) } return(image); } +#endif /* if defined(HasGS) */ /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -452,7 +444,9 @@ ModuleExport void RegisterPSImage(void) *entry; entry=SetMagickInfo("EPI"); +#if defined(HasGS) entry->decoder=(DecoderHandler) ReadPSImage; +#endif /* if defined(HasGS) */ entry->encoder=(EncoderHandler) WritePSImage; entry->magick=(MagickHandler) IsPS; entry->adjoin=False; @@ -462,7 +456,9 @@ ModuleExport void RegisterPSImage(void) (void) RegisterMagickInfo(entry); entry=SetMagickInfo("EPS"); +#if defined(HasGS) entry->decoder=(DecoderHandler) ReadPSImage; +#endif /* if defined(HasGS) */ entry->encoder=(EncoderHandler) WritePSImage; entry->magick=(MagickHandler) IsPS; entry->adjoin=False; @@ -472,7 +468,9 @@ ModuleExport void RegisterPSImage(void) (void) RegisterMagickInfo(entry); entry=SetMagickInfo("EPSF"); +#if defined(HasGS) entry->decoder=(DecoderHandler) ReadPSImage; +#endif /* if defined(HasGS) */ entry->encoder=(EncoderHandler) WritePSImage; entry->magick=(MagickHandler) IsPS; entry->adjoin=False; @@ -482,7 +480,9 @@ ModuleExport void RegisterPSImage(void) (void) RegisterMagickInfo(entry); entry=SetMagickInfo("EPSI"); +#if defined(HasGS) entry->decoder=(DecoderHandler) ReadPSImage; +#endif /* if defined(HasGS) */ entry->encoder=(EncoderHandler) WritePSImage; entry->magick=(MagickHandler) IsPS; entry->adjoin=False; @@ -492,7 +492,9 @@ ModuleExport void RegisterPSImage(void) (void) RegisterMagickInfo(entry); entry=SetMagickInfo("PS"); +#if defined(HasGS) entry->decoder=(DecoderHandler) ReadPSImage; +#endif /* if defined(HasGS) */ entry->encoder=(EncoderHandler) WritePSImage; entry->magick=(MagickHandler) IsPS; entry->description="Adobe PostScript"; @@ -1258,6 +1260,8 @@ static unsigned int WritePSImage(const ImageInfo *image_info,Image *image) /* Dump image as grayscale. */ + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Writing image as grayscale..."); i++; bp=buffer; for (y=0; y < (long) image->rows; y++) @@ -1306,11 +1310,9 @@ static unsigned int WritePSImage(const ImageInfo *image_info,Image *image) /* Dump image as bitmap. */ + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Writing image as monochrome bitmap..."); (void) SetImageType(image,BilevelType); - polarity=PixelIntensityToQuantum(&image->colormap[0]) < (MaxRGB/2); - if (image->colors == 2) - polarity=PixelIntensityToQuantum(&image->colormap[1]) < - PixelIntensityToQuantum(&image->colormap[0]); count=0; bp=buffer; for (y=0; y < (long) image->rows; y++) @@ -1325,8 +1327,16 @@ static unsigned int WritePSImage(const ImageInfo *image_info,Image *image) for (x=0; x < (long) image->columns; x++) { byte<<=1; - if (indexes[x] != polarity) - byte|=0x01; + if (image->storage_class == PseudoClass) + { + if (GetGraySample(&image->colormap[indexes[x]]) >= MaxRGB/2) + byte|=0x01; + } + else + { + if (GetGraySample(p) >= MaxRGB/2) + byte|=0x01; + } bit++; if (bit == 8) { @@ -1389,6 +1399,9 @@ static unsigned int WritePSImage(const ImageInfo *image_info,Image *image) /* Dump runlength-encoded DirectColor packets. */ + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Writing image as DirectColor " + "(RLE compressed)..."); bp=buffer; for (y=0; y < (long) image->rows; y++) { @@ -1444,6 +1457,9 @@ static unsigned int WritePSImage(const ImageInfo *image_info,Image *image) /* Dump uncompressed DirectColor packets. */ + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Writing image as DirectColor " + "(uncompressed)..."); i=0; bp=buffer; for (y=0; y < (long) image->rows; y++) @@ -1518,6 +1534,10 @@ static unsigned int WritePSImage(const ImageInfo *image_info,Image *image) /* Dump runlength-encoded PseudoColor packets. */ + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Writing image as PseudoColor " + "(%u colors, RLE compressed)...", + image->colors); i=0; bp=buffer; for (y=0; y < (long) image->rows; y++) @@ -1577,6 +1597,10 @@ static unsigned int WritePSImage(const ImageInfo *image_info,Image *image) /* Dump uncompressed PseudoColor packets. */ + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Writing image as PseudoColor " + "(%u colors, unompressed)...", + image->colors); i=0; bp=buffer; for (y=0; y < (long) image->rows; y++) diff --git a/coders/ps2.c b/coders/ps2.c index 9b7e0dd..ecb86ac 100644 --- a/coders/ps2.c +++ b/coders/ps2.c @@ -172,7 +172,7 @@ static unsigned int Huffman2DEncodeImage(const ImageInfo *image_info, for (i=1; i < (long) TIFFNumberOfStrips(tiff); i++) if (byte_count[i] > strip_size) strip_size=byte_count[i]; - buffer=MagickAllocateMemory(unsigned char *,strip_size); + buffer=MagickAllocateResourceLimitedMemory(unsigned char *,strip_size); if (buffer == (unsigned char *) NULL) { TIFFClose(tiff); @@ -194,7 +194,7 @@ static unsigned int Huffman2DEncodeImage(const ImageInfo *image_info, Ascii85Encode(image,(unsigned long) buffer[j]); Ascii85Flush(image); } - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(buffer); TIFFClose(tiff); (void) LiberateTemporaryFile(filename); return(True); @@ -856,7 +856,7 @@ static unsigned int WritePS2Image(const ImageInfo *image_info,Image *image) Allocate pixel array. */ length=number_pixels; - pixels=MagickAllocateMemory(unsigned char *,length); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed, image); @@ -891,7 +891,7 @@ static unsigned int WritePS2Image(const ImageInfo *image_info,Image *image) status=LZWEncodeImage(image,length,pixels); else status=PackbitsEncodeImage(image,length,pixels); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (!status) { CloseBlob(image); @@ -968,7 +968,7 @@ static unsigned int WritePS2Image(const ImageInfo *image_info,Image *image) */ length=MagickArraySize(image->colorspace == CMYKColorspace ? 4 : 3, number_pixels); - pixels=MagickAllocateMemory(unsigned char *,length); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -1026,7 +1026,7 @@ static unsigned int WritePS2Image(const ImageInfo *image_info,Image *image) CloseBlob(image); return(False); } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); break; } case NoCompression: @@ -1114,7 +1114,7 @@ static unsigned int WritePS2Image(const ImageInfo *image_info,Image *image) Allocate pixel array. */ length=number_pixels; - pixels=MagickAllocateMemory(unsigned char *,length); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -1146,7 +1146,7 @@ static unsigned int WritePS2Image(const ImageInfo *image_info,Image *image) status=LZWEncodeImage(image,length,pixels); else status=PackbitsEncodeImage(image,length,pixels); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (!status) { CloseBlob(image); diff --git a/coders/ps3.c b/coders/ps3.c index 77e585b..04d0dbe 100644 --- a/coders/ps3.c +++ b/coders/ps3.c @@ -206,7 +206,7 @@ static unsigned int SerializeHuffman2DImage(const ImageInfo *image_info, strip_size=byte_count[i]; *length+=byte_count[i]; } - buffer=MagickAllocateMemory(unsigned char *,strip_size); + buffer=MagickAllocateResourceLimitedMemory(unsigned char *,strip_size); if (buffer == (unsigned char *) NULL) { TIFFClose(tiff); @@ -214,10 +214,10 @@ static unsigned int SerializeHuffman2DImage(const ImageInfo *image_info, ThrowBinaryException(ResourceLimitError,MemoryAllocationFailed, (char *) NULL) } - *pixels=MagickAllocateMemory(unsigned char *,*length); + *pixels=MagickAllocateResourceLimitedMemory(unsigned char *,*length); if (*pixels == (unsigned char *) NULL) { - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(buffer); TIFFClose(tiff); (void) LiberateTemporaryFile(filename); ThrowBinaryException(ResourceLimitError,MemoryAllocationFailed, @@ -234,7 +234,7 @@ static unsigned int SerializeHuffman2DImage(const ImageInfo *image_info, for (j=0; j < count; j++) *p++=buffer[j]; } - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(buffer); TIFFClose(tiff); (void) LiberateTemporaryFile(filename); return(True); @@ -268,7 +268,7 @@ static unsigned int Huffman2DEncodeImage(const ImageInfo *image_info, for (i=0; i < length; i++) Ascii85Encode(image,(unsigned long) pixels[i]); Ascii85Flush(image); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); return(True); } @@ -451,7 +451,7 @@ static unsigned int SerializePseudoClassImage(const ImageInfo *image_info, assert(image->signature == MagickSignature); status=True; *length=MagickArraySize(image->columns,image->rows); - *pixels=MagickAllocateMemory(unsigned char *, *length); + *pixels=MagickAllocateResourceLimitedMemory(unsigned char *, *length); if (*pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); q=(*pixels); @@ -474,7 +474,7 @@ static unsigned int SerializePseudoClassImage(const ImageInfo *image_info, } } if (status == False) - MagickFreeMemory(*pixels); + MagickFreeResourceLimitedMemory(*pixels); return(status); } @@ -529,7 +529,7 @@ static unsigned int SerializeMultiChannelImage(const ImageInfo *image_info, assert(image->signature == MagickSignature); status=True; *length=(size_t) (image->colorspace == CMYKColorspace ? 4U : 3U)*MagickArraySize(image->columns,image->rows); - *pixels=MagickAllocateMemory(unsigned char *, *length); + *pixels=MagickAllocateResourceLimitedMemory(unsigned char *, *length); if (*pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -567,7 +567,7 @@ static unsigned int SerializeMultiChannelImage(const ImageInfo *image_info, } } if (status == False) - MagickFreeMemory(*pixels); + MagickFreeResourceLimitedMemory(*pixels); return(status); } @@ -636,7 +636,7 @@ static unsigned int SerializeSingleChannelImage(const ImageInfo *image_info, /* Padded columns are padded to byte boundary */ padded_columns=((image->columns+pack-1)/pack)*pack; *length=padded_columns*image->rows/pack; - *pixels=MagickAllocateMemory(unsigned char *, *length); + *pixels=MagickAllocateResourceLimitedMemory(unsigned char *, *length); if (*pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed, image); @@ -684,7 +684,7 @@ static unsigned int SerializeSingleChannelImage(const ImageInfo *image_info, } } if (status == False) - MagickFreeMemory(*pixels); + MagickFreeResourceLimitedMemory(*pixels); return(status); } /* @@ -860,7 +860,7 @@ static MagickPassFail WritePS3MaskImage(const ImageInfo *image_info,Image *image for (i=0; i < length; i++) Ascii85Encode(image, (unsigned long)pixels[i]); Ascii85Flush(image); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); } break; case FaxCompression: @@ -884,7 +884,7 @@ static MagickPassFail WritePS3MaskImage(const ImageInfo *image_info,Image *image for (i=0; i < length; i++) Ascii85Encode(image,(unsigned long) pixels[i]); Ascii85Flush(image); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); } } break; @@ -896,7 +896,7 @@ static MagickPassFail WritePS3MaskImage(const ImageInfo *image_info,Image *image status=PackbitsEncode2Image(image,length,pixels, Ascii85WriteByteHook,(void *)NULL); Ascii85Flush(image); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); } break; case LZWCompression: @@ -906,7 +906,7 @@ static MagickPassFail WritePS3MaskImage(const ImageInfo *image_info,Image *image Ascii85Initialize(image); status=LZWEncode2Image(image,length,pixels,Ascii85WriteByteHook,(void*)NULL); Ascii85Flush(image); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); } break; case ZipCompression: @@ -917,7 +917,7 @@ static MagickPassFail WritePS3MaskImage(const ImageInfo *image_info,Image *image status=ZLIBEncode2Image(image,length,image_info->quality,pixels, Ascii85WriteByteHook,(void*)NULL); Ascii85Flush(image); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); } break; } @@ -1724,7 +1724,7 @@ static MagickPassFail WritePS3Image(const ImageInfo *image_info,Image *image) break; } Ascii85Flush(image); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); } } else @@ -1793,7 +1793,7 @@ static MagickPassFail WritePS3Image(const ImageInfo *image_info,Image *image) break; } Ascii85Flush(image); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); } } else @@ -1869,7 +1869,7 @@ static MagickPassFail WritePS3Image(const ImageInfo *image_info,Image *image) break; } Ascii85Flush(image); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); } if (!status) @@ -2006,7 +2006,7 @@ static unsigned int ZLIBEncode2Image(Image *image,const size_t length, assert(image != (Image *) NULL); assert(image->signature == MagickSignature); compressed_packets=(unsigned long) (1.001*length+12); - compressed_pixels=MagickAllocateMemory(unsigned char *,compressed_packets); + compressed_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,compressed_packets); if (compressed_pixels == (unsigned char *) NULL) ThrowBinaryException(ResourceLimitError,MemoryAllocationFailed, (char *) NULL); @@ -2032,7 +2032,7 @@ static unsigned int ZLIBEncode2Image(Image *image,const size_t length, else for (i=0; i < (long) compressed_packets; i++) (void) (*write_byte)(image,(magick_uint8_t)compressed_pixels[i],info); - MagickFreeMemory(compressed_pixels); + MagickFreeResourceLimitedMemory(compressed_pixels); return(!status); } #else diff --git a/coders/psd.c b/coders/psd.c index cfbf263..d3731de 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 - 2017 GraphicsMagick Group +% Copyright (C) 2003 - 2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -449,7 +449,7 @@ static const char* ModeToString( PSDImageType inType ) #define ThrowPSDReaderException(code_,reason_,image_) \ { \ - MagickFreeMemory(layer_info); \ + MagickFreeResourceLimitedMemory(layer_info); \ ThrowReaderException(code_,reason_,image_); \ } @@ -697,7 +697,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Duotone image data; the format of this data is undocumented. */ - data=MagickAllocateMemory(unsigned char *,length); + data=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (data == (unsigned char *) NULL) { if(logging) { @@ -709,7 +709,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) image); } (void) ReadBlob(image,length,data); - MagickFreeMemory(data); + MagickFreeResourceLimitedMemory(data); } else { @@ -763,7 +763,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) " reading image resources (IPTC) - %ld bytes", (long) length); } - data=MagickAllocateMemory(unsigned char *,length); + data=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (data == (unsigned char *) NULL) { if (logging) @@ -786,7 +786,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowPSDReaderException(CorruptImageError,ImproperImageHeader,image); } (void) SetImageProfile(image,"IPTC",data,length); - MagickFreeMemory(data); + MagickFreeResourceLimitedMemory(data); } /* @@ -855,7 +855,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) } else { - layer_info=MagickAllocateArray(LayerInfo *,number_layers,sizeof(LayerInfo)); + layer_info=MagickAllocateResourceLimitedArray(LayerInfo *,number_layers,sizeof(LayerInfo)); if (layer_info == (LayerInfo *) NULL) { if (logging) @@ -1354,7 +1354,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) DestroyImage(image); returnImage = layer_info[0].image; #endif - MagickFreeMemory(layer_info); + MagickFreeResourceLimitedMemory(layer_info); if (logging) { @@ -1687,7 +1687,7 @@ static MagickPassFail WriteWhiteBackground( Image* image ) int numChannels = 3, i, bytecount, dim = (int) (image->rows*numChannels); - scanline=MagickAllocateMemory(char *,(image->columns/128)*2 + 2); + scanline=MagickAllocateResourceLimitedMemory(char *,(image->columns/128)*2 + 2); if (scanline == (char *) NULL) ThrowBinaryException(ResourceLimitError,MemoryAllocationFailed,NULL); @@ -1730,7 +1730,7 @@ static MagickPassFail WriteWhiteBackground( Image* image ) (void) WriteBlob( image, count, scanline ); } - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); return MagickPass; } @@ -1806,7 +1806,7 @@ static unsigned int WritePSDImage(const ImageInfo *image_info,Image *image) packet_size=image->depth > 8 ? 6 : 3; if (image->matte) packet_size+=image->depth > 8 ? 2 : 1; - pixels=MagickAllocateArray(unsigned char *, + pixels=MagickAllocateResourceLimitedArray(unsigned char *, packet_size, MagickArraySize(image->columns, sizeof(PixelPacket))); @@ -2045,7 +2045,7 @@ static unsigned int WritePSDImage(const ImageInfo *image_info,Image *image) else WriteImageChannels( image, image, pixels ); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); CloseBlob(image); return(True); } diff --git a/coders/rgb.c b/coders/rgb.c index ce53b93..0fff80c 100644 --- a/coders/rgb.c +++ b/coders/rgb.c @@ -52,7 +52,7 @@ static unsigned int #define ThrowRGBReaderException(code_,reason_,image_) \ { \ - MagickFreeMemory(scanline); \ + MagickFreeResourceLimitedMemory(scanline); \ ThrowReaderException(code_,reason_,image_); \ } @@ -186,7 +186,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception) packet_size=(quantum_size*4)/8; } - scanline=MagickAllocateArray(unsigned char *, + scanline=MagickAllocateResourceLimitedArray(unsigned char *, packet_size,image->tile_info.width); if (scanline == (unsigned char *) NULL) ThrowRGBReaderException(ResourceLimitError,MemoryAllocationFailed,image); @@ -508,7 +508,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while (count != 0); - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); while (image->previous != (Image *) NULL) image=image->previous; CloseBlob(image); @@ -687,10 +687,17 @@ static unsigned int WriteRGBImage(const ImageInfo *image_info,Image *image) /* Allocate memory for pixels. */ - MagickReallocMemory(unsigned char *,pixels, - MagickArraySize(packet_size,image->columns)); - if (pixels == (unsigned char *) NULL) - ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); + unsigned char + *new_pixels; + + new_pixels=MagickReallocateResourceLimitedArray(unsigned char *,pixels, + packet_size,image->columns); + if (new_pixels == (unsigned char *) NULL) + { + MagickFreeResourceLimitedMemory(pixels); + ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); + } + pixels=new_pixels; /* Initialize export options. @@ -893,7 +900,7 @@ static unsigned int WriteRGBImage(const ImageInfo *image_info,Image *image) image->filename)) break; } while (image_info->adjoin); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); if (image_info->adjoin) while (image->previous != (Image *) NULL) image=image->previous; diff --git a/coders/rla.c b/coders/rla.c index 02bbc67..20fdd21 100644 --- a/coders/rla.c +++ b/coders/rla.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2018 GraphicsMagick Group +% Copyright (C) 2003-2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -84,7 +84,7 @@ #define ThrowRLAReaderException(code_,reason_,image_) \ do { \ - MagickFreeMemory(scanlines); \ + MagickFreeResourceLimitedMemory(scanlines); \ ThrowReaderException(code_,reason_,image_); \ } while (0); static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception) @@ -503,7 +503,7 @@ static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowRLAReaderException(ResourceLimitError,ImagePixelLimitExceeded,image); number_channels=rla_info.number_channels+rla_info.number_matte_channels; - scanlines=MagickAllocateArray(magick_uint32_t *,image->rows,sizeof(magick_uint32_t)); + scanlines=MagickAllocateResourceLimitedArray(magick_uint32_t *,image->rows,sizeof(magick_uint32_t)); if (scanlines == (magick_uint32_t *) NULL) ThrowRLAReaderException(ResourceLimitError,MemoryAllocationFailed,image); if (*rla_info.description != '\0') @@ -710,7 +710,7 @@ static Image *ReadRLAImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image)) ThrowRLAReaderException(CorruptImageError,UnexpectedEndOfFile,image); CloseBlob(image); - MagickFreeMemory(scanlines); + MagickFreeResourceLimitedMemory(scanlines); StopTimer(&image->timer); return(image); } diff --git a/coders/rle.c b/coders/rle.c index dbffc21..0dd0e71 100644 --- a/coders/rle.c +++ b/coders/rle.c @@ -191,8 +191,8 @@ static unsigned int IsRLE(const unsigned char *magick,const size_t length) */ #define ThrowRLEReaderException(code_,reason_,image_) \ do { \ - MagickFreeMemory(colormap); \ - MagickFreeMemory(rle_pixels); \ + MagickFreeResourceLimitedMemory(colormap); \ + MagickFreeResourceLimitedMemory(rle_pixels); \ ThrowReaderException(code_,reason_,image_); \ } while (0); static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) @@ -365,7 +365,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) Read image colormaps. Color map values are stored as 16 bit quantities, left justified in the word. */ - colormap=MagickAllocateArray(unsigned char *,number_colormaps, + colormap=MagickAllocateResourceLimitedArray(unsigned char *,number_colormaps, map_length); if (colormap == (unsigned char *) NULL) ThrowRLEReaderException(ResourceLimitError,MemoryAllocationFailed, @@ -400,7 +400,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) arbitrary string. */ length=ReadBlobLSBShort(image); - comment=MagickAllocateMemory(char *,(size_t) length+1); + comment=MagickAllocateResourceLimitedMemory(char *,(size_t) length+1); if (comment == (char *) NULL) { (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -411,7 +411,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (ReadBlob(image,length,comment) != length) { - MagickFreeMemory(comment); + MagickFreeResourceLimitedMemory(comment); ThrowRLEReaderException(CorruptImageError,UnexpectedEndOfFile,image); } comment[length]='\0'; @@ -427,7 +427,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) SetImageAttribute(image,"comment",comment); (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Comment: '%s'", comment); - MagickFreeMemory(comment); + MagickFreeResourceLimitedMemory(comment); if ((length & 0x01) == 0) (void) ReadBlobByte(image); } @@ -437,7 +437,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image_info->ping) { - MagickFreeMemory(colormap); + MagickFreeResourceLimitedMemory(colormap); CloseBlob(image); StopTimer(&image->timer); return(image); @@ -453,7 +453,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) rle_bytes=MagickArraySize(number_pixels,number_planes); if ((number_pixels == 0) || (rle_bytes == 0)) ThrowRLEReaderException(ResourceLimitError,MemoryAllocationFailed,image); - rle_pixels=MagickAllocateArray(unsigned char *,number_pixels, + rle_pixels=MagickAllocateResourceLimitedArray(unsigned char *,number_pixels, number_planes); if (rle_pixels == (unsigned char *) NULL) ThrowRLEReaderException(ResourceLimitError,MemoryAllocationFailed,image); @@ -761,8 +761,8 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) image->colors=0; } } - MagickFreeMemory(colormap); - MagickFreeMemory(rle_pixels); + MagickFreeResourceLimitedMemory(colormap); + MagickFreeResourceLimitedMemory(rle_pixels); if (EOFBlob(image)) { ThrowRLEReaderException(CorruptImageError,UnexpectedEndOfFile,image); diff --git a/coders/sfw.c b/coders/sfw.c index 277ee43..a5bd5a3 100644 --- a/coders/sfw.c +++ b/coders/sfw.c @@ -258,14 +258,14 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception) { ThrowReaderException(CorruptImageError,ImproperImageHeader,image); } - buffer=MagickAllocateMemory(unsigned char *,buffer_size); + buffer=MagickAllocateResourceLimitedMemory(unsigned char *,buffer_size); if (buffer == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); buffer_end=buffer+buffer_size-1; count=ReadBlob(image,buffer_size,(char *) buffer); if ((count != buffer_size) || (LocaleNCompare((char *) buffer,"SFW",3) != 0)) { - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(buffer); ThrowReaderException(CorruptImageError,ImproperImageHeader,image); } /* @@ -276,7 +276,7 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception) if ((header == (unsigned char *) NULL) || (header+6+134 > buffer_end)) /* 134 ~ Minimum JFIF size */ { - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(buffer); ThrowReaderException(CorruptImageError,ImproperImageHeader,image) } /* @@ -294,7 +294,7 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception) { if (offset+4 > buffer_end) { - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(buffer); ThrowReaderException(CorruptImageError,ImproperImageHeader,image) } TranslateSFWMarker(offset); @@ -307,7 +307,7 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception) (unsigned char *) "\377\311",2); if (data == (unsigned char *) NULL) { - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(buffer); ThrowReaderException(CorruptImageError,ImproperImageHeader,image) } TranslateSFWMarker(data++); /* translate eoi marker */ @@ -320,7 +320,7 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception) file=AcquireTemporaryFileStream(temporary_filename,BinaryFileIOMode); if (file == (FILE *) NULL) { - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(buffer); DestroyImageInfo(clone_info); ThrowReaderTemporaryFileException(image_info->filename) } @@ -329,7 +329,7 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) fwrite(offset+1,(size_t) (data-offset),1,file); status=ferror(file); (void) fclose(file); - MagickFreeMemory(buffer); + MagickFreeResourceLimitedMemory(buffer); if (status) { (void) LiberateTemporaryFile(temporary_filename); diff --git a/coders/sgi.c b/coders/sgi.c index 360b17f..383f571 100644 --- a/coders/sgi.c +++ b/coders/sgi.c @@ -252,11 +252,11 @@ static int SGIDecode(const size_t bytes_per_pixel, #define ThrowSGIReaderException(code_,reason_,image_) \ { \ - MagickFreeMemory(iris_pixels) \ - MagickFreeMemory(max_packets); \ - MagickFreeMemory(offsets); \ - MagickFreeMemory(runlength); \ - MagickFreeMemory(scanline) \ + MagickFreeResourceLimitedMemory(iris_pixels) \ + MagickFreeResourceLimitedMemory(max_packets); \ + MagickFreeResourceLimitedMemory(offsets); \ + MagickFreeResourceLimitedMemory(runlength); \ + MagickFreeResourceLimitedMemory(scanline) \ ThrowReaderException(code_,reason_,image_); \ } @@ -551,7 +551,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Read standard image format. */ - scanline=MagickAllocateArray(unsigned char *, + scanline=MagickAllocateResourceLimitedArray(unsigned char *, bytes_per_pixel,iris_info.xsize); if (scanline == (unsigned char *) NULL) ThrowSGIReaderException(ResourceLimitError,MemoryAllocationFailed, @@ -559,7 +559,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) iris_pixels_size = MagickArraySize(MagickArraySize(4U,bytes_per_pixel), MagickArraySize(iris_info.xsize,iris_info.ysize)); - iris_pixels=MagickAllocateMemory(unsigned char *,iris_pixels_size); + iris_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,iris_pixels_size); if (iris_pixels == (unsigned char *) NULL) ThrowSGIReaderException(ResourceLimitError,MemoryAllocationFailed,image); (void) memset(iris_pixels,0,iris_pixels_size); @@ -595,7 +595,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) if (EOFBlob(image)) break; } - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); } else { @@ -626,7 +626,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) */ if (TellBlob(image)+rle_alloc_size > (size_t) file_size) ThrowSGIReaderException(CorruptImageError,UnexpectedEndOfFile,image); - offsets=MagickAllocateMemory(magick_uint32_t *,rle_alloc_size); + offsets=MagickAllocateResourceLimitedMemory(magick_uint32_t *,rle_alloc_size); if (offsets == (magick_uint32_t *) NULL) ThrowSGIReaderException(ResourceLimitError,MemoryAllocationFailed, image); @@ -635,7 +635,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) if (TellBlob(image)+rle_alloc_size > (size_t) file_size) ThrowSGIReaderException(CorruptImageError,UnexpectedEndOfFile,image); - runlength=MagickAllocateMemory(magick_uint32_t *,rle_alloc_size); + runlength=MagickAllocateResourceLimitedMemory(magick_uint32_t *,rle_alloc_size); if (runlength == (magick_uint32_t *) NULL) ThrowSGIReaderException(ResourceLimitError,MemoryAllocationFailed, image); @@ -660,14 +660,14 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) } max_packets_alloc_size=MagickArraySize((size_t) iris_info.xsize+10U,4U); - max_packets=MagickAllocateMemory(unsigned char *,max_packets_alloc_size); + max_packets=MagickAllocateResourceLimitedMemory(unsigned char *,max_packets_alloc_size); if (max_packets == (unsigned char *) NULL) ThrowSGIReaderException(ResourceLimitError,MemoryAllocationFailed, image); iris_pixels_size=MagickArraySize(MagickArraySize(4U,bytes_per_pixel), MagickArraySize(iris_info.xsize,iris_info.ysize)); - iris_pixels=MagickAllocateMemory(unsigned char *,iris_pixels_size); + iris_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,iris_pixels_size); if (iris_pixels == (unsigned char *) NULL) ThrowSGIReaderException(ResourceLimitError,MemoryAllocationFailed,image); @@ -764,9 +764,9 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } - MagickFreeMemory(runlength); - MagickFreeMemory(max_packets); - MagickFreeMemory(offsets); + MagickFreeResourceLimitedMemory(runlength); + MagickFreeResourceLimitedMemory(max_packets); + MagickFreeResourceLimitedMemory(offsets); } /* @@ -900,7 +900,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Only transferred %lu rows out of %lu", y, image->rows); - MagickFreeMemory(iris_pixels); + MagickFreeResourceLimitedMemory(iris_pixels); /* Not sure what a proper error report is here */ @@ -908,7 +908,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) } (void) SyncImage(image); } - MagickFreeMemory(iris_pixels); + MagickFreeResourceLimitedMemory(iris_pixels); if (EOFBlob(image)) { ThrowSGIReaderException(CorruptImageError,UnexpectedEndOfFile, @@ -1069,11 +1069,11 @@ static size_t SGIEncode(unsigned char *pixels,size_t count, #define ThrowSGIWriterException(code_,reason_,image_) \ { \ - MagickFreeMemory(scanline) \ - MagickFreeMemory(offsets); \ - MagickFreeMemory(packets); \ - MagickFreeMemory(runlength); \ - MagickFreeMemory(iris_pixels); \ + MagickFreeResourceLimitedMemory(scanline) \ + MagickFreeResourceLimitedMemory(offsets); \ + MagickFreeResourceLimitedMemory(packets); \ + MagickFreeResourceLimitedMemory(runlength); \ + MagickFreeResourceLimitedMemory(iris_pixels); \ ThrowWriterException(code_,reason_,image_); \ } @@ -1201,7 +1201,7 @@ static unsigned int WriteSGIImage(const ImageInfo *image_info,Image *image) Allocate SGI pixels. */ number_pixels=image->columns*image->rows; - iris_pixels=MagickAllocateMemory(unsigned char *, (size_t)4*number_pixels); + iris_pixels=MagickAllocateResourceLimitedArray(unsigned char *,4,number_pixels); if (iris_pixels == (unsigned char *) NULL) ThrowSGIWriterException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -1232,7 +1232,7 @@ static unsigned int WriteSGIImage(const ImageInfo *image_info,Image *image) /* Write uncompressed SGI pixels. */ - scanline=MagickAllocateMemory(unsigned char *,iris_info.xsize); + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,iris_info.xsize); if (scanline == (unsigned char *) NULL) ThrowSGIWriterException(ResourceLimitError,MemoryAllocationFailed, image); @@ -1249,7 +1249,7 @@ static unsigned int WriteSGIImage(const ImageInfo *image_info,Image *image) (void) WriteBlob(image,iris_info.xsize,(char *) scanline); } } - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); } else { @@ -1261,13 +1261,13 @@ static unsigned int WriteSGIImage(const ImageInfo *image_info,Image *image) /* Convert SGI uncompressed pixels. */ - offsets=MagickAllocateArray(unsigned long *,iris_info.ysize, + offsets=MagickAllocateResourceLimitedArray(unsigned long *,iris_info.ysize, MagickArraySize(iris_info.zsize, sizeof(unsigned long))); - packets=MagickAllocateArray(unsigned char *, + packets=MagickAllocateResourceLimitedArray(unsigned char *, 4*(2*(size_t) iris_info.xsize+10), image->rows); - runlength=MagickAllocateArray(unsigned long *,iris_info.ysize, + runlength=MagickAllocateResourceLimitedArray(unsigned long *,iris_info.ysize, MagickArraySize(iris_info.zsize, sizeof(unsigned long))); if ((offsets == (unsigned long *) NULL) || @@ -1302,11 +1302,11 @@ static unsigned int WriteSGIImage(const ImageInfo *image_info,Image *image) /* Free memory. */ - MagickFreeMemory(runlength); - MagickFreeMemory(packets); - MagickFreeMemory(offsets); + MagickFreeResourceLimitedMemory(runlength); + MagickFreeResourceLimitedMemory(packets); + MagickFreeResourceLimitedMemory(offsets); } - MagickFreeMemory(iris_pixels); + MagickFreeResourceLimitedMemory(iris_pixels); } while (0); CloseBlob(image); return(True); diff --git a/coders/sun.c b/coders/sun.c index 746b11e..2ec7246 100644 --- a/coders/sun.c +++ b/coders/sun.c @@ -428,7 +428,7 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) if (!AllocateImageColormap(image,image->colors)) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, image); - sun_colormap=MagickAllocateMemory(unsigned char *,image->colors); + sun_colormap=MagickAllocateResourceLimitedMemory(unsigned char *,image->colors); if (sun_colormap == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, image); @@ -460,7 +460,7 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) image->colormap[i].blue=ScaleCharToQuantum(sun_colormap[i]); break; } while (1); - MagickFreeMemory(sun_colormap); + MagickFreeResourceLimitedMemory(sun_colormap); if (MagickFail == status) ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); break; @@ -476,14 +476,14 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) if (!AllocateImageColormap(image,image->colors)) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, image); - sun_colormap=MagickAllocateMemory(unsigned char *,sun_info.maplength); + sun_colormap=MagickAllocateResourceLimitedMemory(unsigned char *,sun_info.maplength); if (sun_colormap == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, image); if (ReadBlob(image,sun_info.maplength,(char *) sun_colormap) != sun_info.maplength) status = MagickFail; - MagickFreeMemory(sun_colormap); + MagickFreeResourceLimitedMemory(sun_colormap); if (MagickFail == status) ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); break; @@ -560,13 +560,13 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) } } - sun_data=MagickAllocateMemory(unsigned char *,sun_data_length); + sun_data=MagickAllocateResourceLimitedMemory(unsigned char *,sun_data_length); if (sun_data == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); if ((count=ReadBlob(image,sun_data_length,(char *) sun_data)) != sun_data_length) { - MagickFreeMemory(sun_data); + MagickFreeResourceLimitedMemory(sun_data); ThrowReaderException(CorruptImageError,UnableToReadImageData,image); } sun_pixels=sun_data; @@ -575,18 +575,18 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Read run-length encoded raster pixels (padded to 16-bit boundary). */ - sun_pixels=MagickAllocateMemory(unsigned char *,bytes_per_image); + sun_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,bytes_per_image); if (sun_pixels == (unsigned char *) NULL) { - MagickFreeMemory(sun_data); + MagickFreeResourceLimitedMemory(sun_data); ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, image); } status &= DecodeImage(sun_data,sun_data_length,sun_pixels,bytes_per_image); - MagickFreeMemory(sun_data); + MagickFreeResourceLimitedMemory(sun_data); if (status != MagickPass) { - MagickFreeMemory(sun_pixels); + MagickFreeResourceLimitedMemory(sun_pixels); ThrowReaderException(CorruptImageError,UnableToRunlengthDecodeImage,image); } } @@ -714,7 +714,7 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } - MagickFreeMemory(sun_pixels); + MagickFreeResourceLimitedMemory(sun_pixels); if (EOFBlob(image)) { ThrowException(exception,CorruptImageError,UnexpectedEndOfFile, @@ -990,7 +990,7 @@ static unsigned int WriteSUNImage(const ImageInfo *image_info,Image *image) */ pad=(image->columns & 0x01 ? 1 : 0); length=(image->columns + pad) *sizeof(PixelPacket); - pixels=MagickAllocateMemory(unsigned char *,length); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed, image); @@ -1022,7 +1022,7 @@ static unsigned int WriteSUNImage(const ImageInfo *image_info,Image *image) image->columns,image->rows)) break; } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); } else if (characteristics.monochrome) diff --git a/coders/svg.c b/coders/svg.c index f7441ac..2d08220 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -851,12 +851,18 @@ SVGEndDocument(void *context) */ (void) LogMagickEvent(CoderEvent,GetMagickModule()," SAX.endDocument()"); svg_info=(SVGInfo *) context; - MagickFreeMemory(svg_info->offset); - MagickFreeMemory(svg_info->stop_color); + MagickFreeMemory(svg_info->size); + MagickFreeMemory(svg_info->title); + MagickFreeMemory(svg_info->comment); MagickFreeMemory(svg_info->scale); + MagickFreeMemory(svg_info->stop_color); + MagickFreeMemory(svg_info->offset); MagickFreeMemory(svg_info->text); MagickFreeMemory(svg_info->vertices); MagickFreeMemory(svg_info->url); + + /* Don't free xmlParserCtxtPtr parser which is used later */ + if (svg_info->document != (xmlDocPtr) NULL) { xmlFreeDoc(svg_info->document); @@ -3707,7 +3713,11 @@ SVGCDataBlock(void *context,const xmlChar *value,int length) (void) xmlTextConcat(child,value,length); return; } - (void) xmlAddChild(parser->node,xmlNewCDataBlock(parser->myDoc,value,length)); + /* Create a new node containing a CDATA block. */ + /* FIXME: parser->myDoc is null so add fails. What do do? */ + child=xmlNewCDataBlock(parser->myDoc,value,length); + if (xmlAddChild(parser->node,child) == (xmlNodePtr) NULL) + xmlFreeNode(child); } static void @@ -3919,6 +3929,10 @@ ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) SAXHandler=(&SAXModules); svg_info.parser=xmlCreatePushParserCtxt(SAXHandler,&svg_info,(char *) NULL,0, image->filename); + if (svg_info.parser == (xmlParserCtxtPtr) NULL) + { + /* FIXME: Handle failure! */ + } while ((n=ReadBlob(image,MaxTextExtent-1,message)) != 0) { message[n]='\0'; @@ -3932,12 +3946,18 @@ ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) seeing the document end. */ SVGEndDocument(&svg_info); + if (svg_info.parser->myDoc != (xmlDocPtr) NULL) + xmlFreeDoc(svg_info.parser->myDoc); + /* + Free all the memory used by a parser context. However the parsed + document in ctxt->myDoc is not freed (so we just did that). + */ xmlFreeParserCtxt(svg_info.parser); (void) LogMagickEvent(CoderEvent,GetMagickModule(),"end SAX"); (void) fclose(file); CloseBlob(image); - DestroyImage(image); - image=(Image *) NULL; + image->columns=svg_info.width; + image->rows=svg_info.height; if (!image_info->ping && (exception->severity == UndefinedException)) { ImageInfo @@ -3946,6 +3966,8 @@ ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Draw image. */ + DestroyImage(image); + image=(Image *) NULL; clone_info=CloneImageInfo(image_info); clone_info->blob=(_BlobInfoPtr_) NULL; clone_info->length=0; @@ -3960,21 +3982,26 @@ ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) strlcpy(image->filename,image_info->filename,MaxTextExtent); } /* - Free resources. + Add/update image attributes */ - MagickFreeMemory(svg_info.size); - if (svg_info.title != (char *) NULL) + if (image != (Image *) NULL) { - if (image != (Image *) NULL) + /* Title */ + if (svg_info.title != (char *) NULL) (void) SetImageAttribute(image,"title",svg_info.title); - MagickFreeMemory(svg_info.title); - } - if (svg_info.comment != (char *) NULL) - { - if (image != (Image *) NULL) + + /* Comment */ + if (svg_info.comment != (char *) NULL) (void) SetImageAttribute(image,"comment",svg_info.comment); - MagickFreeMemory(svg_info.comment); } + /* + Free resources allocated above (also freed by SVGEndDocument()). + */ + MagickFreeMemory(svg_info.size); + MagickFreeMemory(svg_info.title); + MagickFreeMemory(svg_info.comment); + MagickFreeMemory(svg_info.scale); + MagickFreeMemory(svg_info.text); (void) memset(&svg_info,0xbf,sizeof(SVGInfo)); (void) LiberateTemporaryFile(filename); diff --git a/coders/tga.c b/coders/tga.c index fb86fc1..0bc67e9 100644 --- a/coders/tga.c +++ b/coders/tga.c @@ -985,7 +985,7 @@ static unsigned int WriteTGAImage(const ImageInfo *image_info,Image *image) /* Dump colormap to file (blue, green, red byte order). */ - targa_colormap=MagickAllocateArray(unsigned char *, + targa_colormap=MagickAllocateResourceLimitedArray(unsigned char *, tga_info.colormap_length,3); if (targa_colormap == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed, @@ -999,13 +999,13 @@ static unsigned int WriteTGAImage(const ImageInfo *image_info,Image *image) } (void) WriteBlob(image, (size_t)3*tga_info.colormap_length, (char *) targa_colormap); - MagickFreeMemory(targa_colormap); + MagickFreeResourceLimitedMemory(targa_colormap); } /* Convert MIFF to TGA raster pixels. */ count=(size_t) ((MagickArraySize(tga_info.bits_per_pixel,image->columns)) >> 3); - tga_pixels=MagickAllocateMemory(unsigned char *,count); + tga_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,count); if (tga_pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); for (y=(long) (image->rows-1); y >= 0; y--) @@ -1061,7 +1061,7 @@ static unsigned int WriteTGAImage(const ImageInfo *image_info,Image *image) image->columns,image->rows)) break; } - MagickFreeMemory(tga_pixels); + MagickFreeResourceLimitedMemory(tga_pixels); if (image->next == (Image *) NULL) break; image=SyncNextImageInList(image); diff --git a/coders/tiff.c b/coders/tiff.c index df0cbbc..f4c21da 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -334,7 +334,7 @@ TIFFIgnoreTags(TIFF *tiff) return; i=0; p=tags; - ignore=MagickAllocateArray(TIFFFieldInfo*,count,sizeof(*ignore)); + ignore=MagickAllocateResourceLimitedArray(TIFFFieldInfo*,count,sizeof(*ignore)); if (ignore == (TIFFFieldInfo*) NULL) { ThrowException(&client_data->image->exception,ResourceLimitError, @@ -357,7 +357,7 @@ TIFFIgnoreTags(TIFF *tiff) p++; } (void) TIFFMergeFieldInfo(tiff,ignore,(uint32) count); - MagickFreeMemory(ignore); + MagickFreeResourceLimitedMemory(ignore); } /* @@ -2035,8 +2035,23 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) { if (chromaticity != (float *) NULL) { - image->chromaticity.white_point.x=chromaticity[0]; - image->chromaticity.white_point.y=chromaticity[1]; + if (logging) + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "White Point: %gx%g", + chromaticity[0] /* white_point.x */, + chromaticity[1] /* white_point.y */); + if (MAGICK_ISNAN(chromaticity[0]) || (chromaticity[0] < 0.0) || + MAGICK_ISNAN(chromaticity[1]) || (chromaticity[1] < 0.0)) + { + if (logging) + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "White Point: Is corrupt!"); + } + else + { + image->chromaticity.white_point.x=chromaticity[0]; + image->chromaticity.white_point.y=chromaticity[1]; + } } } chromaticity=(float *) NULL; @@ -2044,12 +2059,36 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) { if (chromaticity != (float *) NULL) { - image->chromaticity.red_primary.x=chromaticity[0]; - image->chromaticity.red_primary.y=chromaticity[1]; - image->chromaticity.green_primary.x=chromaticity[2]; - image->chromaticity.green_primary.y=chromaticity[3]; - image->chromaticity.blue_primary.x=chromaticity[4]; - image->chromaticity.blue_primary.y=chromaticity[5]; + if (logging) + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Primary Chromaticities: " + "r=%gx%g g=%gx%g b=%gx%g", + chromaticity[0] /* red_primary.x */, + chromaticity[1] /* red_primary.y */, + chromaticity[2] /* green_primary.x */, + chromaticity[3] /* green_primary.y */, + chromaticity[4] /* blue_primary.x */, + chromaticity[5] /* blue_primary.y */); + if (MAGICK_ISNAN(chromaticity[0]) || (chromaticity[0] < 0.0) || + MAGICK_ISNAN(chromaticity[1]) || (chromaticity[1] < 0.0) || + MAGICK_ISNAN(chromaticity[2]) || (chromaticity[2] < 0.0) || + MAGICK_ISNAN(chromaticity[3]) || (chromaticity[3] < 0.0) || + MAGICK_ISNAN(chromaticity[4]) || (chromaticity[4] < 0.0) || + MAGICK_ISNAN(chromaticity[5]) || (chromaticity[5] < 0.0)) + { + if (logging) + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Primary Chromaticities: Is corrupt!"); + } + else + { + image->chromaticity.red_primary.x=chromaticity[0]; + image->chromaticity.red_primary.y=chromaticity[1]; + image->chromaticity.green_primary.x=chromaticity[2]; + image->chromaticity.green_primary.y=chromaticity[3]; + image->chromaticity.blue_primary.x=chromaticity[4]; + image->chromaticity.blue_primary.y=chromaticity[5]; + } } } { @@ -2542,7 +2581,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowTIFFReaderException(ResourceLimitError,MemoryAllocationFailed, image); - scanline=MagickAllocateMemory(unsigned char *,(size_t) scanline_size); + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) scanline_size); if (scanline == (unsigned char *) NULL) { LiberateMagickResource(MemoryResource,scanline_size); @@ -2633,7 +2672,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) } } LiberateMagickResource(MemoryResource,scanline_size); - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); break; } case StrippedMethod: @@ -2733,7 +2772,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowTIFFReaderException(ResourceLimitError,MemoryAllocationFailed, image); - strip=MagickAllocateMemory(unsigned char *,(size_t) strip_size_max); + strip=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) strip_size_max); if (strip == (unsigned char *) NULL) { LiberateMagickResource(MemoryResource,strip_size_max); @@ -2853,7 +2892,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } LiberateMagickResource(MemoryResource,strip_size_max); - MagickFreeMemory(strip); + MagickFreeResourceLimitedMemory(strip); break; } case TiledMethod: @@ -2882,7 +2921,9 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) quantum_type; size_t - tile_total_pixels; + tile_total_pixels, + tile_num=0, + tiles_total; if (logging) (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -2984,7 +3025,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowTIFFReaderException(ResourceLimitError,MemoryAllocationFailed, image); - tile=MagickAllocateMemory(unsigned char *, (size_t) tile_size_max); + tile=MagickAllocateResourceLimitedMemory(unsigned char *, (size_t) tile_size_max); if (tile == (unsigned char *) NULL) { LiberateMagickResource(MemoryResource,tile_size_max); @@ -2992,6 +3033,8 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) image); } memset(tile,0,(size_t) tile_size_max); + tiles_total=(((image->columns/tile_columns)+((image->columns % tile_columns) ? 1 : 0)) + *((image->rows/tile_rows)+((image->rows % tile_rows) ? 1 : 0)))*max_sample; /* Compute per-row stride. */ @@ -3043,6 +3086,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Read a tile. */ + tile_num++; if ((tile_size=TIFFReadTile(tiff,tile,x,y,0,sample)) == -1) { status=MagickFail; @@ -3105,31 +3149,28 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) } p += stride; } + if (image->previous == (Image *) NULL) + if (QuantumTick(tile_num,tiles_total)) + if (!MagickMonitorFormatted(tile_num, + tiles_total, + exception, + LoadImageText,image->filename, + image->columns,image->rows)) + { + status=MagickFail; + } if (status == MagickFail) break; } if (status == MagickFail) break; - - if (image->previous == (Image *) NULL) - if (QuantumTick((y+sample*image->rows)/tile_rows, - (image->rows*max_sample)/tile_rows)) - if (!MagickMonitorFormatted((y+sample*image->rows)/tile_rows, - (image->rows*max_sample)/tile_rows, - exception, - LoadImageText,image->filename, - image->columns,image->rows)) - { - status=MagickFail; - break; - } } if (status == MagickFail) break; } LiberateMagickResource(MemoryResource,tile_size_max); - MagickFreeMemory(tile); + MagickFreeResourceLimitedMemory(tile); break; } case RGBAStrippedMethod: @@ -3177,7 +3218,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowTIFFReaderException(ResourceLimitError,MemoryAllocationFailed, image); - strip_pixels=MagickAllocateMemory(uint32 *,strip_pixels_size); + strip_pixels=MagickAllocateResourceLimitedMemory(uint32 *,strip_pixels_size); if (strip_pixels == (uint32 *) NULL) { LiberateMagickResource(MemoryResource,strip_pixels_size); @@ -3250,7 +3291,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) } } LiberateMagickResource(MemoryResource,strip_pixels_size); - MagickFreeMemory(strip_pixels); + MagickFreeResourceLimitedMemory(strip_pixels); break; } case RGBATiledMethod: @@ -3271,7 +3312,9 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) size_t tile_pixels_size, - tile_total_pixels; + tile_total_pixels, + tile_num=0, + tiles_total; if (logging) (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -3287,14 +3330,18 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowTIFFReaderException(CoderError,ImageIsNotTiled,image); } tile_total_pixels=MagickArraySize(tile_columns,tile_rows); + tiles_total=(((image->columns/tile_columns)+((image->columns % tile_columns) ? 1 : 0)) + *((image->rows/tile_rows)+((image->rows % tile_rows) ? 1 : 0))); if (logging) { (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Reading TIFF tiles ..."); (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "TIFF tile geometry %ux%u, %" MAGICK_SIZE_T_F "u pixels", + "TIFF tile geometry %ux%u, %" MAGICK_SIZE_T_F "u pixels/tile" + ", %" MAGICK_SIZE_T_F "u tiles", (unsigned int)tile_columns, (unsigned int)tile_rows, - (MAGICK_SIZE_T) tile_total_pixels); + (MAGICK_SIZE_T) tile_total_pixels, + (MAGICK_SIZE_T) tiles_total); } /* Obtain the maximum number of bytes required to contain a tile. @@ -3306,6 +3353,32 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) image); } /* + Apply image resource limits to tile width, height, and pixels. + */ + errno=0; + if (AcquireMagickResource(WidthResource,tile_columns) != MagickPass) + { + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "TIFF tile width %u exceeds limit!",tile_columns); + ThrowTIFFReaderException(ResourceLimitError,ImagePixelWidthLimitExceeded, + image); + } + if (AcquireMagickResource(HeightResource,tile_rows) != MagickPass) + { + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "TIFF tile width %u exceeds limit!",tile_rows); + ThrowTIFFReaderException(ResourceLimitError,ImagePixelHeightLimitExceeded, + image); + } + if (AcquireMagickResource(PixelsResource,tile_total_pixels) != MagickPass) + { + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "TIFF tile pixels %" MAGICK_SIZE_T_F "u exceeds limit!", + (MAGICK_SIZE_T) tile_total_pixels); + ThrowTIFFReaderException(ResourceLimitError,ImagePixelLimitExceeded, + image); + } + /* Rationalize memory request based on file size */ if (tile_size_max > file_size*max_compress_ratio) @@ -3326,7 +3399,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) (!AcquireMagickResource(MemoryResource,tile_pixels_size))) ThrowTIFFReaderException(ResourceLimitError,MemoryAllocationFailed, image); - tile_pixels=MagickAllocateMemory(uint32*,tile_pixels_size); + tile_pixels=MagickAllocateResourceLimitedMemory(uint32*,tile_pixels_size); if (tile_pixels == (uint32 *) NULL) { LiberateMagickResource(MemoryResource,tile_pixels_size); @@ -3368,6 +3441,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Obtain one tile. Origin is bottom left of tile. */ + tile_num++; if (!TIFFReadRGBATile(tiff,x,y,tile_pixels)) { status=MagickFail; @@ -3412,6 +3486,16 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) p+=tile_columns-tile_columns_remaining; q-=((size_t) image->columns+tile_columns_remaining); } + if (image->previous == (Image *) NULL) + if (QuantumTick(tile_num,tiles_total)) + if (!MagickMonitorFormatted(tile_num, + tiles_total, + exception, + LoadImageText,image->filename, + image->columns,image->rows)) + { + status=MagickFail; + } if (status == MagickFail) break; } @@ -3428,18 +3512,9 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) status=MagickFail; break; } - if (image->previous == (Image *) NULL) - if (QuantumTick(y,image->rows)) - if (!MagickMonitorFormatted(y,image->rows,exception, - LoadImageText,image->filename, - image->columns,image->rows)) - { - status=MagickFail; - break; - } } LiberateMagickResource(MemoryResource,tile_pixels_size); - MagickFreeMemory(tile_pixels); + MagickFreeResourceLimitedMemory(tile_pixels); break; } case RGBAPuntMethod: @@ -3494,7 +3569,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowTIFFReaderException(ResourceLimitError,MemoryAllocationFailed, image); - pixels=MagickAllocateMemory(uint32 *,pixels_size); + pixels=MagickAllocateResourceLimitedMemory(uint32 *,pixels_size); if (pixels == (uint32 *) NULL) { LiberateMagickResource(MemoryResource,pixels_size); @@ -3506,7 +3581,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) pixels,0)) { LiberateMagickResource(MemoryResource,pixels_size); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); status=MagickFail; break; } @@ -3567,7 +3642,7 @@ ReadTIFFImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } LiberateMagickResource(MemoryResource,pixels_size); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); break; } } @@ -3951,7 +4026,7 @@ WriteGROUP4RAWImage(const ImageInfo *image_info,Image *image) (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Allocating %lu bytes of memory for TIFF strip", (unsigned long) strip_size); - strip=MagickAllocateMemory(unsigned char *,(size_t) strip_size); + strip=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) strip_size); if (strip == (unsigned char *) NULL) { TIFFClose(tiff); @@ -3965,7 +4040,7 @@ WriteGROUP4RAWImage(const ImageInfo *image_info,Image *image) if ((status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception)) == MagickFail) { - MagickFreeMemory(strip); + MagickFreeResourceLimitedMemory(strip); TIFFClose(tiff); (void) LiberateTemporaryFile(temporary_filename); ThrowWriterException(FileOpenError,UnableToOpenFile,image); @@ -3986,7 +4061,7 @@ WriteGROUP4RAWImage(const ImageInfo *image_info,Image *image) status=MagickFail; } - MagickFreeMemory(strip); + MagickFreeResourceLimitedMemory(strip); TIFFClose(tiff); (void) LiberateTemporaryFile(temporary_filename); @@ -4177,7 +4252,7 @@ WriteNewsProfile(TIFF *tiff, Handle TIFFTAG_RICHTIFFIPTC tag. */ length += (4-(length & 0x03)); /* Round up for long word alignment */ - profile=MagickAllocateMemory(unsigned char *,length); + profile=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (profile == (unsigned char *) NULL) return; (void) memset(profile,0,length); @@ -4201,7 +4276,7 @@ WriteNewsProfile(TIFF *tiff, length += (length & 0x01); /* Round up for Photoshop */ #if defined(GET_ONLY_IPTC_DATA) length += 12; /* Space for 8BIM header */ - profile=MagickAllocateMemory(unsigned char *,length); + profile=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (profile == (unsigned char *) NULL) return; (void) memset(profile,0,length); @@ -4212,7 +4287,7 @@ WriteNewsProfile(TIFF *tiff, profile[11]=length & 0xff; (void) memcpy(profile+12,profile_data,profile_length); #else - profile=MagickAllocateMemory(unsigned char *,length); + profile=MagickAllocateResourceLimitedMemory(unsigned char *,length); if (profile == (unsigned char *) NULL) return; (void) memset(profile,0,length); @@ -4225,7 +4300,7 @@ WriteNewsProfile(TIFF *tiff, (void) TIFFSetField(tiff,profile_tag,(uint32) length,(void *) profile); } - MagickFreeMemory(profile); + MagickFreeResourceLimitedMemory(profile); } #define ThrowTIFFWriterException(code_,reason_,image_) \ @@ -4867,9 +4942,23 @@ WriteTIFFImage(const ImageInfo *image_info,Image *image) #if defined(BITS_IN_JSAMPLE) depth=BITS_IN_JSAMPLE; bits_per_sample=BITS_IN_JSAMPLE; +#else + depth=8; + bits_per_sample=8; #endif } +#if defined(COMPRESSION_WEBP) + if (COMPRESSION_WEBP == compress_tag) + { + /* + WebP compression only supports a depth of 8. + */ + depth=8; + bits_per_sample=8; + } +#endif /* if defined(COMPRESSION_WEBP) */ + alpha_type=UnspecifiedAlpha; if (image->matte) { @@ -5527,9 +5616,24 @@ WriteTIFFImage(const ImageInfo *image_info,Image *image) chromaticity[3]=image->chromaticity.green_primary.y; chromaticity[4]=image->chromaticity.blue_primary.x; chromaticity[5]=image->chromaticity.blue_primary.y; + if (logging) + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Primary Chromaticities: " + "r=%gx%g g=%gx%g b=%gx%g", + chromaticity[0] /* red_primary.x */, + chromaticity[1] /* red_primary.y */, + chromaticity[2] /* green_primary.x */, + chromaticity[3] /* green_primary.y */, + chromaticity[4] /* blue_primary.x */, + chromaticity[5] /* blue_primary.y */); (void) TIFFSetField(tiff,TIFFTAG_PRIMARYCHROMATICITIES,chromaticity); chromaticity[0]=image->chromaticity.white_point.x; chromaticity[1]=image->chromaticity.white_point.y; + if (logging) + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "White Point: %gx%g", + chromaticity[0] /* white_point.x */, + chromaticity[1] /* white_point.y */); (void) TIFFSetField(tiff,TIFFTAG_WHITEPOINT,chromaticity); } { @@ -5710,19 +5814,19 @@ WriteTIFFImage(const ImageInfo *image_info,Image *image) /* Initialize TIFF colormap. */ - blue=MagickAllocateMemory(unsigned short *, - 65536L*sizeof(unsigned short)); - green=MagickAllocateMemory(unsigned short *, - 65536L*sizeof(unsigned short)); - red=MagickAllocateMemory(unsigned short *, - 65536L*sizeof(unsigned short)); + blue=MagickAllocateResourceLimitedArray(unsigned short *, + 65536L,sizeof(unsigned short)); + green=MagickAllocateResourceLimitedArray(unsigned short *, + 65536L,sizeof(unsigned short)); + red=MagickAllocateResourceLimitedArray(unsigned short *, + 65536L,sizeof(unsigned short)); if ((blue == (unsigned short *) NULL) || (green == (unsigned short *) NULL) || (red == (unsigned short *) NULL)) { - MagickFreeMemory(blue); - MagickFreeMemory(green); - MagickFreeMemory(red); + MagickFreeResourceLimitedMemory(blue); + MagickFreeResourceLimitedMemory(green); + MagickFreeResourceLimitedMemory(red); ThrowTIFFWriterException(ResourceLimitError,MemoryAllocationFailed, image); } @@ -5736,9 +5840,9 @@ WriteTIFFImage(const ImageInfo *image_info,Image *image) blue[i]=ScaleQuantumToShort(image->colormap[i].blue); } (void) TIFFSetField(tiff,TIFFTAG_COLORMAP,red,green,blue); - MagickFreeMemory(red); - MagickFreeMemory(green); - MagickFreeMemory(blue); + MagickFreeResourceLimitedMemory(red); + MagickFreeResourceLimitedMemory(green); + MagickFreeResourceLimitedMemory(blue); } /* Set extra export options for grayscale. @@ -5827,7 +5931,7 @@ WriteTIFFImage(const ImageInfo *image_info,Image *image) max_sample=quantum_samples; } - scanline=MagickAllocateMemory(unsigned char *,(size_t) scanline_size); + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) scanline_size); if (scanline == (unsigned char *) NULL) ThrowTIFFWriterException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -5902,7 +6006,7 @@ WriteTIFFImage(const ImageInfo *image_info,Image *image) if (status == MagickFail) break; } - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); break; } case TiledMethod: @@ -6010,7 +6114,7 @@ WriteTIFFImage(const ImageInfo *image_info,Image *image) /* Allocate tile buffer */ - tile=MagickAllocateMemory(unsigned char *, (size_t) tile_size_max); + tile=MagickAllocateResourceLimitedMemory(unsigned char *, (size_t) tile_size_max); if (tile == (unsigned char *) NULL) ThrowTIFFWriterException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -6149,7 +6253,7 @@ WriteTIFFImage(const ImageInfo *image_info,Image *image) break; } /* for y */ } /* for sample */ - MagickFreeMemory(tile); + MagickFreeResourceLimitedMemory(tile); break; } } diff --git a/coders/tim.c b/coders/tim.c index f71fe01..8037005 100644 --- a/coders/tim.c +++ b/coders/tim.c @@ -184,13 +184,13 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (!AllocateImageColormap(image,pixel_mode == 1 ? 256 : 16)) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, image); - tim_colormap=MagickAllocateMemory(unsigned char *, (size_t)image->colors*2); + tim_colormap=MagickAllocateResourceLimitedArray(unsigned char *,image->colors,2); if (tim_colormap == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, image); if (ReadBlob(image, (size_t)2*image->colors,(char *) tim_colormap) != (size_t)2*image->colors) { - MagickFreeMemory(tim_colormap); + MagickFreeResourceLimitedMemory(tim_colormap); ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } p=tim_colormap; @@ -203,7 +203,7 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) image->colormap[i].red=ScaleCharToQuantum(ScaleColor5to8(word & 0x1fU)); image->colormap[i].opacity=OpaqueOpacity; } - MagickFreeMemory(tim_colormap); + MagickFreeResourceLimitedMemory(tim_colormap); if (image->logging) (void) LogMagickEvent(CoderEvent,GetMagickModule(), "PSX-TIM read CLUT with %u entries", @@ -270,12 +270,12 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (CheckImagePixelLimits(image, exception) != MagickPass) ThrowReaderException(ResourceLimitError,ImagePixelLimitExceeded,image); - tim_pixels=MagickAllocateMemory(unsigned char *,image_size); + tim_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,image_size); if (tim_pixels == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); if (ReadBlob(image,image_size,(char *) tim_pixels) != image_size) { - MagickFreeMemory(tim_pixels); + MagickFreeResourceLimitedMemory(tim_pixels); ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } @@ -436,13 +436,13 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) } default: { - MagickFreeMemory(tim_pixels); + MagickFreeResourceLimitedMemory(tim_pixels); ThrowReaderException(CorruptImageError,ImproperImageHeader,image); } } if (image->storage_class == PseudoClass) (void) SyncImage(image); - MagickFreeMemory(tim_pixels); + MagickFreeResourceLimitedMemory(tim_pixels); if (EOFBlob(image)) { ThrowException(exception,CorruptImageError,UnexpectedEndOfFile, diff --git a/coders/topol.c b/coders/topol.c index 32e9bf8..08a6f21 100644 --- a/coders/topol.c +++ b/coders/topol.c @@ -321,7 +321,7 @@ static int ReadBlobDwordLSB(Image *image, size_t len, magick_uint32_t *data) DestroyImageInfo(clone_info); \ if (palette) \ DestroyImage(palette); \ - MagickFreeMemory(BImgBuff); \ + MagickFreeResourceLimitedMemory(BImgBuff); \ ThrowReaderException(code_,reason_,image_); \ } @@ -638,7 +638,7 @@ NoPalette: case 0: case 1: ldblk = (long) ((depth * image->columns + 7) / 8); - BImgBuff = MagickAllocateMemory(unsigned char *,(size_t) ldblk); /*Ldblk was set in the check phase */ + BImgBuff = MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) ldblk); /*Ldblk was set in the check phase */ if (BImgBuff == NULL) ThrowTOPOLReaderException(ResourceLimitError, MemoryAllocationFailed, image); (void) SeekBlob(image, 512 /*sizeof(Header)*/, SEEK_SET); @@ -664,12 +664,12 @@ NoPalette: } ldblk = (long)((depth * Header.TileWidth + 7) / 8); - BImgBuff = MagickAllocateMemory(unsigned char *,(size_t) ldblk); /*Ldblk was set in the check phase */ + BImgBuff = MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) ldblk); /*Ldblk was set in the check phase */ if (BImgBuff == NULL) ThrowTOPOLReaderException(ResourceLimitError, MemoryAllocationFailed, image); /* dlazdice.create(Header.TileWidth,Header.TileHeight,p.Planes); */ - Offsets = MagickAllocateArray(magick_uint32_t *, + Offsets = MagickAllocateResourceLimitedArray(magick_uint32_t *, MagickArraySize((size_t)TilesAcross,(size_t)TilesDown), sizeof(magick_uint32_t)); if(Offsets==NULL) @@ -678,7 +678,7 @@ NoPalette: (void)SeekBlob(image, Header.TileOffsets, SEEK_SET); if(ReadBlobDwordLSB(image, TilesAcross*TilesDown*4, (magick_uint32_t *)Offsets) < 0) { - MagickFreeMemory(Offsets); + MagickFreeResourceLimitedMemory(Offsets); ThrowTOPOLReaderException(CorruptImageError,InsufficientImageDataInFile, image); } @@ -688,7 +688,7 @@ NoPalette: ldblk = Offsets[(TilY/Header.TileHeight)*TilesAcross+TilX]; if(SeekBlob(image, ldblk, SEEK_SET) != ldblk) { /* When seek does not reach required place, bail out. */ - MagickFreeMemory(Offsets); + MagickFreeResourceLimitedMemory(Offsets); ThrowTOPOLReaderException(CorruptImageError,InsufficientImageDataInFile, image); break; } @@ -706,7 +706,7 @@ NoPalette: if(ReadBlob(image, ldblk, (char *)BImgBuff) != (size_t) ldblk) { - MagickFreeMemory(Offsets); + MagickFreeResourceLimitedMemory(Offsets); ThrowTOPOLReaderException(CorruptImageError,InsufficientImageDataInFile, image); break; } @@ -715,14 +715,14 @@ NoPalette: if(InsertRow(depth, BImgBuff, i+TilY, image, TilX, (image->columnscolumns:Header.TileWidth, &import_options)) { - MagickFreeMemory(Offsets); + MagickFreeResourceLimitedMemory(Offsets); ThrowTOPOLReaderException(CorruptImageError,TooMuchImageDataInFile, image); break; } } } - MagickFreeMemory(Offsets); + MagickFreeResourceLimitedMemory(Offsets); break; } } @@ -730,7 +730,7 @@ NoPalette: /* Finish: */ DONE_READING: - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); if (palette != NULL) DestroyImage(palette); if (clone_info != NULL) diff --git a/coders/txt.c b/coders/txt.c index ef760ed..ba47f4b 100644 --- a/coders/txt.c +++ b/coders/txt.c @@ -343,7 +343,7 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define ThrowNOTXTReaderException(code_,reason_,image_) \ do { \ - MagickFreeMemory(BImgBuff); \ + MagickFreeResourceLimitedMemory(BImgBuff); \ ThrowReaderException(code_,reason_,image_); \ } while (0); @@ -649,7 +649,7 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Assure that all image pixels are initialized to black */ SetImage(image,OpaqueOpacity); - BImgBuff = MagickAllocateArray(unsigned char *, + BImgBuff = MagickAllocateResourceLimitedArray(unsigned char *, ((size_t)x+1), ((size_t)((image->matte) ? 4 : 3) * NumOfPlanes/8)); @@ -870,7 +870,7 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) } } /* Note that DImgBuff and WImgBuff point to BImgBuff */ - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); } while(!EOFBlob(image) && NextImagePos>0); goto FINISH_TXT; diff --git a/coders/uil.c b/coders/uil.c index e13ab87..654b5c8 100644 --- a/coders/uil.c +++ b/coders/uil.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 GraphicsMagick Group +% Copyright (C) 2003-2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -209,7 +209,7 @@ static unsigned int WriteUILImage(const ImageInfo *image_info,Image *image) Map all the transparent pixels. */ number_pixels=image->columns*image->rows; - matte_image=MagickAllocateMemory(unsigned char *,number_pixels); + matte_image=MagickAllocateResourceLimitedMemory(unsigned char *,number_pixels); if (matte_image == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed, image); @@ -252,7 +252,7 @@ static unsigned int WriteUILImage(const ImageInfo *image_info,Image *image) } } if (matte_image != (unsigned char *) NULL) - MagickFreeMemory(matte_image); + MagickFreeResourceLimitedMemory(matte_image); } /* Compute the character per pixel. diff --git a/coders/vicar.c b/coders/vicar.c index 8f27363..f1b9718 100644 --- a/coders/vicar.c +++ b/coders/vicar.c @@ -277,7 +277,7 @@ static Image *ReadVICARImage(const ImageInfo *image_info, /* Read VICAR pixels. */ - scanline=MagickAllocateMemory(unsigned char *,image->columns); + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,image->columns); if (scanline == (unsigned char *) NULL) ThrowReaderException(CorruptImageError,UnableToReadImageData,image); for (y=0; y < (long) image->rows; y++) @@ -297,7 +297,7 @@ static Image *ReadVICARImage(const ImageInfo *image_info, image->columns,image->rows)) break; } - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); if (EOFBlob(image)) ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); CloseBlob(image); @@ -440,7 +440,7 @@ static unsigned int WriteVICARImage(const ImageInfo *image_info,Image *image) /* Allocate memory for scanline. */ - scanline=MagickAllocateMemory(unsigned char *,image->columns); + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,image->columns); if (scanline == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -459,7 +459,7 @@ static unsigned int WriteVICARImage(const ImageInfo *image_info,Image *image) image->columns,image->rows)) break; } - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); CloseBlob(image); return(True); } diff --git a/coders/viff.c b/coders/viff.c index 5209a85..1d71bbf 100644 --- a/coders/viff.c +++ b/coders/viff.c @@ -505,7 +505,7 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, if (BlobIsSeekable(image) && (GetBlobSize(image)-TellBlob(image) < (magick_off_t) viff_colormap_size)) ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); - viff_colormap=MagickAllocateMemory(unsigned char *,viff_colormap_size); + viff_colormap=MagickAllocateResourceLimitedMemory(unsigned char *,viff_colormap_size); if (viff_colormap == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, image); @@ -515,7 +515,7 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, if (ReadBlob(image,viff_colormap_size,(char *) viff_colormap) != viff_colormap_size) { - MagickFreeMemory(viff_colormap); + MagickFreeResourceLimitedMemory(viff_colormap); ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } @@ -565,7 +565,7 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, image->colormap[i % image->colors].blue= ScaleCharToQuantum((unsigned int) value); } - MagickFreeMemory(viff_colormap); + MagickFreeResourceLimitedMemory(viff_colormap); break; } default: @@ -639,7 +639,7 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, if (BlobIsSeekable(image) && (GetBlobSize(image)-TellBlob(image) < (magick_off_t) alloc_size)) ThrowReaderException(CorruptImageError,InsufficientImageDataInFile,image); - viff_pixels=MagickAllocateArray(unsigned char *, + viff_pixels=MagickAllocateResourceLimitedArray(unsigned char *, MagickArraySize(bytes_per_pixel, max_packets), sizeof(Quantum)); @@ -648,7 +648,7 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, if (ReadBlob(image,bytes_per_pixel*max_packets,(char *) viff_pixels) != bytes_per_pixel*max_packets) { - MagickFreeMemory(viff_pixels); + MagickFreeResourceLimitedMemory(viff_pixels); ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image); } lsb_first=1; @@ -862,7 +862,7 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, break; } } - MagickFreeMemory(viff_pixels); + MagickFreeResourceLimitedMemory(viff_pixels); if (image->storage_class == PseudoClass) (void) SyncImage(image); if (EOFBlob(image)) @@ -1203,7 +1203,7 @@ static unsigned int WriteVIFFImage(const ImageInfo *image_info,Image *image) /* Convert MIFF to VIFF raster pixels. */ - viff_pixels=MagickAllocateMemory(unsigned char *,packets); + viff_pixels=MagickAllocateResourceLimitedMemory(unsigned char *,packets); if (viff_pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); q=viff_pixels; @@ -1245,7 +1245,7 @@ static unsigned int WriteVIFFImage(const ImageInfo *image_info,Image *image) /* Dump colormap to file. */ - viff_colormap=MagickAllocateMemory(unsigned char *, + viff_colormap=MagickAllocateResourceLimitedMemory(unsigned char *, MagickArraySize(3,image->colors)); if (viff_colormap == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed, @@ -1258,7 +1258,7 @@ static unsigned int WriteVIFFImage(const ImageInfo *image_info,Image *image) for (i=0; i < (long) image->colors; i++) *q++=ScaleQuantumToChar(image->colormap[i].blue); (void) WriteBlob(image, (size_t)3*image->colors,(char *) viff_colormap); - MagickFreeMemory(viff_colormap); + MagickFreeResourceLimitedMemory(viff_colormap); /* Convert PseudoClass packet to VIFF colormapped pixels. */ @@ -1356,7 +1356,7 @@ static unsigned int WriteVIFFImage(const ImageInfo *image_info,Image *image) } } (void) WriteBlob(image,packets,(char *) viff_pixels); - MagickFreeMemory(viff_pixels); + MagickFreeResourceLimitedMemory(viff_pixels); if (image->next == (Image *) NULL) break; image=SyncNextImageInList(image); diff --git a/coders/webp.c b/coders/webp.c index a008c57..54eb608 100644 --- a/coders/webp.c +++ b/coders/webp.c @@ -184,20 +184,20 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, Read WEBP file. */ length = (size_t) GetBlobSize(image); /* FIXME, does not work with stream */ - stream=MagickAllocateArray(unsigned char *, - length,sizeof(*stream)); + stream=MagickAllocateResourceLimitedArray(unsigned char *, + length,sizeof(*stream)); if (stream == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); count=(long) ReadBlob(image,length,(char *) stream); if (count != (size_t) length) { - MagickFreeMemory(stream); + MagickFreeResourceLimitedMemory(stream); ThrowReaderException(CorruptImageError,InsufficientImageDataInFile,image); } if ((webp_status=WebPGetFeatures(stream,length,&stream_features)) != VP8_STATUS_OK) { - MagickFreeMemory(stream); + MagickFreeResourceLimitedMemory(stream); switch (webp_status) { @@ -250,14 +250,14 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, image->matte=(stream_features.has_alpha ? MagickTrue : MagickFalse); if (image->ping) { - MagickFreeMemory(stream); + MagickFreeResourceLimitedMemory(stream); CloseBlob(image); StopTimer(&image->timer); return(image); } if (CheckImagePixelLimits(image, exception) != MagickPass) { - MagickFreeMemory(stream); + MagickFreeResourceLimitedMemory(stream); ThrowReaderException(ResourceLimitError,ImagePixelLimitExceeded,image); } if (image->matte) @@ -270,7 +270,7 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, &stream_features.height); if (pixels == (unsigned char *) NULL) { - MagickFreeMemory(stream); + MagickFreeResourceLimitedMemory(stream); ThrowReaderException(CoderError,NoDataReturned,image); } @@ -299,7 +299,10 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, } #if defined(SUPPORT_WEBP_MUX) - /* Read features out of the WebP container */ + /* + Read features out of the WebP container + https://developers.google.com/speed/webp/docs/container-api + */ { uint32_t webp_flags=0; WebPData flag_data; @@ -309,20 +312,23 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, (void) memset(&flag_data,0,sizeof(flag_data)); WebPMuxGetFeatures(mux,&webp_flags); - if (webp_flags & ICCP_FLAG) { - WebPMuxGetChunk(mux,"ICCP",&flag_data); - AppendImageProfile(image,"ICC",flag_data.bytes,flag_data.size); - } + if (webp_flags & ICCP_FLAG) + { + WebPMuxGetChunk(mux,"ICCP",&flag_data); + SetImageProfile(image,"ICC",flag_data.bytes,flag_data.size); + } - if (webp_flags & EXIF_FLAG) { - WebPMuxGetChunk(mux,"EXIF",&flag_data); - AppendImageProfile(image,"EXIF",flag_data.bytes,flag_data.size); - } + if (webp_flags & EXIF_FLAG) + { + WebPMuxGetChunk(mux,"EXIF",&flag_data); + SetImageProfile(image,"EXIF",flag_data.bytes,flag_data.size); + } - if (webp_flags & XMP_FLAG) { - WebPMuxGetChunk(mux,"XMP",&flag_data); - AppendImageProfile(image,"XMP",flag_data.bytes,flag_data.size); - } + if (webp_flags & XMP_FLAG) + { + WebPMuxGetChunk(mux,"XMP",&flag_data); + SetImageProfile(image,"XMP",flag_data.bytes,flag_data.size); + } WebPMuxDelete(mux); } @@ -333,7 +339,7 @@ static Image *ReadWEBPImage(const ImageInfo *image_info, */ free(pixels); pixels=(unsigned char *) NULL; - MagickFreeMemory(stream); + MagickFreeResourceLimitedMemory(stream); CloseBlob(image); StopTimer(&image->timer); return(image); @@ -720,7 +726,7 @@ static unsigned int WriteWEBPImage(const ImageInfo *image_info,Image *image) Allocate memory for pixels. */ per_column = MagickArraySize(MagickArraySize(4,image->rows),sizeof(*pixels)); - pixels=MagickAllocateArray(unsigned char *,image->columns,per_column); + pixels=MagickAllocateResourceLimitedArray(unsigned char *,image->columns,per_column); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -751,7 +757,7 @@ static unsigned int WriteWEBPImage(const ImageInfo *image_info,Image *image) webp_status=WebPPictureImportRGB(&picture,pixels,3*picture.width); else webp_status=WebPPictureImportRGBA(&picture,pixels,4*picture.width); - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); } if (webp_status) diff --git a/coders/wpg.c b/coders/wpg.c index b8ce30c..ab67cb6 100644 --- a/coders/wpg.c +++ b/coders/wpg.c @@ -235,11 +235,11 @@ static unsigned int IsWPG(const unsigned char *magick,const size_t length) return(False); } - static MagickPassFail ReallocColormap(Image *image,unsigned int colors) { PixelPacket *colormap; + /* FIXME: This implementation would be better using a true realloc */ colormap=MagickAllocateClearedArray(PixelPacket *,colors,sizeof(PixelPacket)); if (colormap != (PixelPacket *) NULL) { @@ -403,7 +403,7 @@ return RetVal; x++; \ if((long) x>=ldblk) \ { \ - if(InsertRow(BImgBuff,y,image,bpp)==MagickFail) RetVal=-6; \ + if(InsertRow(BImgBuff,y,image,bpp)==MagickFail) { RetVal=-6; goto unpack_wpg_raser_error; } \ x=0; \ y++; \ if(y>=image->rows) break; \ @@ -413,9 +413,12 @@ return RetVal; /** Call this function to ensure that all data matrix is filled with something. This function * is used only to error recovery. */ -static void ZeroFillMissingData(unsigned char *BImgBuff,unsigned long x, unsigned long y, Image *image, - int bpp, long ldblk) +static MagickPassFail ZeroFillMissingData(unsigned char *BImgBuff,unsigned long x, unsigned long y, Image *image, + int bpp, long ldblk) { + MagickPassFail + status = MagickPass; + while(yrows && image->exception.severity!=UndefinedException) { if((long) x 1 ? "s" : "")); - BImgBuff=MagickAllocateMemory(unsigned char *,(size_t) ldblk); + BImgBuff=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) ldblk); if(BImgBuff==NULL) return(-2); (void) memset(BImgBuff,0,(size_t) ldblk); @@ -471,7 +478,7 @@ static int UnpackWPGRaster(Image *image,int bpp) if(i==EOF) { ZeroFillMissingData(BImgBuff,x,y,image,bpp,ldblk); - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); return(-5); } bbuf = i; @@ -503,7 +510,7 @@ static int UnpackWPGRaster(Image *image,int bpp) if(i==EOF) { ZeroFillMissingData(BImgBuff,x,y,image,bpp,ldblk); - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); return -7; } RunCount = i; @@ -515,7 +522,7 @@ static int UnpackWPGRaster(Image *image,int bpp) y++; ZeroFillMissingData(BImgBuff,x,y,image,bpp,ldblk); } - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); return(-3); } for(i=0; i<(int)RunCount; i++) @@ -523,13 +530,12 @@ static int UnpackWPGRaster(Image *image,int bpp) /* when x=0; y points to a new empty line. For y=0 zero line will be populated. */ if(y>=image->rows) { - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); return(-4); } if(InsertRow(BImgBuff,y,image,bpp)==MagickFail) { - ZeroFillMissingData(BImgBuff,x,y,image,bpp,ldblk); - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); return(-6); } y++; @@ -537,7 +543,8 @@ static int UnpackWPGRaster(Image *image,int bpp) } } } - MagickFreeMemory(BImgBuff); +unpack_wpg_raser_error:; + MagickFreeResourceLimitedMemory(BImgBuff); return(RetVal); } @@ -552,7 +559,7 @@ static int UnpackWPGRaster(Image *image,int bpp) x++; \ if((long) x >= ldblk) \ { \ - if(InsertRow(BImgBuff,(long) y,image,bpp)==MagickFail) RetVal=-6; \ + if(InsertRow(BImgBuff,(long) y,image,bpp)==MagickFail) { RetVal=-6; goto unpack_wpg2_error; } \ x=0; \ y++; \ XorMe = 0; \ @@ -565,8 +572,8 @@ static int UnpackWPGRaster(Image *image,int bpp) #define FreeUnpackWPG2RasterAllocs(BImgBuff,UpImgBuff) \ do \ { \ - MagickFreeMemory(BImgBuff); \ - MagickFreeMemory(UpImgBuff); \ + MagickFreeResourceLimitedMemory(BImgBuff); \ + MagickFreeResourceLimitedMemory(UpImgBuff); \ } while(0); /* WPG2 raster reader. */ @@ -600,10 +607,10 @@ static int UnpackWPG2Raster(Image *image, int bpp) x=0; y=0; ldblk=(long) ((bpp*image->columns+7)/8); - BImgBuff=MagickAllocateMemory(unsigned char *,(size_t) ldblk); + BImgBuff=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) ldblk); if(BImgBuff==NULL) return(-2); - UpImgBuff=MagickAllocateMemory(unsigned char *,(size_t) ldblk); + UpImgBuff=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) ldblk); if(UpImgBuff==NULL) { FreeUnpackWPG2RasterAllocs(BImgBuff,UpImgBuff); @@ -729,6 +736,7 @@ static int UnpackWPG2Raster(Image *image, int bpp) } } } +unpack_wpg2_error:; FreeUnpackWPG2RasterAllocs(BImgBuff,UpImgBuff); return(RetVal); } @@ -899,7 +907,7 @@ static Image *ExtractPostscript(Image *image,const ImageInfo *image_info, */ if (GetBlobStreamData(image) == (unsigned char *) NULL) { - ps_data_alloc=MagickAllocateMemory(unsigned char *, PS_Size); + ps_data_alloc=MagickAllocateResourceLimitedMemory(unsigned char *, PS_Size); if (ps_data_alloc == (unsigned char *) NULL) { if (image->logging) @@ -917,7 +925,7 @@ static Image *ExtractPostscript(Image *image,const ImageInfo *image_info, ps_data=ps_data_alloc; if (ReadBlobZC(image,PS_Size,&ps_data) != PS_Size) { - MagickFreeMemory(ps_data_alloc); + MagickFreeResourceLimitedMemory(ps_data_alloc); if (image->logging) (void) LogMagickEvent(CoderEvent,GetMagickModule(), "ExtractPostscript(): Failed to read %"MAGICK_SIZE_T_F"u bytes of data at" @@ -938,7 +946,7 @@ static Image *ExtractPostscript(Image *image,const ImageInfo *image_info, */ if ((clone_info=CloneImageInfo(image_info)) == NULL) { - MagickFreeMemory(ps_data_alloc); + MagickFreeResourceLimitedMemory(ps_data_alloc); return(image); } clone_info->blob=(void *) NULL; @@ -948,7 +956,7 @@ static Image *ExtractPostscript(Image *image,const ImageInfo *image_info, (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Reading embedded \"%s\" content from blob...", clone_info->magick); image2 = BlobToImage(clone_info, ps_data, PS_Size, &image->exception ); - MagickFreeMemory(ps_data_alloc); + MagickFreeResourceLimitedMemory(ps_data_alloc); if (!image2) { goto FINISH_UNL; @@ -1359,8 +1367,6 @@ UnpackRaster: if ( (image->colors < (1UL<colormap, */ - /* (size_t) (1U<colors<(1UL<colormap, - (size_t) (1U<columns+7)/8); - BImgBuff=MagickAllocateMemory(unsigned char *,(size_t) ldblk); + BImgBuff=MagickAllocateResourceLimitedMemory(unsigned char *,(size_t) ldblk); if(BImgBuff == (unsigned char *) NULL) goto NoMemory; @@ -1584,18 +1585,18 @@ UnpackRaster: { if (ReadBlob(image,ldblk,(char *) BImgBuff) != (size_t) ldblk) { - MagickFreeMemory(BImgBuff); + MagickFreeResourceLimitedMemory(BImgBuff); ThrowException(exception,CorruptImageError,UnexpectedEndOfFile,image->filename); goto DecompressionFailed; } if(InsertRow(BImgBuff,i,image,bpp) == MagickFail) { - if(BImgBuff) MagickFreeMemory(BImgBuff); + if(BImgBuff) MagickFreeResourceLimitedMemory(BImgBuff); goto DecompressionFailed; } } - if(BImgBuff) MagickFreeMemory(BImgBuff); + if(BImgBuff) MagickFreeResourceLimitedMemory(BImgBuff); break; } case 1: /*RLE for WPG2 */ diff --git a/coders/xbm.c b/coders/xbm.c index 0bb0fbe..c66800f 100644 --- a/coders/xbm.c +++ b/coders/xbm.c @@ -300,7 +300,7 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) if ((image->columns % 16) && ((image->columns % 16) < 9) && (version == 10)) padding=1; bytes_per_line=((size_t) image->columns+7)/8+padding; - data=MagickAllocateArray(unsigned char *,image->rows,bytes_per_line); + data=MagickAllocateResourceLimitedArray(unsigned char *,image->rows,bytes_per_line); if (data == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image); /* @@ -346,7 +346,7 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) value=XBMInteger(image,4,hex_digits); if (value < 0) { - MagickFreeMemory(data); + MagickFreeResourceLimitedMemory(data); ThrowReaderException(CorruptImageError,ImproperImageHeader,image); } *p++=(unsigned char) value; @@ -359,7 +359,7 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) value=XBMInteger(image,2,hex_digits); if (value < 0) { - MagickFreeMemory(data); + MagickFreeResourceLimitedMemory(data); ThrowReaderException(CorruptImageError,ImproperImageHeader,image); } *p++=(unsigned char) value; @@ -394,7 +394,7 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) image->columns,image->rows)) break; } - MagickFreeMemory(data); + MagickFreeResourceLimitedMemory(data); (void) SyncImage(image); CloseBlob(image); StopTimer(&image->timer); diff --git a/coders/xcf.c b/coders/xcf.c index d08839a..f7501a6 100644 --- a/coders/xcf.c +++ b/coders/xcf.c @@ -352,7 +352,7 @@ static MagickPassFail load_tile (Image* image, Image* tile_image, XCFDocInfo* in } } - xcfdata = xcfodata = MagickAllocateMemory(XCFPixelPacket *,data_length); + xcfdata = xcfodata = MagickAllocateResourceLimitedMemory(XCFPixelPacket *,data_length); graydata = (unsigned char *) xcfdata; /* used by gray and indexed */ if (xcfdata == (XCFPixelPacket *) NULL) @@ -364,7 +364,7 @@ static MagickPassFail load_tile (Image* image, Image* tile_image, XCFDocInfo* in nmemb_read_successfully = ReadBlob(image, data_length, xcfdata); if (nmemb_read_successfully != data_length) { - MagickFreeMemory(xcfodata); + MagickFreeResourceLimitedMemory(xcfodata); ThrowBinaryException(CorruptImageError,UnexpectedEndOfFile,image->filename); } @@ -372,7 +372,7 @@ static MagickPassFail load_tile (Image* image, Image* tile_image, XCFDocInfo* in if (q == (PixelPacket *) NULL) { CopyException(&image->exception,&tile_image->exception); - MagickFreeMemory(xcfodata); + MagickFreeResourceLimitedMemory(xcfodata); return MagickFail; } @@ -403,7 +403,7 @@ static MagickPassFail load_tile (Image* image, Image* tile_image, XCFDocInfo* in } } - MagickFreeMemory(xcfodata); + MagickFreeResourceLimitedMemory(xcfodata); return MagickPass; } @@ -440,7 +440,7 @@ static MagickPassFail load_tile_rle (Image* image, bpp = (int) inDocInfo->bpp; - xcfdata = xcfodata = MagickAllocateMemory(unsigned char *,data_length); + xcfdata = xcfodata = MagickAllocateResourceLimitedMemory(unsigned char *,data_length); if (xcfdata == (unsigned char *) NULL) { ThrowException(&image->exception,ResourceLimitError,MemoryAllocationFailed,NULL); @@ -455,7 +455,7 @@ static MagickPassFail load_tile_rle (Image* image, "Read %lu bytes, expected %lu bytes", (unsigned long) nmemb_read_successfully, (unsigned long) data_length); - MagickFreeMemory(xcfodata); + MagickFreeResourceLimitedMemory(xcfodata); ThrowBinaryException(CorruptImageError,UnexpectedEndOfFile,image->filename); } @@ -628,12 +628,12 @@ static MagickPassFail load_tile_rle (Image* image, if (SyncImagePixelsEx(tile_image,&tile_image->exception) == MagickFail) break; } - MagickFreeMemory(xcfodata); + MagickFreeResourceLimitedMemory(xcfodata); return MagickPass; bogus_rle: if (xcfodata) - MagickFreeMemory(xcfodata); + MagickFreeResourceLimitedMemory(xcfodata); (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Failed to RLE-decode tile"); ThrowBinaryException(CorruptImageError,CorruptImage,image->filename); @@ -1357,7 +1357,7 @@ static MagickPassFail ReadOneLayer( Image* image, XCFDocInfo* inDocInfo, XCFLaye } \ } \ } \ - MagickFreeMemory(layer_info); \ + MagickFreeResourceLimitedMemory(layer_info); \ } while (0); static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception) { @@ -1760,7 +1760,7 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception) last_layer); /* allocate our array of layer info blocks */ - layer_info=MagickAllocateArray(XCFLayerInfo *, + layer_info=MagickAllocateResourceLimitedArray(XCFLayerInfo *, number_layers, sizeof(XCFLayerInfo)); if (layer_info == (XCFLayerInfo *) NULL) @@ -1791,7 +1791,7 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception) saved_pos = TellBlob(image); if (saved_pos < 0) { - MagickFreeMemory(layer_info); + MagickFreeResourceLimitedMemory(layer_info); ThrowReaderException(BlobError,UnableToObtainOffset,image); } @@ -1832,7 +1832,7 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception) layer_info[j].image = (Image *) NULL; } } - MagickFreeMemory(layer_info); + MagickFreeResourceLimitedMemory(layer_info); #endif DestroyLayerInfo(number_layers,layer_info); CopyException(exception,&image->exception); @@ -1938,7 +1938,7 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception) #endif } - MagickFreeMemory(layer_info); + MagickFreeResourceLimitedMemory(layer_info); #if 0 /* BOGUS: do we need the channels?? */ while (True) diff --git a/coders/xpm.c b/coders/xpm.c index c09aa05..734c828 100644 --- a/coders/xpm.c +++ b/coders/xpm.c @@ -151,7 +151,7 @@ static char **StringToListMod(char *text) for (p=text; *p != '\0'; p++) if (*p == '\n') lines++; - textlist=MagickAllocateMemory(char **,(lines+1)*sizeof(char *)); + textlist=MagickAllocateResourceLimitedMemory(char **,(lines+1)*sizeof(char *)); if (textlist == (char **) NULL) MagickFatalError3(ResourceLimitFatalError,MemoryAllocationFailed, UnableToConvertText); @@ -224,10 +224,10 @@ static char *ParseColor(char *data) do { \ if (keys) \ for (i=0; i < (long) image->colors; i++) \ - MagickFreeMemory(keys[i]); \ - MagickFreeMemory(keys); \ - MagickFreeMemory(textlist); \ - MagickFreeMemory(xpm_buffer); \ + MagickFreeResourceLimitedMemory(keys[i]); \ + MagickFreeResourceLimitedMemory(keys); \ + MagickFreeResourceLimitedMemory(textlist); \ + MagickFreeResourceLimitedMemory(xpm_buffer); \ ThrowReaderException(code_,reason_,image_); \ } while (0); @@ -297,13 +297,14 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception) Read XPM file. */ length=MaxTextExtent; - xpm_buffer=MagickAllocateMemory(char *,length); + xpm_buffer=MagickAllocateResourceLimitedMemory(char *,length); if (xpm_buffer != (char *) NULL) { xpm_buffer[0]='\0'; p=xpm_buffer; while (ReadBlobString(image,p) != (char *) NULL) { + char *new_xpm_buffer; if (*p == '#') if ((p == xpm_buffer) || (*(p-1) == '\n')) continue; @@ -313,9 +314,13 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (((size_t) (p-xpm_buffer)+MaxTextExtent+1) < length) continue; length<<=1; - MagickReallocMemory(char *,xpm_buffer,length); - if (xpm_buffer == (char *) NULL) - break; + new_xpm_buffer=MagickReallocateResourceLimitedMemory(char *,xpm_buffer,length); + if (new_xpm_buffer == (char *) NULL) + { + MagickFreeResourceLimitedMemory(xpm_buffer); + break; + } + xpm_buffer=new_xpm_buffer; p=xpm_buffer+strlen(xpm_buffer); } } @@ -403,7 +408,7 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Initialize image structure. */ - keys=MagickAllocateArray(char **,image->colors,sizeof(char *)); + keys=MagickAllocateResourceLimitedArray(char **,image->colors,sizeof(char *)); if (keys == (char **) NULL) ThrowXPMReaderException(ResourceLimitError,MemoryAllocationFailed,image); for (i=0; i < (long) image->colors; i++) @@ -429,7 +434,7 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception) " %lu: %s", i-1, textlist[i-1]); if (strlen(p) < width) break; - keys[j]=MagickAllocateMemory(char *,(size_t) width+1); + keys[j]=MagickAllocateResourceLimitedMemory(char *,(size_t) width+1); if (keys[j] == (char *) NULL) ThrowXPMReaderException(ResourceLimitError,MemoryAllocationFailed,image); keys[j][width]='\0'; @@ -531,10 +536,10 @@ static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception) Free resources. */ for (i=0; i < (long) image->colors; i++) - MagickFreeMemory(keys[i]); - MagickFreeMemory(keys); - MagickFreeMemory(textlist); - MagickFreeMemory(xpm_buffer); + MagickFreeResourceLimitedMemory(keys[i]); + MagickFreeResourceLimitedMemory(keys); + MagickFreeResourceLimitedMemory(textlist); + MagickFreeResourceLimitedMemory(xpm_buffer); CloseBlob(image); StopTimer(&image->timer); return(image); diff --git a/coders/xwd.c b/coders/xwd.c index 4177c37..146146c 100644 --- a/coders/xwd.c +++ b/coders/xwd.c @@ -267,9 +267,9 @@ static MagickPassFail BytesPerLine(size_t *bytes_per_line, #define ThrowXWDReaderException(code_,reason_,image_) \ do { \ if (ximage) \ - MagickFreeMemory(ximage->data); \ - MagickFreeMemory(ximage); \ - MagickFreeMemory(colors); \ + MagickFreeResourceLimitedMemory(ximage->data); \ + MagickFreeResourceLimitedMemory(ximage); \ + MagickFreeResourceLimitedMemory(colors); \ ThrowReaderException(code_,reason_,image_); \ } while (0); @@ -533,7 +533,7 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Initialize the X image. */ - ximage=MagickAllocateMemory(XImage *,sizeof(XImage)); + ximage=MagickAllocateResourceLimitedMemory(XImage *,sizeof(XImage)); if (ximage == (XImage *) NULL) ThrowXWDReaderException(ResourceLimitError,MemoryAllocationFailed,image); ximage->depth=(int) header.pixmap_depth; @@ -601,7 +601,7 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) register unsigned int i; - colors=MagickAllocateArray(XColor *,header.ncolors,sizeof(XColor)); + colors=MagickAllocateResourceLimitedArray(XColor *,header.ncolors,sizeof(XColor)); if (colors == (XColor *) NULL) ThrowXWDReaderException(ResourceLimitError,MemoryAllocationFailed, image); @@ -662,7 +662,7 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowXWDReaderException(CorruptImageError,UnexpectedEndOfFile,image); } - ximage->data=MagickAllocateMemory(char *,length); + ximage->data=MagickAllocateResourceLimitedMemory(char *,length); if (ximage->data == (char *) NULL) ThrowXWDReaderException(ResourceLimitError,MemoryAllocationFailed,image); count=ReadBlob(image,length,ximage->data); @@ -829,9 +829,9 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Free image and colormap. */ - MagickFreeMemory(colors); - MagickFreeMemory(ximage->data); - MagickFreeMemory(ximage); + MagickFreeResourceLimitedMemory(colors); + MagickFreeResourceLimitedMemory(ximage->data); + MagickFreeResourceLimitedMemory(ximage); CloseBlob(image); StopTimer(&image->timer); return(image); @@ -1067,7 +1067,7 @@ static unsigned int WriteXWDImage(const ImageInfo *image_info,Image *image) /* Allocate memory for pixels. */ - pixels=MagickAllocateMemory(unsigned char *,bytes_per_line); + pixels=MagickAllocateResourceLimitedMemory(unsigned char *,bytes_per_line); if (pixels == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); @@ -1091,7 +1091,7 @@ static unsigned int WriteXWDImage(const ImageInfo *image_info,Image *image) Dump colormap to file. */ (void) memset(&color,0,sizeof(color)); - colors=MagickAllocateArray(XColor *,image->colors,sizeof(XColor)); + colors=MagickAllocateResourceLimitedArray(XColor *,image->colors,sizeof(XColor)); if (colors == (XColor *) NULL) ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); for (i=0; i < image->colors; i++) @@ -1118,7 +1118,7 @@ static unsigned int WriteXWDImage(const ImageInfo *image_info,Image *image) if (WriteBlob(image,sz_XWDColor,(char *) &color) != sz_XWDColor) break; } - MagickFreeMemory(colors); + MagickFreeResourceLimitedMemory(colors); } /* Convert MIFF to XWD raster pixels. @@ -1161,7 +1161,7 @@ static unsigned int WriteXWDImage(const ImageInfo *image_info,Image *image) image->columns,image->rows)) break; } - MagickFreeMemory(pixels); + MagickFreeResourceLimitedMemory(pixels); CloseBlob(image); return (y < image->rows ? MagickFail : MagickPass); } diff --git a/coders/yuv.c b/coders/yuv.c index e754588..7a59aa4 100644 --- a/coders/yuv.c +++ b/coders/yuv.c @@ -83,7 +83,7 @@ static unsigned int */ #define ThrowYUVReaderException(code_,reason_,image_) \ { \ - MagickFreeMemory(scanline); \ + MagickFreeResourceLimitedMemory(scanline); \ DestroyImage(chroma_image); \ DestroyImage(resize_image); \ ThrowReaderException(code_,reason_,image_); \ @@ -184,9 +184,9 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) Allocate memory for a scanline. */ if (interlace == NoInterlace) - scanline=MagickAllocateMemory(unsigned char *,(size_t) 2*image->columns+2); + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,MagickArraySize(2,image->columns)+2); else - scanline=MagickAllocateMemory(unsigned char *,image->columns); + scanline=MagickAllocateResourceLimitedMemory(unsigned char *,image->columns); if (scanline == (unsigned char *) NULL) ThrowYUVReaderException(ResourceLimitError,MemoryAllocationFailed,image); do @@ -417,7 +417,7 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image->next == (Image *) NULL) { DestroyImageList(image); - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); return((Image *) NULL); } image=SyncNextImageInList(image); @@ -427,7 +427,7 @@ static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } while (count != 0); - MagickFreeMemory(scanline); + MagickFreeResourceLimitedMemory(scanline); while (image->previous != (Image *) NULL) image=image->previous; CloseBlob(image); diff --git a/common.shi.in b/common.shi.in index c08465a..bd76c5b 100644 --- a/common.shi.in +++ b/common.shi.in @@ -1,5 +1,5 @@ # -*- shell-script -*- -# Copyright (C) 2012-2017 GraphicsMagick Group +# Copyright (C) 2012-2020 GraphicsMagick Group # Definitions of optional features and configuration values for this build. # Intended for use by test scripts. MAGICK_FEATURES='@MAGICK_FEATURES@' @@ -18,4 +18,30 @@ MAGICK_CODER_STABILITY='BROKEN' MAGICK_FONT='@abs_top_srcdir@/PerlMagick/demo/Generic.ttf' PATH="@abs_top_builddir@/utilities:${PATH}" + +# Number of bits in a pixel Quantum (8/16/32) +QuantumDepth=@QuantumDepth@ + +# Memory limit (in MB) for a 'Q8' build +Q8_MEMORY_LIMIT=128 + +# Apply some resource limits (FAX/G4 need 2592x3508 pixel image!) +if test -z "$MAGICK_LIMIT_MEMORY" ; then + export MAGICK_LIMIT_MEMORY=`expr $Q8_MEMORY_LIMIT '*' '(' $QuantumDepth / 8 ')'`MB +fi +if test -z "$MAGICK_LIMIT_WIDTH" ; then + export MAGICK_LIMIT_WIDTH=2592 +fi +if test -z "$MAGICK_LIMIT_HEIGHT" ; then + export MAGICK_LIMIT_HEIGHT=3508 +fi +if test -z "$MAGICK_LIMIT_DISK" ; then + export MAGICK_LIMIT_DISK=0 +fi +# Enable debug traces for exceptions +if test -z "MAGICK_DEBUG" ; then + export MAGICK_DEBUG=exception +fi +printf "Resource Limits: MAGICK_LIMIT_MEMORY=%s MAGICK_LIMIT_WIDTH=%s MAGICK_LIMIT_HEIGHT=%s MAGICK_LIMIT_DISK=%s\n\n" "$MAGICK_LIMIT_MEMORY" "$MAGICK_LIMIT_WIDTH" "$MAGICK_LIMIT_HEIGHT" "$MAGICK_LIMIT_DISK" + set +a diff --git a/config/compile b/config/compile index 99e5052..23fcba0 100755 --- a/config/compile +++ b/config/compile @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) diff --git a/config/config.guess b/config/config.guess index 256083a..7f74817 100755 --- a/config/config.guess +++ b/config/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2018 Free Software Foundation, Inc. +# Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2018-03-08' +timestamp='2020-12-22' # 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 @@ -27,12 +27,12 @@ timestamp='2018-03-08' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . -me=`echo "$0" | sed -e 's,.*/,,'` +me=$(echo "$0" | sed -e 's,.*/,,') usage="\ Usage: $0 [OPTION] @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2018 Free Software Foundation, Inc. +Copyright 1992-2020 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." @@ -84,8 +84,6 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 - # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -96,66 +94,82 @@ trap 'exit 1' 1 2 15 # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > "$dummy.c" ; - for c in cc gcc c89 c99 ; do - if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown +UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown +UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown +UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown - eval "$set_cc_for_build" + set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu fi ;; esac @@ -175,19 +189,20 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ - echo unknown)` + echo unknown)) case "$UNAME_MACHINE_ARCH" in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') + endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; @@ -199,7 +214,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval "$set_cc_for_build" + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -218,7 +233,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") ;; esac # The OS release @@ -231,24 +246,24 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in release='-gnu' ;; *) - release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2) ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi}" + echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) @@ -260,6 +275,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; + *:OS108:*:*) + echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" + exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; @@ -269,26 +287,29 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; + *:Twizzler:*:*) + echo "$UNAME_MACHINE"-unknown-twizzler + exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}') ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}') ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1) case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; @@ -326,7 +347,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" + echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -360,7 +381,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then + if test "$( (/bin/universe) 2>/dev/null)" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd @@ -373,28 +394,28 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in + case $(/usr/bin/uname -p) in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval "$set_cc_for_build" + set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null @@ -402,30 +423,30 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case "$(/usr/bin/arch -k)" in Series*|S4*) - UNAME_RELEASE=`uname -v` + UNAME_RELEASE=$(uname -v) ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in + case "$(/bin/arch)" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; @@ -482,7 +503,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval "$set_cc_for_build" + set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ @@ -505,8 +526,8 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`"$dummy" "$dummyarg"` && + dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && + SYSTEM_NAME=$("$dummy" "$dummyarg") && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; @@ -533,11 +554,11 @@ EOF exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + UNAME_PROCESSOR=$(/usr/bin/uname -p) + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then echo m88k-dg-dgux"$UNAME_RELEASE" else @@ -561,17 +582,17 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if test -x /usr/bin/oslevel ; then + IBM_REV=$(/usr/bin/oslevel) else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi @@ -579,7 +600,7 @@ EOF exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval "$set_cc_for_build" + set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include @@ -591,7 +612,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") then echo "$SYSTEM_NAME" else @@ -604,15 +625,15 @@ EOF fi exit ;; *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + if test -x /usr/bin/lslpp ; then + IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi @@ -640,14 +661,14 @@ EOF echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + if test -x /usr/bin/getconf; then + sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) + sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null) case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 @@ -659,8 +680,8 @@ EOF esac ;; esac fi - if [ "$HP_ARCH" = "" ]; then - eval "$set_cc_for_build" + if test "$HP_ARCH" = ""; then + set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE @@ -694,13 +715,13 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy") test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ "$HP_ARCH" = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then - eval "$set_cc_for_build" + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -722,11 +743,11 @@ EOF echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval "$set_cc_for_build" + set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int @@ -752,7 +773,7 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; @@ -772,7 +793,7 @@ EOF echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then + if test -x /usr/sbin/sysversion ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 @@ -821,14 +842,14 @@ EOF echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') + FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') + FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -840,15 +861,26 @@ EOF *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=$(uname -p) + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + fi + exit ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` + UNAME_PROCESSOR=$(/usr/bin/uname -p) case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin @@ -881,21 +913,21 @@ EOF echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin + echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; *:GNU:*:*) # the GNU system - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" exit ;; - i*86:Minix:*:*) - echo "$UNAME_MACHINE"-pc-minix + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" @@ -905,7 +937,7 @@ EOF echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -922,7 +954,7 @@ EOF echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval "$set_cc_for_build" + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then @@ -964,6 +996,9 @@ EOF k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; @@ -971,23 +1006,51 @@ EOF echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval "$set_cc_for_build" + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" - test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" @@ -1006,7 +1069,7 @@ EOF exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; @@ -1046,7 +1109,17 @@ EOF echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI="$LIBC"x32 + fi + fi + echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" @@ -1086,7 +1159,7 @@ EOF echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) - UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else @@ -1095,19 +1168,19 @@ EOF exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in + case $(/bin/uname -X | grep "^Machine") in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 @@ -1157,7 +1230,7 @@ EOF 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1168,7 +1241,7 @@ EOF NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1201,7 +1274,7 @@ EOF exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=$( (uname -p) 2>/dev/null) echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv @@ -1235,7 +1308,7 @@ EOF echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then + if test -d /usr/nec; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" @@ -1283,44 +1356,48 @@ EOF *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; + arm64:Darwin:*:*) + echo aarch64-apple-darwin"$UNAME_RELEASE" + exit ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval "$set_cc_for_build" - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc + UNAME_PROCESSOR=$(uname -p) + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build fi - if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc - if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_PPC >/dev/null - then - UNAME_PROCESSOR=powerpc - fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` + UNAME_PROCESSOR=$(uname -p) if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc @@ -1358,6 +1435,7 @@ EOF # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. + # shellcheck disable=SC2154 if test "$cputype" = 386; then UNAME_MACHINE=i386 else @@ -1387,10 +1465,10 @@ EOF echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=$( (uname -p) 2>/dev/null) case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1400,7 +1478,7 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" + echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos @@ -1414,8 +1492,148 @@ EOF amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; + *:Unleashed:*:*) + echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + exit ;; esac +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null); + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in @@ -1435,9 +1653,15 @@ This script (version $timestamp), has failed to recognize the operating system you are using. If your script is old, overwrite *all* copies of config.guess and config.sub with the latest versions from: - https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess + https://git.savannah.gnu.org/cgit/config.git/plain/config.guess and - https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + https://git.savannah.gnu.org/cgit/config.git/plain/config.sub +EOF + +year=$(echo $timestamp | sed 's,-.*,,') +# shellcheck disable=SC2003 +if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then + cat >&2 </dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` +uname -m = $( (uname -m) 2>/dev/null || echo unknown) +uname -r = $( (uname -r) 2>/dev/null || echo unknown) +uname -s = $( (uname -s) 2>/dev/null || echo unknown) +uname -v = $( (uname -v) 2>/dev/null || echo unknown) -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` +/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null) +/bin/uname -X = $( (/bin/uname -X) 2>/dev/null) -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` +hostinfo = $( (hostinfo) 2>/dev/null) +/bin/universe = $( (/bin/universe) 2>/dev/null) +/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null) +/bin/arch = $( (/bin/arch) 2>/dev/null) +/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null) +/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null) UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF +fi exit 1 diff --git a/config/config.sub b/config/config.sub index 9ccf09a..90bb8ae 100755 --- a/config/config.sub +++ b/config/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2018 Free Software Foundation, Inc. +# Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2018-03-08' +timestamp='2020-12-22' # 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 @@ -33,7 +33,7 @@ timestamp='2018-03-08' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,7 +50,7 @@ timestamp='2018-03-08' # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -me=`echo "$0" | sed -e 's,.*/,,'` +me=$(echo "$0" | sed -e 's,.*/,,') usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS @@ -67,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2018 Free Software Foundation, Inc. +Copyright 1992-2020 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." @@ -89,7 +89,7 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) @@ -110,1223 +110,1169 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | cloudabi*-eabi* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo "$1" | sed 's/-[^-]*$//'` - if [ "$basic_machine" != "$1" ] - then os=`echo "$1" | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +# shellcheck disable=SC2162 +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 ;; - -lynx*) - os=-lynxos + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 ;; - -ptx*) - basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os 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*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac ;; - -psos*) - os=-psos + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia16 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | wasm32 \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) + op50n) + cpu=hppa1.1 + vendor=oki ;; - ms1) - basic_machine=mt-unknown + op60c) + cpu=hppa1.1 + vendor=oki ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - xscaleeb) - basic_machine=armeb-unknown + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - - xscaleel) - basic_machine=armel-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - # 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) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | wasm32-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-pc - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att + cpu=m68000 + vendor=att ;; 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux + cpu=we32k + vendor=att ;; bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec + cpu=powerpc + vendor=ibm + basic_os=cnk ;; decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 + cpu=pdp10 + vendor=dec + basic_os=tops10 ;; decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 + cpu=pdp10 + vendor=dec + basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx + cpu=m68k + vendor=motorola ;; dpx2*) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + cpu=m68k + vendor=bull + basic_os=sysv3 ;; encore | umax | mmax) - basic_machine=ns32k-encore + cpu=ns32k + vendor=encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} ;; fx2800) - basic_machine=i860-alliant + cpu=i860 + vendor=alliant ;; genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 + cpu=ns32k + vendor=ns ;; h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp + cpu=m68000 + vendor=hp ;; hp9k3[2-9][0-9]) - basic_machine=m68k-hp + cpu=m68k + vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm + cpu=hppa1.0 + vendor=hp ;; i*86v32) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv32 + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=sysv32 ;; i*86v4*) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv4 + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=sysv4 ;; i*86v) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=sysv ;; i*86sol2) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-solaris2 + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=solaris2 ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - vsta) - basic_machine=i386-unknown - os=-vsta + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} ;; iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) + cpu=mips + vendor=sgi + case $basic_os in + irix*) ;; *) - os=-irix4 + basic_os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos + cpu=m68000 + vendor=convergent ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint ;; news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv + cpu=mips + vendor=sony + basic_os=newsos ;; next | m*-next) - basic_machine=m68k-next - case $os in - -nextstep* ) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) ;; - -ns2*) - os=-nextstep2 + ns2*) + basic_os=nextstep2 ;; *) - os=-nextstep3 + basic_os=nextstep3 ;; esac ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - nsv-tandem) - basic_machine=nsv-tandem - ;; - nsx-tandem) - basic_machine=nsx-tandem + cpu=np1 + vendor=gould ;; op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k + cpu=hppa1.1 + vendor=oki + basic_os=proelf ;; pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; pbd) - basic_machine=sparc-tti + cpu=sparc + vendor=tti ;; pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc + cpu=m68k + vendor=tti ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` + pc532) + cpu=ns32k + vendor=pc532 ;; pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm + cpu=pn + vendor=gould ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` + power) + cpu=power + vendor=ibm ;; - ppc64) basic_machine=powerpc64-unknown + ps2) + cpu=i386 + vendor=ibm ;; - ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + rm[46]00) + cpu=mips + vendor=siemens ;; - ppc64le | powerpc64little) - basic_machine=powerpc64le-unknown + rtpc | rtpc-*) + cpu=romp + vendor=ibm ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} ;; - ps2) - basic_machine=i386-ibm + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks ;; - pw32) - basic_machine=i586-unknown - os=-pw32 + tower | tower-32) + cpu=m68k + vendor=ncr ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu ;; - rdos32) - basic_machine=i386-pc - os=-rdos + w65) + cpu=w65 + vendor=wdc ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf ;; - rm[46]00) - basic_machine=mips-siemens + none) + cpu=none + vendor=none ;; - rtpc | rtpc-*) - basic_machine=romp-ibm + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine ;; - s390 | s390-*) - basic_machine=s390-ibm + leon-*|leon[3-9]-*) + cpu=sparc + vendor=$(echo "$basic_machine" | sed 's/-.*//') ;; - s390x | s390x-*) - basic_machine=s390x-ibm + + *-*) + # shellcheck disable=SC2162 + IFS="-" read cpu vendor <&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb \ + | arm | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bpf | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | loongarch32 | loongarch64 | loongarchx32 \ + | 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 \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k | nvptx \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | picochip \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv64 \ + | rl78 | romp | rs6000 | rx \ + | s390 | s390x \ + | score \ + | sh | shl \ + | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | thumbv7* \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | w65 \ + | wasm32 | wasm64 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1334,203 +1280,213 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if test x$basic_os != x then + +# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|') + ;; + os2-emx) + kernel=os2 + os=$(echo $basic_os | sed -e 's|os2-emx|emx|') + ;; + nto-qnx*) + kernel=nto + os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|') + ;; + *-*) + # shellcheck disable=SC2162 + IFS="-" read kernel os <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1543,254 +1499,352 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +kernel= +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + kernel=linux + os=gnu ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; pru-*) - os=-elf + os=elf ;; *-be) - os=-beos + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna + os=luna ;; *-next) - os=-nextstep + os=nextstep ;; *-sequent) - os=-ptx + os=ptx ;; *-crds) - os=-unos + os=unos ;; *-ns) - os=-genix + os=genix ;; i370-*) - os=-mvs + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-abi", so those need to count as OSes. + musl* | newlib* | uclibc*) + ;; + # Likewise for "kernel-libc" + eabi | eabihf | gnueabi | gnueabihf) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*) + ;; + # 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. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 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-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -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 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - -sunos*) + *-sunos*) vendor=sun ;; - -cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - -beos*) + *-beos*) vendor=be ;; - -hpux*) + *-hpux*) vendor=hp ;; - -mpeix*) + *-mpeix*) vendor=hp ;; - -hiux*) + *-hiux*) vendor=hitachi ;; - -unos*) + *-unos*) vendor=crds ;; - -dgux*) + *-dgux*) vendor=dg ;; - -luna*) + *-luna*) vendor=omron ;; - -genix*) + *-genix*) vendor=ns ;; - -mvs* | -opened*) + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) vendor=ibm ;; - -os400*) + s390-* | s390x-*) vendor=ibm ;; - -ptx*) + *-ptx*) vendor=sequent ;; - -tpf*) + *-tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - -aux*) + *-aux*) vendor=apple ;; - -hms*) + *-hms*) vendor=hitachi ;; - -mpw* | -macos*) + *-mpw* | *-macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - -vos*) + *-vos*) vendor=stratus ;; esac - basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac -echo "$basic_machine$os" +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: diff --git a/config/depcomp b/config/depcomp index 65cbf70..6b39162 100755 --- a/config/depcomp +++ b/config/depcomp @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 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 diff --git a/config/install-sh b/config/install-sh index 8175c64..ec298b5 100755 --- a/config/install-sh +++ b/config/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2018-03-11.20; # UTC +scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -69,6 +69,11 @@ posix_mkdir= # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -99,18 +104,28 @@ Options: --version display version info and exit. -c (ignored) - -C install only if different (preserve the last data modification time) + -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +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/ " while test $# -ne 0; do @@ -137,8 +152,13 @@ while test $# -ne 0; do -o) chowncmd="$chownprog $2" shift;; + -p) cpprog="$cpprog -p";; + -s) stripcmd=$stripprog;; + -S) backupsuffix="$2" + shift;; + -t) is_target_a_directory=always dst_arg=$2 @@ -255,6 +275,10 @@ do dstdir=$dst test -d "$dstdir" dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command @@ -301,22 +325,6 @@ do if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then @@ -326,52 +334,49 @@ do fi posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; esac if @@ -382,7 +387,7 @@ do then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. @@ -411,7 +416,7 @@ do prefixes= else if $posix_mkdir; then - (umask=$mkdir_umask && + (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 @@ -451,7 +456,18 @@ do trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -477,6 +493,13 @@ do then rm -f "$dsttmp" else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || @@ -491,9 +514,9 @@ do # file should still install successfully. { test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || + $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 diff --git a/config/missing b/config/missing index 625aeb1..8d0eaad 100755 --- a/config/missing +++ b/config/missing @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify diff --git a/config/tap-driver.sh b/config/tap-driver.sh index 2516e9c..0ca4903 100755 --- a/config/tap-driver.sh +++ b/config/tap-driver.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2011-2018 Free Software Foundation, Inc. +# Copyright (C) 2011-2020 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 @@ -369,7 +369,7 @@ function setup_result_obj(line) sub("^(not )?ok[ \t]*", "", line) # If the result has an explicit number, get it and strip it; otherwise, - # automatically assing the next progresive number to it. + # automatically assign the next test number to it. if (line ~ /^[0-9]+$/ || line ~ /^[0-9]+[^a-zA-Z0-9_]/) { match(line, "^[0-9]+") diff --git a/config/test-driver b/config/test-driver index b8521a4..9759384 100755 --- a/config/test-driver +++ b/config/test-driver @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2018 Free Software Foundation, Inc. +# Copyright (C) 2011-2020 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 @@ -42,11 +42,13 @@ print_usage () { cat <&5 -$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } -if ${ac_cv_prog_cc_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -#include - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -#define debug(...) fprintf (stderr, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - your preprocessor is broken; -#endif -#if BIG_OK -#else - your preprocessor is broken; -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -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) - continue; - return 0; -} - -// Check varargs and va_copy. -static void -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str; - int number; - float fnumber; - - while (*format) - { - switch (*format++) - { - case 's': // string - str = va_arg (args_copy, const char *); - break; - case 'd': // int - number = va_arg (args_copy, int); - break; - case 'f': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); -} - -int -main () -{ - - // Check bool. - _Bool success = false; - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - test_varargs ("s, d' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' - || dynamic_array[ni.number - 1] != 543); - - ; - return 0; -} -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c99" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c99" != xno; then : - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* 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 don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 -else - ac_cv_prog_cc_stdc=no -fi - -fi - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 -$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } - if ${ac_cv_prog_cc_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -fi - - case $ac_cv_prog_cc_stdc in #( - no) : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; #( - '') : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; #( - *) : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 -$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; -esac - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -7097,35 +6810,17 @@ done -LIB_GDI32='' native_win32_build='no' cygwin_build='no' case "${host_os}" in cygwin* ) cygwin_build='yes' - LIB_GDI32='-lgdi32' ;; mingw* ) native_win32_build='yes' - LIB_GDI32='-lgdi32' ;; esac -if test "${LIB_GDI32}x" != 'x' -then - -$as_echo "#define HasWINGDI32 1" >>confdefs.h - -fi - - if test "${LIB_GDI32}x" != 'x' ; then - HasWINGDI32_TRUE= - HasWINGDI32_FALSE='#' -else - HasWINGDI32_TRUE='#' - HasWINGDI32_FALSE= -fi - - if test "${native_win32_build}" = 'yes' ; then + if test "${native_win32_build}" = 'yes'; then WIN32_NATIVE_BUILD_TRUE= WIN32_NATIVE_BUILD_FALSE='#' else @@ -7133,7 +6828,7 @@ else WIN32_NATIVE_BUILD_FALSE= fi - if test "${cygwin_build}" = 'yes' ; then + if test "${cygwin_build}" = 'yes'; then CYGWIN_BUILD_TRUE= CYGWIN_BUILD_FALSE='#' else @@ -7750,6 +7445,21 @@ $as_echo "#define DisableSlowOpenMP 1" >>confdefs.h fi +# Disable reading/writing gzip/bzip compressed files +# Check whether --enable-compressed-files was given. +if test "${enable_compressed_files+set}" = set; then : + enableval=$enable_compressed_files; with_compressed_files=$enableval +else + with_compressed_files='yes' +fi + +if test "$with_compressed_files" != 'yes'; then + +$as_echo "#define DISABLE_COMPRESSED_FILES 1" >>confdefs.h + + DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-compressed-files=$with_compressed_files " +fi + ######## # # Check for large file support @@ -8071,10 +7781,6 @@ esac # # Configure libtool -enable_dlopen=yes - - - case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 @@ -11360,6 +11066,7 @@ test -z "$OBJDUMP" && OBJDUMP=objdump +enable_dlopen=yes @@ -19542,7 +19249,7 @@ case "${with_quantum_depth}" in 8 ) ;; 16 ) ;; 32 ) ;; - * ) as_fn_error 16 "\"Pixel quantum depth must have value of 8" "$LINENO" 5 ;; + * ) as_fn_error $? "Pixel quantum depth must have value of 8, 16, or 32" "$LINENO" 5 ;; esac QuantumDepth="$with_quantum_depth" @@ -19645,6 +19352,45 @@ if test "$with_fpx" != 'yes' ; then DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx " fi +# Enable Windows lgdi32 library + +# Check whether --with-gdi32 was given. +if test "${with_gdi32+set}" = set; then : + withval=$with_gdi32; with_gdi32=$withval +else + with_gdi32='yes' +fi + +if test "$with_gdi32" != 'yes' ; then + DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gdi32=$with_gdi32 " +fi + +# Disable Ghostscript support. + +# Check whether --with-gs was given. +if test "${with_gs+set}" = set; then : + withval=$with_gs; with_gs=$withval +else + with_gs='yes' +fi + +if test "$with_gs" != 'yes' ; then + DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs=$with_gs " +fi +if test "$with_gs" = 'yes' ; then + +$as_echo "#define HasGS 1" >>confdefs.h + +fi + if test "$with_gs" = 'yes'; then + HasGS_TRUE= + HasGS_FALSE='#' +else + HasGS_TRUE='#' + HasGS_FALSE= +fi + + # Disable JBIG. # Check whether --with-jbig was given. @@ -19724,7 +19470,7 @@ if test "$with_lzma" != 'yes' ; then fi # # Disable MPEG. -# AC_ARG_WITH(mpeg2, +# AC_ARG_WITH([mpeg2], # AS_HELP_STRING([--without-mpeg2], # [disable MPEG support]), # [with_mpeg2=$withval], @@ -21200,43 +20946,6 @@ _ACEOF -# If `signal.h' declares signal as returning a pointer to a function -# returning void, define RETSIGTYPE to be void; otherwise, define it -# to be int. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - - # Test for C compiler __func__ support if test "$ac_cv_have_C__func__" != 'yes' ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler __func__ support" >&5 @@ -21250,7 +20959,6 @@ else int main () { - const char *func=__func__; return (func != 0 ? 0 : 1); @@ -22670,8 +22378,7 @@ else int main () { - - const char *func=__func__; +const char *func=__func__; return (func != 0 ? 0 : 1); ; @@ -22679,7 +22386,7 @@ main () } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_have_CPP__func__='yes' + ac_cv_have_CPP__func__='yes' else ac_cv_have_CPP__func__='no' fi @@ -24205,9 +23912,9 @@ fi else failed=`expr $failed + 1` fi - #AC_CHECK_LIB(bz2,BZ2_bzCompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - #AC_CHECK_LIB(bz2,BZ2_bzDecompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - #AC_CHECK_LIB(bz2,_imp__BZ2_decompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) + #AC_CHECK_LIB([bz2],[BZ2_bzCompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + #AC_CHECK_LIB([bz2],[BZ2_bzDecompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + #AC_CHECK_LIB([bz2],[_imp__BZ2_decompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if BZLIB package is complete" >&5 $as_echo_n "checking if BZLIB package is complete... " >&6; } if test $passed -gt 0 @@ -25887,7 +25594,6 @@ $as_echo_n "checking for LIBPNG1${var} support ... " >&6; } int main () { - #if PNG_LIBPNG_VER_MINOR != ${var} #error LIBPNG library must be version 1${var}! Kaboom, Kaboom @@ -25899,7 +25605,7 @@ return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_libpng_ok='yes' + ac_cv_libpng_ok='yes' else ac_cv_libpng_ok='no' fi @@ -26311,49 +26017,6 @@ else failed=`expr $failed + 1` fi - -# Test for compatible JPEG library -if test "$ac_cv_jpeg_version_ok" != 'yes' ; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JPEG library is version 6b or later" >&5 -$as_echo_n "checking for JPEG library is version 6b or later... " >&6; } -if ${ac_cv_jpeg_version_ok+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ - -#if JPEG_LIB_VERSION < 62 -#error IJG JPEG library must be version 6b or newer! -Kaboom, Kaboom -#endif -return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_jpeg_version_ok='yes' -else - ac_cv_jpeg_version_ok='no' -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_jpeg_version_ok" >&5 -$as_echo "$ac_cv_jpeg_version_ok" >&6; } -if test "$ac_cv_jpeg_version_ok" = 'yes' ; then - passed=`expr $passed + 1` -else - failed=`expr $failed + 1` -fi -fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if JPEG package is complete" >&5 $as_echo_n "checking if JPEG package is complete... " >&6; } if test $passed -gt 0 @@ -26389,7 +26052,7 @@ fi # -# Check for JPEG Version 2 +# Check for JPEG Version 2 (Jasper) # have_jp2='no' LIB_JP2='' @@ -26492,32 +26155,32 @@ fi # LIB_MPEG2='' # if test "$with_mpeg2" != 'no' # then -# AC_MSG_CHECKING(for MPEG version 2 support ) +# AC_MSG_CHECKING([for MPEG version 2 support ]) # AC_MSG_RESULT() # failed=0 # passed=0 -# AC_CHECK_HEADER(mpeg2dec/mpeg2.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) -# AC_CHECK_LIB(mpeg2,mpeg2_decode_data,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) -# AC_MSG_CHECKING(if MPEG version 2 support package is complete) +# AC_CHECK_HEADER([mpeg2dec/mpeg2.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) +# AC_CHECK_LIB([mpeg2],[mpeg2_decode_data],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) +# AC_MSG_CHECKING([if MPEG version 2 support package is complete]) # if test $passed -gt 0 # then # if test $failed -gt 0 # then -# AC_MSG_RESULT(no -- some components failed test) +# AC_MSG_RESULT([no -- some components failed test]) # have_mpeg2='no (failed tests)' # else # LIB_MPEG2='-lmpeg2' # LIBS="$LIB_MPEG2 $LIBS" -# AC_DEFINE(HasMPEG2,1,Define if you have MPEG2 library) -# AC_MSG_RESULT(yes) +# AC_DEFINE([HasMPEG2],[1],[Define if you have MPEG2 library]) +# AC_MSG_RESULT([yes]) # have_mpeg2='yes' # fi # else -# AC_MSG_RESULT(no) +# AC_MSG_RESULT([no]) # fi # fi -# AM_CONDITIONAL(HasMPEG2, test "$have_mpeg2" = 'yes') -# AC_SUBST(LIB_MPEG2) +# AM_CONDITIONAL([HasMPEG2],[test "$have_mpeg2" = 'yes']) +# AC_SUBST([LIB_MPEG2]) # # Check for TTF @@ -28042,6 +27705,118 @@ fi + +# +# Check for Windows gdi32 library +# +have_gdi32='no' +if test "$with_gdi32" != 'no' +then + LIB_GDI32='' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows GDI32 support" >&5 +$as_echo_n "checking for Windows GDI32 support... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } + failed=0 + passed=0 + found_libgdi32=0 + ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = xyes; then : + passed=`expr $passed + 1` +else + failed=`expr $failed + 1` +fi + + + ac_fn_c_check_header_compile "$LINENO" "wingdi.h" "ac_cv_header_wingdi_h" "#include +" +if test "x$ac_cv_header_wingdi_h" = xyes; then : + passed=`expr $passed + 1` +else + failed=`expr $failed + 1` +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenClipboard in -lgdi32" >&5 +$as_echo_n "checking for OpenClipboard in -lgdi32... " >&6; } +if ${ac_cv_lib_gdi32_OpenClipboard+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgdi32 $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. */ +#ifdef __cplusplus +extern "C" +#endif +char OpenClipboard (); +int +main () +{ +return OpenClipboard (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gdi32_OpenClipboard=yes +else + ac_cv_lib_gdi32_OpenClipboard=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gdi32_OpenClipboard" >&5 +$as_echo "$ac_cv_lib_gdi32_OpenClipboard" >&6; } +if test "x$ac_cv_lib_gdi32_OpenClipboard" = xyes; then : + found_libgdi32=`expr $found_libgdi32 + 1` +fi + + if test $found_libgdi32 -gt 0 + then + passed=`expr $passed + 1` + else + failed=`expr $failed + 1` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Windows GDI32 support is complete" >&5 +$as_echo_n "checking if Windows GDI32 support is complete... " >&6; } + if test $passed -gt 0 + then + if test $failed -gt 0 + then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no -- some components failed test" >&5 +$as_echo "no -- some components failed test" >&6; } + have_gdi32='no (failed tests)' + else + LIB_GDI32='-lgdi32' + LIBS="$LIB_GDI32 $LIBS" + +$as_echo "#define HasWINGDI32 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_gdi32='yes' + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi +fi + if test "$have_gdi32" = 'yes'; then + HasWINGDI32_TRUE= + HasWINGDI32_FALSE='#' +else + HasWINGDI32_TRUE='#' + HasWINGDI32_FALSE= +fi + + + ######## # # Check for functions @@ -28455,10 +28230,14 @@ LaunchDelegateDefault='gimp' MPEGDecodeDelegateDefault='mpeg2decode' MPEGEncodeDelegateDefault='mpeg2encode' MVDelegateDefault='mv' -if test "$native_win32_build" = 'yes' ; then - PSDelegateDefault='gswin32c' +if test "$with_gs" = 'yes' ; then + if test "$native_win32_build" = 'yes' ; then + PSDelegateDefault='gswin32c' + else + PSDelegateDefault='gs' + fi else - PSDelegateDefault='gs' + PSDelegateDefault='false' fi # Search for delegates @@ -29205,7 +28984,8 @@ $as_echo "no" >&6; } fi -# Extract the first word of ""$PSDelegateDefault"", so it can be a program name with args. +if test "$with_gs" = 'yes' ; then + # Extract the first word of ""$PSDelegateDefault"", so it can be a program name with args. set dummy "$PSDelegateDefault"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } @@ -29246,6 +29026,9 @@ $as_echo "no" >&6; } fi +else + PSDelegate=$PSDelegateDefault +fi # Prefer lpr to lp; lp needs options tacked on. if test "$LPRDelegate" != no @@ -29489,9 +29272,11 @@ else break 1 fi done - if test "${PSDelegate}" != 'gswin32c' - then - ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\" + if test "$with_gs" = 'yes' ; then + if test "${PSDelegate}" != "${PSDelegateDefault}" + then + ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\" + fi fi else @@ -29513,9 +29298,11 @@ else if test "${ghostscript_font_dir}x" = 'x' then - if test "$PSDelegate" != 'gs' - then - ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/" + if test "$with_gs" = 'yes' ; then + if test "$PSDelegate" != "${PSDelegateDefault}" + then + ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/" + fi fi fi @@ -29633,7 +29420,7 @@ fi done - if test "x$RPM" != "x" ; then + if test "x$RPM" != "x"; then HAS_RPM_TRUE= HAS_RPM_FALSE='#' else @@ -29689,7 +29476,7 @@ fi done - if test "x$P7ZIP" != "x" ; then + if test "x$P7ZIP" != "x"; then HAS_P7ZIP_TRUE= HAS_P7ZIP_FALSE='#' else @@ -29745,7 +29532,7 @@ fi done - if test "x$ZIP" != "x" ; then + if test "x$ZIP" != "x"; then HAS_ZIP_TRUE= HAS_ZIP_FALSE='#' else @@ -30189,8 +29976,7 @@ fi have_ps='no' if test "$have_dps" = 'yes' || \ - test "$have_gs" = 'yes' || \ - test "${native_win32_build}" = 'yes' ; then + test "$have_gs" = 'yes' ; then have_ps='yes' fi if test "$have_ps" = 'yes' ; then @@ -30359,13 +30145,12 @@ _ACEOF # Pass only user-provided LIBS as "global" libraries LIBS=$LIBS_USER -#AC_SUBST(CPPFLAGS) - -#AC_SUBST(LDFLAGS) -#AC_SUBST(X_PRE_LIBS) -#AC_SUBST(X_LIBS) -#AC_SUBST(X_EXTRA_LIBS) +#AC_SUBST([CPPFLAGS]) +#AC_SUBST([LDFLAGS]) +#AC_SUBST([X_PRE_LIBS]) +#AC_SUBST([X_LIBS]) +#AC_SUBST([X_EXTRA_LIBS]) @@ -30527,10 +30312,6 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HasWINGDI32_TRUE}" && test -z "${HasWINGDI32_FALSE}"; then - as_fn_error $? "conditional \"HasWINGDI32\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${WIN32_NATIVE_BUILD_TRUE}" && test -z "${WIN32_NATIVE_BUILD_FALSE}"; then as_fn_error $? "conditional \"WIN32_NATIVE_BUILD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -30563,6 +30344,10 @@ if test -z "${MAGICK_COMPAT_TRUE}" && test -z "${MAGICK_COMPAT_FALSE}"; then as_fn_error $? "conditional \"MAGICK_COMPAT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HasGS_TRUE}" && test -z "${HasGS_FALSE}"; then + as_fn_error $? "conditional \"HasGS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. @@ -30656,6 +30441,10 @@ if test -z "${HasWMF_TRUE}" && test -z "${HasWMF_FALSE}"; then as_fn_error $? "conditional \"HasWMF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HasWINGDI32_TRUE}" && test -z "${HasWINGDI32_FALSE}"; then + as_fn_error $? "conditional \"HasWINGDI32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HasPSDelegate_TRUE}" && test -z "${HasPSDelegate_FALSE}"; then as_fn_error $? "conditional \"HasPSDelegate\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -32375,7 +32164,9 @@ $as_echo X/"$am_mf" | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + 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; } @@ -33167,13 +32958,14 @@ printf "BZLIB --with-bzlib=$with_bzlib \t$have_bzlib\n" printf "DPS --with-dps=$with_dps \t$have_dps\n" printf "FlashPIX --with-fpx=$with_fpx \t$have_fpx\n" printf "FreeType 2.0 --with-ttf=$with_ttf \t$have_ttf\n" -printf "Ghostscript None \t$PSDelegate ($GSVersion)\n" +printf "Ghostscript --with-gs=$with_gs \t$PSDelegate ($GSVersion)\n" result_ghostscript_font_dir='none' if test "${ghostscript_font_dir}x" != 'x' then result_ghostscript_font_dir="$ghostscript_font_dir" fi printf "Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir\t$result_ghostscript_font_dir\n" +printf "Windows GDI32 --with-gdi32=$with_gdi32 \t$have_gdi32\n" printf "JBIG --with-jbig=$with_jbig \t$have_jbig\n" printf "JPEG v1 --with-jpeg=$with_jpeg \t$have_jpeg\n" printf "JPEG-2000 --with-jp2=$with_jp2 \t$have_jp2\n" diff --git a/configure.ac b/configure.ac old mode 100755 new mode 100644 index 8b512ec..d6a30f6 --- a/configure.ac +++ b/configure.ac @@ -11,8 +11,9 @@ # Written by Bob Friesenhahn # -AC_PREREQ(2.69) -AC_INIT(magick/magick.h) +AC_PREREQ([2.69]) +AC_INIT +AC_CONFIG_SRCDIR([magick/magick.h]) # Specify directory where m4 macros may be found. AC_CONFIG_MACRO_DIR([m4]) @@ -44,47 +45,47 @@ dnl Compute the canonical host (run-time) system type variable AC_CANONICAL_HOST MAGICK_TARGET_CPU=$host_cpu -AC_SUBST(MAGICK_TARGET_CPU) -AC_DEFINE_UNQUOTED(MAGICK_TARGET_CPU,$MAGICK_TARGET_CPU,[Target Host CPU]) +AC_SUBST([MAGICK_TARGET_CPU]) +AC_DEFINE_UNQUOTED([MAGICK_TARGET_CPU],[$MAGICK_TARGET_CPU],[Target Host CPU]) MAGICK_TARGET_VENDOR=$host_vendor -AC_SUBST(MAGICK_TARGET_VENDOR) -AC_DEFINE_UNQUOTED(MAGICK_TARGET_VENDOR,$MAGICK_TARGET_VENDOR,[Target Host Vendor]) +AC_SUBST([MAGICK_TARGET_VENDOR]) +AC_DEFINE_UNQUOTED([MAGICK_TARGET_VENDOR],[$MAGICK_TARGET_VENDOR],[Target Host Vendor]) MAGICK_TARGET_OS=$host_os -AC_SUBST(MAGICK_TARGET_OS) -AC_DEFINE_UNQUOTED(MAGICK_TARGET_OS,$MAGICK_TARGET_OS,[Target Host OS]) +AC_SUBST([MAGICK_TARGET_OS]) +AC_DEFINE_UNQUOTED([MAGICK_TARGET_OS],[$MAGICK_TARGET_OS],[Target Host OS]) # Compute newest and oldest interface numbers. MAGICK_LIB_INTERFACE_NEWEST=$MAGICK_LIBRARY_CURRENT MAGICK_LIB_INTERFACE_OLDEST=`expr ${MAGICK_LIBRARY_CURRENT} - ${MAGICK_LIBRARY_AGE}` # Substitute Magick library versioning -AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl -AC_SUBST(MAGICK_LIBRARY_REVISION)dnl -AC_SUBST(MAGICK_LIBRARY_AGE)dnl +AC_SUBST([MAGICK_LIBRARY_CURRENT])dnl +AC_SUBST([MAGICK_LIBRARY_REVISION])dnl +AC_SUBST([MAGICK_LIBRARY_AGE])dnl -AC_SUBST(MAGICK_LIB_INTERFACE_NEWEST) -AC_SUBST(MAGICK_LIB_INTERFACE_OLDEST) +AC_SUBST([MAGICK_LIB_INTERFACE_NEWEST]) +AC_SUBST([MAGICK_LIB_INTERFACE_OLDEST]) # Substitute Magick++ library versioning -AC_SUBST(MAGICK_PLUS_PLUS_LIBRARY_CURRENT) -AC_SUBST(MAGICK_PLUS_PLUS_LIBRARY_REVISION) -AC_SUBST(MAGICK_PLUS_PLUS_LIBRARY_AGE) +AC_SUBST([MAGICK_PLUS_PLUS_LIBRARY_CURRENT]) +AC_SUBST([MAGICK_PLUS_PLUS_LIBRARY_REVISION]) +AC_SUBST([MAGICK_PLUS_PLUS_LIBRARY_AGE]) # Substitute Magick Wand library versioning -AC_SUBST(MAGICK_WAND_LIBRARY_CURRENT) -AC_SUBST(MAGICK_WAND_LIBRARY_REVISION) -AC_SUBST(MAGICK_WAND_LIBRARY_AGE) +AC_SUBST([MAGICK_WAND_LIBRARY_CURRENT]) +AC_SUBST([MAGICK_WAND_LIBRARY_REVISION]) +AC_SUBST([MAGICK_WAND_LIBRARY_AGE]) -AC_SUBST(PACKAGE_NAME)dnl -AC_SUBST(PACKAGE_VERSION)dnl -AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl -AC_SUBST(PACKAGE_CHANGE_DATE)dnl -AC_SUBST(PACKAGE_RELEASE_DATE)dnl +AC_SUBST([PACKAGE_NAME])dnl +AC_SUBST([PACKAGE_VERSION])dnl +AC_SUBST([PACKAGE_VERSION_ADDENDUM])dnl +AC_SUBST([PACKAGE_CHANGE_DATE])dnl +AC_SUBST([PACKAGE_RELEASE_DATE])dnl # Substitute Mercurial branch tag -AC_SUBST(HG_BRANCH_TAG)dnl +AC_SUBST([HG_BRANCH_TAG])dnl # Definition used to define MagickLibVersion in version.h MAGICK_LIB_VERSION="0x" @@ -100,15 +101,15 @@ if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0 fi MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION} -AC_SUBST(MAGICK_LIB_VERSION) +AC_SUBST([MAGICK_LIB_VERSION]) # Definition used to define MagickLibVersionText in version.h MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}" -AC_SUBST(MAGICK_LIB_VERSION_TEXT) +AC_SUBST([MAGICK_LIB_VERSION_TEXT]) # Definition used to define MagickLibVersionNumber in version.h MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}" -AC_SUBST(MAGICK_LIB_VERSION_NUMBER) +AC_SUBST([MAGICK_LIB_VERSION_NUMBER]) # Ensure that make can run correctly AM_SANITY_CHECK @@ -116,7 +117,7 @@ AM_SANITY_CHECK # Generate configure header. AC_CONFIG_HEADERS([magick/magick_config.h magick/magick_config_api.h]) -AM_INIT_AUTOMAKE($PACKAGE_NAME,"${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}", ' ') +AM_INIT_AUTOMAKE([$PACKAGE_NAME],["${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"],[' ']) # Enable support for silent build rules AM_SILENT_RULES @@ -158,37 +159,37 @@ fi # eval "eval PREFIX_DIR=${prefix}" -AC_SUBST(PREFIX_DIR) +AC_SUBST([PREFIX_DIR]) eval "eval EXEC_PREFIX_DIR=${exec_prefix}" -AC_SUBST(EXEC_PREFIX_DIR) +AC_SUBST([EXEC_PREFIX_DIR]) eval "eval BIN_DIR=$bindir" -AC_SUBST(BIN_DIR) +AC_SUBST([BIN_DIR]) eval "eval SBIN_DIR=$sbindir" -AC_SUBST(SBIN_DIR) +AC_SUBST([SBIN_DIR]) eval "eval LIBEXEC_DIR=$libexecdir" -AC_SUBST(LIBEXEC_DIR) +AC_SUBST([LIBEXEC_DIR]) eval "eval DATA_DIR=$datadir" -AC_SUBST(DATA_DIR) +AC_SUBST([DATA_DIR]) eval "eval DOC_DIR=$docdir" -AC_SUBST(DOC_DIR) +AC_SUBST([DOC_DIR]) eval "eval HTML_DIR=$htmldir" -AC_SUBST(HTML_DIR) +AC_SUBST([HTML_DIR]) eval "eval SYSCONF_DIR=$sysconfdir" -AC_SUBST(SYSCONF_DIR) +AC_SUBST([SYSCONF_DIR]) eval "eval SHAREDSTATE_DIR=$sharedstatedir" -AC_SUBST(SHAREDSTATE_DIR) +AC_SUBST([SHAREDSTATE_DIR]) eval "eval LOCALSTATE_DIR=$localstatedir" -AC_SUBST(LOCALSTATE_DIR) +AC_SUBST([LOCALSTATE_DIR]) eval "eval LIB_DIR=$libdir" -AC_SUBST(LIB_DIR) +AC_SUBST([LIB_DIR]) eval "eval INCLUDE_DIR=$includedir" -AC_SUBST(INCLUDE_DIR) +AC_SUBST([INCLUDE_DIR]) eval "eval OLDINCLUDE_DIR=$oldincludedir" -AC_SUBST(OLDINCLUDE_DIR) +AC_SUBST([OLDINCLUDE_DIR]) eval "eval INFO_DIR=$infodir" -AC_SUBST(INFO_DIR) +AC_SUBST([INFO_DIR]) eval "eval MAN_DIR=$mandir" -AC_SUBST(MAN_DIR) +AC_SUBST([MAN_DIR]) # Get full paths to source and build directories srcdirfull="`cd $srcdir && pwd`" @@ -218,18 +219,17 @@ case "${host_os}" in DIRSEP=';' ;; esac -AC_SUBST(MAGICK_CODER_MODULE_PATH) -AC_SUBST(MAGICK_CONFIGURE_SRC_PATH) -AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH) -AC_SUBST(MAGICK_FILTER_MODULE_PATH) -AC_SUBST(DIRSEP) +AC_SUBST([MAGICK_CODER_MODULE_PATH]) +AC_SUBST([MAGICK_CONFIGURE_SRC_PATH]) +AC_SUBST([MAGICK_CONFIGURE_BUILD_PATH]) +AC_SUBST([MAGICK_FILTER_MODULE_PATH]) +AC_SUBST([DIRSEP]) # Check for programs AC_PROG_CC -AC_PROG_CC_STDC AC_PROG_CPP -AM_PROG_LD -AC_SUBST(LD) +LT_PATH_LD +AC_SUBST([LD]) AM_PROG_CC_C_O # Necessary if objects are placed in subdirectories. AC_PROG_INSTALL AC_PROG_MAKE_SET @@ -242,30 +242,21 @@ AC_PROG_AWK AC_EXEEXT AC_OBJEXT -LIB_GDI32='' native_win32_build='no' cygwin_build='no' case "${host_os}" in cygwin* ) cygwin_build='yes' - LIB_GDI32='-lgdi32' ;; mingw* ) native_win32_build='yes' - LIB_GDI32='-lgdi32' ;; esac -if test "${LIB_GDI32}x" != 'x' -then - AC_DEFINE(HasWINGDI32,1,Define to use the Windows GDI32 library) -fi -AC_SUBST(LIB_GDI32) -AM_CONDITIONAL(HasWINGDI32, test "${LIB_GDI32}x" != 'x' ) -AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' ) -AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' ) +AM_CONDITIONAL([WIN32_NATIVE_BUILD],[test "${native_win32_build}" = 'yes']) +AM_CONDITIONAL([CYGWIN_BUILD],[test "${cygwin_build}" = 'yes']) WinPathScript="${srcdirfull}/winpath.sh" -AC_SUBST(WinPathScript) +AC_SUBST([WinPathScript]) # # Compiler flags tweaks @@ -304,7 +295,7 @@ fi # Determine POSIX threads settings # # Enable support for POSIX thread APIs -AC_ARG_WITH(threads, +AC_ARG_WITH([threads], AS_HELP_STRING([--without-threads], [disable POSIX threads API support]), [with_threads=$withval], @@ -346,10 +337,10 @@ AC_OPENMP([C]) CFLAGS="$OPENMP_CFLAGS $CFLAGS" #CXXFLAGS="$OPENMP_CXXFLAGS $CXXFLAGS" #LDFLAGS="$LDFLAGS $OPENMP_CFLAGS" -AC_SUBST(OPENMP_CFLAGS) +AC_SUBST([OPENMP_CFLAGS]) # Allow the user to disable use of OpenMP where algorithms sometimes run slower. -AC_ARG_ENABLE(openmp-slow, +AC_ARG_ENABLE([openmp-slow], AS_HELP_STRING([--enable-openmp-slow], [enable OpenMP for algorithms which sometimes run slower]), @@ -357,7 +348,18 @@ AC_ARG_ENABLE(openmp-slow, [with_openmp_slow='no']) if test "$with_openmp_slow" = 'no' then - AC_DEFINE(DisableSlowOpenMP,1,[Disable OpenMP for algorithms which sometimes run slower]) + AC_DEFINE([DisableSlowOpenMP],[1],[Disable OpenMP for algorithms which sometimes run slower]) +fi + +# Disable reading/writing gzip/bzip compressed files +AC_ARG_ENABLE([compressed-files], + AS_HELP_STRING([--disable-compressed-files], + [disable reading and writing of gzip/bzip files]), + [with_compressed_files=$enableval], + [with_compressed_files='yes']) +if test "$with_compressed_files" != 'yes'; then + AC_DEFINE([DISABLE_COMPRESSED_FILES],[1],[Disable reading and writing of gzip/bzip files]) + DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-compressed-files=$with_compressed_files " fi ######## @@ -393,7 +395,7 @@ then LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1" fi fi -AC_SUBST(LFS_CPPFLAGS) +AC_SUBST([LFS_CPPFLAGS]) # # Decide if setjmp/longjmp is thread safe based on host OS @@ -404,7 +406,7 @@ case "${host_os}" in ;; *) - AC_DEFINE(SETJMP_IS_THREAD_SAFE,1,[Setjmp/longjmp are thread safe]) + AC_DEFINE([SETJMP_IS_THREAD_SAFE],[1],[Setjmp/longjmp are thread safe]) ;; esac @@ -413,8 +415,7 @@ esac # # Configure libtool -AC_LIBTOOL_DLOPEN -LT_INIT([disable-shared win32-dll]) +LT_INIT([disable-shared win32-dll dlopen]) LT_LANG([C++]) AC_SUBST(LIBTOOL_DEPS) @@ -432,13 +433,13 @@ then libtool_build_static_libs='yes' fi -AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes') +AM_CONDITIONAL([WITH_SHARED_LIBS],[test "${libtool_build_shared_libs}" = 'yes']) # # Enable support for building loadable modules # build_modules='no' -AC_ARG_WITH(modules, +AC_ARG_WITH([modules], AS_HELP_STRING([--with-modules], [enable building dynamically loadable modules]), @@ -455,37 +456,37 @@ if test "$with_modules" != 'no' ; then fi fi if test "$build_modules" != 'no' ; then - AC_DEFINE(BuildMagickModules,1,Define if coders and filters are to be built as modules.) + AC_DEFINE([BuildMagickModules],[1],[Define if coders and filters are to be built as modules.]) fi -AM_CONDITIONAL(WITH_MODULES, test "$build_modules" != 'no') +AM_CONDITIONAL([WITH_MODULES],[test "$build_modules" != 'no']) # Build a version of GraphicsMagick which operates uninstalled. # Used to build distributions located via MAGICK_HOME / executable path -AC_ARG_ENABLE(installed, +AC_ARG_ENABLE([installed], AS_HELP_STRING([--disable-installed], [disable building an installed GraphicsMagick]), [with_installed=$enableval], [with_installed='yes']) if test "$with_installed" = 'yes' then - AC_DEFINE(UseInstalledMagick,1,[GraphicsMagick is formally installed under prefix]) + AC_DEFINE([UseInstalledMagick],[1],[GraphicsMagick is formally installed under prefix]) else DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed " fi # Enable broken/dangerous coders # EnableBrokenCoders CPP define and ENABLE_BROKEN_CODERS Automake conditional) -AC_ARG_ENABLE(broken-coders, +AC_ARG_ENABLE([broken-coders], AS_HELP_STRING([--enable-broken-coders], [enable broken/dangerous file formats support]), [with_broken_coders=$enableval], [with_broken_coders='no']) if test "$with_broken_coders" = 'yes' then - AC_DEFINE(EnableBrokenCoders,1,[Enable broken/dangerous file formats support]) + AC_DEFINE([EnableBrokenCoders],[1],[Enable broken/dangerous file formats support]) fi -AM_CONDITIONAL(ENABLE_BROKEN_CODERS, test "$with_broken_coders" != 'no') +AM_CONDITIONAL([ENABLE_BROKEN_CODERS],[test "$with_broken_coders" != 'no']) # Add configure option --enable-maintainer-mode which enables dependency # checking and generation useful to package maintainers. This is made an @@ -493,21 +494,21 @@ AM_CONDITIONAL(ENABLE_BROKEN_CODERS, test "$with_broken_coders" != 'no') AM_MAINTAINER_MODE # Enable prof-based profiling support -AC_ARG_ENABLE(prof, +AC_ARG_ENABLE([prof], AS_HELP_STRING([--enable-prof], [enable 'prof' profiling support]), [with_prof=$enableval], [with_prof='no']) # Enable gprof-based profiling support -AC_ARG_ENABLE(gprof, +AC_ARG_ENABLE([gprof], AS_HELP_STRING([--enable-gprof], [enable 'gprof' profiling support]), [with_gprof=$enableval], [with_gprof='no']) # Enable gcov-based profiling support -AC_ARG_ENABLE(gcov, +AC_ARG_ENABLE([gcov], AS_HELP_STRING([--enable-gcov], [enable 'gcov' profiling support]), [with_gcov=$enableval], @@ -525,27 +526,27 @@ then fi # Enable prefixing library symbols with a common string -AC_ARG_ENABLE(symbol-prefix, +AC_ARG_ENABLE([symbol-prefix], AS_HELP_STRING([--enable-symbol-prefix], [enable prefixing library symbols with "Gm"]), [with_symbol_prefix=$enableval], [with_symbol_prefix='no']) if test "$with_symbol_prefix" != 'no' then - AC_DEFINE(PREFIX_MAGICK_SYMBOLS,1,[Prefix Magick library symbols with a common string.]) + AC_DEFINE([PREFIX_MAGICK_SYMBOLS],[1],[Prefix Magick library symbols with a common string.]) DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --enable-symbol-prefix " fi # Enable ImageMagick utilities compatibility shortcuts (default no) -AC_ARG_ENABLE(magick-compat, +AC_ARG_ENABLE([magick-compat], AS_HELP_STRING([--enable-magick-compat], [install ImageMagick utility shortcuts]), [with_magick_compat=$enableval], [with_magick_compat='no']) -AM_CONDITIONAL(MAGICK_COMPAT, test "$with_magick_compat" != 'no') +AM_CONDITIONAL([MAGICK_COMPAT],[test "$with_magick_compat" != 'no']) # Number of bits in a Quantum -AC_ARG_WITH(quantum-depth, +AC_ARG_WITH([quantum-depth], AS_HELP_STRING([--with-quantum-depth], [number of bits in a pixel quantum (default 8)]), [with_quantum_depth=$withval], @@ -558,14 +559,14 @@ case "${with_quantum_depth}" in 8 ) ;; 16 ) ;; 32 ) ;; - * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, or 32") ;; + * ) AC_MSG_ERROR([Pixel quantum depth must have value of 8, 16, or 32]) ;; esac QuantumDepth="$with_quantum_depth" -AC_DEFINE_UNQUOTED(QuantumDepth,$QuantumDepth,[Number of bits in a pixel Quantum (8/16/32)]) -AC_SUBST(QuantumDepth)dnl +AC_DEFINE_UNQUOTED([QuantumDepth],[$QuantumDepth],[Number of bits in a pixel Quantum (8/16/32)]) +AC_SUBST([QuantumDepth])dnl # Enable QuantumDepth in shared library names -AC_ARG_ENABLE(quantum-library-names, +AC_ARG_ENABLE([quantum-library-names], AS_HELP_STRING([--enable-quantum-library-names], [shared library name includes quantum depth to allow shared libraries with @@ -579,40 +580,40 @@ if test "$with_quantum_library_names" != 'no' then MAGICK_LT_RELEASE_OPTS="-release Q${QuantumDepth}" fi -AC_SUBST(MAGICK_LT_RELEASE_OPTS) +AC_SUBST([MAGICK_LT_RELEASE_OPTS]) # Disable/Enable support for full delegate paths in delegates.mgk -AC_ARG_WITH(frozenpaths, +AC_ARG_WITH([frozenpaths], AS_HELP_STRING([--with-frozenpaths], [enable frozen delegate paths]), [with_frozenpaths=$withval], [with_frozenpaths='no']) # Enable build/install of Magick++ -AC_ARG_WITH(magick-plus-plus, +AC_ARG_WITH([magick-plus-plus], AS_HELP_STRING([--without-magick-plus-plus], [disable build/install of Magick++]), [with_magick_plus_plus=$withval], [with_magick_plus_plus='yes']) # Enable build/install of PerlMagick. -AC_ARG_WITH(perl, +AC_ARG_WITH([perl], AS_HELP_STRING([--with-perl@<:@=PERL@:>@], [enable build/install of PerlMagick and optionally specify perl to use]), [with_perl=$withval], [with_perl='no']) # Options to pass when configuring PerlMagick -AC_ARG_WITH(perl-options, +AC_ARG_WITH([perl-options], AS_HELP_STRING([--with-perl-options=OPTIONS], [options to pass on command-line when generating PerlMagick's Makefile from Makefile.PL]), [PERL_MAKE_OPTIONS=$withval]) -AC_SUBST(PERL_MAKE_OPTIONS) +AC_SUBST([PERL_MAKE_OPTIONS]) # Disable BZLIB (bzip2 library) -AC_ARG_WITH(bzlib, +AC_ARG_WITH([bzlib], AS_HELP_STRING([--without-bzlib], [disable BZLIB support]), [with_bzlib=$withval], @@ -622,7 +623,7 @@ if test "$with_bzlib" != 'yes' ; then fi # Disable Display Postscript. -AC_ARG_WITH(dps, +AC_ARG_WITH([dps], AS_HELP_STRING([--without-dps], [disable Display Postscript support]), [with_dps=$withval], @@ -632,7 +633,7 @@ if test "$with_dps" != 'yes' ; then fi # Enable FlashPIX. -AC_ARG_WITH(fpx, +AC_ARG_WITH([fpx], AS_HELP_STRING([--with-fpx], [enable FlashPIX support]), [with_fpx=$withval], @@ -641,8 +642,32 @@ if test "$with_fpx" != 'yes' ; then DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx " fi +# Enable Windows lgdi32 library +AC_ARG_WITH([gdi32], + AS_HELP_STRING([--without-gdi32], + [disable Windows gdi32 support]), + [with_gdi32=$withval], + [with_gdi32='yes']) +if test "$with_gdi32" != 'yes' ; then + DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gdi32=$with_gdi32 " +fi + +# Disable Ghostscript support. +AC_ARG_WITH([gs], + AS_HELP_STRING([--without-gs], + [disable Ghostscript support]), + [with_gs=$withval], + [with_gs='yes']) +if test "$with_gs" != 'yes' ; then + DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs=$with_gs " +fi +if test "$with_gs" = 'yes' ; then + AC_DEFINE([HasGS],[1],[Enable use of Ghostscript]) +fi +AM_CONDITIONAL([HasGS],[test "$with_gs" = 'yes']) + # Disable JBIG. -AC_ARG_WITH(jbig, +AC_ARG_WITH([jbig], AS_HELP_STRING([--without-jbig], [disable JBIG support]), [with_jbig=$withval], @@ -652,7 +677,7 @@ if test "$with_jbig" != 'yes' ; then fi # Disable WEBP. -AC_ARG_WITH(webp, +AC_ARG_WITH([webp], AS_HELP_STRING([--without-webp], [disable WEBP support]), [with_webp=$withval], @@ -662,7 +687,7 @@ if test "$with_webp" != 'yes' ; then fi # Disable JPEG. -AC_ARG_WITH(jpeg, +AC_ARG_WITH([jpeg], AS_HELP_STRING([--without-jpeg], [disable JPEG support]), [with_jpeg=$withval], @@ -672,7 +697,7 @@ if test "$with_jpeg" != 'yes' ; then fi # Disable JPEG Version 2. -AC_ARG_WITH(jp2, +AC_ARG_WITH([jp2], AS_HELP_STRING([--without-jp2], [disable JPEG v2 support]), [with_jp2=$withval], @@ -682,7 +707,7 @@ if test "$with_jp2" != 'yes' ; then fi # Disable LCMS2. -AC_ARG_WITH(lcms2, +AC_ARG_WITH([lcms2], AS_HELP_STRING([--without-lcms2], [disable lcms (v2.X) support]), [with_lcms2=$withval], @@ -692,7 +717,7 @@ if test "$with_lcms2" != 'yes' ; then fi # Disable LZMA (lzma library) -AC_ARG_WITH(lzma, +AC_ARG_WITH([lzma], AS_HELP_STRING([--without-lzma], [disable LZMA support]), [with_lzma=$withval], @@ -702,14 +727,14 @@ if test "$with_lzma" != 'yes' ; then fi # # Disable MPEG. -# AC_ARG_WITH(mpeg2, +# AC_ARG_WITH([mpeg2], # AS_HELP_STRING([--without-mpeg2], # [disable MPEG support]), # [with_mpeg2=$withval], # [with_mpeg2='yes']) # Disable PNG. -AC_ARG_WITH(png, +AC_ARG_WITH([png], AS_HELP_STRING([--without-png], [disable PNG support]), [with_png=$withval], @@ -719,7 +744,7 @@ if test "$with_png" != 'yes' ; then fi # Disable TIFF. -AC_ARG_WITH(tiff, +AC_ARG_WITH([tiff], AS_HELP_STRING([--without-tiff], [disable TIFF support]), [with_tiff=$withval], @@ -729,7 +754,7 @@ if test "$with_tiff" != 'yes' ; then fi # Disable TRIO. -AC_ARG_WITH(trio, +AC_ARG_WITH([trio], AS_HELP_STRING([--without-trio], [disable TRIO support]), [with_trio=$withval], @@ -739,7 +764,7 @@ if test "$with_trio" != 'yes' ; then fi # Disable TTF. -AC_ARG_WITH(ttf, +AC_ARG_WITH([ttf], AS_HELP_STRING([--without-ttf], [disable TrueType support]), [with_ttf=$withval], @@ -749,7 +774,7 @@ if test "$with_ttf" != 'yes' ; then fi # Enable use of Google tcmalloc library. -AC_ARG_WITH(tcmalloc, +AC_ARG_WITH([tcmalloc], AS_HELP_STRING([--with-tcmalloc], [enable Google perftools tcmalloc (minimal) memory allocation library support]), [with_tcmalloc=$withval], @@ -759,7 +784,7 @@ if test "$with_tcmalloc" != 'no' ; then fi # Enable use of Solaris mtmalloc library. -AC_ARG_WITH(mtmalloc, +AC_ARG_WITH([mtmalloc], AS_HELP_STRING([--with-mtmalloc], [enable Solaris mtmalloc memory allocation library support]), [with_mtmalloc=$withval], @@ -771,7 +796,7 @@ fi # Enable use of Solaris libumem (object-caching memory allocation library). # Available as a SourceForge project http://sourceforge.net/projects/umem/ or # https://labs.omniti.com/trac/portableumem/. -AC_ARG_WITH(umem, +AC_ARG_WITH([umem], AS_HELP_STRING([--with-umem], [enable Solaris umem memory allocation library support]), [with_umem=$withval], @@ -781,7 +806,7 @@ if test "$with_umem" != 'no' ; then fi # Disable WMF. -AC_ARG_WITH(wmf, +AC_ARG_WITH([wmf], AS_HELP_STRING([--without-wmf], [disable WMF support]), [with_wmf=$withval], @@ -791,7 +816,7 @@ if test "$with_wmf" != 'yes' ; then fi # Set default font search path -AC_ARG_WITH(fontpath, +AC_ARG_WITH([fontpath], AS_HELP_STRING([--with-fontpath=DIR], [prepend to default font search path]), [with_fontpath=$withval], @@ -800,14 +825,14 @@ if test "$with_fontpath" != "yes" && test -z "$with_fontpath" then with_fontpath='' else - AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",Define to prepend to default font search path.) + AC_DEFINE_UNQUOTED([MAGICK_FONT_PATH],["$with_fontpath"],[Define to prepend to default font search path.]) fi if test "$with_fontpath=" != '' ; then DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath " fi # Set Ghostscript font directory -AC_ARG_WITH(gs-font-dir, +AC_ARG_WITH([gs-font-dir], AS_HELP_STRING([--with-gs-font-dir=DIR], [directory containing Ghostscript fonts]), [with_gs_font_dir=$withval], @@ -817,7 +842,7 @@ if test "$with_gs_font_dir" != 'default' ; then fi # Set Windows font directory -AC_ARG_WITH(windows-font-dir, +AC_ARG_WITH([windows-font-dir], AS_HELP_STRING([--with-windows-font-dir=DIR], [directory containing MS-Windows fonts]), [with_windows_font_dir=$withval], @@ -827,7 +852,7 @@ if test "$with_windows_font_dir" != '' ; then fi # Disable XML. -AC_ARG_WITH(xml, +AC_ARG_WITH([xml], AS_HELP_STRING([--without-xml], [disable XML support]), [with_xml=$withval], @@ -836,7 +861,7 @@ if test "$with_xml" != 'yes' ; then DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml " fi -AC_ARG_WITH(zlib, +AC_ARG_WITH([zlib], AS_HELP_STRING([--without-zlib], [disable ZLIB support]), [with_zlib=$withval], @@ -846,7 +871,7 @@ if test "$with_zlib" != 'yes' ; then fi # Disable Zstd (zstd library) -AC_ARG_WITH(zstd, +AC_ARG_WITH([zstd], AS_HELP_STRING([--without-zstd], [disable Zstd support]), [with_zstd=$withval], @@ -858,7 +883,7 @@ fi # # Specify path to shared libstdc++ if not in normal location # -AC_ARG_WITH(libstdc, +AC_ARG_WITH([libstdc], AS_HELP_STRING([--with-libstdc=DIR], [use libstdc++ in DIR (for GNU C++)]), [if test "$withval" != no && test "$withval" != yes; then @@ -866,7 +891,7 @@ AC_ARG_WITH(libstdc, LIBSTDCLDFLAGS="-L$withval" fi fi]) -AC_SUBST(LIBSTDCLDFLAGS) +AC_SUBST([LIBSTDCLDFLAGS]) # Does gcc required -traditional? AC_PROG_GCC_TRADITIONAL @@ -911,8 +936,8 @@ then MAGICK_API_PC_CPPFLAGS="$MAGICK_API_PC_CPPFLAGS -D_MT" fi fi -AC_SUBST(MODULE_EXTRA_CPPFLAGS) -AC_SUBST(LIBRARY_EXTRA_CPPFLAGS) +AC_SUBST([MODULE_EXTRA_CPPFLAGS]) +AC_SUBST([LIBRARY_EXTRA_CPPFLAGS]) # Check standard headers AC_HEADER_DIRENT @@ -978,62 +1003,53 @@ AC_TYPE_LONG_DOUBLE_WIDER AC_C_CHAR_UNSIGNED # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT -AC_CHECK_SIZEOF(signed short) +AC_CHECK_SIZEOF([signed short]) # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT -AC_CHECK_SIZEOF(unsigned short) +AC_CHECK_SIZEOF([unsigned short]) # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT -AC_CHECK_SIZEOF(signed int) +AC_CHECK_SIZEOF([signed int]) # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT -AC_CHECK_SIZEOF(unsigned int) +AC_CHECK_SIZEOF([unsigned int]) # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG -AC_CHECK_SIZEOF(signed long) +AC_CHECK_SIZEOF([signed long]) # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG -AC_CHECK_SIZEOF(unsigned long) +AC_CHECK_SIZEOF([unsigned long]) # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If # 'signed long long' is not supported then the value defined is zero. -AC_CHECK_SIZEOF(signed long long) +AC_CHECK_SIZEOF([signed long long]) # Obtain size of a 'unsigned long long' and define as # 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([unsigned long long]) # Obtain size of off_t and define as SIZEOF_OFF_T -AC_CHECK_SIZEOF(off_t) +AC_CHECK_SIZEOF([off_t]) # Obtain size of size_t and define as SIZEOF_SIZE_T -AC_CHECK_SIZEOF(size_t) +AC_CHECK_SIZEOF([size_t]) # Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP -AC_CHECK_SIZEOF(unsigned int*) - -# If `signal.h' declares signal as returning a pointer to a function -# returning void, define RETSIGTYPE to be void; otherwise, define it -# to be int. -AC_TYPE_SIGNAL +AC_CHECK_SIZEOF([unsigned int*]) # Test for C compiler __func__ support if test "$ac_cv_have_C__func__" != 'yes' ; then -AC_CACHE_CHECK(for C compiler __func__ support, ac_cv_have_C__func__, -[AC_TRY_COMPILE( -, -changequote(<<, >>)dnl -<< -const char *func=__func__; +AC_CACHE_CHECK([for C compiler __func__ support], ac_cv_have_C__func__, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], +[[const char *func=__func__; return (func != 0 ? 0 : 1); ->>, -changequote([, ])dnl -ac_cv_have_C__func__='yes', -ac_cv_have_C__func__='no')]) +]])], +[ac_cv_have_C__func__='yes'], +[ac_cv_have_C__func__='no'])]) if test "$ac_cv_have_C__func__" = 'yes' ; then - AC_DEFINE(HAS_C__func__,1,Define if C compiler supports __func__) + AC_DEFINE([HAS_C__func__],[1],[Define if C compiler supports __func__]) fi fi @@ -1045,27 +1061,27 @@ fi # with Windows builds which don't use configure. # -AC_MSG_CHECKING(for signed 8-bit type) +AC_MSG_CHECKING([for signed 8-bit type]) INT8_T='signed char' -AC_MSG_RESULT($INT8_T) -AC_SUBST(INT8_T) +AC_MSG_RESULT([$INT8_T]) +AC_SUBST([INT8_T]) -AC_MSG_CHECKING(for unsigned 8-bit type) +AC_MSG_CHECKING([for unsigned 8-bit type]) UINT8_T='unsigned char' -AC_MSG_RESULT($UINT8_T) -AC_SUBST(UINT8_T) +AC_MSG_RESULT([$UINT8_T]) +AC_SUBST([UINT8_T]) -AC_MSG_CHECKING(for signed 16-bit type) +AC_MSG_CHECKING([for signed 16-bit type]) INT16_T='signed short' -AC_MSG_RESULT($INT16_T) -AC_SUBST(INT16_T) +AC_MSG_RESULT([$INT16_T]) +AC_SUBST([INT16_T]) -AC_MSG_CHECKING(for unsigned 16-bit type) +AC_MSG_CHECKING([for unsigned 16-bit type]) UINT16_T='unsigned short' -AC_MSG_RESULT($UINT16_T) -AC_SUBST(UINT16_T) +AC_MSG_RESULT([$UINT16_T]) +AC_SUBST([UINT16_T]) -AC_MSG_CHECKING(for signed 32-bit type) +AC_MSG_CHECKING([for signed 32-bit type]) INT32_T='none' INT32_F='none' if test $ac_cv_sizeof_signed_int -eq 4 @@ -1077,11 +1093,11 @@ then INT32_T='signed long' INT32_F='"l"' fi -AC_MSG_RESULT($INT32_T) -AC_SUBST(INT32_T) -AC_SUBST(INT32_F) +AC_MSG_RESULT([$INT32_T]) +AC_SUBST([INT32_T]) +AC_SUBST([INT32_F]) -AC_MSG_CHECKING(for unsigned 32-bit type) +AC_MSG_CHECKING([for unsigned 32-bit type]) UINT32_T='none' UINT32_F='none' if test $ac_cv_sizeof_unsigned_int -eq 4 @@ -1093,11 +1109,11 @@ then UINT32_T='unsigned long' UINT32_F='"l"' fi -AC_MSG_RESULT($UINT32_T) -AC_SUBST(UINT32_T) -AC_SUBST(UINT32_F) +AC_MSG_RESULT([$UINT32_T]) +AC_SUBST([UINT32_T]) +AC_SUBST([UINT32_F]) -AC_MSG_CHECKING(for signed 64-bit type) +AC_MSG_CHECKING([for signed 64-bit type]) INT64_T='none' INT64_F='none' if test $ac_cv_sizeof_signed_long -eq 8 @@ -1114,11 +1130,11 @@ case "${host_os}" in INT64_F='"I64"' ;; esac -AC_MSG_RESULT($INT64_T) -AC_SUBST(INT64_T) -AC_SUBST(INT64_F) +AC_MSG_RESULT([$INT64_T]) +AC_SUBST([INT64_T]) +AC_SUBST([INT64_F]) -AC_MSG_CHECKING(for unsigned 64-bit type) +AC_MSG_CHECKING([for unsigned 64-bit type]) UINT64_T='none' UINT64_F='none' if test $ac_cv_sizeof_unsigned_long -eq 8 @@ -1135,11 +1151,11 @@ case "${host_os}" in UINT64_F='"I64"' ;; esac -AC_MSG_RESULT($UINT64_T) -AC_SUBST(UINT64_T) -AC_SUBST(UINT64_F) +AC_MSG_RESULT([$UINT64_T]) +AC_SUBST([UINT64_T]) +AC_SUBST([UINT64_F]) -AC_MSG_CHECKING(for unsigned maximum type) +AC_MSG_CHECKING([for unsigned maximum type]) UINTMAX_T='none' UINTMAX_F='none' if test "$UINT64_T" != 'none' @@ -1151,11 +1167,11 @@ then UINTMAX_T=$UINT32_T UINTMAX_F=$UINT32_F fi -AC_MSG_RESULT($UINTMAX_T) -AC_SUBST(UINTMAX_T) -AC_SUBST(UINTMAX_F) +AC_MSG_RESULT([$UINTMAX_T]) +AC_SUBST([UINTMAX_T]) +AC_SUBST([UINTMAX_F]) -AC_MSG_CHECKING(for pointer difference type) +AC_MSG_CHECKING([for pointer difference type]) UINTPTR_T='none' UINTPTR_F='none' if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp @@ -1167,15 +1183,15 @@ then UINTPTR_T='unsigned long long' UINTPTR_F='"ll"' fi -AC_MSG_RESULT($UINTPTR_T) -AC_SUBST(UINTPTR_T) -AC_SUBST(UINTPTR_F) +AC_MSG_RESULT([$UINTPTR_T]) +AC_SUBST([UINTPTR_T]) +AC_SUBST([UINTPTR_F]) MAGICK_SIZE_T='none' MAGICK_SIZE_T_F='none' MAGICK_SSIZE_T='none' MAGICK_SSIZE_T_F='none' -AC_MSG_CHECKING(for size_t format specification) +AC_MSG_CHECKING([for size_t format specification]) if test $ac_cv_sizeof_size_t -eq $ac_cv_sizeof_unsigned_long then # Normal case for LP32 and LP64 @@ -1201,11 +1217,11 @@ then ;; esac fi -AC_MSG_RESULT($MAGICK_SIZE_T_F) -AC_SUBST(MAGICK_SIZE_T) -AC_SUBST(MAGICK_SIZE_T_F) -AC_SUBST(MAGICK_SSIZE_T) -AC_SUBST(MAGICK_SSIZE_T_F) +AC_MSG_RESULT([$MAGICK_SIZE_T_F]) +AC_SUBST([MAGICK_SIZE_T]) +AC_SUBST([MAGICK_SIZE_T_F]) +AC_SUBST([MAGICK_SSIZE_T]) +AC_SUBST([MAGICK_SSIZE_T_F]) ######## @@ -1229,7 +1245,7 @@ AC_CHECK_DECLS([vsnprintf],[],[],[ # Check for /dev/urandom device # ####### -AC_CACHE_CHECK(for /dev/urandom,gm_cv_dev_urandom, +AC_CACHE_CHECK([for /dev/urandom],gm_cv_dev_urandom, [ gm_cv_dev_urandom=no if test -c /dev/urandom then @@ -1237,7 +1253,7 @@ AC_CACHE_CHECK(for /dev/urandom,gm_cv_dev_urandom, fi]) if test "${gm_cv_dev_urandom}" = yes then - AC_DEFINE(HAVE_DEV_URANDOM,1,[Have a /dev/urandom device for producing random bytes]) + AC_DEFINE([HAVE_DEV_URANDOM],[1],[Have a /dev/urandom device for producing random bytes]) fi ######## @@ -1248,7 +1264,7 @@ AC_CACHE_CHECK(for /dev/urandom,gm_cv_dev_urandom, MAGICK_PHYSICAL_MEMORY_COMMAND='' case "${host}" in *-*-freebsd* | *-apple-darwin*) - AC_PATH_PROG(SysCtlDelegate,sysctl,) + AC_PATH_PROG([SysCtlDelegate],[sysctl],[]) if test "${SysCtlDelegate}X" != 'X' then # "sysctl -n hw.physmem" became available in FreeBSD 2.0 @@ -1259,8 +1275,8 @@ case "${host}" in esac if test "${MAGICK_PHYSICAL_MEMORY_COMMAND}X" != 'X' then - AC_DEFINE_UNQUOTED(MAGICK_PHYSICAL_MEMORY_COMMAND, - "${MAGICK_PHYSICAL_MEMORY_COMMAND}", + AC_DEFINE_UNQUOTED([MAGICK_PHYSICAL_MEMORY_COMMAND], + ["${MAGICK_PHYSICAL_MEMORY_COMMAND}"], [Command which returns total physical memory in bytes]) fi @@ -1274,12 +1290,12 @@ if test "$with_magick_plus_plus" = 'yes' then OLIBS="$LIBS" LIBS='' - AC_LANG_PUSH(C++) + AC_LANG_PUSH([C++]) # Full set of headers used ... # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception # functional iomanip iosfwd iostream iterator list string strstream utility - AC_LANG_CPLUSPLUS + AC_LANG([C++]) AC_PROG_CXX AC_CXX_BOOL AC_CXX_CONST_CAST @@ -1298,25 +1314,20 @@ then # Test for C++ compiler __func__ support if test "$ac_cv_have_CPP__func__" != 'yes' ; then AC_CACHE_CHECK(for C++ compiler __func__ support, ac_cv_have_CPP__func__, - [AC_TRY_COMPILE( - , - changequote(<<, >>)dnl - << - const char *func=__func__; + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], + [[const char *func=__func__; return (func != 0 ? 0 : 1); - >>, - changequote([, ])dnl - ac_cv_have_CPP__func__='yes', - ac_cv_have_CPP__func__='no')]) + ]])], + [ac_cv_have_CPP__func__='yes'],[ac_cv_have_CPP__func__='no'])]) if test "$ac_cv_have_CPP__func__" = 'yes' ; then - AC_DEFINE(HAS_CPP__func__,1,Define if C++ compiler supports __func__) + AC_DEFINE([HAS_CPP__func__],[1],[Define if C++ compiler supports __func__]) fi fi AC_LANG_POP - AC_MSG_CHECKING(whether C++ compiler is sufficient for Magick++) + AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++]) if \ test $ac_cv_cxx_bool = 'yes' && \ test $ac_cv_cxx_const_cast = 'yes' && @@ -1335,10 +1346,10 @@ then else have_magick_plus_plus='no (failed tests)' fi - AC_MSG_RESULT($have_magick_plus_plus) + AC_MSG_RESULT([$have_magick_plus_plus]) LIBS="$OLIBS" fi -AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes') +AM_CONDITIONAL([WITH_MAGICK_PLUS_PLUS],[test "$have_magick_plus_plus" = 'yes']) # Assume that delegate headers and libraries may reside under same # directory as GraphicsMagick installation prefix. @@ -1349,7 +1360,7 @@ MAGICK_API_CPPFLAGS="-I$INCLUDE_DIR/GraphicsMagick $MAGICK_API_CPPFLAGS" # # Find the X11 RGB database # -AC_CACHE_CHECK(for X11 configure files,gm_cv_x_configure, +AC_CACHE_CHECK([for X11 configure files],[gm_cv_x_configure], [# 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 \ @@ -1404,7 +1415,7 @@ case "${build_os}" in X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1` ;; esac -AC_DEFINE_UNQUOTED(X11ConfigurePath,"X11ConfigurePath",Location of X11 configure files) +AC_DEFINE_UNQUOTED([X11ConfigurePath],["X11ConfigurePath"],[Location of X11 configure files]) # # Find Posix threads library @@ -1417,7 +1428,7 @@ then then case "${host_cpu}-${host_os}" in *-freebsd*) - MAGICK_CHECK_PTHREAD_LIB(c_r,PTHREAD_LIBS=-lc_r) ;; + MAGICK_CHECK_PTHREAD_LIB([c_r],[PTHREAD_LIBS=-lc_r]) ;; esac fi @@ -1431,7 +1442,7 @@ then LIB_THREAD="$PTHREAD_LIBS" LIBS="$LIBS $LIB_THREAD" fi -AC_SUBST(LIB_THREAD) +AC_SUBST([LIB_THREAD]) # # Check for Google perftools tcmalloc library @@ -1474,13 +1485,13 @@ have_umem='no' LIB_UMEM='' if test "$with_umem" != 'no' then - AC_MSG_CHECKING(for Solaris umem library support ) + AC_MSG_CHECKING([for Solaris umem library support ]) AC_MSG_RESULT() failed=0 passed=0 - AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) - AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) + AC_CHECK_HEADER([umem.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) + AC_CHECK_LIB([umem],[umem_alloc],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_CHECK_LIB([umem],[umem_free],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) if test $passed -gt 0 then if test $failed -gt 0 @@ -1489,17 +1500,17 @@ then else LIB_UMEM='-lumem' LIBS="$LIB_UMEM $LIBS" - AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library) + AC_DEFINE([HasUMEM],[1],[Define if you have umem memory allocation library]) have_umem='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi AC_MSG_CHECKING([if Solaris umem memory allocation library is complete ]) AC_MSG_RESULT([$have_umem]) fi -AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes') -AC_SUBST(LIB_UMEM) +AM_CONDITIONAL([HasUMEM],[test "$have_umem" = 'yes']) +AC_SUBST([LIB_UMEM]) # # Check for Solaris-derived mtmalloc library @@ -1546,44 +1557,44 @@ then # Open64 (passes for GCC but uses different OpenMP implementation) if test "x$LIB_OMP" = x ; then if $CC --version 2>&1 | grep Open64 > /dev/null ; then - AC_CHECK_LIB(openmp,omp_get_num_procs,LIB_OMP="-lopenmp",,) + AC_CHECK_LIB([openmp],[omp_get_num_procs],[LIB_OMP="-lopenmp"],,) fi fi # Clang (passes for GCC but uses different OpenMP implementation) if test "x$LIB_OMP" = x ; then if $CC --version 2>&1 | grep clang > /dev/null ; then - AC_CHECK_LIB(omp,GOMP_parallel_start,LIB_OMP="-lomp",,) + AC_CHECK_LIB([omp],[GOMP_parallel_start],[LIB_OMP="-lomp"],,) fi fi # GCC if test "x$LIB_OMP" = x ; then - AC_CHECK_LIB(gomp,GOMP_parallel_start,LIB_OMP="-lgomp",,) + AC_CHECK_LIB([gomp],[GOMP_parallel_start],[LIB_OMP="-lgomp"],,) fi else # Sun CC if test "x$LIB_OMP" = x ; then - AC_CHECK_LIB(mtsk,sunw_mp_register_warn,LIB_OMP="-lmtsk",,) + AC_CHECK_LIB([mtsk],[sunw_mp_register_warn],[LIB_OMP="-lmtsk"],,) fi # AIX xlc if test "x$LIB_OMP" = x ; then - AC_CHECK_LIB(xlsmp,_xlsmpFlush,LIB_OMP="-lxlsmp",,) + AC_CHECK_LIB([xlsmp],[_xlsmpFlush],[LIB_OMP="-lxlsmp"],,) fi # SGI IRIX 6.5 MIPSpro C/C++ if test "x$LIB_OMP" = x ; then - AC_CHECK_LIB(mp,mp_destroy,LIB_OMP="-lmp",,) + AC_CHECK_LIB([mp],[mp_destroy],[LIB_OMP="-lmp"],,) fi fi LIBS="$LIB_OMP $LIBS" fi -AC_SUBST(LIB_OMP) +AC_SUBST([LIB_OMP]) # # Find math library # LIB_MATH='' -AC_CHECK_LIB(m,sqrt,LIB_MATH="-lm",,) +AC_CHECK_LIB([m],[sqrt],[LIB_MATH="-lm"],,) LIBS="$LIB_MATH $LIBS" -AC_SUBST(LIB_MATH) +AC_SUBST([LIB_MATH]) # @@ -1593,19 +1604,19 @@ have_trio='no' LIB_TRIO='' if test "$ac_cv_func_vsnprintf" != 'yes' && test "$with_trio" != 'no' then - AC_MSG_CHECKING(for TRIO vsnprintf replacement) - AC_CHECK_LIB(trio,trio_vsnprintf,have_trio='yes',,) + AC_MSG_CHECKING([for TRIO vsnprintf replacement]) + AC_CHECK_LIB([trio],[trio_vsnprintf],[have_trio='yes'],,) if test "$have_trio" = 'yes' then LIB_TRIO="-ltrio" LIBS="$LIB_TRIO $LIBS" - AC_DEFINE(HasTRIO,1,Define if you have TRIO vsnprintf replacement library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasTRIO],[1],[Define if you have TRIO vsnprintf replacement library]) + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AC_SUBST(LIB_TRIO) +AC_SUBST([LIB_TRIO]) # @@ -1635,7 +1646,7 @@ then else LIB_LTDL='-lltdl' LIBS="$LIB_LTDL $LIBS" - AC_DEFINE(HasLTDL,1,[Define if using libltdl to support dynamically loadable modules]) + AC_DEFINE([HasLTDL],[1],[Define if using libltdl to support dynamically loadable modules]) AC_MSG_RESULT([yes]) have_ltdl='yes' fi @@ -1647,7 +1658,7 @@ then AC_MSG_FAILURE([libltdl is required by modules build],[1]) fi fi -AM_CONDITIONAL(WITH_LTDL, test "$have_ltdl" != 'no') +AM_CONDITIONAL([WITH_LTDL],[test "$have_ltdl" != 'no']) # # Check for ZLIB @@ -1657,40 +1668,40 @@ LIB_ZLIB='' dnl PNG requires zlib so enable zlib check if PNG is requested if test "$with_zlib" != 'no' || test "$with_png" != 'no' then - AC_MSG_CHECKING(for ZLIB support ) + AC_MSG_CHECKING([for ZLIB support ]) AC_MSG_RESULT() failed=0 passed=0 # PKG_CHECK_MODULES([ZLIB], [zlib], [], []) - AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) - AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) - AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_MSG_CHECKING(if ZLIB package is complete) + AC_CHECK_HEADER([zconf.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) + AC_CHECK_HEADER([zlib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) + AC_CHECK_LIB([z],[compress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_CHECK_LIB([z],[uncompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_CHECK_LIB([z],[deflate],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_CHECK_LIB([z],[inflate],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_CHECK_LIB([z],[gzseek],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_CHECK_LIB([z],[gztell],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_MSG_CHECKING([if ZLIB package is complete]) if test $passed -gt 0 then if test $failed -gt 0 then - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_zlib='no (failed tests)' else LIB_ZLIB='-lz' LIBS="$LIB_ZLIB $LIBS" - AC_DEFINE(HasZLIB,1,Define if you have zlib compression library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasZLIB],[1],[Define if you have zlib compression library]) + AC_MSG_RESULT([yes]) have_zlib='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AM_CONDITIONAL(HasZLIB, test "$have_zlib" = 'yes') -AC_SUBST(LIB_ZLIB) +AM_CONDITIONAL([HasZLIB],[test "$have_zlib" = 'yes']) +AC_SUBST([LIB_ZLIB]) # # Check for BZLIB @@ -1699,13 +1710,13 @@ have_bzlib='no' if test "$with_bzlib" != 'no' then LIB_BZLIB='' - AC_MSG_CHECKING(for BZLIB support ) + AC_MSG_CHECKING([for BZLIB support ]) AC_MSG_RESULT() failed=0 passed=0 found_libbz=0 - 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`,,) + 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 # Under MinGW, libbz2 obfuscates its functions by declaring them @@ -1713,7 +1724,7 @@ then # somehow include bzlib.h during the test but Autoconf does not # make that possible. We check for BZ2_decompress since that is # one of the few functions exported from the DLL (very strange). - AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,) + AC_CHECK_LIB([bz2],[_imp__BZ2_decompress],[found_libbz=`expr $found_libbz + 1`],,) fi if test $found_libbz -gt 0 then @@ -1721,29 +1732,29 @@ then else failed=`expr $failed + 1` fi - #AC_CHECK_LIB(bz2,BZ2_bzCompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - #AC_CHECK_LIB(bz2,BZ2_bzDecompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - #AC_CHECK_LIB(bz2,_imp__BZ2_decompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_MSG_CHECKING(if BZLIB package is complete) + #AC_CHECK_LIB([bz2],[BZ2_bzCompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + #AC_CHECK_LIB([bz2],[BZ2_bzDecompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + #AC_CHECK_LIB([bz2],[_imp__BZ2_decompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_MSG_CHECKING([if BZLIB package is complete]) if test $passed -gt 0 then if test $failed -gt 0 then - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_bzlib='no (failed tests)' else LIB_BZLIB='-lbz2' LIBS="$LIB_BZLIB $LIBS" - AC_DEFINE(HasBZLIB,1,Define if you have the bzip2 library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasBZLIB],[1],[Define if you have the bzip2 library]) + AC_MSG_RESULT([yes]) have_bzlib='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AM_CONDITIONAL(HasBZLIB, test "$have_bzlib" = 'yes') -AC_SUBST(LIB_BZLIB) +AM_CONDITIONAL([HasBZLIB],[test "$have_bzlib" = 'yes']) +AC_SUBST([LIB_BZLIB]) # # Check for LZMA @@ -1752,33 +1763,33 @@ have_lzma='no' LIB_LZMA='' if test "$with_lzma" != 'no' then - AC_MSG_CHECKING(for LZMA support ) + AC_MSG_CHECKING([for LZMA support ]) AC_MSG_RESULT() # PKG_CHECK_MODULES([LZMA], [liblzma], [], []) failed=0 passed=0 - AC_CHECK_HEADER(lzma.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) - AC_CHECK_LIB(lzma,lzma_code,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_MSG_CHECKING(if LZMA package is complete) + AC_CHECK_HEADER([lzma.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) + AC_CHECK_LIB([lzma],[lzma_code],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_MSG_CHECKING([if LZMA package is complete]) if test $passed -gt 0 then if test $failed -gt 0 then - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_lzma='no (failed tests)' else LIB_LZMA='-llzma' LIBS="$LIB_LZMA $LIBS" - AC_DEFINE(HasLZMA,1,Define if you have lzma compression library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasLZMA],[1],[Define if you have lzma compression library]) + AC_MSG_RESULT([yes]) have_lzma='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AM_CONDITIONAL(HasLZMA, test "$have_lzma" = 'yes') -AC_SUBST(LIB_LZMA) +AM_CONDITIONAL([HasLZMA],[test "$have_lzma" = 'yes']) +AC_SUBST([LIB_LZMA]) # # Check for Zstd @@ -1787,33 +1798,33 @@ have_zstd='no' LIB_ZSTD='' if test "$with_zstd" != 'no' then - AC_MSG_CHECKING(for Zstd support ) + AC_MSG_CHECKING([for Zstd support ]) AC_MSG_RESULT() failed=0 passed=0 # PKG_CHECK_MODULES([ZSTD], [libzstd], [], []) - AC_CHECK_HEADER(zstd.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) - AC_CHECK_LIB(zstd,ZSTD_createDStream,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_MSG_CHECKING(if Zstd package is complete) + AC_CHECK_HEADER([zstd.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) + AC_CHECK_LIB([zstd],[ZSTD_createDStream],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_MSG_CHECKING([if Zstd package is complete]) if test $passed -gt 0 then if test $failed -gt 0 then - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_zstd='no (failed tests)' else LIB_ZSTD='-lzstd' LIBS="$LIB_ZSTD $LIBS" - AC_DEFINE(HasZSTD,1,Define if you have zstd compression library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasZSTD],[1],[Define if you have zstd compression library]) + AC_MSG_RESULT([yes]) have_zstd='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AM_CONDITIONAL(HasZSTD, test "$have_zstd" = 'yes') -AC_SUBST(LIB_ZSTD) +AM_CONDITIONAL([HasZSTD],[test "$have_zstd" = 'yes']) +AC_SUBST([LIB_ZSTD]) # # Find the X11 include and library directories. @@ -1828,7 +1839,7 @@ then LIBS="$LIB_X11 $LIBS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" - AC_DEFINE(HasX11,1,Define if you have X11 library)dnl + AC_DEFINE([HasX11],[1],[Define if you have X11 library])dnl # # Check for X11 shared memory extension @@ -1843,13 +1854,13 @@ then if test "$have_shmctl" = 'yes' then - AC_CHECK_LIB([Xext],[XShmAttach],[LIB_XEXT='-lXext' ; AC_DEFINE(HasSharedMemory,1,X11 server supports shared memory extension)],[],[]) + AC_CHECK_LIB([Xext],[XShmAttach],[LIB_XEXT='-lXext' ; AC_DEFINE([HasSharedMemory],[1],[X11 server supports shared memory extension])],[],[]) fi # # Check for X11 shape extension # - AC_CHECK_LIB([Xext],[XShapeCombineMask],[LIB_XEXT='-lXext' ; AC_DEFINE(HasShape,1,X11 server supports shape extension)],[],[]) + AC_CHECK_LIB([Xext],[XShapeCombineMask],[LIB_XEXT='-lXext' ; AC_DEFINE([HasShape],[1],[X11 server supports shape extension])],[],[]) LIBS="$LIB_XEXT $LIBS" fi @@ -1859,9 +1870,9 @@ then else have_x='no' fi -AM_CONDITIONAL(HasX11, test "$have_x" = 'yes') -AC_SUBST(LIB_X11) -AC_SUBST(LIB_XEXT) +AM_CONDITIONAL([HasX11],[test "$have_x" = 'yes']) +AC_SUBST([LIB_X11]) +AC_SUBST([LIB_XEXT]) # # If profiling, then check for -ldl and dlopen (required for Solaris & gcc) @@ -1869,10 +1880,10 @@ AC_SUBST(LIB_XEXT) LIB_DL='' if test "$with_profiling" = 'yes' then - AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,) + AC_CHECK_LIB([dl],[dlopen],[LIB_DL='-ldl'],,) LIBS="$LIB_DL $LIBS" fi -AC_SUBST(LIB_DL) +AC_SUBST([LIB_DL]) # # Check for Display Postscript @@ -1887,7 +1898,7 @@ then passed=0 O_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11" - AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) + AC_CHECK_HEADER([DPS/dpsXclient.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) # DPS issues: # XFree86-4.x needs -lXt to provide XtMalloc for -ldps. # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build. @@ -1895,12 +1906,12 @@ then # GraphicsMagick itself doesn't use -lXt. have_libdps='no' LIBDPS_XT='' - AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',) + AC_CHECK_LIB([dps],[DPSInitialize],[have_libdps='yes'],[have_libdps='no'],) if test "$have_libdps" != 'yes' then # Unset cache variable so we can try again. unset ac_cv_lib_dps_DPSInitialize - AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt) + AC_CHECK_LIB([dps],[DPSInitialize],[have_libdps='yes'],[have_libdps='no'],[-lXt]) if test "$have_libdps" = 'yes' then LIBDPS_XT='-lXt' @@ -1912,8 +1923,8 @@ then else failed=`expr $failed + 1` fi - AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT) - AC_MSG_CHECKING(if DPS package is complete) + AC_CHECK_LIB([dpstk],[XDPSPixelsPerPoint],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[-ldps $LIBDPS_XT]) + AC_MSG_CHECKING([if DPS package is complete]) if test $passed -gt 0 then if test $failed -gt 0 @@ -1924,17 +1935,17 @@ then else LIB_DPS="-ldpstk -ldps ${LIBDPS_XT}" LIBS="$LIB_DPS $LIBS" - AC_DEFINE(HasDPS,1,Define if you have Display Postscript) - AC_MSG_RESULT(yes) + AC_DEFINE([HasDPS],[1],[Define if you have Display Postscript]) + AC_MSG_RESULT([yes]) have_dps='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) CPPFLAGS=$O_CPPFLAGS fi fi -AM_CONDITIONAL(HasDPS, test "$have_dps" = 'yes') -AC_SUBST(LIB_DPS) +AM_CONDITIONAL([HasDPS],[test "$have_dps" = 'yes']) +AC_SUBST([LIB_DPS]) # # Check for FlashPIX @@ -1943,35 +1954,35 @@ have_fpx='no' LIB_FPX='' if test "$with_fpx" != 'no' then - AC_MSG_CHECKING(for FlashPIX components ) + AC_MSG_CHECKING([for FlashPIX components ]) AC_MSG_RESULT() failed=0 passed=0 - AC_LANG_PUSH(C++) - AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) - AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) + AC_LANG_PUSH([C++]) + AC_CHECK_HEADER([fpxlib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) + AC_CHECK_LIB([fpx],[FPX_OpenImageByFilename],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) AC_LANG_POP - AC_MSG_CHECKING(if FlashPIX package is complete) + AC_MSG_CHECKING([if FlashPIX package is complete]) if test $passed -gt 0 then if test $failed -gt 0 then - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_fpx='no (failed tests)' else LIB_FPX='-lfpx' # LIBS="$LIB_FPX $LIBS" - AC_DEFINE(HasFPX,1,Define if you have FlashPIX library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasFPX],[1],[Define if you have FlashPIX library]) + AC_MSG_RESULT([yes]) have_fpx='yes' PERLMAINCC="$CXX" fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AM_CONDITIONAL(HasFPX, test "$have_fpx" = 'yes') -AC_SUBST(LIB_FPX) +AM_CONDITIONAL([HasFPX],[test "$have_fpx" = 'yes']) +AC_SUBST([LIB_FPX]) # # Check for LCMS v2 @@ -1989,21 +2000,21 @@ then # PKG_CHECK_MODULES([LCMS2], [lcms2], [], []) # Check for - AC_CHECK_HEADER(lcms2.h,have_lcms_header='yes',,) + AC_CHECK_HEADER([lcms2.h],[have_lcms_header='yes'],,) if test "$have_lcms_header" = 'yes' then - AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the header file.) + AC_DEFINE([HAVE_LCMS2_H],[1],[Define if you have the header file.]) passed=`expr $passed + 1` fi # Check for header file.) + AC_DEFINE([HAVE_LCMS2_LCMS2_H],[1],[Define if you have the header file.]) fi fi @@ -2013,33 +2024,33 @@ then failed=`expr $failed + 1` fi - AC_CHECK_LIB(lcms2,cmsSetLogErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_MSG_CHECKING(if LCMS v2 package is complete) + AC_CHECK_LIB([lcms2],[cmsSetLogErrorHandler],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_MSG_CHECKING([if LCMS v2 package is complete]) if test $passed -gt 0 then if test $failed -gt 0 then - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_lcms2='no (failed tests)' else LIB_LCMS='-llcms2' LIBS="$LIB_LCMS $LIBS" #AC_DEFINE(HasLCMS2,1,Define if you have LCMS v2 library) - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) have_lcms2='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AM_CONDITIONAL(HasLCMS, test "$have_lcms2" = 'yes') +AM_CONDITIONAL([HasLCMS],[test "$have_lcms2" = 'yes']) if test "$have_lcms2" = 'yes' then - AC_DEFINE(HasLCMS,1,[Define if you have LCMS (v2.0 or later) library]) + AC_DEFINE([HasLCMS],[1],[Define if you have LCMS (v2.0 or later) library]) fi -AC_SUBST(LIB_LCMS) +AC_SUBST([LIB_LCMS]) have_png='no' LIB_PNG='' @@ -2048,9 +2059,8 @@ then # # Check for PNG delegate library. # - AC_ARG_WITH(png, - [AC_HELP_STRING([--without-png], - [disable PNG support])], + AC_ARG_WITH([png], + [AS_HELP_STRING([--without-png],[disable PNG support])], [with_png=$withval], [with_png='yes']) # PKG_CHECK_MODULES([PNG], [libpng], [], []) @@ -2061,12 +2071,12 @@ then if test "$with_png" != 'no' ; then - AC_MSG_CHECKING(for PNG support ) + AC_MSG_CHECKING([for PNG support ]) AC_MSG_RESULT() failed=0 passed=0 - AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`, - failed=`expr $failed + 1`,) + AC_CHECK_HEADER([png.h],[passed=`expr $passed + 1`], + [failed=`expr $failed + 1`],) if test $passed -gt 0; then for var in 7 6 5 4 2 '' ; do @@ -2083,69 +2093,63 @@ then passed=0 if test "$with_png" = 'yes' -o "$with_png" = "libpng1${var}" ; then if test "${pnglib}" != 'png' ; then - AC_MSG_CHECKING(for LIBPNG1${var} support ) - AC_TRY_COMPILE( -#include + AC_MSG_CHECKING([for LIBPNG1${var} support ]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include #include -, -changequote(<<, >>)dnl -<< -#if PNG_LIBPNG_VER_MINOR != ${var} +]], +[[#if PNG_LIBPNG_VER_MINOR != ${var} #error LIBPNG library must be version 1${var}! Kaboom, Kaboom #endif return 0; ->>, - changequote([, ])dnl - ac_cv_libpng_ok='yes', - ac_cv_libpng_ok='no') +]])],[ac_cv_libpng_ok='yes'],[ac_cv_libpng_ok='no']) if test "$ac_cv_libpng_ok" = 'yes' ; then passed=`expr $passed + 1` - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) else failed=`expr $failed + 1` - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi else passed=`expr $passed + 1` - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) fi fi if test $passed -gt 0 -a $failed -le 0 then if test "1${var}" = '15' ; then - AC_CHECK_LIB(png15,png_get_io_ptr,passed=`expr $passed + 1`, - failed=`expr $failed + 1`,) - AC_CHECK_LIB(png15,png_longjmp,passed=`expr $passed + 1`, - failed=`expr $failed + 1`,) + AC_CHECK_LIB([png15],[png_get_io_ptr],[passed=`expr $passed + 1`], + [failed=`expr $failed + 1`],) + AC_CHECK_LIB([png15],[png_longjmp],[passed=`expr $passed + 1`], + [failed=`expr $failed + 1`],) fi if test "1${var}" = '14' ; then - AC_CHECK_LIB(png14,png_get_io_ptr,passed=`expr $passed + 1`, - failed=`expr $failed + 1`,) - AC_CHECK_LIB(png14,png_get_io_state,passed=`expr $passed + 1`, - failed=`expr $failed + 1`,) + AC_CHECK_LIB([png14],[png_get_io_ptr],[passed=`expr $passed + 1`], + [failed=`expr $failed + 1`],) + AC_CHECK_LIB([png14],[png_get_io_state],[passed=`expr $passed + 1`], + [failed=`expr $failed + 1`],) fi if test "1${var}" = '12' ; then - AC_CHECK_LIB(png12,png_get_io_ptr,passed=`expr $passed + 1`, - failed=`expr $failed + 1`,) + AC_CHECK_LIB([png12],[png_get_io_ptr],[passed=`expr $passed + 1`], + [failed=`expr $failed + 1`],) fi if test "1${var}" = '1' ; then - AC_CHECK_LIB(png,png_get_io_ptr,passed=`expr $passed + 1`, - failed=`expr $failed + 1`,) + AC_CHECK_LIB([png],[png_get_io_ptr],[passed=`expr $passed + 1`], + [failed=`expr $failed + 1`],) fi if test $passed -gt 0 -a $failed -le 0 ; then - AC_MSG_CHECKING(if ${pnglib} package is complete) + AC_MSG_CHECKING([if ${pnglib} package is complete]) if test $passed -gt 0 ; then if test $failed -gt 0 ; then - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_png='no (failed tests)' else LIB_PNG="-l${pnglib}" LIBS="$LIB_PNG $LIBS" - AC_DEFINE(HasPNG,1,Define if you have PNG library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasPNG],[1],[Define if you have PNG library]) + AC_MSG_RESULT([yes]) have_png='yes' fi fi @@ -2156,10 +2160,10 @@ return 0; fi fi else - AC_MSG_RESULT(PNG requires zlib support) + AC_MSG_RESULT([PNG requires zlib support]) fi -AM_CONDITIONAL(HasPNG, test "$have_png" = 'yes') -AC_SUBST(LIB_PNG) +AM_CONDITIONAL([HasPNG],[test "$have_png" = 'yes']) +AC_SUBST([LIB_PNG]) # # Check for JPEG @@ -2168,98 +2172,72 @@ have_jpeg='no' LIB_JPEG='' if test "$with_jpeg" != 'no' then - AC_MSG_CHECKING(for JPEG support ) + AC_MSG_CHECKING([for JPEG support ]) AC_MSG_RESULT() failed=0 passed=0 # PKG_CHECK_MODULES([JPEG], [libturbojpeg, libjpeg], [], []) - 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`) - AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) - AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - -# Test for compatible JPEG library -if test "$ac_cv_jpeg_version_ok" != 'yes' ; then -AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok, -[AC_TRY_COMPILE( -#include -#include -#include -, -changequote(<<, >>)dnl -<< -#if JPEG_LIB_VERSION < 62 -#error IJG JPEG library must be version 6b or newer! -Kaboom, Kaboom -#endif -return 0; ->>, -changequote([, ])dnl -ac_cv_jpeg_version_ok='yes', -ac_cv_jpeg_version_ok='no')]) -if test "$ac_cv_jpeg_version_ok" = 'yes' ; then - passed=`expr $passed + 1` -else - failed=`expr $failed + 1` -fi -fi - AC_MSG_CHECKING(if JPEG package is complete) + 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`]) + AC_CHECK_HEADER([jpeglib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) + AC_CHECK_LIB([jpeg],[jpeg_read_header],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_MSG_CHECKING([if JPEG package is complete]) if test $passed -gt 0 then if test $failed -gt 0 then - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_jpeg='no (failed tests)' else LIB_JPEG='-ljpeg' LIBS="$LIB_JPEG $LIBS" - AC_DEFINE(HasJPEG,1,Define if you have JPEG library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasJPEG],[1],[Define if you have JPEG library]) + AC_MSG_RESULT([yes]) have_jpeg='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AM_CONDITIONAL(HasJPEG, test "$have_jpeg" = 'yes') -AC_SUBST(LIB_JPEG) +AM_CONDITIONAL([HasJPEG],[test "$have_jpeg" = 'yes']) +AC_SUBST([LIB_JPEG]) # -# Check for JPEG Version 2 +# Check for JPEG Version 2 (Jasper) # have_jp2='no' LIB_JP2='' if test "$with_jp2" != 'no' then - AC_MSG_CHECKING(for JPEG version 2 support ) + AC_MSG_CHECKING([for JPEG version 2 support ]) AC_MSG_RESULT() failed=0 passed=0 - AC_CHECK_HEADER(jasper/jasper.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) - AC_CHECK_LIB(jasper,jas_stream_fopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_MSG_CHECKING(if JPEG version 2 support package is complete) + AC_CHECK_HEADER([jasper/jasper.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) + AC_CHECK_LIB([jasper],[jas_stream_fopen],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_MSG_CHECKING([if JPEG version 2 support package is complete]) if test $passed -gt 0 then if test $failed -gt 0 then - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_jp2='no (failed tests)' else LIB_JP2='-ljasper' LIBS="$LIB_JP2 $LIBS" - AC_DEFINE(HasJP2,1,Define if you have JPEG version 2 "Jasper" library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasJP2],[1],[Define if you have JPEG version 2 "Jasper" library]) + AC_MSG_RESULT([yes]) have_jp2='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AM_CONDITIONAL(HasJP2, test "$have_jp2" = 'yes') -AC_SUBST(LIB_JP2) +AM_CONDITIONAL([HasJP2],[test "$have_jp2" = 'yes']) +AC_SUBST([LIB_JP2]) # # # # Check for MPEG2 library @@ -2268,32 +2246,32 @@ AC_SUBST(LIB_JP2) # LIB_MPEG2='' # if test "$with_mpeg2" != 'no' # then -# AC_MSG_CHECKING(for MPEG version 2 support ) +# AC_MSG_CHECKING([for MPEG version 2 support ]) # AC_MSG_RESULT() # failed=0 # passed=0 -# AC_CHECK_HEADER(mpeg2dec/mpeg2.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) -# AC_CHECK_LIB(mpeg2,mpeg2_decode_data,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) -# AC_MSG_CHECKING(if MPEG version 2 support package is complete) +# AC_CHECK_HEADER([mpeg2dec/mpeg2.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) +# AC_CHECK_LIB([mpeg2],[mpeg2_decode_data],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) +# AC_MSG_CHECKING([if MPEG version 2 support package is complete]) # if test $passed -gt 0 # then # if test $failed -gt 0 # then -# AC_MSG_RESULT(no -- some components failed test) +# AC_MSG_RESULT([no -- some components failed test]) # have_mpeg2='no (failed tests)' # else # LIB_MPEG2='-lmpeg2' # LIBS="$LIB_MPEG2 $LIBS" -# AC_DEFINE(HasMPEG2,1,Define if you have MPEG2 library) -# AC_MSG_RESULT(yes) +# AC_DEFINE([HasMPEG2],[1],[Define if you have MPEG2 library]) +# AC_MSG_RESULT([yes]) # have_mpeg2='yes' # fi # else -# AC_MSG_RESULT(no) +# AC_MSG_RESULT([no]) # fi # fi -# AM_CONDITIONAL(HasMPEG2, test "$have_mpeg2" = 'yes') -# AC_SUBST(LIB_MPEG2) +# AM_CONDITIONAL([HasMPEG2],[test "$have_mpeg2" = 'yes']) +# AC_SUBST([LIB_MPEG2]) # # Check for TTF @@ -2302,7 +2280,7 @@ have_ttf='no' LIB_TTF='' if test "$with_ttf" != 'no' then - AC_MSG_CHECKING(for FreeType 2.0 ) + AC_MSG_CHECKING([for FreeType 2.0 ]) AC_MSG_RESULT() failed=0 passed=0 @@ -2322,7 +2300,7 @@ then freetype_cflags='' freeype_libs='' freetype_config='' - AC_PATH_PROG(freetype_config,freetype-config,)dnl + AC_PATH_PROG([freetype_config],[freetype-config],)dnl PKG_CHECK_MODULES([FT], [freetype2], [freetype_cflags=$FT_CFLAGS; freeype_libs=$FT_LIBS], [if test -n "$freetype_config" @@ -2411,30 +2389,30 @@ dnl Now test for the headers CPPFLAGS="$OLD_CPPFLAGS" fi - AC_MSG_CHECKING(if FreeType package is complete) + AC_MSG_CHECKING([if FreeType package is complete]) if test $passed -gt 0 then if test $failed -gt 0 then LIB_TTF='' - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_ttf='no (failed tests)' else LIBS="$LIB_TTF $LIBS" - AC_DEFINE(HasTTF,1,Define if you have FreeType (TrueType font) library) + AC_DEFINE([HasTTF],[1],[Define if you have FreeType (TrueType font) library]) if test "$ac_cv_header_ft2build_h" = 'yes' then AC_DEFINE([HAVE_FT2BUILD_H],[1],[Define to 1 if you have the header file.]) fi - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) have_ttf='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AM_CONDITIONAL(HasTTF, test "$have_ttf" = 'yes') -AC_SUBST(LIB_TTF) +AM_CONDITIONAL([HasTTF],[test "$have_ttf" = 'yes']) +AC_SUBST([LIB_TTF]) # # Check for TIFF @@ -2443,32 +2421,32 @@ have_tiff='no' LIB_TIFF='' if test "$with_tiff" != 'no' then - AC_MSG_CHECKING(for TIFF support ) + AC_MSG_CHECKING([for TIFF support ]) AC_MSG_RESULT() failed=0 passed=0 # PKG_CHECK_MODULES([TIFF], [libtiff-4], [], []) - 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) + 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) + AC_MSG_RESULT([no -- some components failed test]) have_tiff='no (failed tests)' else LIB_TIFF='-ltiff' LIBS="$LIB_TIFF $LIBS" - AC_DEFINE(HasTIFF,1,Define if you have TIFF library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasTIFF],[1],[Define if you have TIFF library]) + AC_MSG_RESULT([yes]) have_tiff='yes' - AC_CHECK_HEADERS(tiffconf.h) + AC_CHECK_HEADERS([tiffconf.h]) AC_CHECK_FUNCS([TIFFIsCODECConfigured \ TIFFMergeFieldInfo \ TIFFSetErrorHandlerExt \ @@ -2477,11 +2455,11 @@ then TIFFSwabArrayOfTriples]) fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi AM_CONDITIONAL([HasTIFF], [test "$have_tiff" = 'yes']) -AC_SUBST(LIB_TIFF) +AC_SUBST([LIB_TIFF]) # # Check for JBIG @@ -2490,32 +2468,32 @@ have_jbig='no' LIB_JBIG='' if test "$with_jbig" != 'no' then - AC_MSG_CHECKING(for JBIG support ) + AC_MSG_CHECKING([for JBIG support ]) AC_MSG_RESULT() failed=0 passed=0 - AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) - AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) - AC_MSG_CHECKING(if JBIG package is complete) + AC_CHECK_HEADER([jbig.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) + AC_CHECK_LIB([jbig],[jbg_dec_init],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],) + AC_MSG_CHECKING([if JBIG package is complete]) if test $passed -gt 0 then if test $failed -gt 0 then - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_jbig='no (failed tests)' else LIB_JBIG='-ljbig' LIBS="$LIB_JBIG $LIBS" - AC_DEFINE(HasJBIG,1,Define if you have JBIG library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasJBIG],[1],[Define if you have JBIG library]) + AC_MSG_RESULT([yes]) have_jbig='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AM_CONDITIONAL(HasJBIG, test "$have_jbig" = 'yes') -AC_SUBST(LIB_JBIG) +AM_CONDITIONAL([HasJBIG],[test "$have_jbig" = 'yes']) +AC_SUBST([LIB_JBIG]) # # Check for WEBP @@ -2524,7 +2502,7 @@ have_webp='no' LIB_WEBP='' if test "$with_webp" != 'no' then - AC_MSG_CHECKING(for WEBP support ) + AC_MSG_CHECKING([for WEBP support ]) AC_MSG_RESULT() failed=0 passed=0 @@ -2533,25 +2511,25 @@ then AC_CHECK_HEADER([webp/encode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[]) AC_CHECK_LIB([webp],[WebPDecodeRGB],[passed=`expr $passed + 1`; LIB_WEBP='-lwebp'],[failed=`expr $failed + 1`],[]) AC_CHECK_LIB([webpmux],[WebPMuxSetImage],[LIB_WEBP="$LIB_WEBP -lwebpmux"],[],[-lwebp]) - AC_MSG_CHECKING(if WEBP package is complete) + AC_MSG_CHECKING([if WEBP package is complete]) if test $passed -gt 0 then if test $failed -gt 0 then - AC_MSG_RESULT(no -- some components failed test) + AC_MSG_RESULT([no -- some components failed test]) have_webp='no (failed tests)' else LIBS="$LIB_WEBP $LIBS" - AC_DEFINE(HasWEBP,1,Define if you have WEBP library) - AC_MSG_RESULT(yes) + AC_DEFINE([HasWEBP],[1],[Define if you have WEBP library]) + AC_MSG_RESULT([yes]) have_webp='yes' fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi fi -AM_CONDITIONAL(HasWEBP, test "$have_webp" = 'yes') -AC_SUBST(LIB_WEBP) +AM_CONDITIONAL([HasWEBP],[test "$have_webp" = 'yes']) +AC_SUBST([LIB_WEBP]) # # Check for XML @@ -2759,6 +2737,49 @@ AM_CONDITIONAL([HasWMF], [test "$have_wmf" = 'yes']) AC_SUBST([LIB_WMF]) AC_SUBST([LIB_WMF_DEPS]) + +# +# Check for Windows gdi32 library +# +have_gdi32='no' +if test "$with_gdi32" != 'no' +then + LIB_GDI32='' + AC_MSG_CHECKING([for Windows GDI32 support]) + AC_MSG_RESULT() + failed=0 + passed=0 + found_libgdi32=0 + AC_CHECK_HEADER([windows.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`]) + AC_CHECK_HEADER([wingdi.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[#include ]) + AC_CHECK_LIB([gdi32],[OpenClipboard],[found_libgdi32=`expr $found_libgdi32 + 1`],,) + if test $found_libgdi32 -gt 0 + then + passed=`expr $passed + 1` + else + failed=`expr $failed + 1` + fi + AC_MSG_CHECKING([if Windows GDI32 support is complete]) + if test $passed -gt 0 + then + if test $failed -gt 0 + then + AC_MSG_RESULT([no -- some components failed test]) + have_gdi32='no (failed tests)' + else + LIB_GDI32='-lgdi32' + LIBS="$LIB_GDI32 $LIBS" + AC_DEFINE([HasWINGDI32],[1],[Define to use the Windows GDI32 library]) + AC_MSG_RESULT([yes]) + have_gdi32='yes' + fi + else + AC_MSG_RESULT([no]) + fi +fi +AM_CONDITIONAL([HasWINGDI32], [test "$have_gdi32" = 'yes']) +AC_SUBST([LIB_GDI32]) + ######## # # Check for functions @@ -2785,7 +2806,7 @@ AC_SUBST([PERLMAINCC]) # Subdirectory under lib to place GraphicsMagick lib files MagickLibSubdir="${PACKAGE_NAME}-${PACKAGE_VERSION}" -AC_DEFINE_UNQUOTED(MagickLibSubdir,"$MagickLibSubdir",Subdirectory of lib where GraphicsMagick architecture dependent files are installed) +AC_DEFINE_UNQUOTED([MagickLibSubdir],["$MagickLibSubdir"],[Subdirectory of lib where GraphicsMagick architecture dependent files are installed]) # Path to GraphicsMagick bin directory MagickBinPath="${BIN_DIR}" @@ -2795,8 +2816,8 @@ case "${build_os}" in MagickBinPathDefine=`$WinPathScript "$MagickBinPathDefine" 1` ;; esac -AC_DEFINE_UNQUOTED(MagickBinPath,"$MagickBinPathDefine",Directory where executables are installed.) -AC_SUBST(MagickBinPath) +AC_DEFINE_UNQUOTED([MagickBinPath],["$MagickBinPathDefine"],[Directory where executables are installed.]) +AC_SUBST([MagickBinPath]) # Path to GraphicsMagick lib MagickLibPath="${LIB_DIR}/${MagickLibSubdir}" @@ -2806,12 +2827,12 @@ case "${build_os}" in MagickLibPathDefine=`$WinPathScript "$MagickLibPathDefine" 1` ;; esac -AC_DEFINE_UNQUOTED(MagickLibPath,"$MagickLibPathDefine",Directory where architecture-dependent files live.) -AC_SUBST(MagickLibPath) +AC_DEFINE_UNQUOTED([MagickLibPath],["$MagickLibPathDefine"],[Directory where architecture-dependent files live.]) +AC_SUBST([MagickLibPath]) # Subdirectory under lib to place GraphicsMagick configuration files MagickLibConfigSubDir="${MagickLibSubdir}/config" -AC_DEFINE_UNQUOTED(MagickLibConfigSubDir,"$MagickLibConfigSubDir",Subdirectory of lib where architecture-dependent configuration files live.) +AC_DEFINE_UNQUOTED([MagickLibConfigSubDir],["$MagickLibConfigSubDir"],[Subdirectory of lib where architecture-dependent configuration files live.]) MagickLibConfigPath="${LIB_DIR}/${MagickLibConfigSubDir}" MagickLibConfigPathDefine="${MagickLibConfigPath}/" case "${build_os}" in @@ -2819,13 +2840,13 @@ case "${build_os}" in MagickLibConfigPathDefine=`$WinPathScript "$MagickLibConfigPathDefine" 1` ;; esac -AC_DEFINE_UNQUOTED(MagickLibConfigPath,"$MagickLibConfigPathDefine",Directory where architecture-dependent configuration files live.) -AC_SUBST(MagickLibConfigPath) +AC_DEFINE_UNQUOTED([MagickLibConfigPath],["$MagickLibConfigPathDefine"],[Directory where architecture-dependent configuration files live.]) +AC_SUBST([MagickLibConfigPath]) # # Subdirectory under lib to place GraphicsMagick coder module files MagickCoderModulesSubdir="${MagickLibSubdir}/modules-Q${QuantumDepth}/coders" -AC_DEFINE_UNQUOTED(MagickCoderModulesSubdir,"$MagickCoderModulesSubdir",Subdirectory of lib where coder modules are installed) +AC_DEFINE_UNQUOTED([MagickCoderModulesSubdir],["$MagickCoderModulesSubdir"],[Subdirectory of lib where coder modules are installed]) MagickCoderModulesPath="${LIB_DIR}/${MagickCoderModulesSubdir}" MagickCoderModulesPathDefine="${MagickCoderModulesPath}/" case "${build_os}" in @@ -2833,13 +2854,13 @@ case "${build_os}" in MagickCoderModulesPathDefine=`$WinPathScript "$MagickCoderModulesPathDefine" 1` ;; esac -AC_DEFINE_UNQUOTED(MagickCoderModulesPath,"$MagickCoderModulesPathDefine",Location of coder modules) -AC_SUBST(MagickCoderModulesPath) +AC_DEFINE_UNQUOTED([MagickCoderModulesPath],["$MagickCoderModulesPathDefine"],[Location of coder modules]) +AC_SUBST([MagickCoderModulesPath]) # # Subdirectory under lib to place GraphicsMagick filter module files MagickFilterModulesSubdir="${MagickLibSubdir}/modules-Q${QuantumDepth}/filters" -AC_DEFINE_UNQUOTED(MagickFilterModulesSubdir,"$MagickFilterModulesSubdir",Subdirectory of lib where filter modules are installed) +AC_DEFINE_UNQUOTED([MagickFilterModulesSubdir],["$MagickFilterModulesSubdir"],[Subdirectory of lib where filter modules are installed]) MagickFilterModulesPath="${LIB_DIR}/${MagickFilterModulesSubdir}" MagickFilterModulesPathDefine="${MagickFilterModulesPath}/" case "${build_os}" in @@ -2847,8 +2868,8 @@ case "${build_os}" in MagickFilterModulesPathDefine=`$WinPathScript "$MagickFilterModulesPathDefine" 1` ;; esac -AC_DEFINE_UNQUOTED(MagickFilterModulesPath,"$MagickFilterModulesPathDefine",Location of filter modules) -AC_SUBST(MagickFilterModulesPath) +AC_DEFINE_UNQUOTED([MagickFilterModulesPath],["$MagickFilterModulesPathDefine"],[Location of filter modules]) +AC_SUBST([MagickFilterModulesPath]) # # Path to GraphicsMagick share files @@ -2860,12 +2881,12 @@ case "${build_os}" in MagickSharePathDefine=`$WinPathScript "$MagickSharePathDefine" 1` ;; esac -AC_DEFINE_UNQUOTED(MagickSharePath,"$MagickSharePathDefine",Directory where architecture-independent files live.) -AC_SUBST(MagickSharePath) +AC_DEFINE_UNQUOTED([MagickSharePath],["$MagickSharePathDefine"],[Directory where architecture-independent files live.]) +AC_SUBST([MagickSharePath]) # Subdirectory under share to place GraphicsMagick configuration files MagickShareConfigSubDir="${MagickLibSubdir}/config" -AC_DEFINE_UNQUOTED(MagickShareConfigSubDir,"$MagickShareConfigSubDir",Subdirectory of lib where architecture-independent configuration files live.) +AC_DEFINE_UNQUOTED([MagickShareConfigSubDir],["$MagickShareConfigSubDir"],[Subdirectory of lib where architecture-independent configuration files live.]) MagickShareConfigPath="${DATA_DIR}/${MagickShareConfigSubDir}" MagickShareConfigPathDefine="${MagickShareConfigPath}/" case "${build_os}" in @@ -2873,8 +2894,8 @@ case "${build_os}" in MagickShareConfigPathDefine=`$WinPathScript "$MagickShareConfigPathDefine" 1` ;; esac -AC_DEFINE_UNQUOTED(MagickShareConfigPath,"$MagickShareConfigPathDefine",Directory where architecture-independent configuration files live.) -AC_SUBST(MagickShareConfigPath) +AC_DEFINE_UNQUOTED([MagickShareConfigPath],["$MagickShareConfigPathDefine"],[Directory where architecture-independent configuration files live.]) +AC_SUBST([MagickShareConfigPath]) # Extra options to pass to dcraw via delegates.mgk. This substition # is done directly on delegates.mgk and has no effect on the compiled @@ -2889,7 +2910,7 @@ if test "$have_tiff" = 'yes' ; then DcrawExtraOptions="$DcrawExtraOptions -T" fi DcrawExtraOptions=`echo $DcrawExtraOptions | sed -e 's/ */ /g'` -AC_SUBST(DcrawExtraOptions) +AC_SUBST([DcrawExtraOptions]) # # program_transform_name is formed for use in a Makefile, so create a @@ -2923,10 +2944,14 @@ MPEGEncodeDelegateDefault='mpeg2encode' MVDelegateDefault='mv' dnl PGPDecodeDelegateDefault='pgpv' dnl POVDelegateDefault='povray' -if test "$native_win32_build" = 'yes' ; then - PSDelegateDefault='gswin32c' +if test "$with_gs" = 'yes' ; then + if test "$native_win32_build" = 'yes' ; then + PSDelegateDefault='gswin32c' + else + PSDelegateDefault='gs' + fi else - PSDelegateDefault='gs' + PSDelegateDefault='false' fi dnl RADDecodeDelegateDefault='ra_ppm' dnl RLEEncodeDelegateDefault='rawtorle' @@ -2940,31 +2965,35 @@ dnl ZipDelegateDefault='gzip' # Search for delegates dnl AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault") dnl AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault") -AC_PATH_PROGS(BrowseDelegate, "$BrowseDelegateDefault" firefox konqueror google-chrome mozilla lynx, "$BrowseDelegateDefault") -AC_PATH_PROG(CGMDecodeDelegate, "$CGMDecodeDelegateDefault", "$CGMDecodeDelegateDefault") -dnl AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault") -AC_PATH_PROG(DCRAWDecodeDelegate, "$DCRAWDecodeDelegateDefault", "$DCRAWDecodeDelegateDefault") -AC_PATH_PROG(DOTDecodeDelegate, "$DOTDecodeDelegateDefault", "$DOTDecodeDelegateDefault") -AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault") -dnl AC_PATH_PROG(EchoDelegate, "$EchoDelegateDefault", "$EchoDelegateDefault") -AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault") -AC_PATH_PROG(FIGDecodeDelegate, "$FIGDecodeDelegateDefault", "$FIGDecodeDelegateDefault") -AC_PATH_PROG(GMDelegate, "$GMDelegateDefault", "$GMDelegateDefault") -dnl AC_PATH_PROG(GnuplotDecodeDelegate, "$GnuplotDecodeDelegateDefault", "$GnuplotDecodeDelegateDefault") -AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault") -AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault") -AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault") -AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault") -AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no) -AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", no) -AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault") +AC_PATH_PROGS([BrowseDelegate], ["$BrowseDelegateDefault" firefox konqueror google-chrome mozilla lynx], ["$BrowseDelegateDefault"]) +AC_PATH_PROG([CGMDecodeDelegate], ["$CGMDecodeDelegateDefault"], ["$CGMDecodeDelegateDefault"]) +dnl AC_PATH_PROG([CatDelegate], ["$CatDelegateDefault"], ["$CatDelegateDefault"]) +AC_PATH_PROG([DCRAWDecodeDelegate], ["$DCRAWDecodeDelegateDefault"], ["$DCRAWDecodeDelegateDefault"]) +AC_PATH_PROG([DOTDecodeDelegate], ["$DOTDecodeDelegateDefault"], ["$DOTDecodeDelegateDefault"]) +AC_PATH_PROG([DVIDecodeDelegate], ["$DVIDecodeDelegateDefault"], ["$DVIDecodeDelegateDefault"]) +dnl AC_PATH_PROG([EchoDelegate], ["$EchoDelegateDefault"], ["$EchoDelegateDefault"]) +AC_PATH_PROG([EditorDelegate], ["$EditorDelegateDefault"], ["$EditorDelegateDefault"]) +AC_PATH_PROG([FIGDecodeDelegate], ["$FIGDecodeDelegateDefault"], ["$FIGDecodeDelegateDefault"]) +AC_PATH_PROG([GMDelegate], ["$GMDelegateDefault"], ["$GMDelegateDefault"]) +dnl AC_PATH_PROG([GnuplotDecodeDelegate], [$GnuplotDecodeDelegateDefault"], ["$GnuplotDecodeDelegateDefault"]) +AC_PATH_PROG([HPGLDecodeDelegate], ["$HPGLDecodeDelegateDefault"], ["$HPGLDecodeDelegateDefault"]) +AC_PATH_PROG([HTMLDecodeDelegate], ["$HTMLDecodeDelegateDefault"], ["$HTMLDecodeDelegateDefault"]) +AC_PATH_PROG([ILBMDecodeDelegate], ["$ILBMDecodeDelegateDefault"], ["$ILBMDecodeDelegateDefault"]) +AC_PATH_PROG([ILBMEncodeDelegate], ["$ILBMEncodeDelegateDefault"], ["$ILBMEncodeDelegateDefault"]) +AC_PATH_PROG([LPDelegate], ["$LPDelegateDefault"], [no]) +AC_PATH_PROG([LPRDelegate], ["$LPRDelegateDefault"], [no]) +AC_PATH_PROG([LaunchDelegate], ["$LaunchDelegateDefault"], ["$LaunchDelegateDefault"]) dnl AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault") -AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault") -AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault") -AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault") -dnl AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault") -dnl AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault") -AC_PATH_PROG(PSDelegate, "$PSDelegateDefault", "$PSDelegateDefault") +AC_PATH_PROG([MPEGDecodeDelegate], ["$MPEGDecodeDelegateDefault"], ["$MPEGDecodeDelegateDefault"]) +AC_PATH_PROG([MPEGEncodeDelegate], ["$MPEGEncodeDelegateDefault"], ["$MPEGEncodeDelegateDefault"]) +AC_PATH_PROG([MVDelegate], ["$MVDelegateDefault"], ["$MVDelegateDefault"]) +dnl AC_PATH_PROG([PGPDecodeDelegate], ["$PGPDecodeDelegateDefault"], ["$PGPDecodeDelegateDefault"]) +dnl AC_PATH_PROG([POVDelegate], ["$POVDelegateDefault"], ["$POVDelegateDefault"]) +if test "$with_gs" = 'yes' ; then + AC_PATH_PROG([PSDelegate], ["$PSDelegateDefault"], ["$PSDelegateDefault"]) +else + PSDelegate=$PSDelegateDefault +fi dnl AC_PATH_PROG(RADDecodeDelegate, "$RADDecodeDelegateDefault", "$RADDecodeDelegateDefault") dnl AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault") dnl AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault") @@ -2981,7 +3010,7 @@ then else PrintDelegate="$LPDelegate -c -s" fi -AC_SUBST(PrintDelegate) +AC_SUBST([PrintDelegate]) # Installed GraphicsMagick utiltity paths GMDelegate="${BIN_DIR}/${GMDelegateDefault}" @@ -2998,17 +3027,17 @@ dnl have_ra_ppm='no' ; if test "$RADDecodeDelegate" != "$RADDecodeDelegateDefau have_ralcgm='no' ; if test "$CGMDecodeDelegate" != "$CGMDecodeDelegateDefault" ; then have_ralcgm='yes' ; fi # Automake conditional to support test suite -AM_CONDITIONAL(HasPSDelegate, test "$have_gs" = 'yes') +AM_CONDITIONAL([HasPSDelegate],[test "$have_gs" = 'yes']) # Test for optional rst2html.py utility and define automake conditional HasRST2HTML if found. -AC_CHECK_PROGS(RST2HTML,[rst2html.py rst2html]) -AC_SUBST(RST2HTML) -AM_CONDITIONAL(HasRST2HTML, test "x$RST2HTML" != 'x') +AC_CHECK_PROGS([RST2HTML],[rst2html.py rst2html]) +AC_SUBST([RST2HTML]) +AM_CONDITIONAL([HasRST2HTML],[test "x$RST2HTML" != 'x']) # Test for optional txt2html utility and define automake conditional HasTXT2HTML if found. -AC_PATH_PROGS(TXT2HTML, [txt2html]) -AC_SUBST(TXT2HTML) -AM_CONDITIONAL(HasTXT2HTML, test "$TXT2HTML" != 'x') +AC_PATH_PROGS([TXT2HTML], [txt2html]) +AC_SUBST([TXT2HTML]) +AM_CONDITIONAL([HasTXT2HTML],[test "$TXT2HTML" != 'x']) # # Test for font directories @@ -3044,11 +3073,11 @@ fi if test -n "$windows_font_dir" then type_include_files="$type_include_files "'' - AC_MSG_RESULT($windows_font_dir) + AC_MSG_RESULT([$windows_font_dir]) else - AC_MSG_RESULT(not found!); + AC_MSG_RESULT([not found!]); fi -AC_SUBST(windows_font_dir) +AC_SUBST([windows_font_dir]) # Adobe Postscript fonts on various systems AC_MSG_CHECKING([for Solaris OpenWindows Type 1 fonts (location of Helvetica.afm)]) @@ -3065,9 +3094,9 @@ case $host_os in esac if test -n "$openwin_fonts" then - AC_MSG_RESULT($openwin_fonts) + AC_MSG_RESULT([$openwin_fonts]) else - AC_MSG_RESULT(not found!); + AC_MSG_RESULT([not found!]); fi # Ghostscript @@ -3104,9 +3133,11 @@ else break 1 fi done - if test "${PSDelegate}" != 'gswin32c' - then - ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\" + if test "$with_gs" = 'yes' ; then + if test "${PSDelegate}" != "${PSDelegateDefault}" + then + ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\" + fi fi else @@ -3128,9 +3159,11 @@ else if test "${ghostscript_font_dir}x" = 'x' then - if test "$PSDelegate" != 'gs' - then - ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/" + if test "$with_gs" = 'yes' ; then + if test "$PSDelegate" != "${PSDelegateDefault}" + then + ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/" + fi fi fi @@ -3139,18 +3172,18 @@ fi if test "${ghostscript_font_dir}x" != 'x' then type_include_files="${type_include_files} "'' - AC_MSG_RESULT($ghostscript_font_dir) + AC_MSG_RESULT([$ghostscript_font_dir]) else - AC_MSG_RESULT(not found!); + AC_MSG_RESULT([not found!]); fi -AC_SUBST(ghostscript_font_dir) +AC_SUBST([ghostscript_font_dir]) case "${build_os}" in mingw* ) PSDelegate=`$WinPathScript "$PSDelegate" 1` ;; esac -AC_SUBST(type_include_files) +AC_SUBST([type_include_files]) # # Handle case where user doesn't want frozen paths @@ -3197,65 +3230,65 @@ dnl ZipDelegate="$ZipDelegateDefault" fi # Delegate substitutions -dnl AC_SUBST(AutotraceDecodeDelegate) -dnl AC_SUBST(BZIPDelegate) -AC_SUBST(BrowseDelegate) -dnl AC_SUBST(CGMDecodeDelegate) -dnl AC_SUBST(CatDelegate) -AC_SUBST(ConvertDelegate) -AC_SUBST(DOTDecodeDelegate) -AC_SUBST(DVIDecodeDelegate) -dnl AC_SUBST(EchoDelegate) -AC_SUBST(EditorDelegate) -AC_SUBST(FIGDecodeDelegate) -dnl AC_SUBST(GnuplotDecodeDelegate) -AC_SUBST(HPGLDecodeDelegate) -AC_SUBST(HTMLDecodeDelegate) -AC_SUBST(ILBMDecodeDelegate) -AC_SUBST(ILBMEncodeDelegate) -AC_SUBST(LPDelegate) -AC_SUBST(LaunchDelegate) -dnl AC_SUBST(MANDelegate) -AC_SUBST(MPEGDecodeDelegate) -AC_SUBST(MPEGEncodeDelegate) -dnl AC_SUBST(MVDelegate) -AC_SUBST(MogrifyDelegate) -dnl AC_SUBST(PGPDecodeDelegate) -dnl AC_SUBST(POVDelegate) -AC_SUBST(PSDelegate) -dnl AC_SUBST(RADDecodeDelegate) -dnl AC_SUBST(RLEEncodeDelegate) -dnl AC_SUBST(RMDelegate) -dnl AC_SUBST(SCANDecodeDelegate) -AC_SUBST(ShowImageDelegate) -dnl AC_SUBST(TXTDelegate) -dnl AC_SUBST(WMFDecodeDelegate) -dnl AC_SUBST(WWWDecodeDelegate) -dnl AC_SUBST(ZipDelegate) +dnl AC_SUBST([AutotraceDecodeDelegate]) +dnl AC_SUBST([BZIPDelegate]) +AC_SUBST([BrowseDelegate]) +dnl AC_SUBST([CGMDecodeDelegate]) +dnl AC_SUBST([CatDelegate]) +AC_SUBST([ConvertDelegate]) +AC_SUBST([DOTDecodeDelegate]) +AC_SUBST([DVIDecodeDelegate]) +dnl AC_SUBST([EchoDelegate]) +AC_SUBST([EditorDelegate]) +AC_SUBST([FIGDecodeDelegate]) +dnl AC_SUBST([GnuplotDecodeDelegate]) +AC_SUBST([HPGLDecodeDelegate]) +AC_SUBST([HTMLDecodeDelegate]) +AC_SUBST([ILBMDecodeDelegate]) +AC_SUBST([ILBMEncodeDelegate]) +AC_SUBST([LPDelegate]) +AC_SUBST([LaunchDelegate]) +dnl AC_SUBST([MANDelegate]) +AC_SUBST([MPEGDecodeDelegate]) +AC_SUBST([MPEGEncodeDelegate]) +dnl AC_SUBST([MVDelegate]) +AC_SUBST([MogrifyDelegate]) +dnl AC_SUBST([PGPDecodeDelegate]) +dnl AC_SUBST([POVDelegate]) +AC_SUBST([PSDelegate]) +dnl AC_SUBST([RADDecodeDelegate]) +dnl AC_SUBST([RLEEncodeDelegate]) +dnl AC_SUBST([RMDelegate]) +dnl AC_SUBST([SCANDecodeDelegate]) +AC_SUBST([ShowImageDelegate]) +dnl AC_SUBST([TXTDelegate]) +dnl AC_SUBST([WMFDecodeDelegate]) +dnl AC_SUBST([WWWDecodeDelegate]) +dnl AC_SUBST([ZipDelegate]) # # RedHat RPM support (http://rpm5.org/) # RPM='' -AC_CHECK_PROGS(RPM,[rpmbuild rpm]) -AC_SUBST(RPM) -AM_CONDITIONAL(HAS_RPM, test "x$RPM" != "x" ) +AC_CHECK_PROGS([RPM],[rpmbuild rpm]) +AC_SUBST([RPM]) +AM_CONDITIONAL([HAS_RPM],[test "x$RPM" != "x"]) # # 7ZIP support (http://p7zip.sourceforge.net/) # P7ZIP='' -AC_CHECK_PROGS(P7ZIP,[7za]) +AC_CHECK_PROGS([P7ZIP],[7za]) AC_SUBST(P7ZIP) -AM_CONDITIONAL(HAS_P7ZIP, test "x$P7ZIP" != "x" ) +AM_CONDITIONAL([HAS_P7ZIP],[test "x$P7ZIP" != "x"]) # # ZIP support (http://www.info-zip.org/Zip.html) # ZIP='' -AC_CHECK_PROGS(ZIP,[zip]) -AC_SUBST(ZIP) -AM_CONDITIONAL(HAS_ZIP, test "x$ZIP" != "x" ) +AC_CHECK_PROGS([ZIP],[zip]) +AC_SUBST([ZIP]) +AM_CONDITIONAL([HAS_ZIP],[test "x$ZIP" != "x"]) # # Ghostscript related configuration. @@ -3273,14 +3306,14 @@ GSVersion='unknown' if test $have_gs = 'yes' then - AC_MSG_CHECKING(for Ghostscript version) + AC_MSG_CHECKING([for Ghostscript version]) if GSVersion=`$PSDelegate --version` then : else GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'` fi - AC_MSG_RESULT($GSVersion) + AC_MSG_RESULT([$GSVersion]) # GSColorDevice # AS_MESSAGE_LOG_FD AC_MSG_CHECKING([for gs color device]) @@ -3295,7 +3328,7 @@ then GSColorDevice=ppmraw fi fi - AC_MSG_RESULT($GSColorDevice) + AC_MSG_RESULT([$GSColorDevice]) # GSColorAlphaDevice AC_MSG_CHECKING([for gs color+alpha device]) @@ -3305,7 +3338,7 @@ then else GSColorAlphaDevice=$GSColorDevice fi - AC_MSG_RESULT($GSColorAlphaDevice) + AC_MSG_RESULT([$GSColorAlphaDevice]) # GSGrayDevice AC_MSG_CHECKING([for gs gray device]) @@ -3315,7 +3348,7 @@ then else GSGrayDevice=ppmraw fi - AC_MSG_RESULT($GSGrayDevice) + AC_MSG_RESULT([$GSGrayDevice]) # GSPaletteDevice AC_MSG_CHECKING([for gs pallet device]) @@ -3335,7 +3368,7 @@ then else GSMonoDevice=ppmraw fi - AC_MSG_RESULT($GSMonoDevice) + AC_MSG_RESULT([$GSMonoDevice]) # GSCMYKDevice AC_MSG_CHECKING([for gs CMYK device]) @@ -3348,7 +3381,7 @@ then break fi done - AC_MSG_RESULT($GSCMYKDevice) + AC_MSG_RESULT([$GSCMYKDevice]) # GSPDFDevice AC_MSG_CHECKING([for gs PDF writing device]) @@ -3358,7 +3391,7 @@ then else GSPDFDevice=nodevice fi - AC_MSG_RESULT($GSPDFDevice) + AC_MSG_RESULT([$GSPDFDevice]) # GSPSDevice AC_MSG_CHECKING([for gs PS writing device]) @@ -3371,7 +3404,7 @@ then break fi done - AC_MSG_RESULT($GSPSDevice) + AC_MSG_RESULT([$GSPSDevice]) # GSEPSDevice AC_MSG_CHECKING([for gs EPS writing device]) @@ -3384,20 +3417,20 @@ then break fi done - AC_MSG_RESULT($GSEPSDevice) + AC_MSG_RESULT([$GSEPSDevice]) fi -AC_SUBST(GSMonoDevice) -AC_SUBST(GSCMYKDevice) -AC_SUBST(GSGrayDevice) -AC_SUBST(GSPaletteDevice) -AC_SUBST(GSColorDevice) -AC_SUBST(GSColorAlphaDevice) -AC_SUBST(GSPDFDevice) -AC_SUBST(GSPSDevice) -AC_SUBST(GSEPSDevice) -AC_SUBST(GSVersion) +AC_SUBST([GSMonoDevice]) +AC_SUBST([GSCMYKDevice]) +AC_SUBST([GSGrayDevice]) +AC_SUBST([GSPaletteDevice]) +AC_SUBST([GSColorDevice]) +AC_SUBST([GSColorAlphaDevice]) +AC_SUBST([GSPDFDevice]) +AC_SUBST([GSPSDevice]) +AC_SUBST([GSEPSDevice]) +AC_SUBST([GSVersion]) # # PerlMagick-related configuration @@ -3410,12 +3443,12 @@ if test "$with_perl" != 'no' then if test "$with_perl" != 'yes' then - AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl"); + AC_CACHE_CHECK([for perl],[ac_cv_path_PERL],[ac_cv_path_PERL="$with_perl"]); PERL=$ac_cv_path_PERL - AC_SUBST(PERL)dnl + AC_SUBST([PERL])dnl have_perl="$ac_cv_path_PERL" else - AC_PATH_PROGS(PERL,perl perl5,)dnl + AC_PATH_PROGS([PERL],[perl perl5],)dnl if test "$ac_cv_path_PERL" then have_perl="$ac_cv_path_PERL" @@ -3442,12 +3475,12 @@ then fi # Is PERL's MakeMaker new enough to support DESTDIR? - AC_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no']) + AC_PROG_PERL_VERSION([5.8.1],[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no']) fi -AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no') -AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes') -AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes') -AC_SUBST(PERL_SUPPORTS_DESTDIR) +AM_CONDITIONAL([WITH_PER]L,[test "$have_perl" != 'no']) +AM_CONDITIONAL([WITH_PERL_STATIC],[test $with_perl_static = 'yes']) +AM_CONDITIONAL([WITH_PERL_DYNAMIC],[test $with_perl_dynamic = 'yes']) +AC_SUBST([PERL_SUPPORTS_DESTDIR]) # Determine path to pick up GraphicsMagick library from for use with building PerlMagick MAGICKLIBDIR="${LIB_DIR}" @@ -3471,8 +3504,8 @@ then MAGICKLIBDIR="${builddir}/magick/${libtool_objdir}" MAGICKLIB="-L${MAGICKLIBDIR} -lGraphicsMagick" fi -AC_SUBST(MAGICKLIB) -AC_SUBST(MAGICKLIBDIR) +AC_SUBST([MAGICKLIB]) +AC_SUBST([MAGICKLIBDIR]) # Create a simple string containing format names for all delegate libraries # DELEGATES is used to select sub-directories in the PerlMagick test suite @@ -3542,8 +3575,7 @@ fi have_ps='no' if test "$have_dps" = 'yes' || \ - test "$have_gs" = 'yes' || \ - test "${native_win32_build}" = 'yes' ; then + test "$have_gs" = 'yes' ; then have_ps='yes' fi if test "$have_ps" = 'yes' ; then @@ -3589,8 +3621,8 @@ fi # Remove extraneous spaces from output variables (asthetic) DELEGATES=`echo $DELEGATES | sed -e 's/ */ /g'` MAGICK_FEATURES=`echo $MAGICK_FEATURES | sed -e 's/ */ /g'` -AC_SUBST(DELEGATES) -AC_SUBST(MAGICK_FEATURES) +AC_SUBST([DELEGATES]) +AC_SUBST([MAGICK_FEATURES]) # # Handle special compiler flags @@ -3636,8 +3668,8 @@ else MAGICK_DEP_LIBS="$LIBS_USER $LIB_JBIG $LIB_WEBP $LIB_LCMS $LIB_TIFF $LIB_TTF $LIB_JP2 $LIB_JPEG $LIB_GS $LIB_PNG $LIB_FPX $LIB_WMF $LIB_DPS $LIB_XEXT $LIB_IPC $LIB_X11 $LIB_LZMA $LIB_BZLIB $LIB_XML $LIB_ZLIB $LIB_ZSTD $LIB_TRIO $LIB_GDI32 $LIB_MATH $LIB_THREAD $LIB_TCMALLOC $LIB_UMEM $LIB_MTMALLOC" fi MAGICK_EXTRA_DEP_LIBS="$LIB_OMP" # Extra libraries typically added due to CFLAGS -AC_SUBST(MAGICK_DEP_LIBS) -AC_SUBST(MAGICK_EXTRA_DEP_LIBS) +AC_SUBST([MAGICK_DEP_LIBS]) +AC_SUBST([MAGICK_EXTRA_DEP_LIBS]) # # Remove extraneous spaces from output variables (asthetic) @@ -3667,32 +3699,31 @@ MAGICK_API_DEP_LIBS=`echo $MAGICK_API_DEP_LIBS | sed -e 's/ */ /g'` MAGICK_API_LIBS=`echo $MAGICK_API_LIBS | sed -e 's/ */ /g'` # Save configure/build parameters for later reference -AC_DEFINE_UNQUOTED(GM_BUILD_CONFIGURE_ARGS,"$0 ${ac_configure_args}",[arguments passed to configure]) -AC_DEFINE_UNQUOTED(GM_BUILD_HOST,"${host}",[Host identification triplet]) -AC_DEFINE_UNQUOTED(GM_BUILD_CC,"${CC}",[C compiler used for compilation]) -AC_DEFINE_UNQUOTED(GM_BUILD_CXX,"${CXX}",[C++ compiler used for compilation]) -AC_DEFINE_UNQUOTED(GM_BUILD_CFLAGS,"${CFLAGS}",[CFLAGS used for C compilation]) -AC_DEFINE_UNQUOTED(GM_BUILD_CPPFLAGS,"${CPPFLAGS}",[CPPFLAGS used for preprocessing]) -AC_DEFINE_UNQUOTED(GM_BUILD_CXXFLAGS,"${CXXFLAGS}",[CXXFLAGS used for C++ compilation]) -AC_DEFINE_UNQUOTED(GM_BUILD_LDFLAGS,"${LDFLAGS}",[LDFLAGS used for linking]) -AC_DEFINE_UNQUOTED(GM_BUILD_LIBS,"${MAGICK_API_DEP_LIBS}",[LIBS used for linking]) +AC_DEFINE_UNQUOTED([GM_BUILD_CONFIGURE_ARGS],["$0 ${ac_configure_args}"],[arguments passed to configure]) +AC_DEFINE_UNQUOTED([GM_BUILD_HOST],["${host}"],[Host identification triplet]) +AC_DEFINE_UNQUOTED([GM_BUILD_CC],["${CC}"],[C compiler used for compilation]) +AC_DEFINE_UNQUOTED([GM_BUILD_CXX],["${CXX}"],[C++ compiler used for compilation]) +AC_DEFINE_UNQUOTED([GM_BUILD_CFLAGS],["${CFLAGS}"],[CFLAGS used for C compilation]) +AC_DEFINE_UNQUOTED([GM_BUILD_CPPFLAGS],["${CPPFLAGS}"],[CPPFLAGS used for preprocessing]) +AC_DEFINE_UNQUOTED([GM_BUILD_CXXFLAGS],["${CXXFLAGS}"],[CXXFLAGS used for C++ compilation]) +AC_DEFINE_UNQUOTED([GM_BUILD_LDFLAGS],["${LDFLAGS}"],[LDFLAGS used for linking]) +AC_DEFINE_UNQUOTED([GM_BUILD_LIBS],["${MAGICK_API_DEP_LIBS}"],[LIBS used for linking]) # Pass only user-provided LIBS as "global" libraries LIBS=$LIBS_USER -#AC_SUBST(CPPFLAGS) -AC_SUBST(X_CFLAGS) -#AC_SUBST(LDFLAGS) -#AC_SUBST(X_PRE_LIBS) -#AC_SUBST(X_LIBS) -#AC_SUBST(X_EXTRA_LIBS) - +#AC_SUBST([CPPFLAGS]) +AC_SUBST([X_CFLAGS]) +#AC_SUBST([LDFLAGS]) +#AC_SUBST([X_PRE_LIBS]) +#AC_SUBST([X_LIBS]) +#AC_SUBST([X_EXTRA_LIBS]) -AC_SUBST(MAGICK_API_CFLAGS) -AC_SUBST(MAGICK_API_CPPFLAGS) -AC_SUBST(MAGICK_API_PC_CPPFLAGS) -AC_SUBST(MAGICK_API_LDFLAGS) -AC_SUBST(MAGICK_API_LIBS) +AC_SUBST([MAGICK_API_CFLAGS]) +AC_SUBST([MAGICK_API_CPPFLAGS]) +AC_SUBST([MAGICK_API_PC_CPPFLAGS]) +AC_SUBST([MAGICK_API_LDFLAGS]) +AC_SUBST([MAGICK_API_LIBS]) AC_CONFIG_FILES(\ GraphicsMagick.spec \ @@ -3750,13 +3781,14 @@ printf "BZLIB --with-bzlib=$with_bzlib \t$have_bzlib\n" printf "DPS --with-dps=$with_dps \t$have_dps\n" printf "FlashPIX --with-fpx=$with_fpx \t$have_fpx\n" printf "FreeType 2.0 --with-ttf=$with_ttf \t$have_ttf\n" -printf "Ghostscript None \t$PSDelegate ($GSVersion)\n" +printf "Ghostscript --with-gs=$with_gs \t$PSDelegate ($GSVersion)\n" result_ghostscript_font_dir='none' if test "${ghostscript_font_dir}x" != 'x' then result_ghostscript_font_dir="$ghostscript_font_dir" fi printf "Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir\t$result_ghostscript_font_dir\n" +printf "Windows GDI32 --with-gdi32=$with_gdi32 \t$have_gdi32\n" printf "JBIG --with-jbig=$with_jbig \t$have_jbig\n" printf "JPEG v1 --with-jpeg=$with_jpeg \t$have_jpeg\n" printf "JPEG-2000 --with-jp2=$with_jp2 \t$have_jp2\n" diff --git a/locale/C.mgk b/locale/C.mgk index b7ebf44..1b90122 100644 --- a/locale/C.mgk +++ b/locale/C.mgk @@ -667,6 +667,9 @@ unbalanced graphic context push-pop + + unbalanced push-pop + too many coordinates @@ -694,6 +697,9 @@ unreasonable gradient image size + + unreasonable dash polygon length + unable to draw on image diff --git a/magick/Makefile.am b/magick/Makefile.am index 487fda6..9360146 100644 --- a/magick/Makefile.am +++ b/magick/Makefile.am @@ -248,6 +248,7 @@ MAGICK_INCLUDE_HDRS = \ magick/draw.h \ magick/effect.h \ magick/enhance.h \ + magick/enum_strings.h \ magick/error.h \ magick/forward.h \ magick/fx.h \ diff --git a/magick/analyze.c b/magick/analyze.c index 694b5c1..938d0fb 100644 --- a/magick/analyze.c +++ b/magick/analyze.c @@ -233,11 +233,10 @@ MagickExport RectangleInfo GetImageBoundingBox(const Image *image, #endif } } - if ((bounds.width != 0) || (bounds.height != 0)) - { - bounds.width-=(bounds.x-1); - bounds.height-=(bounds.y-1); - } + if (bounds.width != 0) + bounds.width-=(bounds.x-1); + if (bounds.height != 0) + bounds.height-=(bounds.y-1); if (bounds.x < 0) bounds.x=0; if (bounds.y < 0) diff --git a/magick/api.h b/magick/api.h index 8a51223..1ddb142 100644 --- a/magick/api.h +++ b/magick/api.h @@ -9,6 +9,12 @@ GraphicsMagick Application Programming Interface declarations. + Please notice that the header inclusion is designed such that the compiler + include path should include the parent directory of 'magick' and should not + include the directly where api.h resides. If the include path includes the + directory where api.h resides, then there may be conflicts with other + headers. + */ #if !defined(_MAGICK_API_H) @@ -75,6 +81,7 @@ extern "C" { #include "magick/effect.h" #include "magick/enhance.h" #include "magick/error.h" +#include "magick/enum_strings.h" #include "magick/fx.h" #include "magick/gem.h" #include "magick/gradient.h" diff --git a/magick/blob.c b/magick/blob.c index b517d6c..2216516 100644 --- a/magick/blob.c +++ b/magick/blob.c @@ -56,10 +56,10 @@ #include "magick/semaphore.h" #include "magick/tempfile.h" #include "magick/utility.h" -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) # include "zlib.h" #endif -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) # include "bzlib.h" #endif @@ -90,10 +90,10 @@ typedef enum typedef union _MagickFileHandle { FILE *std; /* stdio handle */ -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) BZFILE *bz; /* bzip handle */ #endif -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) gzFile gz; /* zlib handle */ #endif } MagickFileHandle; @@ -398,10 +398,10 @@ MagickExport void AttachBlob(BlobInfo *blob_info,const void *blob, blob_info->offset=0; blob_info->type=BlobStream; blob_info->handle.std=(FILE *) NULL; -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) blob_info->handle.bz=(BZFILE *) NULL; #endif -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) blob_info->handle.gz=(gzFile) NULL; #endif blob_info->data=(unsigned char *) blob; @@ -972,7 +972,7 @@ MagickExport MagickPassFail CloseBlob(Image *image) } case ZipStream: { -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) if (!(status)) { int @@ -991,7 +991,7 @@ MagickExport MagickPassFail CloseBlob(Image *image) } case BZipStream: { -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) if (!(status)) { int @@ -1062,7 +1062,7 @@ MagickExport MagickPassFail CloseBlob(Image *image) } case ZipStream: { -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) int gzerror_errnum; @@ -1078,7 +1078,7 @@ MagickExport MagickPassFail CloseBlob(Image *image) } case BZipStream: { -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) /* Returns void */ BZ2_bzclose(blob->handle.bz); #endif @@ -1272,10 +1272,10 @@ MagickExport void DetachBlob(BlobInfo *blob_info) blob_info->exempt=MagickFalse; blob_info->type=UndefinedStream; blob_info->handle.std=(FILE *) NULL; -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) blob_info->handle.bz=(BZFILE *) NULL; #endif -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) blob_info->handle.gz=(gzFile) NULL; #endif blob_info->data=(unsigned char *) NULL; @@ -1331,20 +1331,20 @@ MagickExport int EOFBlob(const Image *image) } case ZipStream: { -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) blob->eof=gzeof(blob->handle.gz); -#endif /* defined(HasZLIB) */ +#endif /* defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) */ break; } case BZipStream: { -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) int status; (void) BZ2_bzerror(blob->handle.bz,&status); blob->eof=status == BZ_UNEXPECTED_EOF; -#endif /* defined(HasBZLIB) */ +#endif /* defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) */ break; } case BlobStream: @@ -2394,7 +2394,7 @@ MagickExport MagickPassFail ImageToFile(Image *image,const char *filename, if (image->logging) (void) LogMagickEvent(BlobEvent,GetMagickModule(), - "Copying from Blob stream to file %s",filename); + "Copying from Blob stream to file \"%s\"...",filename); if (MagickConfirmAccess(FileWriteConfirmAccessMode,filename,exception) == MagickFail) return MagickFail; @@ -2425,8 +2425,11 @@ MagickExport MagickPassFail ImageToFile(Image *image,const char *filename, break; } (void) close(file); + if (image->logging) + (void) LogMagickEvent(BlobEvent,GetMagickModule(), + "Copyied %"MAGICK_SIZE_T_F"u bytes from Blob stream to \"%s\"",(MAGICK_SIZE_T) i,filename); MagickFreeMemory(buffer); - return(i < length); + return (i < length ? MagickFail : MagickPass); } /* @@ -2785,7 +2788,7 @@ MagickExport MagickPassFail OpenBlob(const ImageInfo *image_info,Image *image, FormMultiPartFilename(image,image_info); (void) strcpy(filename,image->filename); } -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) if (((strlen(filename) > 2) && (LocaleCompare(filename+strlen(filename)-2,".Z") == 0)) || ((strlen(filename) > 3) && @@ -2818,7 +2821,7 @@ MagickExport MagickPassFail OpenBlob(const ImageInfo *image_info,Image *image, } else #endif -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) if ((strlen(filename) > 4) && (LocaleCompare(filename+strlen(filename)-4,".bz2") == 0)) { @@ -2936,7 +2939,7 @@ MagickExport MagickPassFail OpenBlob(const ImageInfo *image_info,Image *image, " read %" MAGICK_SIZE_T_F "u magic header bytes", (MAGICK_SIZE_T) count); -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) if ((magick[0] == 0x1FU) && (magick[1] == 0x8BU) && (magick[2] == 0x08U)) { @@ -2953,7 +2956,7 @@ MagickExport MagickPassFail OpenBlob(const ImageInfo *image_info,Image *image, } } #endif -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) if (strncmp((char *) magick,"BZh",3) == 0) { if (image->blob->handle.std) @@ -3204,7 +3207,7 @@ MagickExport size_t ReadBlob(Image *image,const size_t length,void *data) } case ZipStream: { -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) size_t i; @@ -3254,7 +3257,7 @@ MagickExport size_t ReadBlob(Image *image,const size_t length,void *data) } case BZipStream: { -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) size_t i; @@ -4580,7 +4583,7 @@ MagickExport magick_off_t SeekBlob(Image *image,const magick_off_t offset, return(-1); case ZipStream: { -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) if (gzseek(image->blob->handle.gz,(off_t) offset,whence) < 0) return(-1); #endif @@ -4761,14 +4764,14 @@ static int SyncBlob(Image *image) } case ZipStream: { -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) status=gzflush(image->blob->handle.gz,Z_SYNC_FLUSH); #endif break; } case BZipStream: { -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) status=BZ2_bzflush(image->blob->handle.bz); #endif break; @@ -4829,7 +4832,7 @@ MagickExport magick_off_t TellBlob(const Image *image) case PipeStream: case ZipStream: { -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) offset=gztell(image->blob->handle.gz); #endif break; @@ -4970,7 +4973,7 @@ MagickExport size_t WriteBlob(Image *image,const size_t length,const void *data) } case ZipStream: { -#if defined(HasZLIB) +#if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) size_t i; @@ -5015,7 +5018,7 @@ MagickExport size_t WriteBlob(Image *image,const size_t length,const void *data) } case BZipStream: { -#if defined(HasBZLIB) +#if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) size_t i; diff --git a/magick/color.c b/magick/color.c index b955006..ec5a4ce 100644 --- a/magick/color.c +++ b/magick/color.c @@ -410,7 +410,7 @@ MagickExport MagickBool FuzzyColorMatch(const PixelPacket *p, % which specify the number of times each unique color occurs in the image. % The referenced colors parameter is updated with the number of unique colors % in the image. The returned array should be deallocated by the user once it -% is no longer ndded. +% is no longer needed. % % The format of the GetColorHistogram method is: % diff --git a/magick/command.c b/magick/command.c index 96a8285..04ee069 100644 --- a/magick/command.c +++ b/magick/command.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 - 2019 GraphicsMagick Group +% Copyright (C) 2003 - 2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % % This program is covered by multiple licenses, which are described in @@ -2263,21 +2263,15 @@ static OptionStatus CheckOptionValue(const char *option, const char *value) */ #define ThrowCompareException(code,reason,description) \ { \ - DestroyImageList(compare_image); \ - DestroyImageList(difference_image); \ - DestroyImageList(reference_image); \ + status=MagickFail; \ ThrowException(exception,code,reason,description); \ - LiberateArgumentList(argc,argv); \ - return(MagickFail); \ + goto compare_cleanup_and_return; \ } #define ThrowCompareException3(code,reason,description) \ { \ - DestroyImageList(compare_image); \ - DestroyImageList(difference_image); \ - DestroyImageList(reference_image); \ + status=MagickFail; \ ThrowException3(exception,code,reason,description); \ - LiberateArgumentList(argc,argv); \ - return(MagickFail); \ + goto compare_cleanup_and_return; \ } MagickExport MagickPassFail CompareImageCommand(ImageInfo *image_info, @@ -2302,6 +2296,12 @@ CompareImageCommand(ImageInfo *image_info, MetricType metric=UndefinedMetric; + enum { + UndefinedMatte, + IgnoreMatte, + StoreMatte + } matte=UndefinedMatte; + DifferenceImageOptions difference_options; @@ -2629,7 +2629,13 @@ CompareImageCommand(ImageInfo *image_info, case 'm': { if (LocaleCompare("matte",option+1) == 0) - break; + { + if (*option == '+') + matte=IgnoreMatte; + else + matte=StoreMatte; + break; + } if (LocaleCompare("maximum-error",option+1) == 0) { if (*option == '-') @@ -2729,7 +2735,7 @@ CompareImageCommand(ImageInfo *image_info, image_info->verbose+=(*option == '-'); break; } - if (LocaleCompare("verbose",option+1) == 0) + if (LocaleCompare("version",option+1) == 0) break; ThrowCompareException(OptionError,UnrecognizedOption,option) } @@ -2742,13 +2748,19 @@ CompareImageCommand(ImageInfo *image_info, if (compare_image == (Image *) NULL) { if (exception->severity == UndefinedException) - ThrowCompareException(OptionError,RequestDidNotReturnAnImage, - (char *) NULL); - return(MagickFail); + ThrowException(exception,OptionError,RequestDidNotReturnAnImage,(char *) NULL); + } + if (reference_image == (Image *) NULL) + { + if (exception->severity == UndefinedException) + ThrowException(exception,OptionError,MissingAnImageFilename,(char *) NULL); } if ((reference_image == (Image *) NULL) || (compare_image == (Image *) NULL)) - ThrowCompareException(OptionError,MissingAnImageFilename,(char *) NULL); + { + status=MagickFail; + goto compare_cleanup_and_return; + } /* Apply any user settings to images prior to compare. @@ -2765,6 +2777,24 @@ CompareImageCommand(ImageInfo *image_info, (void) TransformColorspace(compare_image,image_info->colorspace); } + if (matte != UndefinedMatte) + { + if (matte == IgnoreMatte) + { + reference_image->matte=MagickFalse; + compare_image->matte=MagickFalse; + } + else if (matte == StoreMatte) + { + if (reference_image->matte == MagickFalse) + SetImageOpacity(reference_image,OpaqueOpacity); + reference_image->matte=MagickTrue; + if (compare_image->matte == MagickFalse) + SetImageOpacity(compare_image,OpaqueOpacity); + compare_image->matte=MagickTrue; + } + } + if (metric != UndefinedMetric) { /* @@ -2836,6 +2866,8 @@ CompareImageCommand(ImageInfo *image_info, } } + compare_cleanup_and_return: + DestroyImageList(difference_image); DestroyImageList(reference_image); DestroyImageList(compare_image); @@ -3086,23 +3118,15 @@ static void LiberateCompositeOptions(CompositeOptions *option_info) #define NotInitialized (unsigned int) (~0) #define ThrowCompositeException(code,reason,description) \ { \ - LiberateCompositeOptions(&option_info); \ - DestroyImageList(image); \ - DestroyImageList(composite_image); \ - DestroyImageList(mask_image); \ + status=MagickFail; \ ThrowException(exception,code,reason,description); \ - LiberateArgumentList(argc,argv); \ - return(MagickFail); \ + goto composite_cleanup_and_return; \ } #define ThrowCompositeException3(code,reason,description) \ { \ - LiberateCompositeOptions(&option_info); \ - DestroyImageList(image); \ - DestroyImageList(composite_image); \ - DestroyImageList(mask_image); \ + status=MagickFail; \ ThrowException3(exception,code,reason,description); \ - LiberateArgumentList(argc,argv); \ - return(MagickFail); \ + goto composite_cleanup_and_return; \ } MagickExport MagickPassFail CompositeImageCommand(ImageInfo *image_info, int argc,char **argv,char **metadata,ExceptionInfo *exception) @@ -4001,7 +4025,7 @@ MagickExport MagickPassFail CompositeImageCommand(ImageInfo *image_info, image_info->verbose+=(*option == '-'); break; } - if (LocaleCompare("verbose",option+1) == 0) + if (LocaleCompare("version",option+1) == 0) break; if (LocaleCompare("virtual-pixel",option+1) == 0) { @@ -4065,9 +4089,9 @@ MagickExport MagickPassFail CompositeImageCommand(ImageInfo *image_info, if (image == (Image *) NULL) { if (exception->severity == UndefinedException) - ThrowCompositeException(OptionError,RequestDidNotReturnAnImage, - (char *) NULL); - return(MagickFail); + ThrowException(exception,OptionError,RequestDidNotReturnAnImage,(char *) NULL); + status=MagickFail; + goto composite_cleanup_and_return; } if (i != (argc-1)) ThrowCompositeException(OptionError,MissingAnImageFilename,(char *) NULL); @@ -4092,6 +4116,9 @@ MagickExport MagickPassFail CompositeImageCommand(ImageInfo *image_info, (void) ConcatenateString(&(*metadata),"\n"); MagickFreeMemory(text); } + + composite_cleanup_and_return: + LiberateCompositeOptions(&option_info); DestroyImageList(composite_image); DestroyImageList(mask_image); @@ -6026,7 +6053,7 @@ MagickExport MagickPassFail ConvertImageCommand(ImageInfo *image_info, image_info->verbose+=(*option == '-'); break; } - if (LocaleCompare("verbose",option+1) == 0) + if (LocaleCompare("version",option+1) == 0) break; if (LocaleCompare("view",option+1) == 0) { @@ -8624,7 +8651,7 @@ MagickExport MagickPassFail IdentifyImageCommand(ImageInfo *image_info, image_info->verbose+=(*option == '-'); break; } - if (LocaleCompare("verbose",option+1) == 0) + if (LocaleCompare("version",option+1) == 0) break; if (LocaleCompare("virtual-pixel",option+1) == 0) { @@ -9962,7 +9989,6 @@ MagickExport MagickPassFail MogrifyImage(const ImageInfo *image_info, { if (LocaleCompare("label",option+1) == 0) { - fprintf(stderr,"%d: Handling label\n",__LINE__); (void) SetImageAttribute(*image,"label",(char *) NULL); if (*option == '-') { @@ -15012,7 +15038,7 @@ MagickExport MagickPassFail MontageImageCommand(ImageInfo *image_info, image_info->verbose+=(*option == '-'); break; } - if (LocaleCompare("verbose",option+1) == 0) + if (LocaleCompare("version",option+1) == 0) break; if (LocaleCompare("virtual-pixel",option+1) == 0) { @@ -16959,9 +16985,9 @@ static MagickPassFail VersionCommand(ImageInfo *image_info, /* Ghostscript Library */ supported=MagickFalse; -#if defined(HasGS) +#if defined(HasGSLIB) supported=MagickTrue; -#endif /* defined(HasGS) */ +#endif /* defined(HasGSLIB) */ PrintFeature("Ghostscript (Library)", supported); /* JBIG */ diff --git a/magick/compress.c b/magick/compress.c index 500c6b8..bb47303 100644 --- a/magick/compress.c +++ b/magick/compress.c @@ -700,7 +700,7 @@ MagickExport MagickPassFail HuffmanDecodeImage(Image *image) } \ } MagickExport MagickPassFail HuffmanEncode2Image(const ImageInfo *image_info, - Image *image, WriteByteHook write_byte, void *info) + Image *image, WriteByteHook write_byte, void *info) { const HuffmanTable *entry; @@ -765,14 +765,19 @@ MagickExport MagickPassFail HuffmanEncode2Image(const ImageInfo *image_info, scanline=MagickAllocateMemory(unsigned char *,(size_t) width+1); if (scanline == (unsigned char *) NULL) ThrowBinaryException(ResourceLimitError,MemoryAllocationFailed, - (char *) NULL); + (char *) NULL); huffman_image=CloneImage(image,0,0,True,&image->exception); if (huffman_image == (Image *) NULL) { MagickFreeMemory(scanline); return(MagickFail); } - status &= SetImageType(huffman_image,BilevelType); + if (SetImageType(huffman_image,BilevelType) != MagickPass) + { + CopyException(&image->exception,&huffman_image->exception); + MagickFreeMemory(scanline); + return(MagickFail); + } byte=0; bit=0x80; if (is_fax == True) @@ -790,103 +795,107 @@ MagickExport MagickPassFail HuffmanEncode2Image(const ImageInfo *image_info, polarity=(PixelIntensity(&huffman_image->colormap[0]) < (MaxRGB/2)); if (huffman_image->colors == 2) polarity=(PixelIntensityToQuantum(&huffman_image->colormap[0]) < - PixelIntensityToQuantum(&huffman_image->colormap[1]) ? 0x00 : 0x01); + PixelIntensityToQuantum(&huffman_image->colormap[1]) ? 0x00 : 0x01); q=scanline; for (i=0; i < width; i++) /* was: for (i=(long) width; i > 0; i--) */ *q++=(unsigned char) polarity; q=scanline; for (y=0; y < huffman_image->rows; y++) - { - p=AcquireImagePixels(huffman_image,0,y,huffman_image->columns,1, - &huffman_image->exception); - if (p == (const PixelPacket *) NULL) - { - status=MagickFail; - break; - } - indexes=AccessImmutableIndexes(huffman_image); - for (x=0; x < huffman_image->columns; x++) - { - *q=(unsigned char) (indexes[x] == polarity ? !polarity : polarity); - q++; - } - /* - Huffman encode scanline. - */ - q=scanline; - for (n=(long) width; n > 0; ) { - /* - Output white run. - */ - for (runlength=0; ((n > 0) && (*q == polarity)); n--) - { - q++; - runlength++; - } - if (runlength >= 64) + p=AcquireImagePixels(huffman_image,0,y,huffman_image->columns,1, + &huffman_image->exception); + indexes=AccessImmutableIndexes(huffman_image); + if ((p == (const PixelPacket *) NULL) || + (indexes == (const IndexPacket *) NULL)) { - if (runlength < 1792) - entry=MWTable+(((size_t) runlength/64)-1); - else - entry=EXTable+(Min(runlength,2560)-1792)/64; - runlength-=entry->count; - HuffmanOutputCode(entry); + status=MagickFail; + break; + } + for (x=0; x < huffman_image->columns; x++) + { + *q=(unsigned char) (indexes[x] == polarity ? !polarity : polarity); + q++; } - entry=TWTable+Min(runlength,63); - HuffmanOutputCode(entry); - if (n != 0) + /* + Huffman encode scanline. + */ + q=scanline; + for (n=(long) width; n > 0; ) { /* - Output black run. + Output white run. */ - for (runlength=0; ((*q != polarity) && (n > 0)); n--) - { - q++; - runlength++; - } + for (runlength=0; ((n > 0) && (*q == polarity)); n--) + { + q++; + runlength++; + } if (runlength >= 64) { - entry=MBTable+(((size_t) runlength/64)-1); - if (runlength >= 1792) + if (runlength < 1792) + entry=MWTable+(((size_t) runlength/64)-1); + else entry=EXTable+(Min(runlength,2560)-1792)/64; runlength-=entry->count; HuffmanOutputCode(entry); } - entry=TBTable+Min(runlength,63); + entry=TWTable+Min(runlength,63); HuffmanOutputCode(entry); + if (n != 0) + { + /* + Output black run. + */ + for (runlength=0; ((*q != polarity) && (n > 0)); n--) + { + q++; + runlength++; + } + if (runlength >= 64) + { + entry=MBTable+(((size_t) runlength/64)-1); + if (runlength >= 1792) + entry=EXTable+(Min(runlength,2560)-1792)/64; + runlength-=entry->count; + HuffmanOutputCode(entry); + } + entry=TBTable+Min(runlength,63); + HuffmanOutputCode(entry); + } + } /* for (n=... */ + /* + End of line. + */ + for (k=0; k < 11; k++) + OutputBit(0); + OutputBit(1); + q=scanline; + if (huffman_image->previous == (Image *) NULL) + if (QuantumTick(y,huffman_image->rows)) + if (!MagickMonitorFormatted(y,huffman_image->rows,&image->exception, + "[%s] Huffman encode image...",image->filename)) + { + status=MagickFail; + break; + } + } /* for (y=... */ + if (status == MagickPass) + { + /* + End of page. + */ + for (i=0; i < 6; i++) + { + for (k=0; k < 11; k++) + OutputBit(0); + OutputBit(1); } + /* + Flush bits. + */ + if (bit != 0x80U) + (void) (*write_byte)(image,(magick_uint8_t)byte,info); } - /* - End of line. - */ - for (k=0; k < 11; k++) - OutputBit(0); - OutputBit(1); - q=scanline; - if (huffman_image->previous == (Image *) NULL) - if (QuantumTick(y,huffman_image->rows)) - if (!MagickMonitorFormatted(y,huffman_image->rows,&image->exception, - "[%s] Huffman encode image...",image->filename)) - { - status=MagickFail; - break; - } - } - /* - End of page. - */ - for (i=0; i < 6; i++) - { - for (k=0; k < 11; k++) - OutputBit(0); - OutputBit(1); - } - /* - Flush bits. - */ - if (bit != 0x80U) - (void) (*write_byte)(image,(magick_uint8_t)byte,info); DestroyImage(huffman_image); MagickFreeMemory(scanline); return(status); diff --git a/magick/constitute.c b/magick/constitute.c index 106d73a..7930ee4 100644 --- a/magick/constitute.c +++ b/magick/constitute.c @@ -189,6 +189,9 @@ MagickExport Image *ConstituteImage(const unsigned long width, size_t length; + unsigned int + storage_type_depth = QuantumDepth; + /* Allocate image structure. */ @@ -205,6 +208,18 @@ MagickExport Image *ConstituteImage(const unsigned long width, image->columns=width; image->rows=height; + switch (type) + { + case CharPixel : storage_type_depth = sizeof(unsigned char)*8 ; break; + case ShortPixel : storage_type_depth = sizeof(unsigned short)*8 ; break; + case IntegerPixel : storage_type_depth = sizeof(unsigned short)*8 ; break; + case LongPixel : storage_type_depth = sizeof(unsigned long)*8 ; break; + case FloatPixel : storage_type_depth = sizeof(float)*8 ; break; + case DoublePixel : storage_type_depth = sizeof(double)*8 ; break; + } + + image->depth = Min(storage_type_depth,QuantumDepth); + /* Handle a few common special cases in order to improve performance. */ @@ -1122,7 +1137,7 @@ MagickFindRawImageMinMax(Image *image, EndianType endian, *min=0.0; *max=1.0; - status=MagickFail; + status=MagickPass; filepos = TellBlob(image); @@ -1138,8 +1153,8 @@ MagickFindRawImageMinMax(Image *image, EndianType endian, read_func = ReadBlob; MagickFindMinMax(status,image,read_func,char,scanline_octets, - scanline_buffer,min,max) - break; + scanline_buffer,min,max); + break; } case ShortPixel: { @@ -1196,7 +1211,8 @@ MagickFindRawImageMinMax(Image *image, EndianType endian, } } - (void) SeekBlob(image, filepos, SEEK_SET); + if (SeekBlob(image, filepos, SEEK_SET) != filepos) + status = MagickFail; } return status; @@ -1586,7 +1602,14 @@ MagickExport Image *ReadImage(const ImageInfo *image_info, DestroyImage(image); return((Image *) NULL); } - (void) ImageToFile(image,clone_info->filename,exception); + if (ImageToFile(image,clone_info->filename,exception) == MagickFail) + { + LiberateTemporaryFile(clone_info->filename); + CloseBlob(image); + DestroyImageInfo(clone_info); + DestroyImage(image); + return(MagickFail); + } clone_info->temporary=True; } CloseBlob(image); diff --git a/magick/decorate.c b/magick/decorate.c index b2c0645..40f36ea 100644 --- a/magick/decorate.c +++ b/magick/decorate.c @@ -246,51 +246,54 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, */ height=(long) (frame_info->outer_bevel+(frame_info->y-bevel_width)+ frame_info->inner_bevel); - q=SetImagePixelsEx(frame_image,0,0,frame_image->columns,height,exception); - if (q != (PixelPacket *) NULL) + if (height > 0) { - for (y=0; y < frame_info->outer_bevel; y++) + q=SetImagePixelsEx(frame_image,0,0,frame_image->columns,height,exception); + if (q != (PixelPacket *) NULL) { - for (x=0; x < (long) (frame_image->columns-y); x++) - if (x < y) - *q++=highlight; - else - *q++=accentuate; - for ( ; x < (long) frame_image->columns; x++) - *q++=shadow; - } - for (y=0; y < (long) (frame_info->y-bevel_width); y++) - { - for (x=0; x < frame_info->outer_bevel; x++) - *q++=highlight; - width=(long) (frame_image->columns-2*frame_info->outer_bevel); - for (x=0; x < (long) width; x++) - *q++=matte; - for (x=0; x < frame_info->outer_bevel; x++) - *q++=shadow; - } - for (y=0; y < frame_info->inner_bevel; y++) - { - for (x=0; x < frame_info->outer_bevel; x++) - *q++=highlight; - for (x=0; x < (long) (frame_info->x-bevel_width); x++) - *q++=matte; - width=(long) (image->columns+(frame_info->inner_bevel << 1)-y); - for (x=0; x < width; x++) - if (x < y) - *q++=shadow; - else - *q++=trough; - for ( ; x < (long) (image->columns+(frame_info->inner_bevel << 1)); x++) - *q++=highlight; - width=(long) - (frame_info->width-frame_info->x-image->columns-bevel_width); - for (x=0; x < width; x++) - *q++=matte; - for (x=0; x < frame_info->outer_bevel; x++) - *q++=shadow; + for (y=0; y < frame_info->outer_bevel; y++) + { + for (x=0; x < (long) (frame_image->columns-y); x++) + if (x < y) + *q++=highlight; + else + *q++=accentuate; + for ( ; x < (long) frame_image->columns; x++) + *q++=shadow; + } + for (y=0; y < (long) (frame_info->y-bevel_width); y++) + { + for (x=0; x < frame_info->outer_bevel; x++) + *q++=highlight; + width=(long) (frame_image->columns-2*frame_info->outer_bevel); + for (x=0; x < (long) width; x++) + *q++=matte; + for (x=0; x < frame_info->outer_bevel; x++) + *q++=shadow; + } + for (y=0; y < frame_info->inner_bevel; y++) + { + for (x=0; x < frame_info->outer_bevel; x++) + *q++=highlight; + for (x=0; x < (long) (frame_info->x-bevel_width); x++) + *q++=matte; + width=(long) (image->columns+(frame_info->inner_bevel << 1)-y); + for (x=0; x < width; x++) + if (x < y) + *q++=shadow; + else + *q++=trough; + for ( ; x < (long) (image->columns+(frame_info->inner_bevel << 1)); x++) + *q++=highlight; + width=(long) + (frame_info->width-frame_info->x-image->columns-bevel_width); + for (x=0; x < width; x++) + *q++=matte; + for (x=0; x < frame_info->outer_bevel; x++) + *q++=shadow; + } + (void) SyncImagePixelsEx(frame_image,exception); } - (void) SyncImagePixelsEx(frame_image,exception); } /* Draw sides of ornamental border. @@ -380,50 +383,53 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, */ height=(long) (frame_info->inner_bevel+frame_info->height-frame_info->y- image->rows-bevel_width+frame_info->outer_bevel); - q=SetImagePixelsEx(frame_image,0,(long) (frame_image->rows-height), - frame_image->columns,height,exception); - if (q == (PixelPacket *) NULL) - return(frame_image); - for (y=frame_info->inner_bevel-1; y >= 0; y--) + if (height > 0) { - for (x=0; x < frame_info->outer_bevel; x++) - *q++=highlight; - for (x=0; x < (long) (frame_info->x-bevel_width); x++) - *q++=matte; - for (x=0; x < y; x++) - *q++=shadow; - for ( ; x < (long) (image->columns+(frame_info->inner_bevel << 1)); x++) - if (x >= (long) (image->columns+(frame_info->inner_bevel << 1)-y)) - *q++=highlight; - else - *q++=accentuate; - width=(long) (frame_info->width-frame_info->x-image->columns-bevel_width); - for (x=0; x < (long) width; x++) - *q++=matte; - for (x=0; x < frame_info->outer_bevel; x++) - *q++=shadow; - } - height=(long) (frame_info->height-frame_info->y-image->rows-bevel_width); - for (y=0; y < height; y++) - { - for (x=0; x < frame_info->outer_bevel; x++) - *q++=highlight; - for (x=0; x < (long) (frame_image->columns-2*frame_info->outer_bevel); x++) - *q++=matte; - for (x=0; x < frame_info->outer_bevel; x++) - *q++=shadow; - } - for (y=frame_info->outer_bevel-1; y >= 0; y--) - { - for (x=0; x < y; x++) - *q++=highlight; - for ( ; x < (long) frame_image->columns; x++) - if (x >= (long) (frame_image->columns-y)) - *q++=shadow; - else - *q++=trough; + q=SetImagePixelsEx(frame_image,0,(long) (frame_image->rows-height), + frame_image->columns,height,exception); + if (q == (PixelPacket *) NULL) + return(frame_image); + for (y=frame_info->inner_bevel-1; y >= 0; y--) + { + for (x=0; x < frame_info->outer_bevel; x++) + *q++=highlight; + for (x=0; x < (long) (frame_info->x-bevel_width); x++) + *q++=matte; + for (x=0; x < y; x++) + *q++=shadow; + for ( ; x < (long) (image->columns+(frame_info->inner_bevel << 1)); x++) + if (x >= (long) (image->columns+(frame_info->inner_bevel << 1)-y)) + *q++=highlight; + else + *q++=accentuate; + width=(long) (frame_info->width-frame_info->x-image->columns-bevel_width); + for (x=0; x < (long) width; x++) + *q++=matte; + for (x=0; x < frame_info->outer_bevel; x++) + *q++=shadow; + } + height=(long) (frame_info->height-frame_info->y-image->rows-bevel_width); + for (y=0; y < height; y++) + { + for (x=0; x < frame_info->outer_bevel; x++) + *q++=highlight; + for (x=0; x < (long) (frame_image->columns-2*frame_info->outer_bevel); x++) + *q++=matte; + for (x=0; x < frame_info->outer_bevel; x++) + *q++=shadow; + } + for (y=frame_info->outer_bevel-1; y >= 0; y--) + { + for (x=0; x < y; x++) + *q++=highlight; + for ( ; x < (long) frame_image->columns; x++) + if (x >= (long) (frame_image->columns-y)) + *q++=shadow; + else + *q++=trough; + } + (void) SyncImagePixelsEx(frame_image,exception); } - (void) SyncImagePixelsEx(frame_image,exception); frame_image->is_grayscale=is_grayscale; return(frame_image); diff --git a/magick/delegate.c b/magick/delegate.c index 9c4a60b..8777701 100644 --- a/magick/delegate.c +++ b/magick/delegate.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 - 2016 GraphicsMagick Group +% Copyright (C) 2003 - 2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % % This program is covered by multiple licenses, which are described in @@ -959,6 +959,11 @@ MagickExport MagickPassFail InvokePostscriptDelegate(const unsigned int verbose, const char *command,ExceptionInfo *exception) { + int + status; + +#if defined(HasGS) + register long i; @@ -968,10 +973,7 @@ InvokePostscriptDelegate(const unsigned int verbose, int argc; - int - status; - -#if defined(HasGS) || defined(MSWINDOWS) +#if (defined(HasGSLIB) || defined(MSWINDOWS)) gs_main_instance *interpreter; @@ -984,7 +986,7 @@ InvokePostscriptDelegate(const unsigned int verbose, *gs_func; gs_func=NTGhostscriptDLLVectors(); -#elif defined(HasGS) +#elif defined(HasGSLIB) GhostscriptVectors gs_func_struct; @@ -1075,7 +1077,7 @@ InvokePostscriptDelegate(const unsigned int verbose, "Returning with success"); return(MagickPass); } -#endif /* defined(HasGS) || defined(MSWINDOWS) */ +#endif /* defined(HasGSLIB) || defined(MSWINDOWS) */ status=MagickFail; { @@ -1114,6 +1116,18 @@ InvokePostscriptDelegate(const unsigned int verbose, MagickFreeMemory(argv); } } +#else + + /* + Ghostscript is not supported at all! + */ + (void) verbose; + (void) command; + (void) exception; + + status = MagickFail; + +#endif /* if defined(HasGS) */ (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Returning with %s", status == MagickFail ? @@ -1408,10 +1422,12 @@ static unsigned int ReadConfigureFile(const char *basename, path[MaxTextExtent]; BinPath[0]=0; +#if defined(HasGS) /* Substitute @PSDelegate@ with path to Ghostscript */ NTGhostscriptEXE(path,MaxTextExtent-1); SubstituteString((char **) &delegate_list->commands, "@PSDelegate@",path); +#endif /* if defined(HasGS) */ # if defined(UseInstalledMagick) # if defined(MagickBinPath) diff --git a/magick/delegate.h b/magick/delegate.h index 1c36260..b431d16 100644 --- a/magick/delegate.h +++ b/magick/delegate.h @@ -67,7 +67,7 @@ extern MagickExport MagickPassFail #if defined(MAGICK_IMPLEMENTATION) -#if defined(HasGS) +#if defined(HasGSLIB) #include "ghostscript/iapi.h" #endif diff --git a/magick/draw.c b/magick/draw.c index b4af40f..9f95543 100644 --- a/magick/draw.c +++ b/magick/draw.c @@ -4237,6 +4237,9 @@ MagickExport int DrawRender(const DrawContext context) CurrentContext->primitive = context->mvg; (void) LogMagickEvent(RenderEvent,GetMagickModule(),"MVG:\n'%s'\n",context->mvg); + /* SetImageAttribute concatenates values! Delete with NULL */ + (void) SetImageAttribute(context->image,"[MVG]",NULL); + (void) SetImageAttribute(context->image,"[MVG]",CurrentContext->primitive); (void) DrawImage(context->image, CurrentContext); CurrentContext->primitive = (char *) NULL; diff --git a/magick/effect.c b/magick/effect.c index 73f1da0..296ec60 100644 --- a/magick/effect.c +++ b/magick/effect.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2019 GraphicsMagick Group +% Copyright (C) 2003-2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % % This program is covered by multiple licenses, which are described in @@ -313,7 +313,8 @@ MagickExport Image *AdaptiveThresholdImage(const Image * image, * pre-computed data and only for pixels inside valid * domain */ - if ((y > (height/2 + height)) && (x >= width) && + if ((q != (PixelPacket *) NULL) && /* FIXME: May be patching over a bug! */ + (y > (height/2 + height)) && (x >= width) && (x < (image->columns + width))) { /* Left, Right, Upper, Bottom coord. to calculate the @@ -1018,7 +1019,7 @@ BlurImage(const Image *original_image,const double radius, MagickFreeMemory(kernel); - if (status != MagickFail) + if (blur_image != (Image *) NULL) blur_image->is_grayscale=original_image->is_grayscale; return(blur_image); @@ -1869,7 +1870,8 @@ MagickExport Image *DespeckleImage(const Image *image,ExceptionInfo *exception) return (Image *) NULL; } - despeckle_image->is_grayscale=image->is_grayscale; + if (despeckle_image != (Image *) NULL) + despeckle_image->is_grayscale=image->is_grayscale; return(despeckle_image); } @@ -1934,7 +1936,8 @@ MagickExport Image *EdgeImage(const Image *image,const double radius, kernel[i/2]=(double) width*width-1.0; edge_image=ConvolveImage(image,width,kernel,exception); MagickFreeMemory(kernel); - edge_image->is_grayscale=image->is_grayscale; + if (edge_image != (Image *) NULL) + edge_image->is_grayscale=image->is_grayscale; return(edge_image); } @@ -2250,7 +2253,8 @@ MagickExport Image *EnhanceImage(const Image *image,ExceptionInfo *exception) } } } - enhance_image->is_grayscale=image->is_grayscale; + if (enhance_image != (Image *) NULL) + enhance_image->is_grayscale=image->is_grayscale; return(enhance_image); } @@ -2333,7 +2337,8 @@ MagickExport Image *GaussianBlurImage(const Image *image,const double radius, } blur_image=ConvolveImage(image,width,kernel,exception); MagickFreeMemory(kernel); - blur_image->is_grayscale=image->is_grayscale; + if (blur_image != (Image *) NULL) + blur_image->is_grayscale=image->is_grayscale; return(blur_image); } @@ -2825,7 +2830,8 @@ MagickExport Image *MedianFilterImage(const Image *image,const double radius, } } DestroyThreadViewDataSet(data_set); - median_image->is_grayscale=image->is_grayscale; + if (median_image != (Image *) NULL) + median_image->is_grayscale=image->is_grayscale; return(median_image); } @@ -3108,7 +3114,8 @@ MagickExport Image *MotionBlurImage(const Image *image,const double radius, } MagickFreeMemory(kernel); MagickFreeMemory(offsets); - blur_image->is_grayscale=image->is_grayscale; + if (blur_image != (Image *) NULL) + blur_image->is_grayscale=image->is_grayscale; return(blur_image); } @@ -3644,6 +3651,8 @@ RandomChannelThresholdImage(Image *image,const char *channel, % */ +static PixelPacket GetNonpeakMedianList(MedianPixelList *pixel_list) MAGICK_FUNC_PURE; + static PixelPacket GetNonpeakMedianList(MedianPixelList *pixel_list) { PixelPacket @@ -3860,7 +3869,8 @@ MagickExport Image *ReduceNoiseImage(const Image *image,const double radius, } } DestroyThreadViewDataSet(data_set); - noise_image->is_grayscale=image->is_grayscale; + if (noise_image != (Image *) NULL) + noise_image->is_grayscale=image->is_grayscale; return(noise_image); } @@ -4071,9 +4081,12 @@ MagickExport Image *ShadeImage(const Image *image,const unsigned int gray, } } } - shade_image->is_grayscale=image->is_grayscale; - if (gray) - shade_image->is_grayscale=True; + if (shade_image != (Image *) NULL) + { + shade_image->is_grayscale=image->is_grayscale; + if (gray) + shade_image->is_grayscale=True; + } return(shade_image); } @@ -4156,7 +4169,8 @@ MagickExport Image *SharpenImage(const Image *image,const double radius, kernel[i/2]=(-2.0)*normalize; sharp_image=ConvolveImage(image,width,kernel,exception); MagickFreeMemory(kernel); - sharp_image->is_grayscale=image->is_grayscale; + if (sharp_image != (Image *) NULL) + sharp_image->is_grayscale=image->is_grayscale; return(sharp_image); } @@ -4432,8 +4446,11 @@ MagickExport Image *SpreadImage(const Image *image,const unsigned int radius, } } MagickFreeMemory(offsets); - spread_image->is_grayscale=image->is_grayscale; - spread_image->is_monochrome=image->is_monochrome; + if (spread_image != (Image *) NULL) + { + spread_image->is_grayscale=image->is_grayscale; + spread_image->is_monochrome=image->is_monochrome; + } return(spread_image); } diff --git a/magick/error.c b/magick/error.c index cfb57da..a0b9f02 100644 --- a/magick/error.c +++ b/magick/error.c @@ -303,6 +303,10 @@ static void DefaultErrorHandler(const ExceptionType severity,const char *reason, if (description != (char *) NULL) (void) fprintf(stderr," (%.1024s)",description); } + /* + FIXME: The following captures a random errno value rather than the + errno associated with the actual error. + */ if ((severity != OptionError) && errno) (void) fprintf(stderr," [%.1024s]",GetErrorMessageString(errno)); (void) fprintf(stderr,".\n"); @@ -664,7 +668,7 @@ MagickExport void MagickError(const ExceptionType error,const char *reason, % MagickFatalError() calls the fatal error handler methods with an error % reason. The fatal error handler is not expected to return! % -% The format of the MagickError method is: +% The format of the MagickFatalError method is: % % void MagickFatalError(const ExceptionType error,const char *reason, % const char *description) @@ -933,6 +937,7 @@ MagickExport WarningHandler SetWarningHandler(WarningHandler handler) MagickExport void ThrowException(ExceptionInfo *exception, const ExceptionType severity,const char *reason,const char *description) { + const int orig_errno=errno; assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); LockSemaphoreInfo(error_semaphore); @@ -952,7 +957,7 @@ MagickExport void ThrowException(ExceptionInfo *exception, MagickFreeMemory(exception->description); exception->description=new_description; } - exception->error_number=errno; + exception->error_number=orig_errno; MagickFreeMemory(exception->module); MagickFreeMemory(exception->function); exception->line=0UL; @@ -1013,6 +1018,7 @@ MagickExport void ThrowLoggedException(ExceptionInfo *exception, const char *function, const unsigned long line) { + const int orig_errno=errno; MagickBool ignore = MagickFalse; assert(exception != (ExceptionInfo *) NULL); assert(function != (const char *) NULL); @@ -1057,7 +1063,7 @@ MagickExport void ThrowLoggedException(ExceptionInfo *exception, exception->description=new_description; } - exception->error_number=errno; + exception->error_number=orig_errno; { char *new_module = NULL; if (module) diff --git a/magick/image.c b/magick/image.c index 5cbb5d3..8644edd 100644 --- a/magick/image.c +++ b/magick/image.c @@ -307,7 +307,8 @@ AddDefinitions(ImageInfo *image_info,const char *definitions, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % AllocateImage() returns a pointer to an image structure initialized to -% default values. +% default values. Currently a failure in this function results in a fatal +% error, resulting in program exit. % % The format of the AllocateImage method is: % @@ -332,17 +333,21 @@ MagickExport Image *AllocateImage(const ImageInfo *image_info) /* Allocate image structure. */ - allocate_image=MagickAllocateMemory(Image *,sizeof(Image)); + allocate_image=MagickAllocateClearedMemory(Image *,sizeof(Image)); if (allocate_image == (Image *) NULL) MagickFatalError3(ResourceLimitFatalError,MemoryAllocationFailed, UnableToAllocateImage); - (void) memset(allocate_image,0,sizeof(Image)); + + allocate_image->signature=MagickSignature; + allocate_image->semaphore=AllocateSemaphoreInfo(); /* Fatal errors on failure */ + allocate_image->reference_count=1; + /* Entry conditions for DestroyImage() are now satisfied */ /* allocate and initialize struct for extra Image members */ - ImgExtra = MagickAllocateMemory(ImageExtra *,sizeof(ImageExtra)); + ImgExtra = MagickAllocateClearedMemory(ImageExtra *,sizeof(ImageExtra)); if ( ImgExtra == (ImageExtra *) NULL ) - MagickFatalError3(ResourceLimitFatalError,MemoryAllocationFailed,UnableToAllocateImage); - memset(ImgExtra,0,sizeof(*ImgExtra)); + MagickFatalError3(ResourceLimitFatalError,MemoryAllocationFailed, + UnableToAllocateImage); allocate_image->extra = ImgExtra; /* @@ -365,17 +370,24 @@ MagickExport Image *AllocateImage(const ImageInfo *image_info) allocate_image->orientation=UndefinedOrientation; GetTimerInfo(&allocate_image->timer); GetCacheInfo(&allocate_image->cache); + if (allocate_image->cache == (_CacheInfoPtr_) NULL) + { + DestroyImage(allocate_image); + MagickFatalError3(ResourceLimitError,MemoryAllocationFailed, + UnableToAllocateImage); + } allocate_image->blob=CloneBlobInfo((BlobInfo *) NULL); allocate_image->logging=IsEventLogging(); allocate_image->is_monochrome=MagickTrue; allocate_image->is_grayscale=MagickTrue; - allocate_image->semaphore=AllocateSemaphoreInfo(); - LockSemaphoreInfo((SemaphoreInfo *) allocate_image->semaphore); - allocate_image->reference_count=1; - UnlockSemaphoreInfo((SemaphoreInfo *) allocate_image->semaphore); - allocate_image->signature=MagickSignature; allocate_image->default_views=AllocateThreadViewSet(allocate_image, &allocate_image->exception); + if (allocate_image->default_views == (_ThreadViewSetPtr_) NULL) + { + DestroyImage(allocate_image); + MagickFatalError3(ResourceLimitError,MemoryAllocationFailed, + UnableToAllocateImage); + } if (image_info == (ImageInfo *) NULL) return(allocate_image); /* @@ -444,7 +456,14 @@ MagickExport Image *AllocateImage(const ImageInfo *image_info) allocate_image->ping=image_info->ping; if (image_info->attributes != (Image *) NULL) - (void) CloneImageAttributes(allocate_image,image_info->attributes); + { + if (CloneImageAttributes(allocate_image,image_info->attributes) != MagickPass) + { + DestroyImage(allocate_image); + MagickFatalError3(ResourceLimitError,MemoryAllocationFailed, + UnableToAllocateImage); + } + } return(allocate_image); } @@ -464,6 +483,9 @@ MagickExport Image *AllocateImage(const ImageInfo *image_info) % default values. The next member of image points to the newly allocated % image. If there is a memory shortage, next is assigned NULL. % +% It is expected that the image next pointer is null, since otherwise +% there is likely to be a memory leak. In the future this may be enforced. +% % The format of the AllocateNextImage method is: % % void AllocateNextImage(const ImageInfo *image_info,Image *image) @@ -485,6 +507,9 @@ MagickExport void AllocateNextImage(const ImageInfo *image_info,Image *image) */ assert(image != (Image *) NULL); assert(image->signature == MagickSignature); +#if 0 + assert(image->next == (Image *) NULL); +#endif image->next=AllocateImage(image_info); if (image->next == (Image *) NULL) return; @@ -1078,9 +1103,6 @@ MagickExport Image *CloneImage(const Image *image,const unsigned long columns, ImageExtra *ImgExtra; - size_t - length; - /* Clone the image. */ @@ -1089,17 +1111,24 @@ MagickExport Image *CloneImage(const Image *image,const unsigned long columns, assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); - clone_image=MagickAllocateMemory(Image *,sizeof(Image)); + clone_image=MagickAllocateClearedMemory(Image *,sizeof(Image)); if (clone_image == (Image *) NULL) ThrowImageException3(ResourceLimitError,MemoryAllocationFailed, UnableToCloneImage); - (void) memset(clone_image,0,sizeof(Image)); + + clone_image->signature=MagickSignature; + clone_image->semaphore=AllocateSemaphoreInfo(); /* Fatal errors on failure */ + clone_image->reference_count=1; + /* Entry conditions for DestroyImage() are now satisfied */ /* allocate and initialize struct for extra Image members */ - ImgExtra = MagickAllocateMemory(ImageExtra *,sizeof(ImageExtra)); + ImgExtra = MagickAllocateClearedMemory(ImageExtra *,sizeof(ImageExtra)); if ( ImgExtra == (ImageExtra *) NULL ) - ThrowImageException3(ResourceLimitError,MemoryAllocationFailed,UnableToCloneImage); - memset(ImgExtra,0,sizeof(*ImgExtra)); + { + DestroyImage(clone_image); + ThrowImageException3(ResourceLimitError,MemoryAllocationFailed, + UnableToCloneImage); + } clone_image->extra = ImgExtra; clone_image->storage_class=image->storage_class; @@ -1115,20 +1144,25 @@ MagickExport Image *CloneImage(const Image *image,const unsigned long columns, clone_image->depth=image->depth; if (image->colormap != (PixelPacket *) NULL) { - /* - Allocate and copy the image colormap. - */ - clone_image->colors=image->colors; - length=image->colors*sizeof(PixelPacket); - clone_image->colormap=MagickAllocateMemory(PixelPacket *,length); - if (clone_image->colormap == (PixelPacket *) NULL) + size_t + length; + + length=MagickArraySize(image->colors,sizeof(PixelPacket)); + if (length != 0) { - DestroyImage(clone_image); - ThrowImageException3(ResourceLimitError,MemoryAllocationFailed, - UnableToCloneImage); + /* + Allocate and copy the image colormap. + */ + clone_image->colors=image->colors; + clone_image->colormap=MagickAllocateMemory(PixelPacket *,length); + if (clone_image->colormap == (PixelPacket *) NULL) + { + DestroyImage(clone_image); + ThrowImageException3(ResourceLimitError,MemoryAllocationFailed, + UnableToCloneImage); + } + (void) memcpy(clone_image->colormap,image->colormap,length); } - length=image->colors*sizeof(PixelPacket); - (void) memcpy(clone_image->colormap,image->colormap,length); } clone_image->background_color=image->background_color; clone_image->border_color=image->border_color; @@ -1139,7 +1173,14 @@ MagickExport Image *CloneImage(const Image *image,const unsigned long columns, Clone attached profiles. */ if (image->profiles) - clone_image->profiles=MagickMapCloneMap(image->profiles,exception); + { + clone_image->profiles=MagickMapCloneMap(image->profiles,exception); + if (clone_image->profiles == (void *) NULL) + { + DestroyImage(clone_image); + return (Image *) NULL; + } + } clone_image->orientation=image->orientation; clone_image->rendering_intent=image->rendering_intent; clone_image->units=image->units; @@ -1158,7 +1199,6 @@ MagickExport Image *CloneImage(const Image *image,const unsigned long columns, clone_image->endian=image->endian; clone_image->gravity=image->gravity; clone_image->compose=image->compose; - clone_image->signature=MagickSignature; (void) CloneImageAttributes(clone_image,image); clone_image->scene=image->scene; clone_image->dispose=image->dispose; @@ -1166,7 +1206,6 @@ MagickExport Image *CloneImage(const Image *image,const unsigned long columns, clone_image->iterations=image->iterations; clone_image->total_colors=image->total_colors; clone_image->error=image->error; - clone_image->semaphore=AllocateSemaphoreInfo(); clone_image->logging=image->logging; clone_image->timer=image->timer; GetExceptionInfo(&clone_image->exception); @@ -1180,9 +1219,6 @@ MagickExport Image *CloneImage(const Image *image,const unsigned long columns, MaxTextExtent); (void) strlcpy(clone_image->magick,image->magick,MaxTextExtent); (void) strlcpy(clone_image->filename,image->filename,MaxTextExtent); - LockSemaphoreInfo((SemaphoreInfo *) clone_image->semaphore); - clone_image->reference_count=1; - UnlockSemaphoreInfo((SemaphoreInfo *) clone_image->semaphore); clone_image->previous=(Image *) NULL; clone_image->list=(Image *) NULL; clone_image->next=(Image *) NULL; @@ -1380,6 +1416,10 @@ MagickExport ImageInfo *CloneImageInfo(const ImageInfo *image_info) % the image if the reference count becomes zero. There is no effect if the % image pointer is null. % +% In the interest of avoiding dangling pointers or memory leaks, the image +% previous and next pointers should be null when this function is called, +% and no other image should refer to it. In the future this may be enforced. +% % The format of the DestroyImage method is: % % void DestroyImage(Image *image) @@ -1429,13 +1469,23 @@ MagickExport void DestroyImage(Image *image) Destroy image pixel cache. */ DestroyImagePixels(image); - if (image->extra->clip_mask != (Image *) NULL) - DestroyImage(image->extra->clip_mask); - image->extra->clip_mask=(Image *) NULL; - if (image->extra->composite_mask != (Image *) NULL) - DestroyImage(image->extra->composite_mask); - image->extra->composite_mask=(Image *) NULL; - MagickFreeMemory(image->extra); + /* + Destroy ImageExtra + */ + if (image->extra != (ImageExtra *) NULL) + { + if (image->extra->clip_mask != (Image *) NULL) + { + DestroyImage(image->extra->clip_mask); + image->extra->clip_mask=(Image *) NULL; + } + if (image->extra->composite_mask != (Image *) NULL) + { + DestroyImage(image->extra->composite_mask); + image->extra->composite_mask=(Image *) NULL; + } + MagickFreeMemory(image->extra); + } MagickFreeMemory(image->montage); MagickFreeMemory(image->directory); MagickFreeMemory(image->colormap); @@ -2937,21 +2987,21 @@ SetImageInfo(ImageInfo *image_info,const unsigned int flags, static const char *virtual_delegates[] = { - "AUTOTRACE", - "BROWSE", - "EDIT", - "GS-COLOR", - "GS-COLOR+ALPHA", - "GS-GRAY", - "GS-MONO", - "LAUNCH", - "MPEG-ENCODE", - "PRINT", - "SCAN", - "SHOW", - "TMP", - "WIN", - NULL + "AUTOTRACE", + "BROWSE", + "EDIT", + "GS-COLOR", + "GS-COLOR+ALPHA", + "GS-GRAY", + "GS-MONO", + "LAUNCH", + "MPEG-ENCODE", + "PRINT", + "SCAN", + "SHOW", + "TMP", + "WIN", + NULL }; char @@ -3181,18 +3231,25 @@ SetImageInfo(ImageInfo *image_info,const unsigned int flags, /* Copy standard input or pipe to temporary file. */ - if(!AcquireTemporaryFileName(filename)) + if (!AcquireTemporaryFileName(filename)) { CloseBlob(image); DestroyImage(image); return(MagickFail); } - (void) ImageToFile(image,filename,exception); + if (ImageToFile(image,filename,exception) == MagickFail) + { + LiberateTemporaryFile(filename); + CloseBlob(image); + DestroyImage(image); + return(MagickFail); + } CloseBlob(image); (void) strcpy(image->filename,filename); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFail) { + LiberateTemporaryFile(filename); DestroyImage(image); return(MagickFail); } @@ -3309,7 +3366,7 @@ SetImageOpacityCallBack(void *mutable_data, /* User provided mutable dat } return MagickPass; } -MagickExport void SetImageOpacity(Image *image,const unsigned int opacity_val) +MagickExport MagickPassFail SetImageOpacity(Image *image,const unsigned int opacity_val) { const unsigned int opacity = opacity_val; @@ -3318,6 +3375,9 @@ MagickExport void SetImageOpacity(Image *image,const unsigned int opacity_val) is_grayscale, is_monochrome; + MagickPassFail + status = MagickPass; + assert(image != (Image *) NULL); assert(image->signature == MagickSignature); is_grayscale=image->is_grayscale; @@ -3329,10 +3389,10 @@ MagickExport void SetImageOpacity(Image *image,const unsigned int opacity_val) /* Attenuate existing opacity channel */ - (void) PixelIterateMonoModify(ModulateImageOpacityCallBack,NULL, - "[%s] Modulate opacity...", - NULL,&opacity,0,0,image->columns,image->rows, - image,&image->exception); + status&=PixelIterateMonoModify(ModulateImageOpacityCallBack,NULL, + "[%s] Modulate opacity...", + NULL,&opacity,0,0,image->columns,image->rows, + image,&image->exception); } else { @@ -3340,13 +3400,14 @@ MagickExport void SetImageOpacity(Image *image,const unsigned int opacity_val) Add new opacity channel or make existing opacity channel opaque */ image->matte=True; - (void) PixelIterateMonoModify(SetImageOpacityCallBack,NULL, - "[%s] Set opacity...", - NULL,&opacity,0,0,image->columns,image->rows, - image,&image->exception); + status&=PixelIterateMonoModify(SetImageOpacityCallBack,NULL, + "[%s] Set opacity...", + NULL,&opacity,0,0,image->columns,image->rows, + image,&image->exception); } image->is_grayscale=is_grayscale; image->is_monochrome=is_monochrome; + return status; } /* diff --git a/magick/image.h b/magick/image.h index 4344123..ed67c55 100644 --- a/magick/image.h +++ b/magick/image.h @@ -1074,6 +1074,7 @@ extern MagickExport MagickPassFail SetImageCompositeMask(Image *image,const Image *composite_mask), /*to support SVG masks*/ SetImageDepth(Image *image,const unsigned long), SetImageInfo(ImageInfo *image_info,const unsigned int flags,ExceptionInfo *exception), + SetImageOpacity(Image *,const unsigned int), SetImageType(Image *image,const ImageType), StripImage(Image *image), SyncImage(Image *image); @@ -1084,8 +1085,7 @@ extern MagickExport void DestroyImageInfo(ImageInfo *), GetImageException(Image *,ExceptionInfo *), GetImageInfo(ImageInfo *), - ModifyImage(Image **,ExceptionInfo *), - SetImageOpacity(Image *,const unsigned int); + ModifyImage(Image **,ExceptionInfo *); /* provide public access to the clip_mask member of Image */ extern MagickExport Image diff --git a/magick/list.c b/magick/list.c index 7be5fee..1ce2b64 100644 --- a/magick/list.c +++ b/magick/list.c @@ -768,10 +768,16 @@ MagickExport void ReplaceImageInList(Image **images,Image *image) assert((*images)->signature == MagickSignature); image->next=(*images)->next; if (image->next != (Image *) NULL) - image->next->previous=image; + { + image->next->previous=image; + (*images)->next=(Image *) NULL; + } image->previous=(*images)->previous; if (image->previous != (Image *) NULL) - image->previous->next=image; + { + image->previous->next=image; + (*images)->previous=(Image *) NULL; + } DestroyImage(*images); (*images)=image; } diff --git a/magick/locale_c.h b/magick/locale_c.h index 1110449..4488050 100644 --- a/magick/locale_c.h +++ b/magick/locale_c.h @@ -3,7 +3,7 @@ extern MagickExport const char *GetLocaleMessageFromID(const int) MAGICK_FUNC_CONST; -#define MAX_LOCALE_MSGS 583 +#define MAX_LOCALE_MSGS 585 #define MGK_BlobErrorUnableToCreateBlob 1 #define MGK_BlobErrorUnableToDeduceImageFormat 2 @@ -218,376 +218,378 @@ extern MagickExport const char *GetLocaleMessageFromID(const int) MAGICK_FUNC_CO #define MGK_DrawErrorUnableToDrawOnImage 211 #define MGK_DrawErrorUnableToPrint 212 #define MGK_DrawErrorUnbalancedGraphicContextPushPop 213 -#define MGK_DrawErrorUnreasonableGradientSize 214 -#define MGK_DrawErrorVectorPathTruncated 215 -#define MGK_DrawFatalErrorDefault 216 -#define MGK_DrawWarningNotARelativeURL 217 -#define MGK_DrawWarningNotCurrentlyPushingPatternDefinition 218 -#define MGK_DrawWarningURLNotFound 219 -#define MGK_FileOpenErrorUnableToCreateTemporaryFile 220 -#define MGK_FileOpenErrorUnableToOpenFile 221 -#define MGK_FileOpenErrorUnableToWriteFile 222 -#define MGK_FileOpenFatalErrorDefault 223 -#define MGK_FileOpenWarningDefault 224 -#define MGK_ImageErrorAngleIsDiscontinuous 225 -#define MGK_ImageErrorCMYKAImageLacksAlphaChannel 226 -#define MGK_ImageErrorColorspaceColorProfileMismatch 227 -#define MGK_ImageErrorImageColorspaceDiffers 228 -#define MGK_ImageErrorImageColorspaceMismatch 229 -#define MGK_ImageErrorImageDifferenceExceedsLimit 230 -#define MGK_ImageErrorImageDoesNotContainResolution 231 -#define MGK_ImageErrorImageIsNotColormapped 232 -#define MGK_ImageErrorImageOpacityDiffers 233 -#define MGK_ImageErrorImageSequenceIsRequired 234 -#define MGK_ImageErrorImageSizeDiffers 235 -#define MGK_ImageErrorInvalidColormapIndex 236 -#define MGK_ImageErrorLeftAndRightImageSizesDiffer 237 -#define MGK_ImageErrorNoImagesWereFound 238 -#define MGK_ImageErrorNoImagesWereLoaded 239 -#define MGK_ImageErrorNoLocaleImageAttribute 240 -#define MGK_ImageErrorTooManyClusters 241 -#define MGK_ImageErrorUnableToAppendImage 242 -#define MGK_ImageErrorUnableToAssignProfile 243 -#define MGK_ImageErrorUnableToAverageImage 244 -#define MGK_ImageErrorUnableToCoalesceImage 245 -#define MGK_ImageErrorUnableToCompareImages 246 -#define MGK_ImageErrorUnableToCreateImageMosaic 247 -#define MGK_ImageErrorUnableToCreateStereoImage 248 -#define MGK_ImageErrorUnableToDeconstructImageSequence 249 -#define MGK_ImageErrorUnableToExportImagePixels 250 -#define MGK_ImageErrorUnableToFlattenImage 251 -#define MGK_ImageErrorUnableToGetClipMask 252 -#define MGK_ImageErrorUnableToGetCompositeMask 253 -#define MGK_ImageErrorUnableToHandleImageChannel 254 -#define MGK_ImageErrorUnableToImportImagePixels 255 -#define MGK_ImageErrorUnableToResizeImage 256 -#define MGK_ImageErrorUnableToSegmentImage 257 -#define MGK_ImageErrorUnableToSetClipMask 258 -#define MGK_ImageErrorUnableToSetCompositeMask 259 -#define MGK_ImageErrorUnableToShearImage 260 -#define MGK_ImageErrorWidthOrHeightExceedsLimit 261 -#define MGK_ImageFatalErrorUnableToPersistKey 262 -#define MGK_ImageWarningDefault 263 -#define MGK_MissingDelegateErrorDPSLibraryIsNotAvailable 264 -#define MGK_MissingDelegateErrorFPXLibraryIsNotAvailable 265 -#define MGK_MissingDelegateErrorFreeTypeLibraryIsNotAvailable 266 -#define MGK_MissingDelegateErrorJPEGLibraryIsNotAvailable 267 -#define MGK_MissingDelegateErrorLCMSLibraryIsNotAvailable 268 -#define MGK_MissingDelegateErrorLZWEncodingNotEnabled 269 -#define MGK_MissingDelegateErrorNoDecodeDelegateForThisImageFormat 270 -#define MGK_MissingDelegateErrorNoEncodeDelegateForThisImageFormat 271 -#define MGK_MissingDelegateErrorTIFFLibraryIsNotAvailable 272 -#define MGK_MissingDelegateErrorXMLLibraryIsNotAvailable 273 -#define MGK_MissingDelegateErrorXWindowLibraryIsNotAvailable 274 -#define MGK_MissingDelegateErrorZipLibraryIsNotAvailable 275 -#define MGK_MissingDelegateFatalErrorDefault 276 -#define MGK_MissingDelegateWarningDefault 277 -#define MGK_ModuleErrorFailedToCloseModule 278 -#define MGK_ModuleErrorFailedToFindSymbol 279 -#define MGK_ModuleErrorUnableToLoadModule 280 -#define MGK_ModuleErrorUnableToRegisterImageFormat 281 -#define MGK_ModuleErrorUnrecognizedModule 282 -#define MGK_ModuleFatalErrorUnableToInitializeModuleLoader 283 -#define MGK_ModuleWarningDefault 284 -#define MGK_MonitorErrorDefault 285 -#define MGK_MonitorFatalErrorDefault 286 -#define MGK_MonitorFatalErrorUserRequestedTerminationBySignal 287 -#define MGK_MonitorWarningDefault 288 -#define MGK_OptionErrorBevelWidthIsNegative 289 -#define MGK_OptionErrorColorSeparatedImageRequired 290 -#define MGK_OptionErrorFrameIsLessThanImageSize 291 -#define MGK_OptionErrorGeometryDimensionsAreZero 292 -#define MGK_OptionErrorGeometryDoesNotContainImage 293 -#define MGK_OptionErrorHaldClutImageDimensionsInvalid 294 -#define MGK_OptionErrorImagesAreNotTheSameSize 295 -#define MGK_OptionErrorImageSizeMustExceedBevelWidth 296 -#define MGK_OptionErrorImageSmallerThanKernelWidth 297 -#define MGK_OptionErrorImageSmallerThanRadius 298 -#define MGK_OptionErrorImageWidthsOrHeightsDiffer 299 -#define MGK_OptionErrorInputImagesAlreadySpecified 300 -#define MGK_OptionErrorInvalidSubimageSpecification 301 -#define MGK_OptionErrorKernelRadiusIsTooSmall 302 -#define MGK_OptionErrorKernelWidthMustBeAnOddNumber 303 -#define MGK_OptionErrorMatrixIsNotSquare 304 -#define MGK_OptionErrorMatrixOrderOutOfRange 305 -#define MGK_OptionErrorMissingAnImageFilename 306 -#define MGK_OptionErrorMissingArgument 307 -#define MGK_OptionErrorMustSpecifyAnImageName 308 -#define MGK_OptionErrorMustSpecifyImageSize 309 -#define MGK_OptionErrorNoBlobDefined 310 -#define MGK_OptionErrorNoImagesDefined 311 -#define MGK_OptionErrorNonzeroWidthAndHeightRequired 312 -#define MGK_OptionErrorNoProfileNameWasGiven 313 -#define MGK_OptionErrorNullBlobArgument 314 -#define MGK_OptionErrorReferenceImageRequired 315 -#define MGK_OptionErrorReferenceIsNotMyType 316 -#define MGK_OptionErrorRegionAreaExceedsLimit 317 -#define MGK_OptionErrorRequestDidNotReturnAnImage 318 -#define MGK_OptionErrorSteganoImageRequired 319 -#define MGK_OptionErrorStereoImageRequired 320 -#define MGK_OptionErrorSubimageSpecificationReturnsNoImages 321 -#define MGK_OptionErrorTileNotBoundedByImageDimensions 322 -#define MGK_OptionErrorUnableToAddOrRemoveProfile 323 -#define MGK_OptionErrorUnableToAverageImageSequence 324 -#define MGK_OptionErrorUnableToBlurImage 325 -#define MGK_OptionErrorUnableToChopImage 326 -#define MGK_OptionErrorUnableToColorMatrixImage 327 -#define MGK_OptionErrorUnableToConstituteImage 328 -#define MGK_OptionErrorUnableToConvolveImage 329 -#define MGK_OptionErrorUnableToEdgeImage 330 -#define MGK_OptionErrorUnableToEqualizeImage 331 -#define MGK_OptionErrorUnableToFilterImage 332 -#define MGK_OptionErrorUnableToFormatImageMetadata 333 -#define MGK_OptionErrorUnableToFrameImage 334 -#define MGK_OptionErrorUnableToOilPaintImage 335 -#define MGK_OptionErrorUnableToPaintImage 336 -#define MGK_OptionErrorUnableToRaiseImage 337 -#define MGK_OptionErrorUnableToSharpenImage 338 -#define MGK_OptionErrorUnableToThresholdImage 339 -#define MGK_OptionErrorUnableToWaveImage 340 -#define MGK_OptionErrorUnrecognizedAttribute 341 -#define MGK_OptionErrorUnrecognizedChannelType 342 -#define MGK_OptionErrorUnrecognizedColor 343 -#define MGK_OptionErrorUnrecognizedColormapType 344 -#define MGK_OptionErrorUnrecognizedColorspace 345 -#define MGK_OptionErrorUnrecognizedCommand 346 -#define MGK_OptionErrorUnrecognizedComposeOperator 347 -#define MGK_OptionErrorUnrecognizedDisposeMethod 348 -#define MGK_OptionErrorUnrecognizedElement 349 -#define MGK_OptionErrorUnrecognizedEndianType 350 -#define MGK_OptionErrorUnrecognizedGravityType 351 -#define MGK_OptionErrorUnrecognizedHighlightStyle 352 -#define MGK_OptionErrorUnrecognizedImageCompression 353 -#define MGK_OptionErrorUnrecognizedImageFilter 354 -#define MGK_OptionErrorUnrecognizedImageFormat 355 -#define MGK_OptionErrorUnrecognizedImageMode 356 -#define MGK_OptionErrorUnrecognizedImageType 357 -#define MGK_OptionErrorUnrecognizedIntentType 358 -#define MGK_OptionErrorUnrecognizedInterlaceType 359 -#define MGK_OptionErrorUnrecognizedListType 360 -#define MGK_OptionErrorUnrecognizedMetric 361 -#define MGK_OptionErrorUnrecognizedModeType 362 -#define MGK_OptionErrorUnrecognizedNoiseType 363 -#define MGK_OptionErrorUnrecognizedOperator 364 -#define MGK_OptionErrorUnrecognizedOption 365 -#define MGK_OptionErrorUnrecognizedPerlMagickMethod 366 -#define MGK_OptionErrorUnrecognizedPixelMap 367 -#define MGK_OptionErrorUnrecognizedPreviewType 368 -#define MGK_OptionErrorUnrecognizedResourceType 369 -#define MGK_OptionErrorUnrecognizedType 370 -#define MGK_OptionErrorUnrecognizedUnitsType 371 -#define MGK_OptionErrorUnrecognizedVirtualPixelMethod 372 -#define MGK_OptionErrorUnsupportedSamplingFactor 373 -#define MGK_OptionErrorUsageError 374 -#define MGK_OptionFatalErrorInvalidColorspaceType 375 -#define MGK_OptionFatalErrorInvalidEndianType 376 -#define MGK_OptionFatalErrorInvalidImageType 377 -#define MGK_OptionFatalErrorInvalidInterlaceType 378 -#define MGK_OptionFatalErrorMissingAnImageFilename 379 -#define MGK_OptionFatalErrorMissingArgument 380 -#define MGK_OptionFatalErrorNoImagesWereLoaded 381 -#define MGK_OptionFatalErrorOptionLengthExceedsLimit 382 -#define MGK_OptionFatalErrorRequestDidNotReturnAnImage 383 -#define MGK_OptionFatalErrorUnableToOpenXServer 384 -#define MGK_OptionFatalErrorUnableToPersistKey 385 -#define MGK_OptionFatalErrorUnrecognizedColormapType 386 -#define MGK_OptionFatalErrorUnrecognizedColorspaceType 387 -#define MGK_OptionFatalErrorUnrecognizedDisposeMethod 388 -#define MGK_OptionFatalErrorUnrecognizedEndianType 389 -#define MGK_OptionFatalErrorUnrecognizedFilterType 390 -#define MGK_OptionFatalErrorUnrecognizedImageCompressionType 391 -#define MGK_OptionFatalErrorUnrecognizedImageType 392 -#define MGK_OptionFatalErrorUnrecognizedInterlaceType 393 -#define MGK_OptionFatalErrorUnrecognizedOption 394 -#define MGK_OptionFatalErrorUnrecognizedResourceType 395 -#define MGK_OptionFatalErrorUnrecognizedVirtualPixelMethod 396 -#define MGK_OptionWarningUnrecognizedColor 397 -#define MGK_RegistryErrorImageExpected 398 -#define MGK_RegistryErrorImageInfoExpected 399 -#define MGK_RegistryErrorStructureSizeMismatch 400 -#define MGK_RegistryErrorUnableToGetRegistryID 401 -#define MGK_RegistryErrorUnableToLocateImage 402 -#define MGK_RegistryErrorUnableToSetRegistry 403 -#define MGK_RegistryFatalErrorDefault 404 -#define MGK_RegistryWarningDefault 405 -#define MGK_ResourceLimitErrorCacheResourcesExhausted 406 -#define MGK_ResourceLimitErrorImagePixelHeightLimitExceeded 407 -#define MGK_ResourceLimitErrorImagePixelLimitExceeded 408 -#define MGK_ResourceLimitErrorImagePixelWidthLimitExceeded 409 -#define MGK_ResourceLimitErrorMemoryAllocationFailed 410 -#define MGK_ResourceLimitErrorNexusPixelHeightLimitExceeded 411 -#define MGK_ResourceLimitErrorNexusPixelLimitExceeded 412 -#define MGK_ResourceLimitErrorNexusPixelWidthLimitExceeded 413 -#define MGK_ResourceLimitErrorNoPixelsDefinedInCache 414 -#define MGK_ResourceLimitErrorPixelCacheAllocationFailed 415 -#define MGK_ResourceLimitErrorUnableToAddColorProfile 416 -#define MGK_ResourceLimitErrorUnableToAddGenericProfile 417 -#define MGK_ResourceLimitErrorUnableToAddIPTCProfile 418 -#define MGK_ResourceLimitErrorUnableToAddOrRemoveProfile 419 -#define MGK_ResourceLimitErrorUnableToAllocateCoefficients 420 -#define MGK_ResourceLimitErrorUnableToAllocateColormap 421 -#define MGK_ResourceLimitErrorUnableToAllocateICCProfile 422 -#define MGK_ResourceLimitErrorUnableToAllocateImage 423 -#define MGK_ResourceLimitErrorUnableToAllocateString 424 -#define MGK_ResourceLimitErrorUnableToAnnotateImage 425 -#define MGK_ResourceLimitErrorUnableToAverageImageSequence 426 -#define MGK_ResourceLimitErrorUnableToCloneDrawingWand 427 -#define MGK_ResourceLimitErrorUnableToCloneImage 428 -#define MGK_ResourceLimitErrorUnableToComputeImageSignature 429 -#define MGK_ResourceLimitErrorUnableToConstituteImage 430 -#define MGK_ResourceLimitErrorUnableToConvertFont 431 -#define MGK_ResourceLimitErrorUnableToConvertStringToTokens 432 -#define MGK_ResourceLimitErrorUnableToCreateColormap 433 -#define MGK_ResourceLimitErrorUnableToCreateColorTransform 434 -#define MGK_ResourceLimitErrorUnableToCreateCommandWidget 435 -#define MGK_ResourceLimitErrorUnableToCreateImageGroup 436 -#define MGK_ResourceLimitErrorUnableToCreateImageMontage 437 -#define MGK_ResourceLimitErrorUnableToCreateXWindow 438 -#define MGK_ResourceLimitErrorUnableToCropImage 439 -#define MGK_ResourceLimitErrorUnableToDespeckleImage 440 -#define MGK_ResourceLimitErrorUnableToDetermineImageClass 441 -#define MGK_ResourceLimitErrorUnableToDetermineTheNumberOfImageColors 442 -#define MGK_ResourceLimitErrorUnableToDitherImage 443 -#define MGK_ResourceLimitErrorUnableToDrawOnImage 444 -#define MGK_ResourceLimitErrorUnableToEdgeImage 445 -#define MGK_ResourceLimitErrorUnableToEmbossImage 446 -#define MGK_ResourceLimitErrorUnableToEnhanceImage 447 -#define MGK_ResourceLimitErrorUnableToFloodfillImage 448 -#define MGK_ResourceLimitErrorUnableToGammaCorrectImage 449 -#define MGK_ResourceLimitErrorUnableToGetBestIconSize 450 -#define MGK_ResourceLimitErrorUnableToGetFromRegistry 451 -#define MGK_ResourceLimitErrorUnableToGetPackageInfo 452 -#define MGK_ResourceLimitErrorUnableToLevelImage 453 -#define MGK_ResourceLimitErrorUnableToMagnifyImage 454 -#define MGK_ResourceLimitErrorUnableToManageColor 455 -#define MGK_ResourceLimitErrorUnableToMapImage 456 -#define MGK_ResourceLimitErrorUnableToMapImageSequence 457 -#define MGK_ResourceLimitErrorUnableToMedianFilterImage 458 -#define MGK_ResourceLimitErrorUnableToMotionBlurImage 459 -#define MGK_ResourceLimitErrorUnableToNoiseFilterImage 460 -#define MGK_ResourceLimitErrorUnableToNormalizeImage 461 -#define MGK_ResourceLimitErrorUnableToOpenColorProfile 462 -#define MGK_ResourceLimitErrorUnableToQuantizeImage 463 -#define MGK_ResourceLimitErrorUnableToQuantizeImageSequence 464 -#define MGK_ResourceLimitErrorUnableToReadTextChunk 465 -#define MGK_ResourceLimitErrorUnableToReadXImage 466 -#define MGK_ResourceLimitErrorUnableToReadXServerColormap 467 -#define MGK_ResourceLimitErrorUnableToResizeImage 468 -#define MGK_ResourceLimitErrorUnableToRotateImage 469 -#define MGK_ResourceLimitErrorUnableToSampleImage 470 -#define MGK_ResourceLimitErrorUnableToScaleImage 471 -#define MGK_ResourceLimitErrorUnableToSelectImage 472 -#define MGK_ResourceLimitErrorUnableToSharpenImage 473 -#define MGK_ResourceLimitErrorUnableToShaveImage 474 -#define MGK_ResourceLimitErrorUnableToShearImage 475 -#define MGK_ResourceLimitErrorUnableToSortImageColormap 476 -#define MGK_ResourceLimitErrorUnableToThresholdImage 477 -#define MGK_ResourceLimitErrorUnableToTransformColorspace 478 -#define MGK_ResourceLimitFatalErrorMemoryAllocationFailed 479 -#define MGK_ResourceLimitFatalErrorSemaporeOperationFailed 480 -#define MGK_ResourceLimitFatalErrorUnableToAllocateAscii85Info 481 -#define MGK_ResourceLimitFatalErrorUnableToAllocateCacheInfo 482 -#define MGK_ResourceLimitFatalErrorUnableToAllocateCacheView 483 -#define MGK_ResourceLimitFatalErrorUnableToAllocateColorInfo 484 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDashPattern 485 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDelegateInfo 486 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDerivatives 487 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawContext 488 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawInfo 489 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawingWand 490 -#define MGK_ResourceLimitFatalErrorUnableToAllocateGammaMap 491 -#define MGK_ResourceLimitFatalErrorUnableToAllocateImage 492 -#define MGK_ResourceLimitFatalErrorUnableToAllocateImagePixels 493 -#define MGK_ResourceLimitFatalErrorUnableToAllocateLogInfo 494 -#define MGK_ResourceLimitFatalErrorUnableToAllocateMagicInfo 495 -#define MGK_ResourceLimitFatalErrorUnableToAllocateMagickInfo 496 -#define MGK_ResourceLimitFatalErrorUnableToAllocateMagickMap 497 -#define MGK_ResourceLimitFatalErrorUnableToAllocateModuleInfo 498 -#define MGK_ResourceLimitFatalErrorUnableToAllocateMontageInfo 499 -#define MGK_ResourceLimitFatalErrorUnableToAllocateQuantizeInfo 500 -#define MGK_ResourceLimitFatalErrorUnableToAllocateRandomKernel 501 -#define MGK_ResourceLimitFatalErrorUnableToAllocateRegistryInfo 502 -#define MGK_ResourceLimitFatalErrorUnableToAllocateSemaphoreInfo 503 -#define MGK_ResourceLimitFatalErrorUnableToAllocateString 504 -#define MGK_ResourceLimitFatalErrorUnableToAllocateTypeInfo 505 -#define MGK_ResourceLimitFatalErrorUnableToAllocateWand 506 -#define MGK_ResourceLimitFatalErrorUnableToAnimateImageSequence 507 -#define MGK_ResourceLimitFatalErrorUnableToCloneBlobInfo 508 -#define MGK_ResourceLimitFatalErrorUnableToCloneCacheInfo 509 -#define MGK_ResourceLimitFatalErrorUnableToCloneImage 510 -#define MGK_ResourceLimitFatalErrorUnableToCloneImageInfo 511 -#define MGK_ResourceLimitFatalErrorUnableToConcatenateString 512 -#define MGK_ResourceLimitFatalErrorUnableToConvertText 513 -#define MGK_ResourceLimitFatalErrorUnableToCreateColormap 514 -#define MGK_ResourceLimitFatalErrorUnableToDestroySemaphore 515 -#define MGK_ResourceLimitFatalErrorUnableToDisplayImage 516 -#define MGK_ResourceLimitFatalErrorUnableToEscapeString 517 -#define MGK_ResourceLimitFatalErrorUnableToInitializeSemaphore 518 -#define MGK_ResourceLimitFatalErrorUnableToInterpretMSLImage 519 -#define MGK_ResourceLimitFatalErrorUnableToLockSemaphore 520 -#define MGK_ResourceLimitFatalErrorUnableToObtainRandomEntropy 521 -#define MGK_ResourceLimitFatalErrorUnableToUnlockSemaphore 522 -#define MGK_ResourceLimitWarningMemoryAllocationFailed 523 -#define MGK_StreamErrorImageDoesNotContainTheStreamGeometry 524 -#define MGK_StreamErrorNoStreamHandlerIsDefined 525 -#define MGK_StreamErrorPixelCacheIsNotOpen 526 -#define MGK_StreamErrorUnableToAcquirePixelStream 527 -#define MGK_StreamErrorUnableToSetPixelStream 528 -#define MGK_StreamErrorUnableToSyncPixelStream 529 -#define MGK_StreamFatalErrorDefault 530 -#define MGK_StreamWarningDefault 531 -#define MGK_TypeErrorFontNotSpecified 532 -#define MGK_TypeErrorFontSubstitutionRequired 533 -#define MGK_TypeErrorUnableToGetTypeMetrics 534 -#define MGK_TypeErrorUnableToInitializeFreetypeLibrary 535 -#define MGK_TypeErrorUnableToReadFont 536 -#define MGK_TypeErrorUnrecognizedFontEncoding 537 -#define MGK_TypeFatalErrorDefault 538 -#define MGK_TypeWarningDefault 539 -#define MGK_WandErrorInvalidColormapIndex 540 -#define MGK_WandErrorWandAPINotImplemented 541 -#define MGK_WandErrorWandContainsNoImageIndexs 542 -#define MGK_WandErrorWandContainsNoImages 543 -#define MGK_XServerErrorColorIsNotKnownToServer 544 -#define MGK_XServerErrorNoWindowWithSpecifiedIDExists 545 -#define MGK_XServerErrorStandardColormapIsNotInitialized 546 -#define MGK_XServerErrorUnableToConnectToRemoteDisplay 547 -#define MGK_XServerErrorUnableToCreateBitmap 548 -#define MGK_XServerErrorUnableToCreateColormap 549 -#define MGK_XServerErrorUnableToCreatePixmap 550 -#define MGK_XServerErrorUnableToCreateProperty 551 -#define MGK_XServerErrorUnableToCreateStandardColormap 552 -#define MGK_XServerErrorUnableToDisplayImageInfo 553 -#define MGK_XServerErrorUnableToGetProperty 554 -#define MGK_XServerErrorUnableToGetStandardColormap 555 -#define MGK_XServerErrorUnableToGetVisual 556 -#define MGK_XServerErrorUnableToGrabMouse 557 -#define MGK_XServerErrorUnableToLoadFont 558 -#define MGK_XServerErrorUnableToMatchVisualToStandardColormap 559 -#define MGK_XServerErrorUnableToOpenXServer 560 -#define MGK_XServerErrorUnableToReadXAttributes 561 -#define MGK_XServerErrorUnableToReadXWindowImage 562 -#define MGK_XServerErrorUnrecognizedColormapType 563 -#define MGK_XServerErrorUnrecognizedGravityType 564 -#define MGK_XServerErrorUnrecognizedVisualSpecifier 565 -#define MGK_XServerFatalErrorUnableToAllocateXHints 566 -#define MGK_XServerFatalErrorUnableToCreateCursor 567 -#define MGK_XServerFatalErrorUnableToCreateGraphicContext 568 -#define MGK_XServerFatalErrorUnableToCreateStandardColormap 569 -#define MGK_XServerFatalErrorUnableToCreateTextProperty 570 -#define MGK_XServerFatalErrorUnableToCreateXImage 571 -#define MGK_XServerFatalErrorUnableToCreateXPixmap 572 -#define MGK_XServerFatalErrorUnableToCreateXWindow 573 -#define MGK_XServerFatalErrorUnableToDisplayImage 574 -#define MGK_XServerFatalErrorUnableToDitherImage 575 -#define MGK_XServerFatalErrorUnableToGetPixelInfo 576 -#define MGK_XServerFatalErrorUnableToGetVisual 577 -#define MGK_XServerFatalErrorUnableToLoadFont 578 -#define MGK_XServerFatalErrorUnableToMakeXWindow 579 -#define MGK_XServerFatalErrorUnableToOpenXServer 580 -#define MGK_XServerFatalErrorUnableToViewFonts 581 -#define MGK_XServerWarningUnableToGetVisual 582 -#define MGK_XServerWarningUsingDefaultVisual 583 +#define MGK_DrawErrorUnbalancedPushPop 214 +#define MGK_DrawErrorUnreasonableDashPolygonLength 215 +#define MGK_DrawErrorUnreasonableGradientSize 216 +#define MGK_DrawErrorVectorPathTruncated 217 +#define MGK_DrawFatalErrorDefault 218 +#define MGK_DrawWarningNotARelativeURL 219 +#define MGK_DrawWarningNotCurrentlyPushingPatternDefinition 220 +#define MGK_DrawWarningURLNotFound 221 +#define MGK_FileOpenErrorUnableToCreateTemporaryFile 222 +#define MGK_FileOpenErrorUnableToOpenFile 223 +#define MGK_FileOpenErrorUnableToWriteFile 224 +#define MGK_FileOpenFatalErrorDefault 225 +#define MGK_FileOpenWarningDefault 226 +#define MGK_ImageErrorAngleIsDiscontinuous 227 +#define MGK_ImageErrorCMYKAImageLacksAlphaChannel 228 +#define MGK_ImageErrorColorspaceColorProfileMismatch 229 +#define MGK_ImageErrorImageColorspaceDiffers 230 +#define MGK_ImageErrorImageColorspaceMismatch 231 +#define MGK_ImageErrorImageDifferenceExceedsLimit 232 +#define MGK_ImageErrorImageDoesNotContainResolution 233 +#define MGK_ImageErrorImageIsNotColormapped 234 +#define MGK_ImageErrorImageOpacityDiffers 235 +#define MGK_ImageErrorImageSequenceIsRequired 236 +#define MGK_ImageErrorImageSizeDiffers 237 +#define MGK_ImageErrorInvalidColormapIndex 238 +#define MGK_ImageErrorLeftAndRightImageSizesDiffer 239 +#define MGK_ImageErrorNoImagesWereFound 240 +#define MGK_ImageErrorNoImagesWereLoaded 241 +#define MGK_ImageErrorNoLocaleImageAttribute 242 +#define MGK_ImageErrorTooManyClusters 243 +#define MGK_ImageErrorUnableToAppendImage 244 +#define MGK_ImageErrorUnableToAssignProfile 245 +#define MGK_ImageErrorUnableToAverageImage 246 +#define MGK_ImageErrorUnableToCoalesceImage 247 +#define MGK_ImageErrorUnableToCompareImages 248 +#define MGK_ImageErrorUnableToCreateImageMosaic 249 +#define MGK_ImageErrorUnableToCreateStereoImage 250 +#define MGK_ImageErrorUnableToDeconstructImageSequence 251 +#define MGK_ImageErrorUnableToExportImagePixels 252 +#define MGK_ImageErrorUnableToFlattenImage 253 +#define MGK_ImageErrorUnableToGetClipMask 254 +#define MGK_ImageErrorUnableToGetCompositeMask 255 +#define MGK_ImageErrorUnableToHandleImageChannel 256 +#define MGK_ImageErrorUnableToImportImagePixels 257 +#define MGK_ImageErrorUnableToResizeImage 258 +#define MGK_ImageErrorUnableToSegmentImage 259 +#define MGK_ImageErrorUnableToSetClipMask 260 +#define MGK_ImageErrorUnableToSetCompositeMask 261 +#define MGK_ImageErrorUnableToShearImage 262 +#define MGK_ImageErrorWidthOrHeightExceedsLimit 263 +#define MGK_ImageFatalErrorUnableToPersistKey 264 +#define MGK_ImageWarningDefault 265 +#define MGK_MissingDelegateErrorDPSLibraryIsNotAvailable 266 +#define MGK_MissingDelegateErrorFPXLibraryIsNotAvailable 267 +#define MGK_MissingDelegateErrorFreeTypeLibraryIsNotAvailable 268 +#define MGK_MissingDelegateErrorJPEGLibraryIsNotAvailable 269 +#define MGK_MissingDelegateErrorLCMSLibraryIsNotAvailable 270 +#define MGK_MissingDelegateErrorLZWEncodingNotEnabled 271 +#define MGK_MissingDelegateErrorNoDecodeDelegateForThisImageFormat 272 +#define MGK_MissingDelegateErrorNoEncodeDelegateForThisImageFormat 273 +#define MGK_MissingDelegateErrorTIFFLibraryIsNotAvailable 274 +#define MGK_MissingDelegateErrorXMLLibraryIsNotAvailable 275 +#define MGK_MissingDelegateErrorXWindowLibraryIsNotAvailable 276 +#define MGK_MissingDelegateErrorZipLibraryIsNotAvailable 277 +#define MGK_MissingDelegateFatalErrorDefault 278 +#define MGK_MissingDelegateWarningDefault 279 +#define MGK_ModuleErrorFailedToCloseModule 280 +#define MGK_ModuleErrorFailedToFindSymbol 281 +#define MGK_ModuleErrorUnableToLoadModule 282 +#define MGK_ModuleErrorUnableToRegisterImageFormat 283 +#define MGK_ModuleErrorUnrecognizedModule 284 +#define MGK_ModuleFatalErrorUnableToInitializeModuleLoader 285 +#define MGK_ModuleWarningDefault 286 +#define MGK_MonitorErrorDefault 287 +#define MGK_MonitorFatalErrorDefault 288 +#define MGK_MonitorFatalErrorUserRequestedTerminationBySignal 289 +#define MGK_MonitorWarningDefault 290 +#define MGK_OptionErrorBevelWidthIsNegative 291 +#define MGK_OptionErrorColorSeparatedImageRequired 292 +#define MGK_OptionErrorFrameIsLessThanImageSize 293 +#define MGK_OptionErrorGeometryDimensionsAreZero 294 +#define MGK_OptionErrorGeometryDoesNotContainImage 295 +#define MGK_OptionErrorHaldClutImageDimensionsInvalid 296 +#define MGK_OptionErrorImagesAreNotTheSameSize 297 +#define MGK_OptionErrorImageSizeMustExceedBevelWidth 298 +#define MGK_OptionErrorImageSmallerThanKernelWidth 299 +#define MGK_OptionErrorImageSmallerThanRadius 300 +#define MGK_OptionErrorImageWidthsOrHeightsDiffer 301 +#define MGK_OptionErrorInputImagesAlreadySpecified 302 +#define MGK_OptionErrorInvalidSubimageSpecification 303 +#define MGK_OptionErrorKernelRadiusIsTooSmall 304 +#define MGK_OptionErrorKernelWidthMustBeAnOddNumber 305 +#define MGK_OptionErrorMatrixIsNotSquare 306 +#define MGK_OptionErrorMatrixOrderOutOfRange 307 +#define MGK_OptionErrorMissingAnImageFilename 308 +#define MGK_OptionErrorMissingArgument 309 +#define MGK_OptionErrorMustSpecifyAnImageName 310 +#define MGK_OptionErrorMustSpecifyImageSize 311 +#define MGK_OptionErrorNoBlobDefined 312 +#define MGK_OptionErrorNoImagesDefined 313 +#define MGK_OptionErrorNonzeroWidthAndHeightRequired 314 +#define MGK_OptionErrorNoProfileNameWasGiven 315 +#define MGK_OptionErrorNullBlobArgument 316 +#define MGK_OptionErrorReferenceImageRequired 317 +#define MGK_OptionErrorReferenceIsNotMyType 318 +#define MGK_OptionErrorRegionAreaExceedsLimit 319 +#define MGK_OptionErrorRequestDidNotReturnAnImage 320 +#define MGK_OptionErrorSteganoImageRequired 321 +#define MGK_OptionErrorStereoImageRequired 322 +#define MGK_OptionErrorSubimageSpecificationReturnsNoImages 323 +#define MGK_OptionErrorTileNotBoundedByImageDimensions 324 +#define MGK_OptionErrorUnableToAddOrRemoveProfile 325 +#define MGK_OptionErrorUnableToAverageImageSequence 326 +#define MGK_OptionErrorUnableToBlurImage 327 +#define MGK_OptionErrorUnableToChopImage 328 +#define MGK_OptionErrorUnableToColorMatrixImage 329 +#define MGK_OptionErrorUnableToConstituteImage 330 +#define MGK_OptionErrorUnableToConvolveImage 331 +#define MGK_OptionErrorUnableToEdgeImage 332 +#define MGK_OptionErrorUnableToEqualizeImage 333 +#define MGK_OptionErrorUnableToFilterImage 334 +#define MGK_OptionErrorUnableToFormatImageMetadata 335 +#define MGK_OptionErrorUnableToFrameImage 336 +#define MGK_OptionErrorUnableToOilPaintImage 337 +#define MGK_OptionErrorUnableToPaintImage 338 +#define MGK_OptionErrorUnableToRaiseImage 339 +#define MGK_OptionErrorUnableToSharpenImage 340 +#define MGK_OptionErrorUnableToThresholdImage 341 +#define MGK_OptionErrorUnableToWaveImage 342 +#define MGK_OptionErrorUnrecognizedAttribute 343 +#define MGK_OptionErrorUnrecognizedChannelType 344 +#define MGK_OptionErrorUnrecognizedColor 345 +#define MGK_OptionErrorUnrecognizedColormapType 346 +#define MGK_OptionErrorUnrecognizedColorspace 347 +#define MGK_OptionErrorUnrecognizedCommand 348 +#define MGK_OptionErrorUnrecognizedComposeOperator 349 +#define MGK_OptionErrorUnrecognizedDisposeMethod 350 +#define MGK_OptionErrorUnrecognizedElement 351 +#define MGK_OptionErrorUnrecognizedEndianType 352 +#define MGK_OptionErrorUnrecognizedGravityType 353 +#define MGK_OptionErrorUnrecognizedHighlightStyle 354 +#define MGK_OptionErrorUnrecognizedImageCompression 355 +#define MGK_OptionErrorUnrecognizedImageFilter 356 +#define MGK_OptionErrorUnrecognizedImageFormat 357 +#define MGK_OptionErrorUnrecognizedImageMode 358 +#define MGK_OptionErrorUnrecognizedImageType 359 +#define MGK_OptionErrorUnrecognizedIntentType 360 +#define MGK_OptionErrorUnrecognizedInterlaceType 361 +#define MGK_OptionErrorUnrecognizedListType 362 +#define MGK_OptionErrorUnrecognizedMetric 363 +#define MGK_OptionErrorUnrecognizedModeType 364 +#define MGK_OptionErrorUnrecognizedNoiseType 365 +#define MGK_OptionErrorUnrecognizedOperator 366 +#define MGK_OptionErrorUnrecognizedOption 367 +#define MGK_OptionErrorUnrecognizedPerlMagickMethod 368 +#define MGK_OptionErrorUnrecognizedPixelMap 369 +#define MGK_OptionErrorUnrecognizedPreviewType 370 +#define MGK_OptionErrorUnrecognizedResourceType 371 +#define MGK_OptionErrorUnrecognizedType 372 +#define MGK_OptionErrorUnrecognizedUnitsType 373 +#define MGK_OptionErrorUnrecognizedVirtualPixelMethod 374 +#define MGK_OptionErrorUnsupportedSamplingFactor 375 +#define MGK_OptionErrorUsageError 376 +#define MGK_OptionFatalErrorInvalidColorspaceType 377 +#define MGK_OptionFatalErrorInvalidEndianType 378 +#define MGK_OptionFatalErrorInvalidImageType 379 +#define MGK_OptionFatalErrorInvalidInterlaceType 380 +#define MGK_OptionFatalErrorMissingAnImageFilename 381 +#define MGK_OptionFatalErrorMissingArgument 382 +#define MGK_OptionFatalErrorNoImagesWereLoaded 383 +#define MGK_OptionFatalErrorOptionLengthExceedsLimit 384 +#define MGK_OptionFatalErrorRequestDidNotReturnAnImage 385 +#define MGK_OptionFatalErrorUnableToOpenXServer 386 +#define MGK_OptionFatalErrorUnableToPersistKey 387 +#define MGK_OptionFatalErrorUnrecognizedColormapType 388 +#define MGK_OptionFatalErrorUnrecognizedColorspaceType 389 +#define MGK_OptionFatalErrorUnrecognizedDisposeMethod 390 +#define MGK_OptionFatalErrorUnrecognizedEndianType 391 +#define MGK_OptionFatalErrorUnrecognizedFilterType 392 +#define MGK_OptionFatalErrorUnrecognizedImageCompressionType 393 +#define MGK_OptionFatalErrorUnrecognizedImageType 394 +#define MGK_OptionFatalErrorUnrecognizedInterlaceType 395 +#define MGK_OptionFatalErrorUnrecognizedOption 396 +#define MGK_OptionFatalErrorUnrecognizedResourceType 397 +#define MGK_OptionFatalErrorUnrecognizedVirtualPixelMethod 398 +#define MGK_OptionWarningUnrecognizedColor 399 +#define MGK_RegistryErrorImageExpected 400 +#define MGK_RegistryErrorImageInfoExpected 401 +#define MGK_RegistryErrorStructureSizeMismatch 402 +#define MGK_RegistryErrorUnableToGetRegistryID 403 +#define MGK_RegistryErrorUnableToLocateImage 404 +#define MGK_RegistryErrorUnableToSetRegistry 405 +#define MGK_RegistryFatalErrorDefault 406 +#define MGK_RegistryWarningDefault 407 +#define MGK_ResourceLimitErrorCacheResourcesExhausted 408 +#define MGK_ResourceLimitErrorImagePixelHeightLimitExceeded 409 +#define MGK_ResourceLimitErrorImagePixelLimitExceeded 410 +#define MGK_ResourceLimitErrorImagePixelWidthLimitExceeded 411 +#define MGK_ResourceLimitErrorMemoryAllocationFailed 412 +#define MGK_ResourceLimitErrorNexusPixelHeightLimitExceeded 413 +#define MGK_ResourceLimitErrorNexusPixelLimitExceeded 414 +#define MGK_ResourceLimitErrorNexusPixelWidthLimitExceeded 415 +#define MGK_ResourceLimitErrorNoPixelsDefinedInCache 416 +#define MGK_ResourceLimitErrorPixelCacheAllocationFailed 417 +#define MGK_ResourceLimitErrorUnableToAddColorProfile 418 +#define MGK_ResourceLimitErrorUnableToAddGenericProfile 419 +#define MGK_ResourceLimitErrorUnableToAddIPTCProfile 420 +#define MGK_ResourceLimitErrorUnableToAddOrRemoveProfile 421 +#define MGK_ResourceLimitErrorUnableToAllocateCoefficients 422 +#define MGK_ResourceLimitErrorUnableToAllocateColormap 423 +#define MGK_ResourceLimitErrorUnableToAllocateICCProfile 424 +#define MGK_ResourceLimitErrorUnableToAllocateImage 425 +#define MGK_ResourceLimitErrorUnableToAllocateString 426 +#define MGK_ResourceLimitErrorUnableToAnnotateImage 427 +#define MGK_ResourceLimitErrorUnableToAverageImageSequence 428 +#define MGK_ResourceLimitErrorUnableToCloneDrawingWand 429 +#define MGK_ResourceLimitErrorUnableToCloneImage 430 +#define MGK_ResourceLimitErrorUnableToComputeImageSignature 431 +#define MGK_ResourceLimitErrorUnableToConstituteImage 432 +#define MGK_ResourceLimitErrorUnableToConvertFont 433 +#define MGK_ResourceLimitErrorUnableToConvertStringToTokens 434 +#define MGK_ResourceLimitErrorUnableToCreateColormap 435 +#define MGK_ResourceLimitErrorUnableToCreateColorTransform 436 +#define MGK_ResourceLimitErrorUnableToCreateCommandWidget 437 +#define MGK_ResourceLimitErrorUnableToCreateImageGroup 438 +#define MGK_ResourceLimitErrorUnableToCreateImageMontage 439 +#define MGK_ResourceLimitErrorUnableToCreateXWindow 440 +#define MGK_ResourceLimitErrorUnableToCropImage 441 +#define MGK_ResourceLimitErrorUnableToDespeckleImage 442 +#define MGK_ResourceLimitErrorUnableToDetermineImageClass 443 +#define MGK_ResourceLimitErrorUnableToDetermineTheNumberOfImageColors 444 +#define MGK_ResourceLimitErrorUnableToDitherImage 445 +#define MGK_ResourceLimitErrorUnableToDrawOnImage 446 +#define MGK_ResourceLimitErrorUnableToEdgeImage 447 +#define MGK_ResourceLimitErrorUnableToEmbossImage 448 +#define MGK_ResourceLimitErrorUnableToEnhanceImage 449 +#define MGK_ResourceLimitErrorUnableToFloodfillImage 450 +#define MGK_ResourceLimitErrorUnableToGammaCorrectImage 451 +#define MGK_ResourceLimitErrorUnableToGetBestIconSize 452 +#define MGK_ResourceLimitErrorUnableToGetFromRegistry 453 +#define MGK_ResourceLimitErrorUnableToGetPackageInfo 454 +#define MGK_ResourceLimitErrorUnableToLevelImage 455 +#define MGK_ResourceLimitErrorUnableToMagnifyImage 456 +#define MGK_ResourceLimitErrorUnableToManageColor 457 +#define MGK_ResourceLimitErrorUnableToMapImage 458 +#define MGK_ResourceLimitErrorUnableToMapImageSequence 459 +#define MGK_ResourceLimitErrorUnableToMedianFilterImage 460 +#define MGK_ResourceLimitErrorUnableToMotionBlurImage 461 +#define MGK_ResourceLimitErrorUnableToNoiseFilterImage 462 +#define MGK_ResourceLimitErrorUnableToNormalizeImage 463 +#define MGK_ResourceLimitErrorUnableToOpenColorProfile 464 +#define MGK_ResourceLimitErrorUnableToQuantizeImage 465 +#define MGK_ResourceLimitErrorUnableToQuantizeImageSequence 466 +#define MGK_ResourceLimitErrorUnableToReadTextChunk 467 +#define MGK_ResourceLimitErrorUnableToReadXImage 468 +#define MGK_ResourceLimitErrorUnableToReadXServerColormap 469 +#define MGK_ResourceLimitErrorUnableToResizeImage 470 +#define MGK_ResourceLimitErrorUnableToRotateImage 471 +#define MGK_ResourceLimitErrorUnableToSampleImage 472 +#define MGK_ResourceLimitErrorUnableToScaleImage 473 +#define MGK_ResourceLimitErrorUnableToSelectImage 474 +#define MGK_ResourceLimitErrorUnableToSharpenImage 475 +#define MGK_ResourceLimitErrorUnableToShaveImage 476 +#define MGK_ResourceLimitErrorUnableToShearImage 477 +#define MGK_ResourceLimitErrorUnableToSortImageColormap 478 +#define MGK_ResourceLimitErrorUnableToThresholdImage 479 +#define MGK_ResourceLimitErrorUnableToTransformColorspace 480 +#define MGK_ResourceLimitFatalErrorMemoryAllocationFailed 481 +#define MGK_ResourceLimitFatalErrorSemaporeOperationFailed 482 +#define MGK_ResourceLimitFatalErrorUnableToAllocateAscii85Info 483 +#define MGK_ResourceLimitFatalErrorUnableToAllocateCacheInfo 484 +#define MGK_ResourceLimitFatalErrorUnableToAllocateCacheView 485 +#define MGK_ResourceLimitFatalErrorUnableToAllocateColorInfo 486 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDashPattern 487 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDelegateInfo 488 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDerivatives 489 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawContext 490 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawInfo 491 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawingWand 492 +#define MGK_ResourceLimitFatalErrorUnableToAllocateGammaMap 493 +#define MGK_ResourceLimitFatalErrorUnableToAllocateImage 494 +#define MGK_ResourceLimitFatalErrorUnableToAllocateImagePixels 495 +#define MGK_ResourceLimitFatalErrorUnableToAllocateLogInfo 496 +#define MGK_ResourceLimitFatalErrorUnableToAllocateMagicInfo 497 +#define MGK_ResourceLimitFatalErrorUnableToAllocateMagickInfo 498 +#define MGK_ResourceLimitFatalErrorUnableToAllocateMagickMap 499 +#define MGK_ResourceLimitFatalErrorUnableToAllocateModuleInfo 500 +#define MGK_ResourceLimitFatalErrorUnableToAllocateMontageInfo 501 +#define MGK_ResourceLimitFatalErrorUnableToAllocateQuantizeInfo 502 +#define MGK_ResourceLimitFatalErrorUnableToAllocateRandomKernel 503 +#define MGK_ResourceLimitFatalErrorUnableToAllocateRegistryInfo 504 +#define MGK_ResourceLimitFatalErrorUnableToAllocateSemaphoreInfo 505 +#define MGK_ResourceLimitFatalErrorUnableToAllocateString 506 +#define MGK_ResourceLimitFatalErrorUnableToAllocateTypeInfo 507 +#define MGK_ResourceLimitFatalErrorUnableToAllocateWand 508 +#define MGK_ResourceLimitFatalErrorUnableToAnimateImageSequence 509 +#define MGK_ResourceLimitFatalErrorUnableToCloneBlobInfo 510 +#define MGK_ResourceLimitFatalErrorUnableToCloneCacheInfo 511 +#define MGK_ResourceLimitFatalErrorUnableToCloneImage 512 +#define MGK_ResourceLimitFatalErrorUnableToCloneImageInfo 513 +#define MGK_ResourceLimitFatalErrorUnableToConcatenateString 514 +#define MGK_ResourceLimitFatalErrorUnableToConvertText 515 +#define MGK_ResourceLimitFatalErrorUnableToCreateColormap 516 +#define MGK_ResourceLimitFatalErrorUnableToDestroySemaphore 517 +#define MGK_ResourceLimitFatalErrorUnableToDisplayImage 518 +#define MGK_ResourceLimitFatalErrorUnableToEscapeString 519 +#define MGK_ResourceLimitFatalErrorUnableToInitializeSemaphore 520 +#define MGK_ResourceLimitFatalErrorUnableToInterpretMSLImage 521 +#define MGK_ResourceLimitFatalErrorUnableToLockSemaphore 522 +#define MGK_ResourceLimitFatalErrorUnableToObtainRandomEntropy 523 +#define MGK_ResourceLimitFatalErrorUnableToUnlockSemaphore 524 +#define MGK_ResourceLimitWarningMemoryAllocationFailed 525 +#define MGK_StreamErrorImageDoesNotContainTheStreamGeometry 526 +#define MGK_StreamErrorNoStreamHandlerIsDefined 527 +#define MGK_StreamErrorPixelCacheIsNotOpen 528 +#define MGK_StreamErrorUnableToAcquirePixelStream 529 +#define MGK_StreamErrorUnableToSetPixelStream 530 +#define MGK_StreamErrorUnableToSyncPixelStream 531 +#define MGK_StreamFatalErrorDefault 532 +#define MGK_StreamWarningDefault 533 +#define MGK_TypeErrorFontNotSpecified 534 +#define MGK_TypeErrorFontSubstitutionRequired 535 +#define MGK_TypeErrorUnableToGetTypeMetrics 536 +#define MGK_TypeErrorUnableToInitializeFreetypeLibrary 537 +#define MGK_TypeErrorUnableToReadFont 538 +#define MGK_TypeErrorUnrecognizedFontEncoding 539 +#define MGK_TypeFatalErrorDefault 540 +#define MGK_TypeWarningDefault 541 +#define MGK_WandErrorInvalidColormapIndex 542 +#define MGK_WandErrorWandAPINotImplemented 543 +#define MGK_WandErrorWandContainsNoImageIndexs 544 +#define MGK_WandErrorWandContainsNoImages 545 +#define MGK_XServerErrorColorIsNotKnownToServer 546 +#define MGK_XServerErrorNoWindowWithSpecifiedIDExists 547 +#define MGK_XServerErrorStandardColormapIsNotInitialized 548 +#define MGK_XServerErrorUnableToConnectToRemoteDisplay 549 +#define MGK_XServerErrorUnableToCreateBitmap 550 +#define MGK_XServerErrorUnableToCreateColormap 551 +#define MGK_XServerErrorUnableToCreatePixmap 552 +#define MGK_XServerErrorUnableToCreateProperty 553 +#define MGK_XServerErrorUnableToCreateStandardColormap 554 +#define MGK_XServerErrorUnableToDisplayImageInfo 555 +#define MGK_XServerErrorUnableToGetProperty 556 +#define MGK_XServerErrorUnableToGetStandardColormap 557 +#define MGK_XServerErrorUnableToGetVisual 558 +#define MGK_XServerErrorUnableToGrabMouse 559 +#define MGK_XServerErrorUnableToLoadFont 560 +#define MGK_XServerErrorUnableToMatchVisualToStandardColormap 561 +#define MGK_XServerErrorUnableToOpenXServer 562 +#define MGK_XServerErrorUnableToReadXAttributes 563 +#define MGK_XServerErrorUnableToReadXWindowImage 564 +#define MGK_XServerErrorUnrecognizedColormapType 565 +#define MGK_XServerErrorUnrecognizedGravityType 566 +#define MGK_XServerErrorUnrecognizedVisualSpecifier 567 +#define MGK_XServerFatalErrorUnableToAllocateXHints 568 +#define MGK_XServerFatalErrorUnableToCreateCursor 569 +#define MGK_XServerFatalErrorUnableToCreateGraphicContext 570 +#define MGK_XServerFatalErrorUnableToCreateStandardColormap 571 +#define MGK_XServerFatalErrorUnableToCreateTextProperty 572 +#define MGK_XServerFatalErrorUnableToCreateXImage 573 +#define MGK_XServerFatalErrorUnableToCreateXPixmap 574 +#define MGK_XServerFatalErrorUnableToCreateXWindow 575 +#define MGK_XServerFatalErrorUnableToDisplayImage 576 +#define MGK_XServerFatalErrorUnableToDitherImage 577 +#define MGK_XServerFatalErrorUnableToGetPixelInfo 578 +#define MGK_XServerFatalErrorUnableToGetVisual 579 +#define MGK_XServerFatalErrorUnableToLoadFont 580 +#define MGK_XServerFatalErrorUnableToMakeXWindow 581 +#define MGK_XServerFatalErrorUnableToOpenXServer 582 +#define MGK_XServerFatalErrorUnableToViewFonts 583 +#define MGK_XServerWarningUnableToGetVisual 584 +#define MGK_XServerWarningUsingDefaultVisual 585 #endif @@ -650,43 +652,43 @@ static const SeverityInfo severity_map[] = { "Delegate/FatalError", 199, DelegateFatalError }, { "Delegate/Warning", 200, DelegateWarning }, { "Draw/Error", 201, DrawError }, - { "Draw/FatalError", 215, DrawFatalError }, - { "Draw/Warning", 216, DrawWarning }, - { "File/Open/Error", 219, FileOpenError }, - { "File/Open/FatalError", 222, FileOpenFatalError }, - { "File/Open/Warning", 223, FileOpenWarning }, - { "Image/Error", 224, ImageError }, - { "Image/FatalError", 261, ImageFatalError }, - { "Image/Warning", 262, ImageWarning }, - { "Missing/Delegate/Error", 263, MissingDelegateError }, - { "Missing/Delegate/FatalError", 275, MissingDelegateFatalError }, - { "Missing/Delegate/Warning", 276, MissingDelegateWarning }, - { "Module/Error", 277, ModuleError }, - { "Module/FatalError", 282, ModuleFatalError }, - { "Module/Warning", 283, ModuleWarning }, - { "Monitor/Error", 284, MonitorError }, - { "Monitor/FatalError", 285, MonitorFatalError }, - { "Monitor/Warning", 287, MonitorWarning }, - { "Option/Error", 288, OptionError }, - { "Option/FatalError", 374, OptionFatalError }, - { "Option/Warning", 396, OptionWarning }, - { "Registry/Error", 397, RegistryError }, - { "Registry/FatalError", 403, RegistryFatalError }, - { "Registry/Warning", 404, RegistryWarning }, - { "Resource/Limit/Error", 405, ResourceLimitError }, - { "Resource/Limit/FatalError", 478, ResourceLimitFatalError }, - { "Resource/Limit/Warning", 522, ResourceLimitWarning }, - { "Stream/Error", 523, StreamError }, - { "Stream/FatalError", 529, StreamFatalError }, - { "Stream/Warning", 530, StreamWarning }, - { "Type/Error", 531, TypeError }, - { "Type/FatalError", 537, TypeFatalError }, - { "Type/Warning", 538, TypeWarning }, - { "Wand/Error", 539, WandError }, - { "XServer/Error", 543, XServerError }, - { "XServer/FatalError", 565, XServerFatalError }, - { "XServer/Warning", 581, XServerWarning }, - { "", 583, UndefinedException } + { "Draw/FatalError", 217, DrawFatalError }, + { "Draw/Warning", 218, DrawWarning }, + { "File/Open/Error", 221, FileOpenError }, + { "File/Open/FatalError", 224, FileOpenFatalError }, + { "File/Open/Warning", 225, FileOpenWarning }, + { "Image/Error", 226, ImageError }, + { "Image/FatalError", 263, ImageFatalError }, + { "Image/Warning", 264, ImageWarning }, + { "Missing/Delegate/Error", 265, MissingDelegateError }, + { "Missing/Delegate/FatalError", 277, MissingDelegateFatalError }, + { "Missing/Delegate/Warning", 278, MissingDelegateWarning }, + { "Module/Error", 279, ModuleError }, + { "Module/FatalError", 284, ModuleFatalError }, + { "Module/Warning", 285, ModuleWarning }, + { "Monitor/Error", 286, MonitorError }, + { "Monitor/FatalError", 287, MonitorFatalError }, + { "Monitor/Warning", 289, MonitorWarning }, + { "Option/Error", 290, OptionError }, + { "Option/FatalError", 376, OptionFatalError }, + { "Option/Warning", 398, OptionWarning }, + { "Registry/Error", 399, RegistryError }, + { "Registry/FatalError", 405, RegistryFatalError }, + { "Registry/Warning", 406, RegistryWarning }, + { "Resource/Limit/Error", 407, ResourceLimitError }, + { "Resource/Limit/FatalError", 480, ResourceLimitFatalError }, + { "Resource/Limit/Warning", 524, ResourceLimitWarning }, + { "Stream/Error", 525, StreamError }, + { "Stream/FatalError", 531, StreamFatalError }, + { "Stream/Warning", 532, StreamWarning }, + { "Type/Error", 533, TypeError }, + { "Type/FatalError", 539, TypeFatalError }, + { "Type/Warning", 540, TypeWarning }, + { "Wand/Error", 541, WandError }, + { "XServer/Error", 545, XServerError }, + { "XServer/FatalError", 567, XServerFatalError }, + { "XServer/Warning", 583, XServerWarning }, + { "", 585, UndefinedException } }; #endif @@ -912,6 +914,8 @@ static const MessageInfo message_map[] = { "UnableToDrawOnImage", MGK_DrawErrorUnableToDrawOnImage }, { "UnableToPrint", MGK_DrawErrorUnableToPrint }, { "UnbalancedGraphicContextPushPop", MGK_DrawErrorUnbalancedGraphicContextPushPop }, + { "UnbalancedPushPop", MGK_DrawErrorUnbalancedPushPop }, + { "UnreasonableDashPolygonLength", MGK_DrawErrorUnreasonableDashPolygonLength }, { "UnreasonableGradientSize", MGK_DrawErrorUnreasonableGradientSize }, { "VectorPathTruncated", MGK_DrawErrorVectorPathTruncated }, { "Default", MGK_DrawFatalErrorDefault }, @@ -1502,6 +1506,8 @@ static const char message_dat[] = "unable to draw on image\0" "Unable to print\0" "unbalanced graphic context push-pop\0" + "unbalanced push-pop\0" + "unreasonable dash polygon length\0" "unreasonable gradient image size\0" "vector path truncated\0" "default error\0" @@ -2091,376 +2097,378 @@ static const unsigned short message_dat_offsets[] = 6443, 6459, 6495, - 6528, - 6550, - 6564, - 6583, - 6624, - 6638, - 6670, - 6690, - 6711, - 6725, - 6741, + 6515, + 6548, + 6581, + 6603, + 6617, + 6636, + 6677, + 6691, + 6723, + 6743, 6764, - 6809, - 6843, - 6868, - 6894, - 6930, - 6964, - 6989, - 7011, - 7038, - 7057, - 7080, - 7114, - 7135, - 7157, - 7185, - 7202, - 7225, - 7250, - 7274, - 7299, - 7324, - 7354, - 7384, - 7421, - 7451, - 7475, - 7499, + 6778, + 6794, + 6817, + 6862, + 6896, + 6921, + 6947, + 6983, + 7017, + 7042, + 7064, + 7091, + 7110, + 7133, + 7167, + 7188, + 7210, + 7238, + 7255, + 7278, + 7303, + 7327, + 7352, + 7377, + 7407, + 7437, + 7474, + 7504, 7528, - 7559, - 7589, + 7552, + 7581, 7612, - 7636, - 7660, + 7642, + 7665, 7689, - 7711, - 7741, - 7763, - 7779, - 7808, - 7837, - 7871, - 7913, - 7939, - 7964, - 8005, - 8046, - 8076, - 8105, - 8139, - 8181, - 8195, - 8211, + 7713, + 7742, + 7764, + 7794, + 7816, + 7832, + 7861, + 7890, + 7924, + 7966, + 7992, + 8017, + 8058, + 8099, + 8129, + 8158, + 8192, 8234, - 8256, - 8278, - 8310, - 8330, - 8365, - 8381, - 8395, - 8409, - 8449, - 8465, - 8489, - 8520, - 8550, - 8579, - 8611, - 8650, - 8679, - 8708, - 8740, - 8766, - 8797, - 8828, - 8859, - 8886, - 8921, - 8956, - 8984, - 9010, - 9068, - 9094, - 9118, - 9150, - 9168, + 8248, + 8264, + 8287, + 8309, + 8331, + 8363, + 8383, + 8418, + 8434, + 8448, + 8462, + 8502, + 8518, + 8542, + 8573, + 8603, + 8632, + 8664, + 8703, + 8732, + 8761, + 8793, + 8819, + 8850, + 8881, + 8912, + 8939, + 8974, + 9009, + 9037, + 9063, + 9121, + 9147, + 9171, 9203, - 9229, - 9248, - 9273, - 9298, - 9339, - 9371, - 9394, - 9416, - 9457, - 9497, - 9529, - 9562, - 9583, - 9604, - 9633, - 9660, - 9685, - 9706, - 9731, - 9754, - 9787, - 9809, - 9835, - 9857, - 9879, - 9903, - 9929, - 9950, - 9973, - 9999, - 10018, - 10045, - 10075, - 10147, - 10177, - 10205, - 10226, - 10251, - 10277, - 10306, - 10337, - 10363, - 10389, - 10413, - 10437, - 10462, + 9221, + 9256, + 9282, + 9301, + 9326, + 9351, + 9392, + 9424, + 9447, + 9469, + 9510, + 9550, + 9582, + 9615, + 9636, + 9657, + 9686, + 9713, + 9738, + 9759, + 9784, + 9807, + 9840, + 9862, + 9888, + 9910, + 9932, + 9956, + 9982, + 10003, + 10026, + 10052, + 10071, + 10098, + 10128, + 10200, + 10230, + 10258, + 10279, + 10304, + 10330, + 10359, + 10390, + 10416, + 10442, + 10466, 10490, - 10513, - 10539, - 10562, - 10586, - 10608, - 10628, - 10659, - 10682, - 10708, + 10515, + 10543, + 10566, + 10592, + 10615, + 10639, + 10661, + 10681, + 10712, 10735, - 10753, - 10777, - 10811, - 10839, - 10886, - 10910, - 10930, - 10949, - 10972, - 10998, - 11056, - 11078, - 11106, - 11138, - 11161, - 11183, - 11210, - 11239, - 11267, + 10761, + 10788, + 10806, + 10830, + 10864, + 10892, + 10939, + 10963, + 10983, + 11002, + 11025, + 11051, + 11109, + 11131, + 11159, + 11191, + 11214, + 11236, + 11263, 11292, - 11317, - 11347, - 11371, - 11399, - 11419, - 11446, - 11480, + 11320, + 11345, + 11370, + 11400, + 11424, + 11452, + 11472, 11499, - 11514, - 11534, - 11558, - 11584, - 11607, - 11630, - 11644, + 11533, + 11552, + 11567, + 11587, + 11611, + 11637, 11660, - 11704, - 11758, - 11805, - 11857, - 11882, - 11936, - 11983, - 12035, - 12062, - 12092, - 12124, - 12154, - 12181, - 12213, - 12245, - 12273, - 12304, - 12329, - 12355, - 12380, - 12413, - 12442, - 12464, - 12498, - 12525, - 12548, - 12584, - 12610, - 12643, - 12675, - 12704, - 12735, - 12761, - 12782, - 12808, - 12840, - 12887, - 12910, - 12934, - 12955, - 12978, - 13002, - 13028, - 13058, - 13087, - 13115, - 13142, - 13164, - 13188, - 13211, - 13231, - 13260, - 13290, - 13318, - 13347, - 13373, - 13402, - 13427, - 13461, - 13487, - 13510, - 13543, - 13566, - 13589, - 13612, - 13634, - 13657, - 13681, - 13703, - 13725, - 13755, - 13781, - 13812, - 13837, - 13864, - 13896, - 13926, - 13956, - 13986, - 14018, - 14051, - 14080, - 14112, - 14141, - 14173, - 14202, - 14227, - 14259, - 14287, - 14317, - 14348, - 14378, - 14409, - 14441, - 14474, - 14507, - 14540, - 14574, - 14600, - 14629, + 11683, + 11697, + 11713, + 11757, + 11811, + 11858, + 11910, + 11935, + 11989, + 12036, + 12088, + 12115, + 12145, + 12177, + 12207, + 12234, + 12266, + 12298, + 12326, + 12357, + 12382, + 12408, + 12433, + 12466, + 12495, + 12517, + 12551, + 12578, + 12601, + 12637, + 12663, + 12696, + 12728, + 12757, + 12788, + 12814, + 12835, + 12861, + 12893, + 12940, + 12963, + 12987, + 13008, + 13031, + 13055, + 13081, + 13111, + 13140, + 13168, + 13195, + 13217, + 13241, + 13264, + 13284, + 13313, + 13343, + 13371, + 13400, + 13426, + 13455, + 13480, + 13514, + 13540, + 13563, + 13596, + 13619, + 13642, + 13665, + 13687, + 13710, + 13734, + 13756, + 13778, + 13808, + 13834, + 13865, + 13890, + 13917, + 13949, + 13979, + 14009, + 14039, + 14071, + 14104, + 14133, + 14165, + 14194, + 14226, + 14255, + 14280, + 14312, + 14340, + 14370, + 14401, + 14431, + 14462, + 14494, + 14527, + 14560, + 14593, + 14627, 14653, - 14686, - 14712, + 14682, + 14706, 14739, - 14761, - 14788, - 14817, - 14840, - 14866, - 14894, - 14918, - 14942, - 14973, - 15003, - 15028, - 15080, - 15107, - 15132, - 15175, - 15204, + 14765, + 14792, + 14814, + 14841, + 14870, + 14893, + 14919, + 14947, + 14971, + 14995, + 15026, + 15056, + 15081, + 15133, + 15160, + 15185, 15228, - 15259, - 15286, - 15314, - 15328, - 15344, - 15368, - 15395, - 15422, - 15460, - 15480, - 15507, - 15521, - 15537, - 15569, - 15603, - 15643, - 15676, - 15705, - 15740, - 15777, - 15813, - 15837, - 15863, - 15887, - 15913, - 15948, - 15977, - 16000, - 16032, + 15257, + 15281, + 15312, + 15339, + 15367, + 15381, + 15397, + 15421, + 15448, + 15475, + 15513, + 15533, + 15560, + 15574, + 15590, + 15622, + 15656, + 15696, + 15729, + 15758, + 15793, + 15830, + 15866, + 15890, + 15916, + 15940, + 15966, + 16001, + 16030, 16053, - 16074, - 16094, - 16138, - 16162, - 16190, - 16220, - 16247, + 16085, + 16106, + 16127, + 16147, + 16191, + 16215, + 16243, 16273, - 16303, - 16330, + 16300, + 16326, 16356, - 16389, - 16424, - 16455, - 16480, - 16506, - 16532, - 16556, - 16579, - 16604, - 16625, - 16645, - 16669, - 16693, - 16714, - 16735, - 16754, + 16383, + 16409, + 16442, + 16477, + 16508, + 16533, + 16559, + 16585, + 16609, + 16632, + 16657, + 16678, + 16698, + 16722, + 16746, + 16767, + 16788, + 16807, 0 }; #endif /* if defined(_INCLUDE_MESSAGE_TABLE_) */ diff --git a/magick/log-private.h b/magick/log-private.h index f5ed2ea..479c458 100644 --- a/magick/log-private.h +++ b/magick/log-private.h @@ -9,7 +9,7 @@ Log methods. */ -extern MagickExport void +extern void DestroyLogInfo(void); extern MagickPassFail diff --git a/magick/log.c b/magick/log.c index 5a9292c..3e67ea0 100644 --- a/magick/log.c +++ b/magick/log.c @@ -50,21 +50,8 @@ #define MagickLogFilename "log.mgk" /* - Typedef declarations. + Run-time Logger Info */ -typedef enum -{ - DisabledOutput = 0x0000, - UndefinedOutput = 0x0000, - StdoutOutput = 0x0001, - StderrOutput = 0x0002, - XMLFileOutput = 0x0004, - TXTFileOutput = 0x0008, - Win32DebugOutput = 0x0010, - Win32EventlogOutput = 0x0020, - MethodOutput = 0x0040 -} LogOutputType; - typedef struct _LogInfo { SemaphoreInfo @@ -99,7 +86,37 @@ typedef struct _LogInfo filename[256], format[200]; + time_t + last_seconds; + + struct tm + last_tm; + } LogInfo; + +/* + Static Logger Defaults +*/ +typedef struct _LogInfoDefaults +{ + unsigned long + generations, /* 3 */ + limit; /* 2000 */ + + LogEventType + events; /* NoEventsMask */ + + LogOutputType + output_type; /* StderrOutput */ + + LogMethod + method; /* (LogMethod) 0 */ + + char + filename[256], /* "Magick-%d.log" */ + format[200]; /* "%t %r %u %p %m/%f/%l/%d:\n %e" */ + +} LogInfoDefaults; /* This table maps between masks and the various event id's that can occur @@ -175,6 +192,17 @@ static const struct */ static LogInfo *log_info = (LogInfo *) NULL; + +static LogInfoDefaults log_info_defaults = + { + 3, /* unsigned long generations */ + 2000, /* unsigned long limit */ + NoEventsMask, /* LogEventType events */ + StderrOutput, /* LogOutputType output_type */ + (LogMethod) 0, /* LogMethod */ + "Magick-%d.log", /* char filename[256] */ + "%t %r %u %p %m/%f/%l/%d:\n %e", /* char format[200] */ + }; /* Forward declarations. @@ -238,7 +266,7 @@ static LogEventType ParseEvents(const char *event_string) % % */ -MagickExport void DestroyLogInfo(void) +void DestroyLogInfo(void) { if (log_info->file != (FILE *) NULL) if ((log_info->file != stdout) && (log_info->file != stderr)) @@ -270,6 +298,12 @@ MagickExport void DestroyLogInfo(void) % fatal error for the whole program. All of the allocations performed by % this function are released by DestroyLogInfo(). % +% Normally this function will search for a "log.mgk" file from which to +% obtain logging defaults, and use compiled-in defaults if the "log.mgk" +% file is not found. The search for "log.mgk" is skipped if the default +% logging method is MethodOutput and a logging call-back has been +% registered. +% % The format of the InitializeLogInfo method is: % % MagickPassFail InitializeLogInfo(void) @@ -287,7 +321,7 @@ InitializeLogInfo(void) /* Initialize LogInfo */ - log_info=MagickAllocateMemory(LogInfo *,sizeof(LogInfo)); + log_info=MagickAllocateClearedMemory(LogInfo *,sizeof(LogInfo)); if (log_info == (LogInfo *) NULL) MagickFatalError3(ResourceLimitFatalError,MemoryAllocationFailed, UnableToAllocateLogInfo); @@ -306,18 +340,19 @@ InitializeLogInfo(void) log_info->file=(FILE *) NULL; GetTimerInfo(&log_info->timer); - log_info->generations=3; - log_info->limit=2000; + log_info->generations=log_info_defaults.generations; + log_info->limit=log_info_defaults.limit; log_info->generation=0; log_info->count=0; - log_info->events=NoEventsMask; - log_info->output_type=StderrOutput; - log_info->method=0; + log_info->events=log_info_defaults.events; + log_info->output_type=log_info_defaults.output_type; + log_info->method=log_info_defaults.method; log_info->log_configured=MagickFalse; + log_info->last_seconds=0; (void) strlcpy(log_info->path,"(default)",sizeof(log_info->path)); - (void) strlcpy(log_info->filename,"Magick-%d.log",sizeof(log_info->filename)); - (void) strlcpy(log_info->format,"%t %r %u %p %m/%f/%l/%d:\n %e", + (void) strlcpy(log_info->filename,log_info_defaults.filename,sizeof(log_info->filename)); + (void) strlcpy(log_info->format,log_info_defaults.format, sizeof(log_info->format)); #if defined(__COVERITY__) @@ -334,8 +369,11 @@ InitializeLogInfo(void) #if UseInstalledMagick /* - Try to read the log configuration file. + Try to read the log configuration file if not using call-back + method. */ + if (!((log_info->output_type & MethodOutput) && + (log_info->method != (LogMethod) NULL))) { ExceptionInfo exception; @@ -386,16 +424,21 @@ InitializeLogInfoPost(void) *p; /* - Try to read the log configuration file. + Try to read the log configuration file if not using call-back + method. */ if (!log_info->log_configured) { - ExceptionInfo - exception; + if (!((log_info->output_type & MethodOutput) && + (log_info->method != (LogMethod) NULL))) + { + ExceptionInfo + exception; - GetExceptionInfo(&exception); - (void) ReadLogConfigureFile(MagickLogFilename,0,&exception); - DestroyExceptionInfo(&exception); + GetExceptionInfo(&exception); + (void) ReadLogConfigureFile(MagickLogFilename,0,&exception); + DestroyExceptionInfo(&exception); + } /* Set override logging flags using the value of MAGICK_DEBUG if it @@ -403,6 +446,11 @@ InitializeLogInfoPost(void) */ if ((p=getenv("MAGICK_DEBUG")) != (const char *) NULL) (void) SetLogEventMask(p); + + /* + Claim that logging was successfully configured + */ + log_info->log_configured=MagickTrue; } return MagickPass; @@ -419,12 +467,13 @@ InitializeLogInfoPost(void) % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% IsEventLogging() returns True if logging of events is enabled otherwise -% False. +% IsEventLogging() returns MagickTrue if logging of events is enabled otherwise +% MagickFalse. This can be used to enable logging code which is otherwise +% not needed. % % The format of the IsEventLogging method is: % -% unsigned int IsEventLogging(void) +% MagickBool IsEventLogging(void) % % */ @@ -444,12 +493,13 @@ MagickExport MagickBool IsEventLogging(void) % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% LogMagickEvent() logs an event as determined by the log configuration file. -% If an error occurs, False is returned otherwise True. +% LogMagickEvent() logs an event as determined by the current logging +% configuration. If an error occurs, MagickFail is returned otherwise +% MagickPass. % % The format of the LogMagickEvent method is: % -% unsigned int LogMagickEvent(const LogEventType type,const char *module, +% MagickPassFail LogMagickEvent(const LogEventType type,const char *module, % const char *function,const unsigned long line,const char *format,...) % % A description of each parameter follows: @@ -466,31 +516,38 @@ MagickExport MagickBool IsEventLogging(void) % % */ -MagickExport unsigned int LogMagickEventList(const ExceptionType type, - const char *module,const char *function,const unsigned long line, - const char *format,va_list operands) +MagickExport MagickPassFail +LogMagickEventList(const ExceptionType type, + const char *module,const char *function, + const unsigned long line, + const char *format,va_list operands) { - char + const char *domain, - *severity, + *modulebase, + *severity; + + register const char + *p; + + size_t + message_len=0; + + char + message[MaxTextExtent], + event[MaxTextExtent], + timestamp[16]; + #if defined(MSWINDOWS) - nteventtype, + char + nteventtype; #endif - event[MaxTextExtent], - srcname[MaxTextExtent], - timestamp[MaxTextExtent]; double elapsed_time, user_time; - register const char - *p; - struct tm -#if defined(HAVE_LOCALTIME_R) - tm_buf, -#endif /* if defined(HAVE_LOCALTIME_R) */ *time_meridian; time_t @@ -546,87 +603,206 @@ MagickExport unsigned int LogMagickEventList(const ExceptionType type, } } if (!enabled) - return(True); + return(MagickPass); } + event[0]='\0'; + message[0]='\0'; + timestamp[0]='\0'; + /* fixup module info to just include the filename - and not the whole path to the file. This makes the log huge for no good reason */ - GetPathComponent(module,TailPath,srcname); + for (modulebase=module+strlen(module)-1; modulebase > module; modulebase--) + if (IsBasenameSeparator(*modulebase)) + { + modulebase++; + break; + } - LockSemaphoreInfo(log_info->log_semaphore); switch (((unsigned int) type) % 100) - { - case UndefinedException: domain=(char *) "Undefined"; break; - case ExceptionBase: domain=(char *) "Exception"; break; - case ResourceBase: domain=(char *) "Resource"; break; - /* case ResourceLimitBase: domain=(char *) "ResourceLimit"; break; */ - case TypeBase: domain=(char *) "Type"; break; - /* case AnnotateBase: domain=(char *) "Annotate"; break; */ - case OptionBase: domain=(char *) "Option"; break; - case DelegateBase: domain=(char *) "Delegate"; break; - case MissingDelegateBase: domain=(char *) "MissingDelegate"; break; - case CorruptImageBase: domain=(char *) "CorruptImage"; break; - case FileOpenBase: domain=(char *) "FileOpen"; break; - case BlobBase: domain=(char *) "Blob"; break; - case StreamBase: domain=(char *) "Stream"; break; - case CacheBase: domain=(char *) "Cache"; break; - case CoderBase: domain=(char *) "Coder"; break; - case ModuleBase: domain=(char *) "Module"; break; - case DrawBase: domain=(char *) "Draw"; break; - /* case RenderBase: domain=(char *) "Render"; break; */ - case ImageBase: domain=(char *) "image"; break; - case TemporaryFileBase: domain=(char *) "TemporaryFile"; break; - case TransformBase: domain=(char *) "Transform"; break; - case XServerBase: domain=(char *) "XServer"; break; - case X11Base: domain=(char *) "X11"; break; - case UserBase: domain=(char *) "User"; break; - case MonitorBase: domain=(char *) "Monitor"; break; - case LocaleBase: domain=(char *) "Locale"; break; - case DeprecateBase: domain=(char *) "Deprecate"; break; - case RegistryBase: domain=(char *) "Registry"; break; - case ConfigureBase: domain=(char *) "Configure"; break; - default: domain=(char *) "UnknownEvent"; break; - } + { + case UndefinedException: domain="Undefined"; break; + case ExceptionBase: domain="Exception"; break; + case ResourceBase: domain="Resource"; break; + /* case ResourceLimitBase: domain="ResourceLimit"; break; */ + case TypeBase: domain="Type"; break; + /* case AnnotateBase: domain="Annotate"; break; */ + case OptionBase: domain="Option"; break; + case DelegateBase: domain="Delegate"; break; + case MissingDelegateBase: domain="MissingDelegate"; break; + case CorruptImageBase: domain="CorruptImage"; break; + case FileOpenBase: domain="FileOpen"; break; + case BlobBase: domain="Blob"; break; + case StreamBase: domain="Stream"; break; + case CacheBase: domain="Cache"; break; + case CoderBase: domain="Coder"; break; + case ModuleBase: domain="Module"; break; + case DrawBase: domain="Draw"; break; + /* case RenderBase: domain="Render"; break; */ + case ImageBase: domain="image"; break; + case TemporaryFileBase: domain="TemporaryFile"; break; + case TransformBase: domain="Transform"; break; + case XServerBase: domain="XServer"; break; + case X11Base: domain="X11"; break; + case UserBase: domain="User"; break; + case MonitorBase: domain="Monitor"; break; + case LocaleBase: domain="Locale"; break; + case DeprecateBase: domain="Deprecate"; break; + case RegistryBase: domain="Registry"; break; + case ConfigureBase: domain="Configure"; break; + default: domain="UnknownEvent"; break; + } switch ((((unsigned int) type) / 100) * 100) - { - case EventException: severity=(char *) "Event"; break; - case WarningException: severity=(char *) "Warning"; break; - case ErrorException: severity=(char *) "Error"; break; - case FatalErrorException: severity=(char *) "FatalError"; break; - default: severity=(char *) "Unknown"; break; - } + { + case EventException: severity="Event"; break; + case WarningException: severity="Warning"; break; + case ErrorException: severity="Error"; break; + case FatalErrorException: severity="FatalError"; break; + default: severity="Unknown"; break; + } #if defined(MSWINDOWS) switch ((type / 100) * 100) - { + { case EventException: nteventtype=EVENTLOG_INFORMATION_TYPE; break; case WarningException: nteventtype=EVENTLOG_WARNING_TYPE; break; case ErrorException: nteventtype=EVENTLOG_ERROR_TYPE; break; case FatalErrorException: nteventtype=EVENTLOG_ERROR_TYPE; break; default: nteventtype=EVENTLOG_INFORMATION_TYPE; break; - } -#endif -#if defined(HAVE_VSNPRINTF) - (void) vsnprintf(event,MaxTextExtent,format,operands); -#else -# if defined(HAVE_VSPRINTF) - (void) vsprintf(event,format,operands); -# else -# error Neither vsnprintf or vsprintf is available. -# endif + } #endif + MagickFormatStringList(event,sizeof(event),format,operands); + LockSemaphoreInfo(log_info->log_semaphore); seconds=time((time_t *) NULL); + if (seconds == log_info->last_seconds) + { + time_meridian=&log_info->last_tm; + } + else + { + log_info->last_seconds=seconds; #if defined(HAVE_LOCALTIME_R) - time_meridian=localtime_r(&seconds, &tm_buf); + time_meridian=localtime_r(&seconds, &log_info->last_tm); #else - time_meridian=localtime(&seconds); /* Thread-unsafe version */ + time_meridian=localtime(&seconds); /* Possibly thread-unsafe version */ + (void) memcpy(&log_info->last_tm,time_meridian,sizeof(log_info->last_tm)); #endif /* if defined(HAVE_LOCALTIME_R) */ + } elapsed_time=GetElapsedTime(&log_info->timer); user_time=GetUserTime(&log_info->timer); (void) ContinueTimer((TimerInfo *) &log_info->timer); - FormatString(timestamp,"%04d%02d%02d%02d%02d%02d",time_meridian->tm_year+ - 1900,time_meridian->tm_mon+1,time_meridian->tm_mday, - time_meridian->tm_hour,time_meridian->tm_min,time_meridian->tm_sec); + (void) MagickFormatString(timestamp,sizeof(timestamp),"%04d%02d%02d%02d%02d%02d",time_meridian->tm_year+ + 1900,time_meridian->tm_mon+1,time_meridian->tm_mday, + time_meridian->tm_hour,time_meridian->tm_min,time_meridian->tm_sec); + + if (!(((unsigned int) log_info->output_type) & XMLFileOutput)) + { + /* + Format message in a "human readable" format. + */ + for (p=log_info->format; *p != '\0'; p++) + { + /* + Process formatting characters in text. + */ + if ((*p == '\\') && (*(p+1) == 'r')) + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"\r"); + p++; + continue; + } + if ((*p == '\\') && (*(p+1) == 'n')) + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"\n"); + p++; + continue; + } + if (*p != '%') + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%c",*p); + continue; + } + p++; + switch (*p) + { + case 'd': + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%.1024s",domain); + break; + } + case 'e': + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%.1024s",event); + break; + } + case 'f': + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%.1024s",function); + break; + } + case 'l': + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%lu",line); + break; + } + case 'm': + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%.1024s",modulebase); + break; + } + case 'p': + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%ld",(long) getpid()); + break; + } + case 'r': + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%ld:%-9.6f",(long) (elapsed_time/60.0), + fmod(elapsed_time,60.0)); + break; + } + case 's': + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%.1024s",severity); + break; + } + case 't': + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%02d:%02d:%02d",time_meridian->tm_hour, + time_meridian->tm_min,time_meridian->tm_sec); + break; + } + case 'u': + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%0.3fu",user_time); + break; + } + default: + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%%"); + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"%c",*p); + break; + } + } + } + + /* + Add a new-line to message for messages which need it. This avoids buffering or I/O later. + */ + if (((unsigned int) log_info->output_type) & + ((unsigned int) Win32DebugOutput|Win32EventlogOutput|StdoutOutput|StderrOutput)) + { + message_len+=MagickFormatString(&message[message_len],sizeof(message)-message_len,"\n"); + } + } + + if ((log_info->output_type & MethodOutput) && + (log_info->method != (LogMethod) NULL)) + { + log_info->method(type,message); + UnlockSemaphoreInfo(log_info->log_semaphore); + return(MagickPass); + } if (((unsigned int) log_info->output_type) & XMLFileOutput) { /* @@ -661,16 +837,16 @@ MagickExport unsigned int LogMagickEventList(const ExceptionType type, } (void) fprintf(log_info->file,"\n"); (void) fprintf(log_info->file," %.1024s\n", - timestamp); + timestamp); (void) fprintf(log_info->file, - " %ld:%-9.6f\n", - (long) (elapsed_time/60.0),fmod(elapsed_time,60.0)); + " %ld:%-9.6f\n", + (long) (elapsed_time/60.0),fmod(elapsed_time,60.0)); (void) fprintf(log_info->file," %0.3f\n", - user_time); + user_time); (void) fprintf(log_info->file," %ld\n",(long) getpid()); - (void) fprintf(log_info->file," %.1024s\n",srcname); + (void) fprintf(log_info->file," %.1024s\n",modulebase); (void) fprintf(log_info->file," %.1024s\n", - function); + function); (void) fprintf(log_info->file," %lu\n",line); (void) fprintf(log_info->file," %.1024s\n",domain); (void) fprintf(log_info->file," %.1024s\n",severity); @@ -678,7 +854,7 @@ MagickExport unsigned int LogMagickEventList(const ExceptionType type, (void) fprintf(log_info->file,"\n"); (void) fflush(log_info->file); UnlockSemaphoreInfo(log_info->log_semaphore); - return(True); + return(MagickPass); } if (((unsigned int) log_info->output_type) & TXTFileOutput) { @@ -709,55 +885,29 @@ MagickExport unsigned int LogMagickEventList(const ExceptionType type, if (log_info->generation >= log_info->generations) log_info->generation=0; } - (void) fprintf(log_info->file, - "%.1024s %ld:%-9.6f %0.3f %ld %.1024s %.1024s %lu" - " %.1024s %.1024s %.1024s\n", - timestamp, (long) (elapsed_time/60.0), - fmod(elapsed_time,60.0), - user_time, (long) getpid(), srcname, function, line, domain, - severity, event); + (void) fprintf(log_info->file,"%s",message); (void) fflush(log_info->file); UnlockSemaphoreInfo(log_info->log_semaphore); - return(True); + return(MagickPass); } #if defined(MSWINDOWS) if (log_info->output_type & Win32DebugOutput) { - char - buffer[MaxTextExtent]; - - FormatString(buffer, - "%.1024s %ld:%-9.6f %0.3f %ld %.1024s %.1024s %lu %.1024s" - " %.1024s %.1024s\n", - timestamp, (long) (elapsed_time/60.0), - fmod(elapsed_time,60.0), - user_time, (long) getpid(), srcname, function, line, - domain, severity, event); - OutputDebugString(buffer); + OutputDebugString(message); } if (log_info->output_type & Win32EventlogOutput) { #define LOGGING_ERROR_CODE 0 - char - buffer[MaxTextExtent]; - LPCSTR szList[1]; HANDLE hSource; - FormatString(buffer, - "%.1024s %ld:%-9.6f %0.3f %ld %.1024s %.1024s %lu %.1024s" - " %.1024s %.1024s\n", - timestamp, (long) (elapsed_time/60.0), - fmod(elapsed_time,60.0), - user_time, (long) getpid(), srcname, function, line, - domain, severity, event); hSource = RegisterEventSource(NULL, MagickPackageName); if (hSource != NULL) { - szList[0]=buffer; + szList[0]=message; ReportEvent(hSource,nteventtype,0,LOGGING_ERROR_CODE,NULL,1,0,szList,NULL); DeregisterEventSource(hSource); } @@ -768,128 +918,20 @@ MagickExport unsigned int LogMagickEventList(const ExceptionType type, { FILE *file; + /* - Log to stdout in a "human readable" format. + Log to stdout/stderr in a "human readable" format. */ file = stdout; if (((unsigned int) log_info->output_type) & StderrOutput) file = stderr; - for (p=log_info->format; *p != '\0'; p++) - { - /* - Process formatting characters in text. - */ - if ((*p == '\\') && (*(p+1) == 'r')) - { - (void) fprintf(file,"\r"); - p++; - continue; - } - if ((*p == '\\') && (*(p+1) == 'n')) - { - (void) fprintf(file,"\n"); - p++; - continue; - } - if (*p != '%') - { - (void) fprintf(file,"%c",*p); - continue; - } - p++; - switch (*p) - { - case 'd': - { - (void) fprintf(file,"%.1024s",domain); - break; - } - case 'e': - { - (void) fprintf(file,"%.1024s",event); - break; - } - case 'f': - { - (void) fprintf(file,"%.1024s",function); - break; - } - case 'l': - { - (void) fprintf(file,"%lu",line); - break; - } - case 'm': - { - register const char - *lp; - - for (lp=srcname+strlen(srcname)-1; lp > srcname; lp--) - if (*lp == *DirectorySeparator) - { - lp++; - break; - } - (void) fprintf(file,"%.1024s",lp); - break; - } - case 'p': - { - (void) fprintf(file,"%ld",(long) getpid()); - break; - } - case 'r': - { - (void) fprintf(file,"%ld:%-9.6f",(long) (elapsed_time/60.0), - fmod(elapsed_time,60.0)); - break; - } - case 's': - { - (void) fprintf(file,"%.1024s",severity); - break; - } - case 't': - { - (void) fprintf(file,"%02d:%02d:%02d",time_meridian->tm_hour, - time_meridian->tm_min,time_meridian->tm_sec); - break; - } - case 'u': - { - (void) fprintf(file,"%0.3fu",user_time); - break; - } - default: - { - (void) fprintf(file,"%%"); - (void) fprintf(file,"%c",*p); - break; - } - } - } - (void) fprintf(file,"\n"); + (void) fprintf(file,"%s",message); (void) fflush(file); } - if ((log_info->output_type & MethodOutput) && - (log_info->method != (LogMethod) NULL)) - { - char - buffer[MaxTextExtent]; - - FormatString(buffer, - "%.1024s %ld:%-9.6f %0.3f %ld %.1024s %.1024s %lu %.1024s" - " %.1024s %.1024s\n", - timestamp, (long) (elapsed_time/60.0), - fmod(elapsed_time,60.0), - user_time, (long) getpid(), srcname, function, line, - domain, severity, event); - log_info->method(type,buffer); - } UnlockSemaphoreInfo(log_info->log_semaphore); - return(True); + return(MagickPass); } -MagickExport unsigned int LogMagickEvent(const ExceptionType type, +MagickExport MagickPassFail LogMagickEvent(const ExceptionType type, const char *module,const char *function,const unsigned long line, const char *format,...) { @@ -921,7 +963,7 @@ MagickExport unsigned int LogMagickEvent(const ExceptionType type, % % The format of the ReadLogConfigureFile method is: % -% unsigned int ReadLogConfigureFile(const char *basename, +% MagickPassFail ReadLogConfigureFile(const char *basename, % const unsigned int depth,ExceptionInfo *exception) % % A description of each parameter follows: @@ -1128,12 +1170,282 @@ static MagickPassFail ReadLogConfigureFile(const char *basename, MagickFreeMemory(xml); if ((depth == 0) && (status == MagickPass)) - log_info->log_configured=True; + log_info->log_configured=MagickTrue; return(status); } /* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S e t L o g D e f a u l t E v e n t T y p e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SetLogDefaultEventType() accepts a comma-delimited list (Annotate, Blob, +% Cache, Coder, Configure, Deprecate, Error, Exception, FatalError, +% Information, Locale, Option, Render, Resource, TemporaryFile, Transform, +% User, Warning, or X11) that determines the default set of events to log. +% All other events are ignored. By default, no logging is enabled. +% +% This function should be called prior to InitializeMagick() since it +% provides defaults used by InitializeMagick() while the logging system +% is initialized. The events may be modified later after +% InitializeMagick() has been called using the SetLogEventMask() function. +% +% The format of SetLogDefaultEventType method is: +% +% void SetLogDefaultEventType( const char *events ) +% +% A description of each parameter follows: +% +% o events: Comma-separated list of events to report. +% +% +*/ +MagickExport void SetLogDefaultEventType(const char *events) +{ + if (events != NULL) + { + LogEventType event_flags=ParseEvents(events); + log_info_defaults.events=event_flags; + } +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S e t L o g D e f a u l t G e n e r a t i o n s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SetLogDefaultGenerations() specifies the maximum number of log files +% to maintain before circulating back to overwrite the first name. +% +% This function should be called prior to InitializeMagick() since it +% provides defaults used by InitializeMagick() while the logging system +% is initialized. +% +% The format of SetLogDefaultGenerations method is: +% +% void SetLogDefaultGenerations(const unsigned long generations) +% +% A description of each parameter follows: +% +% o generations: Number of log files to maintain before circulating back to +% the first name. +% +% +*/ +MagickExport void SetLogDefaultGenerations(const unsigned long generations) +{ + log_info_defaults.generations=generations; +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S e t L o g D e f a u l t L i m i t % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SetLogDefaultLimit() specifies the maximum number of logging events which +% may occur before creating a new log file. +% +% This function should be called prior to InitializeMagick() since it +% provides defaults used by InitializeMagick() while the logging system +% is initialized. +% +% The format of SetLogDefaultLimit method is: +% +% void SetLogDefaultLimit(const unsigned long limit) +% +% A description of each parameter follows: +% +% o limit: Maximum number of logging events before creating a new log file. +% +% +*/ +MagickExport void SetLogDefaultLimit(const unsigned long limit) +{ + log_info_defaults.limit=limit; +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S e t L o g D e f a u l t L o g M e t h o d % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SetLogDefaultLogMethod() provides a call-back function to be invoked +% for each log event when the logging method type is MethodOutput. +% This call-back function is supported when MethodOutput is enabled +% in the log output type. MethodOutput is automatically enabled if +% a call-back function is provided, and disabled if the call-back +% function is NULL. +% +% This function should be called prior to InitializeMagick() since it +% provides defaults used by InitializeMagick() while the logging system +% is initialized. +% +% The format of SetLogDefaultLogMethod method is: +% +% void SetLogDefaultLogMethod( const LogMethod method ) +% +% A description of each parameter follows: +% +% o method: Call-back function to be invoked for each log event. +% +% +*/ +MagickExport void SetLogDefaultLogMethod(const LogMethod method) +{ + if (method == (LogMethod) NULL) + { + log_info_defaults.output_type=(LogOutputType) + (log_info_defaults.output_type & ~MethodOutput); + } + else + { + log_info_defaults.output_type=(LogOutputType) + (log_info_defaults.output_type | MethodOutput); + } + + log_info_defaults.method=method; +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S e t L o g D e f a u l t O u t p u t T y p e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SetLogDefaultOutputType() sets the logging output destination. +% +% This function should be called prior to InitializeMagick() since it +% provides defaults used by InitializeMagick() while the logging system +% is initialized. +% +% The format of SetLogDefaultOutputType method is: +% +% void SetLogDefaultOutputType( const LogOutputType output_type ) +% +% A description of each parameter follows: +% +% o output_type: The logging output destination. One of the enumerated +% values of LogOutputType. +% +% +*/ +MagickExport void SetLogDefaultOutputType(const LogOutputType output_type) +{ + log_info_defaults.output_type=output_type; +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S e t L o g D e f a u l t F o r ma t % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SetLogDefaultFormat() provides the format of the logging output. +% The specification supports these special format characters: +% +% %d domain +% %e event +% %f function +% %l line +% %m module +% %p process ID +% %r real CPU time +% %t wall clock time +% %u user CPU time +% %% percent sign +% \n newline +% \r carriage return +% +% This function should be called prior to InitializeMagick() since it +% provides defaults used by InitializeMagick() while the logging system +% is initialized. +% +% The format of SetLogDefaultFormat method is: +% +% void SetLogDefaultFormat( const char *format ) +% +% A description of each parameter follows: +% +% o format: The format of the logging output. +% +% +*/ +MagickExport void SetLogDefaultFormat( const char *format ) +{ + (void) strlcpy(log_info_defaults.format,format,sizeof(log_info_defaults.format)); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S e t L o g D e f a u l t F i l e N a m e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SetLogDefaultFileName() provides the file name, or file path, to be +% written to for each log event. Place a %d in the file name in order to +% support multiple log generations. This setting is only used when the +% log output type uses an output file. +% +% This function should be called prior to InitializeMagick() since it +% provides defaults used by InitializeMagick() while the logging system +% is initialized. +% +% The format of SetLogDefaultFileName method is: +% +% void SetLogDefaultFileName( const char *filename ) +% +% A description of each parameter follows: +% +% o filename: File name, or file path to write log output to. +% +% +*/ +MagickExport void SetLogDefaultFileName( const char *filename ) +{ + (void) strlcpy(log_info_defaults.filename,filename,sizeof(log_info_defaults.filename)); +} + +/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % @@ -1144,11 +1456,14 @@ static MagickPassFail ReadLogConfigureFile(const char *basename, % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% SetLogEventMask() accepts a comma-delimited list that determines which -% events to log. All other events are ignored. By default, no logging is -% enabled. This method returns the updated log event mask. +% SetLogEventMask() accepts a comma-delimited list (Annotate, Blob, Cache, +% Coder, Configure, Deprecate, Error, Exception, FatalError, Information, +% Locale, Option, Render, Resource, TemporaryFile, Transform, User, +% Warning, or X11) that determines which events to log. All other events +% are ignored. By default, no logging is enabled. This method returns +% the updated log event mask. % -% The format of the AcquireString method is: +% The format of the SetLogEventMask method is: % % unsigned long SetLogEventMask(const char *events) % @@ -1190,14 +1505,27 @@ MagickExport unsigned long SetLogEventMask(const char *events) % % % % % % -% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % SetLogFormat() sets the format for the "human readable" log record. +% The format specification supports these special format characters: +% +% %d domain, +% %e event, +% %f function, +% %l line, +% %m module, +% %p process ID, +% %r real CPU time, +% %t wall clock time, +% %u user CPU time, +% %% percent sign, +% \n newline, +% \r carriage return % % The format of the LogMagickFormat method is: % -% SetLogFormat(const char *format) +% void SetLogFormat(const char *format) % % A description of each parameter follows: % @@ -1223,19 +1551,18 @@ MagickExport void SetLogFormat(const char *format) % % % % % % -% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% SetLogMethod() sets the method that should be called when logging. +% SetLogMethod() sets the method to be called when logging. % % The format of the SetLogMethod method is: % -% SetLogFormat(LogMethod) +% void SetLogMethod(LogMethod method) % % A description of each parameter follows: % -% o method: pointer to a method that will be called when LogMagickEvent is -% being called. +% o method: pointer to a method of type LogMethod that will be called when LogMagickEvent +% is called. Pass a null pointer to remove a registered method. % % */ @@ -1243,8 +1570,17 @@ MagickExport void SetLogMethod(LogMethod method) { LockSemaphoreInfo(log_info->log_semaphore); - log_info->output_type=(LogOutputType) (log_info->output_type | - MethodOutput); + if (method == (LogMethod) NULL) + { + log_info->output_type=(LogOutputType) + (log_info->output_type & ~MethodOutput); + } + else + { + log_info->output_type=(LogOutputType) + (log_info->output_type | MethodOutput); + } + log_info->method=method; UnlockSemaphoreInfo(log_info->log_semaphore); diff --git a/magick/log.h b/magick/log.h index 2801f5e..4bff1d6 100644 --- a/magick/log.h +++ b/magick/log.h @@ -11,6 +11,8 @@ #ifndef _MAGICK_LOG_H #define _MAGICK_LOG_H +#include "magick/error.h" + #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif @@ -71,8 +73,24 @@ typedef enum AllEventsMask = 0x7FFFFFFF } LogEventType; +/* + Typedef declarations. +*/ +typedef enum +{ + DisabledOutput = 0x0000, + UndefinedOutput = 0x0000, + StdoutOutput = 0x0001, + StderrOutput = 0x0002, + XMLFileOutput = 0x0004, + TXTFileOutput = 0x0008, + Win32DebugOutput = 0x0010, + Win32EventlogOutput = 0x0020, + MethodOutput = 0x0040 +} LogOutputType; + typedef void - (*LogMethod)(const ExceptionType,const char *); + (*LogMethod)(const ExceptionType type,const char *text); /* Method declarations. @@ -90,6 +108,13 @@ extern MagickExport unsigned long SetLogEventMask(const char *events); extern MagickExport void + SetLogDefaultEventType(const char *events), + SetLogDefaultGenerations(const unsigned long generations), + SetLogDefaultLimit(const unsigned long limit), + SetLogDefaultFileName( const char *filename ), + SetLogDefaultFormat( const char *format ), + SetLogDefaultLogMethod(const LogMethod method), + SetLogDefaultOutputType(const LogOutputType output_type), SetLogFormat(const char *format), SetLogMethod(LogMethod); diff --git a/magick/magic-private.h b/magick/magic-private.h index cbc6c7d..3073751 100644 --- a/magick/magic-private.h +++ b/magick/magic-private.h @@ -10,7 +10,7 @@ */ extern MagickExport MagickPassFail - InitializeMagicInfo(void); + InitializeMagicInfo(void) MAGICK_FUNC_CONST; extern MagickExport void DestroyMagicInfo(void); diff --git a/magick/magic.c b/magick/magic.c index 096ffbb..0a7f93f 100644 --- a/magick/magic.c +++ b/magick/magic.c @@ -92,7 +92,6 @@ StaticMagic[] = MAGIC("GIF", 0, "GIF8"), MAGIC("HDF", 1, "HDF"), MAGIC("HPGL", 0, "IN;"), - MAGIC("HPGL", 0, "\033E\033"), MAGIC("HTML", 1, "HTML"), MAGIC("HTML", 1, "html"), MAGIC("ILBM", 8, "ILBM"), diff --git a/magick/magick.c b/magick/magick.c index 00988c6..0911a71 100644 --- a/magick/magick.c +++ b/magick/magick.c @@ -37,6 +37,9 @@ Include declarations. */ #include "magick/studio.h" +#if defined(USE_GLIBC_MTRACE) && USE_GLIBC_MTRACE +# include +#endif /* if defined(USE_GLIBC_MTRACE) && USE_GLIBC_MTRACE */ #if defined(MSWINDOWS) || defined(__CYGWIN__) # include "magick/nt_feature.h" #endif @@ -178,7 +181,7 @@ DestroyMagick(void) DestroyColorInfo(); /* Color database */ DestroyDelegateInfo(); /* External delegate information */ DestroyTypeInfo(); /* Font information */ - DestroyMagicInfo(); /* File format detection */ + /*DestroyMagicInfo();*/ /* File format detection */ DestroyMagickInfoList(); /* Coder registrations + modules */ DestroyConstitute(); /* Constitute semaphore */ DestroyMagickRegistry(); /* Registered images */ @@ -186,7 +189,9 @@ DestroyMagick(void) DestroyMagickRandomGenerator(); /* Random number generator */ DestroyTemporaryFiles(); /* Temporary files */ #if defined(MSWINDOWS) +#if defined(HasGS) NTGhostscriptUnLoadDLL(); /* Ghostscript DLL */ +#endif /* if defined(HasGS) */ #endif /* defined(MSWINDOWS) */ /* Destroy logging last since some components log their destruction. @@ -611,63 +616,94 @@ static RETSIGTYPE MagickPanicSignalHandler(int signo); static RETSIGTYPE MagickSignalHandler(int signo); /* - Signal function which prevents interrupted system calls from - automatically being restarted. From W. Richard Stevens "Advanced - Programming in the UNIX Environment", Chapter 10.14. + Signal function which only sets the signal handler if it its handling + is still set to SIG_DFL. This ensures that signal handlers are not + registered for signals which are being ignored, or that the API + user has already registered before invoking InitializeMagick. + + Due to a weakness in the POSIX APIs, the only way to see the handler + which was registered before is by registering a new handler. + + If an API user registers its own signal hander, then it is responsible + for invoking DestroyMagick when a signal is received. */ -static Sigfunc * -MagickSignal(int signo, Sigfunc *func) +static void +MagickCondSignal(int signo, Sigfunc *func) { #if defined(HAVE_SIGACTION) && defined(HAVE_SIGEMPTYSET) struct sigaction act, oact; + /* + Signal set-up code which prevents interrupted system calls from + automatically being restarted. From W. Richard Stevens "Advanced + Programming in the UNIX Environment", Chapter 10.14. + */ act.sa_handler=func; (void) sigemptyset(&act.sa_mask); act.sa_flags=0; # if defined(SA_INTERRUPT) /* SunOS */ act.sa_flags |= SA_INTERRUPT; -# endif +# endif /* if defined(SA_INTERRUPT) */ # if defined(SA_ONSTACK) /* Use alternate signal stack if available */ act.sa_flags |= SA_ONSTACK; -# endif - if (sigaction(signo, &act, &oact) < 0) - return (SIG_ERR); - return (oact.sa_handler); -#else - return signal(signo, func); -#endif -} +# endif /* if defined(SA_ONSTACK) */ -/* - Signal function which only sets the signal handler if it its handling - is still set to SIG_DFL. This ensures that signal handlers are not - registered for signals which are being ignored, or that the API - user has already registered before invoking InitializeMagick. + (void) memset(&oact, 0, sizeof(oact)); + if (sigaction(signo, &act, &oact) == 0) + { + if ((oact.sa_flags & SA_SIGINFO) || + (oact.sa_handler != SIG_DFL)) + { + /* Restore prior handler! */ + if (sigaction(signo, &oact, &act) != 0) + (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), + "Failed to restore prior signal handler for signal ID %d!",signo); + else + (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), + "Restored prior signal handler for signal ID %d!",signo); + } + else + { + (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), + "Registered signal handler for signal ID %d",signo); + } + } + else + { + (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), + "Failed to register signal handler for signal ID %d!",signo); + } - If an API user registers its own signal hander, then it is responsible - for invoking DestroyMagick when a signal is received. -*/ -static Sigfunc * -MagickCondSignal(int signo, Sigfunc *func) -{ +#else Sigfunc * o_handler; - if ((o_handler=MagickSignal(signo,func)) != SIG_ERR) + if ((o_handler=signal(signo, func)) != SIG_ERR) { - /* - If handler is not the default, then restore the previous - setting. - */ if (o_handler != SIG_DFL) - (void) MagickSignal(signo,o_handler); + { + /* Restore prior handler! */ + if (signal(signo, o_handler) == SIG_ERR) + (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), + "Failed to restore prior signal handler for signal ID %d!",signo); + else + (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), + "Restored prior signal handler for signal ID %d!",signo); + } else - (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), - "Registered signal handler for signal ID %d",signo); + { + (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), + "Registered signal handler for signal ID %d",signo); + } + } + else + { + (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), + "Failed to register signal handler for signal ID %d!",signo); } - return (o_handler); +#endif } /* @@ -1021,49 +1057,49 @@ InitializeMagickSignalHandlers(void) #if 0 /* termination of child process */ #if defined(SIGCHLD) - (void) MagickCondSignal(SIGCHLD,MagickIgnoreSignalHandler); + MagickCondSignal(SIGCHLD,MagickIgnoreSignalHandler); #endif #endif /* hangup, default terminate */ #if defined(SIGHUP) - (void) MagickCondSignal(SIGHUP,MagickSignalHandler); + MagickCondSignal(SIGHUP,MagickSignalHandler); #endif /* interrupt (CONTROL-c), default terminate */ #if defined(SIGINT) - (void) MagickCondSignal(SIGINT,MagickSignalHandler); + MagickCondSignal(SIGINT,MagickSignalHandler); #endif /* quit (CONTROL-\), default terminate with core */ #if defined(SIGQUIT) - (void) MagickCondSignal(SIGQUIT,MagickPanicSignalHandler); + MagickCondSignal(SIGQUIT,MagickPanicSignalHandler); #endif /* software-triggered abort, default terminate with core */ #if defined(SIGABRT) - (void) MagickCondSignal(SIGABRT,MagickPanicSignalHandler); + MagickCondSignal(SIGABRT,MagickPanicSignalHandler); #endif /* floating point exception, default terminate with core */ #if defined(SIGFPE) - (void) MagickCondSignal(SIGFPE,MagickPanicSignalHandler); + MagickCondSignal(SIGFPE,MagickPanicSignalHandler); #endif /* software termination signal from kill, default terminate */ #if defined(SIGTERM) - (void) MagickCondSignal(SIGTERM,MagickSignalHandler); + MagickCondSignal(SIGTERM,MagickSignalHandler); #endif /* Bus Error */ #if defined(SIGBUS) - (void) MagickCondSignal(SIGBUS,MagickPanicSignalHandler); + MagickCondSignal(SIGBUS,MagickPanicSignalHandler); #endif /* segmentation fault */ #if defined(SIGSEGV) - (void) MagickCondSignal(SIGSEGV,MagickPanicSignalHandler); + MagickCondSignal(SIGSEGV,MagickPanicSignalHandler); #endif /* exceeded cpu limit, default terminate */ #if defined(SIGXCPU) - (void) MagickCondSignal(SIGXCPU,MagickSignalHandler); + MagickCondSignal(SIGXCPU,MagickSignalHandler); #endif /* exceeded file size limit, default terminate */ #if defined(SIGXFSZ) - (void) MagickCondSignal(SIGXFSZ,MagickSignalHandler); + MagickCondSignal(SIGXFSZ,MagickSignalHandler); #endif } @@ -1154,6 +1190,10 @@ InitializeMagickEx(const char *path, unsigned int options, return status; } +#if defined(USE_GLIBC_MTRACE) && USE_GLIBC_MTRACE + mtrace(); +#endif /* f defined(USE_GLIBC_MTRACE) && USE_GLIBC_MTRACE */ + /* Save initialization options in case we need them later */ initialize_magick_options = options; @@ -1253,7 +1293,7 @@ InitializeMagickEx(const char *path, unsigned int options, InitializeMagickRegistry(); /* Image/blob registry */ InitializeConstitute(); /* Constitute semaphore */ InitializeMagickInfoList(); /* Coder registrations + modules */ - InitializeMagicInfo(); /* File format detection */ + /*InitializeMagicInfo();*/ /* File format detection */ InitializeTypeInfo(); /* Font information */ InitializeDelegateInfo(); /* External delegate information */ InitializeColorInfo(); /* Color database */ diff --git a/magick/magick_config.h.in b/magick/magick_config.h.in index 2a37080..e5e1a2f 100644 --- a/magick/magick_config.h.in +++ b/magick/magick_config.h.in @@ -6,6 +6,9 @@ /* Define if coders and filters are to be built as modules. */ #undef BuildMagickModules +/* Disable reading and writing of gzip/bzip files */ +#undef DISABLE_COMPRESSED_FILES + /* Disable OpenMP for algorithms which sometimes run slower */ #undef DisableSlowOpenMP @@ -408,6 +411,9 @@ /* Define if you have FlashPIX library */ #undef HasFPX +/* Enable use of Ghostscript */ +#undef HasGS + /* Define if you have JBIG library */ #undef HasJBIG @@ -562,9 +568,6 @@ /* Number of bits in a pixel Quantum (8/16/32) */ #undef QuantumDepth -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - /* Setjmp/longjmp are thread safe */ #undef SETJMP_IS_THREAD_SAFE diff --git a/magick/memory-private.h b/magick/memory-private.h index 3bb9f15..0be98a2 100644 --- a/magick/memory-private.h +++ b/magick/memory-private.h @@ -15,6 +15,16 @@ extern MagickExport void extern MagickExport size_t MagickArraySize(const size_t count,const size_t size) MAGICK_FUNC_CONST; +extern MagickExport + void *_MagickReallocateResourceLimitedMemory(void *p,const size_t count,const size_t size,const MagickBool clear); + +extern MagickExport + void *_MagickAllocateResourceLimitedMemory(const size_t size); + +extern MagickExport + void _MagickFreeResourceLimitedMemory(void *p); + + /* Allocate memory */ @@ -42,6 +52,35 @@ extern MagickExport size_t } /* + Allocate/Reallocate/Free memory (resource limited) + */ +#define MagickAllocateResourceLimitedMemory(type,size) \ + ((((size) != ((size_t) (size))) || (size == 0)) ? ((type) 0) : \ + ((type) _MagickReallocateResourceLimitedMemory(0,1,(size_t) (size),MagickFalse))) + +#define MagickAllocateResourceLimitedClearedMemory(type,size) \ + ((((size) != ((size_t) (size))) || (size == 0)) ? ((type) 0) : \ + ((type) _MagickReallocateResourceLimitedMemory(0,1,(size_t) (size),MagickTrue))) + +#define MagickAllocateResourceLimitedArray(type,count,size) \ + ((type) _MagickReallocateResourceLimitedMemory(0,(size_t) (count),(size_t) (size),MagickFalse)) + +#define MagickAllocateResourceLimitedClearedArray(type,count,size) \ + ((type) _MagickReallocateResourceLimitedMemory(0,(size_t) (count),(size_t) (size),MagickTrue)) + +#define MagickReallocateResourceLimitedMemory(type,memory,size) \ + ((type) _MagickReallocateResourceLimitedMemory(memory,1,(size_t) (size),MagickFalse)) + +#define MagickReallocateResourceLimitedArray(type,memory,count,size) \ + ((type) _MagickReallocateResourceLimitedMemory(memory,(size_t) (count),(size_t) (size),MagickFalse)) + +#define MagickReallocateResourceLimitedClearedArray(type,memory,count,size) \ + ((type) _MagickReallocateResourceLimitedMemory(memory,(size_t) (count),(size_t) (size),MagickTrue)) + +#define MagickFreeResourceLimitedMemory(memory) \ + memory=_MagickReallocateResourceLimitedMemory(memory,0,0,MagickFalse); + +/* Reallocate memory using provided pointer. If reallocation fails then free memory, setting pointer to null. If size is 0 and memory is not a null pointer, then free memory. This interface behaves diff --git a/magick/memory.c b/magick/memory.c index 58cbb41..0dfe45d 100644 --- a/magick/memory.c +++ b/magick/memory.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2018 GraphicsMagick Group +% Copyright (C) 2003-2020 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -37,6 +37,7 @@ Include declarations. */ #include "magick/studio.h" +#include "magick/resource.h" #include "magick/utility.h" #if defined(MAGICK_MEMORY_HARD_LIMIT) @@ -577,3 +578,224 @@ MagickExport void MagickFreeAligned(void *memory) #endif } } + +/* + Structure for tracking resource-limited memory allocation. + */ +typedef struct _MagickMemoryResource_T +{ + void *memory; /* Pointer to memory allocation */ + size_t alloc_size; /* Requested allocation size */ + size_t alloc_size_real; /* Real/underlying allocation size */ + size_t signature; /* Initialized to MagickSignature */ + +} MagickMemoryResource_T; + +#if !defined(MAGICK_DEBUG_RL_MEMORY) +#define MAGICK_DEBUG_RL_MEMORY 0 +#endif /* if !defined(MAGICK_DEBUG_RL_MEMORY) */ + +/* Return MemoryResource_T pointer given user-land pointer */ +#define MagickAccessMemoryResource_T_From_Pub(p) \ + ((MagickMemoryResource_T *) ((char *) p-sizeof(MagickMemoryResource_T))) +/* Return user-land pointer given private base allocation pointer */ +#define UserLandPointerGivenBaseAlloc(p) \ + ((char *)p+sizeof(MagickMemoryResource_T)) +/* Trace MemoryResource_T content given a pointer to it */ +#if defined(MAGICK_DEBUG_RL_MEMORY) && MAGICK_DEBUG_RL_MEMORY +#define TraceMagickAccessMemoryResource_T(operation,memory_resource) \ + fprintf(stderr,__FILE__ ":%d - %s memory_resource: memory=%p (user %p)," \ + " alloc_size=%zu," \ + " alloc_size_real=%zu\n", \ + __LINE__, \ + operation, \ + (memory_resource)->memory, \ + (memory_resource)->memory ? UserLandPointerGivenBaseAlloc((memory_resource)->memory) : 0, \ + (memory_resource)->alloc_size, \ + (memory_resource)->alloc_size_real); +#else +#define TraceMagickAccessMemoryResource_T(operation,memory_resource) ; +#endif + +/* + Clean up a MagickMemoryResource_T, releasing referenced memory and + resource allocation. Not safe if embedded in the memory buffer + being released! +*/ +static void _MagickFreeResourceLimitedMemory_T(MagickMemoryResource_T *memory_resource) +{ + TraceMagickAccessMemoryResource_T("FREE",memory_resource); + if (memory_resource->memory != 0) + { + MagickFree(memory_resource->memory); + memory_resource->memory=0; + } + if (memory_resource->alloc_size != 0) + LiberateMagickResource(MemoryResource, memory_resource->alloc_size); + memory_resource->alloc_size_real=0; + memory_resource->alloc_size=0; +} + + +/* + Reallocate resource-limited array memory based on pointer to + existing allocation, object count, and object size. Freshly + allocated memory is cleared to zero if the clear flag is set. + + This works like MagickRealloc() except for supporting count and size + arguments similar to calloc(). GNU libc has a reallocarray() + function using similar arguments. + + Alignment concerns: 128-bit SSE registers have an alignment + requirement of 16 bytes, the 256-bit Intel AVX registers have an + alignment requirement of 32 bytes, and the 512-bit Intel AVX-512 + registers have an alignment requirement of 64 bytes, that is. + + Linux malloc produces allocations aligned to 16-bytes. + */ +MagickExport void *_MagickReallocateResourceLimitedMemory(void *p, + const size_t count, + const size_t size, + const MagickBool clear) +{ + MagickMemoryResource_T memory_resource; + size_t size_diff; + const size_t new_size = MagickArraySize(count,size); + void *res; + MagickPassFail + status = MagickPass; + +#if defined(MAGICK_DEBUG_RL_MEMORY) && MAGICK_DEBUG_RL_MEMORY + fprintf(stderr,"%d: p = %p, count = %zu, size =%zu\n", __LINE__, p, count, size); +#endif + + if (p != 0) + { + assert(((ptrdiff_t) p - sizeof(MagickMemoryResource_T)) > 0); + (void) memcpy(&memory_resource, + (void *) MagickAccessMemoryResource_T_From_Pub(p), + sizeof(MagickMemoryResource_T)); + assert(memory_resource.signature == MagickSignature); + } + else + { + memory_resource.memory = 0; + memory_resource.alloc_size = 0; + memory_resource.alloc_size_real = 0; + memory_resource.signature = MagickSignature; + } + TraceMagickAccessMemoryResource_T("BEFORE", &memory_resource); + + do + { + if (((new_size == 0) && (count != 0) && (size != 0)) || + (new_size > SIZE_MAX/2) || (SIZE_MAX-new_size <= sizeof(MagickMemoryResource_T))) + { + /* Memory allocation FAILED */ +#if defined(ENOMEM) + errno = ENOMEM; +#endif /* if defined(ENOMEM) */ + status = MagickFail; + break; + } + else if (new_size == 0) + { + /* Deallocate all allocated memory (if any) */ + _MagickFreeResourceLimitedMemory_T(&memory_resource); + break; + } + else if (new_size > memory_resource.alloc_size) + { + /* Allocate or enlarge memory */ + size_diff = new_size - memory_resource.alloc_size; + if (AcquireMagickResource(MemoryResource,size_diff) == MagickPass) + { + if (new_size > memory_resource.alloc_size_real) + { + void *realloc_memory; + /* FIXME: Maybe over-allocate here if re-alloc? */ + realloc_memory = (ReallocFunc)(memory_resource.memory, + new_size+sizeof(MagickMemoryResource_T)); + if (realloc_memory != 0) + { + if (clear) + (void) memset(UserLandPointerGivenBaseAlloc(realloc_memory)+ + memory_resource.alloc_size,0,size_diff); + + memory_resource.memory = realloc_memory; + memory_resource.alloc_size = new_size; + memory_resource.alloc_size_real = new_size; + } + else + { + /* Memory re-allocation FAILED */ +#if defined(ENOMEM) + errno = ENOMEM; +#endif /* if defined(ENOMEM) */ + status = MagickFail; + } + } + else + { + if (clear) + (void) memset(UserLandPointerGivenBaseAlloc(memory_resource.memory)+ + memory_resource.alloc_size,0,size_diff); + + /* Re-allocation is not required */ + memory_resource.alloc_size = new_size; + } + } + else + { + /* Acquire memory resource FAILED */ +#if defined(ENOMEM) + errno = ENOMEM; +#endif /* if defined(ENOMEM) */ + status = MagickFail; + } + break; + } + else if (new_size < memory_resource.alloc_size) + { + /* Reduce memory */ + size_diff = memory_resource.alloc_size - new_size; + LiberateMagickResource(MemoryResource,size_diff); + memory_resource.alloc_size = new_size; + /* FIXME: Maybe actually realloc to smaller size here? */ + break; + } + } while (0); + + if (memory_resource.memory != 0) + { + (void) memcpy((void *) memory_resource.memory,&memory_resource, + sizeof(MagickMemoryResource_T)); + } + TraceMagickAccessMemoryResource_T("AFTER", &memory_resource); + + res = ((status == MagickPass) && memory_resource.memory) ? + UserLandPointerGivenBaseAlloc(memory_resource.memory) : 0; + + return res; +} + +/* + Allocate resource-limited memory. Similar to MagickMalloc(). + + Memory must be released using MagickFreeMemoryResource(). +*/ +MagickExport void *_MagickAllocateResourceLimitedMemory(const size_t size) +{ + return _MagickReallocateResourceLimitedMemory(0,1,size,MagickFalse); +} + +/* + Free resource-limited memory which was allocated by + MagickReallocMemoryResource() or MagickMallocMemoryResource(). + + Similar to MagickFree(). +*/ +MagickExport void _MagickFreeResourceLimitedMemory(void *p) +{ + _MagickReallocateResourceLimitedMemory(p,0,0,MagickFalse); +} diff --git a/magick/nt_base.c b/magick/nt_base.c index 41f23c7..8957fc5 100644 --- a/magick/nt_base.c +++ b/magick/nt_base.c @@ -54,10 +54,12 @@ static char *NTslsearchpath = (char *) NULL; #endif +#if defined(HasGS) static void *gs_dll_handle = (void *)NULL; static GhostscriptVectors gs_vectors; +#endif /* if defined(HasGS) */ static MagickPassFail NTstrerror_r(LONG errnum, char *strerrbuf, size_t buflen); @@ -1288,7 +1290,7 @@ NTGhostscriptFind(const char **gs_productfamily, " Searching for %s...", products[product_index]); FormatString(key,"SOFTWARE\\%s",products[product_index]); - + /* long WINAPI RegOpenKeyEx(const HKEY hKey, const LPCTSTR lpSubKey, const DWORD ulOptions, const REGSAM samDesired, @@ -1412,7 +1414,7 @@ NTGhostscriptGetString(const char *name, char *ptr, const size_t len) static int gs_major_version=0, - gs_minor_version=0; + gs_minor_version=0; unsigned int i; @@ -1455,6 +1457,7 @@ NTGhostscriptGetString(const char *name, char *ptr, const size_t len) return MagickFail; } +#if defined(HasGS) /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1615,6 +1618,7 @@ MagickExport int NTGhostscriptEXE(char *path, int path_length) return FALSE; } +#endif /* if defined(HasGS) */ /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1777,6 +1781,7 @@ MagickExport int NTGhostscriptFonts(char *path, int path_length) return FALSE; } +#if defined(HasGS) /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1867,6 +1872,7 @@ MagickExport int NTGhostscriptUnLoadDLL(void) return False; } +#endif /* if defined(HasGS) */ /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/magick/paint.c b/magick/paint.c index f9af5a5..7a19ae6 100644 --- a/magick/paint.c +++ b/magick/paint.c @@ -661,14 +661,29 @@ OpaqueImage(Image *image,const PixelPacket target,const PixelPacket fill) MagickPassFail status=MagickPass; - /* - Make image color opaque. - */ + MagickBool + is_monochrome = image->is_monochrome, + is_grayscale = image->is_grayscale; + assert(image != (Image *) NULL); assert(image->signature == MagickSignature); options.fuzz=image->fuzz; options.fill=fill; options.target=target; + + /* + Assure that image type is promoted as required based on color + */ + if ((is_grayscale || IsGrayColorspace(image->colorspace)) && !IsGray(fill)) + { + if ((is_monochrome) && !IsBlackPixel(fill) && !IsWhitePixel(fill)) + is_monochrome = MagickFalse; + is_grayscale = MagickFalse; + } + + /* + Make image color opaque. + */ if (image->storage_class == PseudoClass) { assert(image->colormap != (PixelPacket *) NULL); @@ -685,6 +700,9 @@ OpaqueImage(Image *image,const PixelPacket target,const PixelPacket fill) image,&image->exception); } + image->is_monochrome = is_monochrome; + image->is_grayscale = is_grayscale; + return(status); } diff --git a/magick/pixel_cache.c b/magick/pixel_cache.c index 71c16a9..18e7fcd 100644 --- a/magick/pixel_cache.c +++ b/magick/pixel_cache.c @@ -1003,7 +1003,7 @@ ReadCacheIndexes(const Cache cache,const NexusInfo *nexus_info, assert(cache != (Cache) NULL); cache_info=(CacheInfo *) cache; assert(cache_info->signature == MagickSignature); - if (!cache_info->indexes_valid) + if (!(cache_info->indexes_valid && (nexus_info->indexes != (IndexPacket *) NULL))) return(MagickFail); if (nexus_info->in_core) return(MagickPass); @@ -1994,13 +1994,13 @@ AcquireCacheNexus(const Image *image,const long x,const long y, static MagickPassFail ClipCacheNexus(Image *image,const NexusInfo *nexus_info) { - long + unsigned long y; register const PixelPacket *r; - register long + register unsigned long x; register PixelPacket @@ -2036,9 +2036,9 @@ ClipCacheNexus(Image *image,const NexusInfo *nexus_info) nexus_info->region.width,nexus_info->region.height,mask_nexus, &image->exception); if ((p != (PixelPacket *) NULL) && (r != (const PixelPacket *) NULL)) - for (y=0; y < (long) nexus_info->region.height; y++) + for (y=0; y < nexus_info->region.height; y++) { - for (x=0; x < (long) nexus_info->region.width; x++) + for (x=0; x < nexus_info->region.width; x++) { if (r->red == TransparentOpacity) q->red=p->red; @@ -2277,15 +2277,16 @@ SyncCacheNexus(Image *image,const NexusInfo *nexus_info, if (*ImageGetClipMaskInlined(image) != (Image *) NULL) if (!ClipCacheNexus(image,nexus_info)) status=MagickFail; - /* added mask */ - if ( status != MagickFail ) - { - if (*ImageGetCompositeMaskInlined(image) != (Image *) NULL) - { - if (!CompositeCacheNexus(image,nexus_info)) - status=MagickFail; - } - } + + /* added mask */ + if ( status != MagickFail ) + { + if (*ImageGetCompositeMaskInlined(image) != (Image *) NULL) + { + if (!CompositeCacheNexus(image,nexus_info)) + status=MagickFail; + } + } if (status != MagickFail) if ((status=WriteCachePixels(cache_info,nexus_info)) == MagickFail) @@ -4402,7 +4403,8 @@ InterpolateViewColor(ViewInfo *view, p3_area, p_area; - p=AcquireCacheViewPixels(view,(long) x_offset,(long) y_offset,2,2,exception); + p=AcquireCacheViewPixels(view,MagickDoubleToLong(x_offset), + MagickDoubleToLong(y_offset),2,2,exception); if (p == (const PixelPacket *) NULL) return MagickFail; @@ -4547,6 +4549,11 @@ ModifyCache(Image *image, ExceptionInfo *exception) if (status == MagickFail) DestroyCacheInfo(clone_image.cache); } + else + { + DestroyCacheInfo(clone_image.cache); + clone_image.cache=(CacheInfo *) NULL; + } DestroySemaphoreInfo(&clone_image.semaphore); if (status != MagickFail) @@ -4555,7 +4562,7 @@ ModifyCache(Image *image, ExceptionInfo *exception) image->cache=clone_image.cache; } if (status == MagickFail) - fprintf(stderr,"ModifyCache failed!\n"); + fprintf(stderr,"ModifyCache failed!\n"); /* oss-fuzz-20871 leaked clone_image.cache allocated by GetCacheInfo(&clone_image.cache) */ /* fprintf(stderr,"ModifyCache: Thread %d exits (cache_info = %p)\n", omp_get_thread_num(),image->cache); */ } @@ -4567,7 +4574,10 @@ ModifyCache(Image *image, ExceptionInfo *exception) cache if necessary. */ if (destroy_cache) - DestroyCacheInfo(cache_info); + { + DestroyCacheInfo(cache_info); + cache_info=(CacheInfo *) NULL; + } if (status != MagickFail) { diff --git a/magick/render.c b/magick/render.c index 70ffe44..8d74b0c 100644 --- a/magick/render.c +++ b/magick/render.c @@ -74,6 +74,14 @@ #if !defined(PRIMITIVE_INFO_POINTS_MAX) # define PRIMITIVE_INFO_POINTS_MAX ((~((size_t)0)) >> 8) #endif /* !defined(PRIMITIVE_INFO_POINTS_MAX) */ +/* Largest double value which can be converted to a long and survive AbsoluteValue() */ +#if LONG_MAX == 2147483647L +# define DTOLONG_MAX 2147483647.0 +# define DTOLONG_MIN -2147483647.0 +#else +# define DTOLONG_MAX 9007199254740992.0 +# define DTOLONG_MIN -9007199254740992.0 +#endif /* Typedef declarations. @@ -189,7 +197,7 @@ DrawInfoGetCompositePath(const DrawInfo * draw_info) Forward declarations. */ static PrimitiveInfo /* added Image* param so DrawInfo::stroke_width can be clamped */ - *TraceStrokePolygon(const Image *,const DrawInfo *,const PrimitiveInfo *); + *TraceStrokePolygon(const Image *,const DrawInfo *,const PrimitiveInfo *,ExceptionInfo *exception); static MagickPassFail DrawBoundingRectangles(Image *image,const DrawInfo *draw_info, @@ -236,6 +244,7 @@ static void #define STROKE_WIDTH_LIMIT(image) ((2.0*1.415) * Max((image)->columns,(image)->rows)) + /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -576,7 +585,7 @@ ReversePoints(PointInfo *points,const size_t number_points) } static PolygonInfo * -ConvertPathToPolygon(const PathInfo *path_info) +ConvertPathToPolygon(const PathInfo *path_info, ExceptionInfo *exception) { size_t edge, @@ -614,10 +623,12 @@ ConvertPathToPolygon(const PathInfo *path_info) return((PolygonInfo *) NULL); number_edges=16; polygon_info->edges= - MagickAllocateArray(EdgeInfo *,number_edges,sizeof(EdgeInfo)); + MagickAllocateResourceLimitedArray(EdgeInfo *,number_edges,sizeof(EdgeInfo)); if (polygon_info->edges == (EdgeInfo *) NULL) { DestroyPolygonInfo(polygon_info); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PolygonInfo *) NULL); } direction=0; @@ -648,14 +659,21 @@ ConvertPathToPolygon(const PathInfo *path_info) { if (edge == number_edges) { + EdgeInfo *new_edges; number_edges<<=1; - MagickReallocMemory(EdgeInfo *,polygon_info->edges, - MagickArraySize(number_edges,sizeof(EdgeInfo))); - if (polygon_info->edges == (EdgeInfo *) NULL) + new_edges=MagickReallocateResourceLimitedArray(EdgeInfo *, + polygon_info->edges, + number_edges, + sizeof(EdgeInfo)); + if (new_edges == (EdgeInfo *) NULL) { + MagickFreeResourceLimitedMemory(points); DestroyPolygonInfo(polygon_info); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PolygonInfo *) NULL); } + polygon_info->edges=new_edges; } polygon_info->edges[edge].number_points=n; polygon_info->edges[edge].scanline=(-1.0); @@ -671,15 +689,19 @@ ConvertPathToPolygon(const PathInfo *path_info) points=(PointInfo *) NULL; ghostline=MagickFalse; edge++; + polygon_info->number_edges=edge; } if (points == (PointInfo *) NULL) { number_points=16; points= - MagickAllocateArray(PointInfo *,number_points,sizeof(PointInfo)); + MagickAllocateResourceLimitedArray(PointInfo *, + number_points,sizeof(PointInfo)); if (points == (PointInfo *) NULL) { DestroyPolygonInfo(polygon_info); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PolygonInfo *) NULL); } } @@ -707,14 +729,20 @@ ConvertPathToPolygon(const PathInfo *path_info) point=points[n-1]; if (edge == number_edges) { + EdgeInfo *new_edges; number_edges<<=1; - MagickReallocMemory(EdgeInfo *,polygon_info->edges, - MagickArraySize(number_edges,sizeof(EdgeInfo))); - if (polygon_info->edges == (EdgeInfo *) NULL) + new_edges=MagickReallocateResourceLimitedArray(EdgeInfo *, + polygon_info->edges, + number_edges,sizeof(EdgeInfo)); + if (new_edges == (EdgeInfo *) NULL) { + MagickFreeResourceLimitedMemory(points); DestroyPolygonInfo(polygon_info); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PolygonInfo *) NULL); } + polygon_info->edges=new_edges; } polygon_info->edges[edge].number_points=n; polygon_info->edges[edge].scanline=(-1.0); @@ -727,12 +755,17 @@ ConvertPathToPolygon(const PathInfo *path_info) polygon_info->edges[edge].bounds=bounds; polygon_info->edges[edge].bounds.y1=points[0].y; polygon_info->edges[edge].bounds.y2=points[n-1].y; + points=(PointInfo *) NULL; + polygon_info->number_edges=edge+1; number_points=16; points= - MagickAllocateArray(PointInfo *,number_points,sizeof(PointInfo)); + MagickAllocateResourceLimitedArray(PointInfo *, + number_points,sizeof(PointInfo)); if (points == (PointInfo *) NULL) { DestroyPolygonInfo(polygon_info); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PolygonInfo *) NULL); } n=1; @@ -747,13 +780,19 @@ ConvertPathToPolygon(const PathInfo *path_info) continue; if (n == number_points) { + PointInfo *new_points; number_points<<=1; - MagickReallocMemory(PointInfo *,points,MagickArraySize(number_points,sizeof(PointInfo))); - if (points == (PointInfo *) NULL) + new_points=MagickReallocateResourceLimitedArray(PointInfo *,points, + number_points,sizeof(PointInfo)); + if (new_points == (PointInfo *) NULL) { + MagickFreeResourceLimitedMemory(points); DestroyPolygonInfo(polygon_info); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PolygonInfo *) NULL); } + points=new_points; } point=path_info[i].point; points[n]=point; @@ -767,20 +806,25 @@ ConvertPathToPolygon(const PathInfo *path_info) { if (n < 2) { - MagickFreeMemory(points); + MagickFreeResourceLimitedMemory(points); } else { if (edge == number_edges) { + EdgeInfo *new_edges; number_edges<<=1; - MagickReallocMemory(EdgeInfo *,polygon_info->edges, - MagickArraySize(number_edges,sizeof(EdgeInfo))); - if (polygon_info->edges == (EdgeInfo *) NULL) + new_edges=MagickReallocateResourceLimitedArray(EdgeInfo *,polygon_info->edges, + number_edges,sizeof(EdgeInfo)); + if (new_edges == (EdgeInfo *) NULL) { + MagickFreeResourceLimitedMemory(points); DestroyPolygonInfo(polygon_info); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PolygonInfo *) NULL); } + polygon_info->edges=new_edges; } polygon_info->edges[edge].number_points=n; polygon_info->edges[edge].scanline=(-1.0); @@ -793,8 +837,10 @@ ConvertPathToPolygon(const PathInfo *path_info) polygon_info->edges[edge].bounds=bounds; polygon_info->edges[edge].bounds.y1=points[0].y; polygon_info->edges[edge].bounds.y2=points[n-1].y; + points=(PointInfo *) NULL; ghostline=MagickFalse; edge++; + polygon_info->number_edges=edge; } } polygon_info->number_edges=edge; @@ -854,7 +900,8 @@ LogPathInfo(const PathInfo *path_info) static PathInfo * ConvertPrimitiveToPath(const DrawInfo *draw_info, - const PrimitiveInfo *primitive_info) + const PrimitiveInfo *primitive_info, + ExceptionInfo *exception) { PathInfo *path_info; @@ -898,9 +945,13 @@ ConvertPrimitiveToPath(const DrawInfo *draw_info, } for (i=0; primitive_info[i].primitive != UndefinedPrimitive; i++); path_info_elem=(2*i+6); - path_info=MagickAllocateArray(PathInfo *,path_info_elem,sizeof(PathInfo)); + path_info=MagickAllocateResourceLimitedArray(PathInfo *,path_info_elem,sizeof(PathInfo)); if (path_info == (PathInfo *) NULL) - return((PathInfo *) NULL); + { + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); + return((PathInfo *) NULL); + } coordinates=0; n=0; p.x=(-1.0); @@ -990,7 +1041,7 @@ ConvertPrimitiveToPath(const DrawInfo *draw_info, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DestroyDrawInfo() deallocates memory associated with an DrawInfo -% structure. +% structure. Nothing is done if the pointer passed is NULL. % % The format of the DestroyDrawInfo method is: % @@ -1059,7 +1110,7 @@ static size_t DestroyEdge(PolygonInfo * restrict polygon_info,const size_t edge) { assert(edge < polygon_info->number_edges); - MagickFreeMemory(polygon_info->edges[edge].points); + MagickFreeResourceLimitedMemory(polygon_info->edges[edge].points); polygon_info->number_edges--; if (edge < polygon_info->number_edges) (void) memmove(polygon_info->edges+edge,polygon_info->edges+edge+1, @@ -1147,8 +1198,8 @@ DestroyPolygonInfo(void *polygon_info_void) if (polygon_info->edges != (EdgeInfo *) NULL) { for (i=0; i < polygon_info->number_edges; i++) - MagickFreeMemory(polygon_info->edges[i].points); - MagickFreeMemory(polygon_info->edges); + MagickFreeResourceLimitedMemory(polygon_info->edges[i].points); + MagickFreeResourceLimitedMemory(polygon_info->edges); } MagickFreeMemory(polygon_info); } @@ -1208,11 +1259,11 @@ AffineEdge(const Image *image,const AffineMatrix *affine, if (affine->sx > MagickEpsilon) { intercept=(-z/affine->sx); - x=(long) ceil(intercept+MagickEpsilon-0.5); + x=MagickDoubleToLong(ceil(intercept+MagickEpsilon-0.5)); /* FIXME: validate */ if (x > inverse_edge.x1) inverse_edge.x1=x; intercept=(-z+image->columns)/affine->sx; - x=(long) ceil(intercept-MagickEpsilon-0.5); + x=MagickDoubleToLong(ceil(intercept-MagickEpsilon-0.5)); /* FIXME: validate */ if (x < inverse_edge.x2) inverse_edge.x2=x; } @@ -1220,11 +1271,11 @@ AffineEdge(const Image *image,const AffineMatrix *affine, if (affine->sx < -MagickEpsilon) { intercept=(-z+image->columns)/affine->sx; - x=(long) ceil(intercept+MagickEpsilon-0.5); + x=MagickDoubleToLong(ceil(intercept+MagickEpsilon-0.5)); /* FIXME: validate */ if (x > inverse_edge.x1) inverse_edge.x1=x; intercept=(-z/affine->sx); - x=(long) ceil(intercept-MagickEpsilon-0.5); + x=MagickDoubleToLong(ceil(intercept-MagickEpsilon-0.5)); /* FIXME: validate */ if (x < inverse_edge.x2) inverse_edge.x2=x; } @@ -1241,11 +1292,11 @@ AffineEdge(const Image *image,const AffineMatrix *affine, if (affine->rx > MagickEpsilon) { intercept=(-z /affine->rx); - x=(long) ceil(intercept+MagickEpsilon-0.5); + x=MagickDoubleToLong(ceil(intercept+MagickEpsilon-0.5)); /* FIXME: validate */ if (x > inverse_edge.x1) inverse_edge.x1=x; intercept=(-z+image->rows)/affine->rx; - x=(long) ceil(intercept-MagickEpsilon-0.5); + x=MagickDoubleToLong(ceil(intercept-MagickEpsilon-0.5)); /* FIXME: validate */ if (x < inverse_edge.x2) inverse_edge.x2=x; } @@ -1253,11 +1304,11 @@ AffineEdge(const Image *image,const AffineMatrix *affine, if (affine->rx < -MagickEpsilon) { intercept=(-z+image->rows)/affine->rx; - x=(long) ceil(intercept+MagickEpsilon-0.5); + x=MagickDoubleToLong(ceil(intercept+MagickEpsilon-0.5)); /* FIXME: validate */ if (x > inverse_edge.x1) inverse_edge.x1=x; intercept=(-z/affine->rx); - x=(long) ceil(intercept-MagickEpsilon-0.5); + x=MagickDoubleToLong(ceil(intercept-MagickEpsilon-0.5)); /* FIXME: validate */ if (x < inverse_edge.x2) inverse_edge.x2=x; } @@ -1277,9 +1328,11 @@ InverseAffineMatrix(const AffineMatrix *affine) inverse_affine; double - determinant; + determinant, + divisor; - determinant=1.0/(affine->sx*affine->sy-affine->rx*affine->ry); + divisor=affine->sx*affine->sy-affine->rx*affine->ry; + determinant=1.0/divisor; /* oss-fuzz 28293 runtime error: division by zero */ inverse_affine.sx=determinant*affine->sy; inverse_affine.rx=determinant*(-affine->rx); inverse_affine.ry=determinant*(-affine->ry); @@ -1551,7 +1604,7 @@ DrawBoundingRectangles(Image *image,const DrawInfo *draw_info, memset(primitive_info,0,sizeof(primitive_info)); clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); - if ((status=QueryColorDatabase("#000000ff",&clone_info->fill,&image->exception)) == MagickFail) + if ((status &= QueryColorDatabase("#000000ff",&clone_info->fill,&image->exception)) == MagickFail) goto draw_bounding_rectangles_end; resolution.x=72.0; resolution.y=72.0; @@ -1605,14 +1658,14 @@ DrawBoundingRectangles(Image *image,const DrawInfo *draw_info, { if (polygon_info->edges[i].direction) { - if ((status=QueryColorDatabase("red",&clone_info->stroke, - &image->exception)) == MagickFail) + if ((status &= QueryColorDatabase("red",&clone_info->stroke, + &image->exception)) == MagickFail) goto draw_bounding_rectangles_end; } else { - if ((status=QueryColorDatabase("green",&clone_info->stroke, - &image->exception)) == MagickFail) + if ((status &= QueryColorDatabase("green",&clone_info->stroke, + &image->exception)) == MagickFail) goto draw_bounding_rectangles_end; } start.x=polygon_info->edges[i].bounds.x1-mid; @@ -1620,28 +1673,28 @@ DrawBoundingRectangles(Image *image,const DrawInfo *draw_info, end.x=polygon_info->edges[i].bounds.x2+mid; end.y=polygon_info->edges[i].bounds.y2+mid; primitive_info[0].primitive=RectanglePrimitive; - if ((status=TraceRectangle(primitive_info,start,end)) == MagickFail) + if ((status &= TraceRectangle(primitive_info,start,end)) == MagickFail) goto draw_bounding_rectangles_end; primitive_info[0].method=ReplaceMethod; coordinates=(long) primitive_info[0].coordinates; primitive_info[coordinates].primitive=UndefinedPrimitive; - if ((status=DrawPrimitive(image,clone_info,primitive_info)) == MagickFail) + if ((status &= DrawPrimitive(image,clone_info,primitive_info)) == MagickFail) goto draw_bounding_rectangles_end; } } - if ((status=QueryColorDatabase("blue",&clone_info->stroke,&image->exception)) == MagickFail) + if ((status &= QueryColorDatabase("blue",&clone_info->stroke,&image->exception)) == MagickFail) goto draw_bounding_rectangles_end; start.x=bounds.x1-mid; start.y=bounds.y1-mid; end.x=bounds.x2+mid; end.y=bounds.y2+mid; primitive_info[0].primitive=RectanglePrimitive; - if ((status=TraceRectangle(primitive_info,start,end)) == MagickFail) + if ((status &= TraceRectangle(primitive_info,start,end)) == MagickFail) goto draw_bounding_rectangles_end; primitive_info[0].method=ReplaceMethod; coordinates=(long) primitive_info[0].coordinates; primitive_info[coordinates].primitive=UndefinedPrimitive; - if ((status=DrawPrimitive(image,clone_info,primitive_info)) == MagickFail) + if ((status &= DrawPrimitive(image,clone_info,primitive_info)) == MagickFail) goto draw_bounding_rectangles_end; draw_bounding_rectangles_end:; @@ -1700,86 +1753,110 @@ DrawClipPath(Image *image,const DrawInfo *draw_info, const char *name) assert(image != (Image *) NULL); assert(image->signature == MagickSignature); assert(draw_info != (const DrawInfo *) NULL); - FormatString(clip_path,"[%.1024s]",name); + assert(name != (const char *) NULL); + FormatString(clip_path,"[MVG:%.1024s]",name); attribute=GetImageAttribute(image,clip_path); - /* - FIXME: Desired error handling for missing clip-path attribute is - not clear (was returning MagickFail). Maybe the caller does not - know. - */ if (attribute == (ImageAttribute *) NULL) return(MagickPass); - image_clip_mask = *ImageGetClipMaskInlined(image); - if (image_clip_mask == (Image *) NULL) + do { - Image - *clip_mask; - - clip_mask=CloneImage(image,image->columns,image->rows,MagickTrue, - &image->exception); - if (clip_mask == (Image *) NULL) - return(MagickFail); - status=SetImageClipMask(image,clip_mask); - DestroyImage(clip_mask); - if (status == MagickFail) - return(MagickFail); image_clip_mask = *ImageGetClipMaskInlined(image); - } - else - { + if (image_clip_mask == (Image *) NULL) + { + /* + FIXME: Desired error handling for missing clip-path attribute is + not clear (was returning MagickFail). Maybe the caller does not + know. + */ + Image + *clip_mask; + + if ((clip_mask=CloneImage(image,image->columns,image->rows,MagickTrue, + &image->exception)) == (Image *) NULL) + break; + status &= SetImageClipMask(image,clip_mask); + /* + SetImageClipMask() clones the provided clip_mask image so + destroy original reference. + */ + DestroyImage(clip_mask); + if (status == MagickFail) + break; + image_clip_mask = *ImageGetClipMaskInlined(image); + } + else + { + /* + Re-clone the image attributes, since more may have been added since + the clip_mask image was created. + */ + DestroyImageAttributes(image_clip_mask); + CloneImageAttributes(image_clip_mask,image); + } + if ((status &= QueryColorDatabase("none",&image_clip_mask->background_color, + &image->exception)) == MagickFail) + break; + if ((status &= SetImage(image_clip_mask,TransparentOpacity)) == MagickFail) + break; + (void) LogMagickEvent(RenderEvent,GetMagickModule(), + "\nbegin clip-path %.1024s",draw_info->extra->clip_path); + if ((clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info)) == (DrawInfo *) NULL) + { + ThrowException3(&image->exception,ResourceLimitError, + MemoryAllocationFailed,UnableToDrawOnImage); + status=MagickFail; + break; + } + if ((status &= CloneString(&clone_info->primitive,attribute->value)) == MagickFail) + break; + if ((status &= QueryColorDatabase("white",&clone_info->fill,&image->exception)) == MagickFail) + break; + /* - Re-clone the image attributes, since more may have been added since - the clip_mask image was created. - */ - DestroyImageAttributes(image_clip_mask); - CloneImageAttributes(image_clip_mask,image); - } - if ((status=QueryColorDatabase("none",&image_clip_mask->background_color, - &image->exception)) == MagickFail) - goto draw_clip_path_end; - if ((status=SetImage(image_clip_mask,TransparentOpacity)) == MagickFail) - goto draw_clip_path_end; - (void) LogMagickEvent(RenderEvent,GetMagickModule(), - "\nbegin clip-path %.1024s",draw_info->extra->clip_path); - clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); - if ((status=CloneString(&clone_info->primitive,attribute->value)) == MagickFail) - goto draw_clip_path_end; - if ((status=QueryColorDatabase("white",&clone_info->fill,&image->exception)) == MagickFail) - goto draw_clip_path_end; + According to the SVG spec: - /* - According to the SVG spec: + The raw geometry of each child element exclusive of rendering properties such + as ‘fill’, ‘stroke’, ‘stroke-width’ within a ‘clipPath’ conceptually defines a + 1-bit mask (with the possible exception of anti-aliasing along the edge of the + geometry) which represents the silhouette of the graphics associated with that + element. Anything outside the outline of the object is masked out. - The raw geometry of each child element exclusive of rendering properties such - as ‘fill’, ‘stroke’, ‘stroke-width’ within a ‘clipPath’ conceptually defines a - 1-bit mask (with the possible exception of anti-aliasing along the edge of the - geometry) which represents the silhouette of the graphics associated with that - element. Anything outside the outline of the object is masked out. + To conform with the spec, we make sure that fill color (set above), stroke color, + stroke width, and group/global opacity are set to appropriate values. + */ + SetDrawInfoClippingPath(clone_info,MagickTrue); + if ( IsDrawInfoSVGCompliant(clone_info) ) + { + /* changes to fill, etc. will be ignored */ + if ((status &= QueryColorDatabase("none", + &clone_info->stroke,&image->exception)) /* SVG default */ + == MagickFail) + { + break; + } + clone_info->stroke_width = 0.0; /* SVG default */ + clone_info->opacity = OpaqueOpacity; /* SVG default */ + } - To conform with the spec, we make sure that fill color (set above), stroke color, - stroke width, and group/global opacity are set to appropriate values. - */ - SetDrawInfoClippingPath(clone_info,MagickTrue); - if ( IsDrawInfoSVGCompliant(clone_info) ) - { - /* changes to fill, etc. will be ignored */ - if ((status=QueryColorDatabase("none", - &clone_info->stroke,&image->exception)) /* SVG default */ - == MagickFail) + MagickFreeMemory(clone_info->extra->clip_path); + if ((status &= DrawImage(image_clip_mask,clone_info)) == MagickFail) { - goto draw_clip_path_end; + /* Copy exception into base image */ + if (image_clip_mask->exception.severity > image->exception.severity) + CopyException(&image->exception, &image_clip_mask->exception); + break; + } + if ((status &= NegateImage(image_clip_mask,False)) == MagickFail) + { + /* Copy exception into base image */ + if (image_clip_mask->exception.severity > image->exception.severity) + CopyException(&image->exception, &image_clip_mask->exception); + break; } - clone_info->stroke_width = 0.0; /* SVG default */ - clone_info->opacity = OpaqueOpacity; /* SVG default */ - } - MagickFreeMemory(clone_info->extra->clip_path); - if ((status=DrawImage(image_clip_mask,clone_info)) == MagickFail) - goto draw_clip_path_end; - if ((status=NegateImage(image_clip_mask,False)) == MagickFail) - goto draw_clip_path_end; + (void) LogMagickEvent(RenderEvent,GetMagickModule(),"end clip-path"); - draw_clip_path_end: + } while (0); if (clone_info != (DrawInfo *) NULL) { @@ -1788,11 +1865,10 @@ DrawClipPath(Image *image,const DrawInfo *draw_info, const char *name) clone_info = (DrawInfo *) NULL; } - (void) LogMagickEvent(RenderEvent,GetMagickModule(),"end clip-path"); return(status); } -/* code below for DrawCompositeMask() cloned/modifed from DrawClipMask() */ +/* code below for DrawCompositeMask() cloned/modifed from DrawClipPath() */ /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1843,57 +1919,76 @@ DrawCompositeMask(Image *image,const DrawInfo *draw_info, const char *name) assert(image != (Image *) NULL); assert(image->signature == MagickSignature); assert(draw_info != (const DrawInfo *) NULL); - FormatString(composite_path,"[%.1024s]",name); - attribute=GetImageAttribute(image,composite_path); - if (attribute == (ImageAttribute *) NULL) - return(MagickFail); - image_composite_mask = *ImageGetCompositeMaskInlined(image); - if (image_composite_mask == (Image *) NULL) + FormatString(composite_path,"[MVG:%.1024s]",name); + do { - Image - *composite_mask; - - composite_mask=CloneImage(image,image->columns,image->rows,MagickTrue, - &image->exception); - if (composite_mask == (Image *) NULL) - return(MagickFail); - status=SetImageCompositeMask(image,composite_mask); - DestroyImage(composite_mask); + if ((attribute=GetImageAttribute(image,composite_path)) == (ImageAttribute *) NULL) + { + status = MagickFail; + break; + } image_composite_mask = *ImageGetCompositeMaskInlined(image); - if (status == MagickFail) - return(MagickFail); - } - else - { - /* - Re-clone the image attributes, since more may have been added since - the composite_mask image was created. - */ - DestroyImageAttributes(image_composite_mask); - CloneImageAttributes(image_composite_mask,image); - } - if ((status=QueryColorDatabase("none",&image_composite_mask->background_color, - &image->exception)) == MagickFail) - goto draw_composite_mask_end; - if ((status=SetImage(image_composite_mask,TransparentOpacity)) == MagickFail) - goto draw_composite_mask_end; - (void) LogMagickEvent(RenderEvent,GetMagickModule(), - "\nbegin mask %.1024s",draw_info->extra->composite_path); - clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); - if ((status=CloneString(&clone_info->primitive,attribute->value)) == MagickFail) - goto draw_composite_mask_end; - /* these settings are per the SVG spec */ - if ((status=QueryColorDatabase("black",&clone_info->fill,&image->exception)) == MagickFail) - goto draw_composite_mask_end; - if ((status=QueryColorDatabase("none",&clone_info->stroke,&image->exception)) == MagickFail) - goto draw_composite_mask_end; - clone_info->stroke_width = 1.0; - clone_info->opacity = OpaqueOpacity; - if ((status=DrawImage(image_composite_mask,clone_info)) == MagickFail) - goto draw_composite_mask_end; - draw_composite_mask_end:; + if (image_composite_mask == (Image *) NULL) + { + Image + *composite_mask; + + composite_mask=CloneImage(image,image->columns,image->rows,MagickTrue, + &image->exception); + if (composite_mask == (Image *) NULL) + { + status = MagickFail; + break; + } + status &= SetImageCompositeMask(image,composite_mask); + DestroyImage(composite_mask); + image_composite_mask = *ImageGetCompositeMaskInlined(image); + if (status == MagickFail) + break; + } + else + { + /* + Re-clone the image attributes, since more may have been added since + the composite_mask image was created. + */ + DestroyImageAttributes(image_composite_mask); + CloneImageAttributes(image_composite_mask,image); + } + if ((status &= QueryColorDatabase("none",&image_composite_mask->background_color, + &image->exception)) == MagickFail) + break; + if ((status &= SetImage(image_composite_mask,TransparentOpacity)) == MagickFail) + break; + (void) LogMagickEvent(RenderEvent,GetMagickModule(), + "\nbegin mask %.1024s",draw_info->extra->composite_path); + if ((clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info)) == (DrawInfo *) NULL) + { + ThrowException3(&image->exception,ResourceLimitError, + MemoryAllocationFailed,UnableToDrawOnImage); + status=MagickFail; + break; + } + if ((status &= CloneString(&clone_info->primitive,attribute->value)) == MagickFail) + break; + /* these settings are per the SVG spec */ + if ((status &= QueryColorDatabase("black",&clone_info->fill,&image->exception)) == MagickFail) + break; + if ((status &= QueryColorDatabase("none",&clone_info->stroke,&image->exception)) == MagickFail) + break; + clone_info->stroke_width = 1.0; + clone_info->opacity = OpaqueOpacity; + if ((status &= DrawImage(image_composite_mask,clone_info)) == MagickFail) + { + /* Copy exception into base image */ + if (image_composite_mask->exception.severity > image->exception.severity) + CopyException(&image->exception, &image_composite_mask->exception); + break; + } + (void) LogMagickEvent(RenderEvent,GetMagickModule(),"end composite-path"); + } while (0); + DestroyDrawInfo(clone_info); - (void) LogMagickEvent(RenderEvent,GetMagickModule(),"end composite-path"); return(status); } @@ -1936,12 +2031,13 @@ DrawDashPolygon(const DrawInfo *draw_info,const PrimitiveInfo *primitive_info, double length, maximum_length, + maximum_length_limit, offset, scale, total_length; MagickPassFail - status; + status = MagickPass; PrimitiveInfo *dash_polygon; @@ -1968,16 +2064,18 @@ DrawDashPolygon(const DrawInfo *draw_info,const PrimitiveInfo *primitive_info, clone_info->miterlimit=0; for (i=0; primitive_info[i].primitive != UndefinedPrimitive; i++); number_vertices=i; - dash_polygon=MagickAllocateArray(PrimitiveInfo *, - (size_t) 2*number_vertices+1, - sizeof(PrimitiveInfo)); + dash_polygon=MagickAllocateResourceLimitedArray(PrimitiveInfo *, + (size_t) 2*number_vertices+1, + sizeof(PrimitiveInfo)); if (dash_polygon == (PrimitiveInfo *) NULL) { DestroyDrawInfo(clone_info); + ThrowException3(&image->exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return(MagickFail); } dash_polygon[0]=primitive_info[0]; - scale=ExpandAffine(&draw_info->affine); + scale=ExpandAffine(&draw_info->affine); /* oss-fuzz 24236 scale=121287375, total_length=542727042660000, maximum_length=605375610468750! */ length=scale*draw_info->dash_pattern[0]; offset=draw_info->dash_offset != 0.0 ? scale*draw_info->dash_offset : 0.0; j=1; @@ -2002,14 +2100,33 @@ DrawDashPolygon(const DrawInfo *draw_info,const PrimitiveInfo *primitive_info, offset=0.0; n++; } - status=MagickPass; maximum_length=0.0; total_length=0.0; + maximum_length_limit=100.0*sqrt((double)image->columns*(double)image->columns+ + (double) image->rows*(double) image->rows+ + +MagickEpsilon); for (i=1; (i < number_vertices) && (length >= 0.0); i++) { dx=primitive_info[i].point.x-primitive_info[i-1].point.x; dy=primitive_info[i].point.y-primitive_info[i-1].point.y; maximum_length=sqrt(dx*dx+dy*dy+MagickEpsilon); + /* + Apply an arbitrary limit on maximum length in order to avoid + seemingly unending iterations due to affine and other factors + (e.g. oss-fuzz 10614 & 24236). + + FIXME: It is TBD if the arbitrary limit factors used have any + basis in reality! Please report if this limit causes issues + with valid files. + */ + if (maximum_length > maximum_length_limit) + { + char message[MaxTextExtent]; + FormatString(message,"Maximum length: %g, Scale: %g", maximum_length, scale); + ThrowException(&image->exception,DrawError,UnreasonableDashPolygonLength,message); + status=MagickFail; + goto draw_dash_polygon_fail; + } if (length == 0.0) { if (draw_info->dash_pattern[n] != 0.0) @@ -2043,7 +2160,7 @@ DrawDashPolygon(const DrawInfo *draw_info,const PrimitiveInfo *primitive_info, j++; dash_polygon[0].coordinates=j; dash_polygon[j].primitive=UndefinedPrimitive; - status&=DrawStrokePolygon(image,clone_info,dash_polygon); + status &= DrawStrokePolygon(image,clone_info,dash_polygon); if (status == MagickFail) break; } @@ -2069,9 +2186,10 @@ DrawDashPolygon(const DrawInfo *draw_info,const PrimitiveInfo *primitive_info, j++; dash_polygon[0].coordinates=(size_t) j; dash_polygon[j].primitive=UndefinedPrimitive; - status&=DrawStrokePolygon(image,clone_info,dash_polygon); + status &= DrawStrokePolygon(image,clone_info,dash_polygon); } - MagickFreeMemory(dash_polygon); + draw_dash_polygon_fail:; + MagickFreeResourceLimitedMemory(dash_polygon); DestroyDrawInfo(clone_info); (void) LogMagickEvent(RenderEvent,GetMagickModule()," end draw-dash"); return(status); @@ -2123,6 +2241,7 @@ DrawDashPolygon(const DrawInfo *draw_info,const PrimitiveInfo *primitive_info, % % */ + static MagickBool IsPoint(const char *point) { @@ -2145,7 +2264,7 @@ static MagickPassFail MagickAddSizeT(const size_t b, const size_t o, size_t *r) return (((*r < b) || (*r < o)) ? MagickFail : MagickPass); } -static const char *recursion_key ="[DrawImageRecursion]"; +static const char recursion_key[] = "[DrawImageRecursion]"; static long DrawImageGetCurrentRecurseLevel(Image *image) { const ImageAttribute @@ -2209,24 +2328,38 @@ static void DrawImageRecurseOut(Image *image) */ static char * ExtractTokensBetweenPushPop ( - char * q, /* address of pointer into primitive string */ - char * token, /* big enough buffer for extracted string */ - size_t token_max_length, - char const * pop_string, /* stop when we see pop pop_string */ - Image *image, - size_t * pExtractedLength /* if not null, length of extracted string returned */ - ) + char * q, /* address of pointer into primitive string */ + char * token, /* big enough buffer for extracted string */ + size_t token_max_length, + char const * pop_string, /* stop when we see pop pop_string */ + Image *image, + size_t * pExtractedLength /* if not null, length of extracted string returned */ + ) {/*ExtractTokensBetweenPushPop*/ - char const * p; - char * pAfterPopString = 0; + char const *p; + char const *pq; + char *pAfterPopString = 0; char - name[MaxTextExtent]; + name[MaxTextExtent], + pop_message[MaxTextExtent]; size_t ExtractedLength = 0; + MagickBool found_pop = MagickFalse; + + FormatString(pop_message,"push %.512s", pop_string); /* next token is name associated with push/pop data */ + pq = q; MagickGetToken(q,&q,token,token_max_length); - FormatString(name,"[%.1024s]",token); + if (pq == q) + { + /* failed to get a token */ + if ( pExtractedLength ) + *pExtractedLength = ExtractedLength; + return NULL; + } + FormatString(name,"[MVG:%.1024s]",token); + FormatString(pop_message,"push %.512s %.512s", pop_string, token); /* search for "pop " */ for (p=q; *q != '\0'; ) @@ -2249,22 +2382,32 @@ char * ExtractTokensBetweenPushPop ( break; } if (LocaleCompare(token,pop_string) == 0) - break; /* found "pop " */ + { + found_pop = MagickTrue; + break; /* found "pop " */ + } } } - /* sanity check on extracted string length */ - if ( q > (p+4U) ) + if (found_pop) { - ExtractedLength = q - (p+4U); - (void) strncpy(token,p,ExtractedLength); + /* sanity check on extracted string length */ + if ( q > (p+4U) ) + { + ExtractedLength = q - (p+4U); + (void) strncpy(token,p,ExtractedLength); + } + token[ExtractedLength] = '\0'; + /* SetImageAttribute concatenates values! Delete with NULL */ + (void) SetImageAttribute(image,name,NULL); + (void) SetImageAttribute(image,name,token); + if (pAfterPopString != NULL) + q = pAfterPopString; /* skip ID string after "pop" */ + } + else + { + ThrowException(&image->exception,DrawError,UnbalancedPushPop,pop_message); } - token[ExtractedLength] = '\0'; - /* SetImageAttribute concatenates values! Delete with NULL */ - (void) SetImageAttribute(image,name,NULL); - (void) SetImageAttribute(image,name,token); - if (pAfterPopString != NULL) - q = pAfterPopString; /* skip ID string after "pop" */ if ( pExtractedLength ) *pExtractedLength = ExtractedLength; return(q); @@ -2279,6 +2422,7 @@ char * ExtractTokensBetweenPushPop ( */ static char * InsertAttributeIntoInputStream ( + const char *keyword, /* MVG keyword for diagnostics/debugging */ char * q, /* address of pointer into primitive string*/ char ** pprimitive, /* ptr to ptr to primitive string buffer */ size_t * pprimitive_extent, @@ -2296,19 +2440,27 @@ char * InsertAttributeIntoInputStream ( size_t RemainingLength; size_t NeededLength; + if (*pStatus == MagickFail) + return MagickFail; + /* get attribute name, then get attribute value */ if (MagickGetToken(q,&q,*ptoken,*ptoken_max_length) < 1) { *pStatus = MagickFail; return(q); } - FormatString(AttributeName,"[%.1024s]",*ptoken); + FormatString(AttributeName,"[MVG:%.1024s]",*ptoken); attribute=GetImageAttribute(image,AttributeName); if (attribute == (ImageAttribute *) NULL) { - /* the client specifies whether or not an undefined attributes is an error */ + /* the client specifies whether or not an undefined attribute is an error */ if ( UndefAttrIsError ) - *pStatus = MagickFail; + { + char message[MaxTextExtent]; + FormatString(message,"Primitive \"%s\" id \"%s\" not defined",keyword,*ptoken); + ThrowException(&image->exception,DrawError,InvalidPrimitiveArgument,message); + *pStatus = MagickFail; + } return(q); } @@ -2406,7 +2558,7 @@ PrimitiveInfoRealloc(PrimitiveInfoMgr * p_PIMgr, const size_t Needed) /* Need to realloc */ if (((*p_PIMgr->p_AllocCount > 0) && (have_memory == 0)) || ((NeedAllocCount > 0) && (needed_memory == 0)) || - (status=AcquireMagickResource(MemoryResource,added_memory)) == MagickFail) + (status &= AcquireMagickResource(MemoryResource,added_memory)) == MagickFail) { ThrowException3(p_PIMgr->p_Exception,ResourceLimitError,MemoryAllocationFailed,UnableToDrawOnImage); status = MagickFail; @@ -2573,9 +2725,6 @@ DrawImage(Image *image,const DrawInfo *draw_info) return(MagickFail); primitive_extent=strlen(primitive); - /* SetImageAttribute concatenates values! Delete with NULL */ - (void) SetImageAttribute(image,"[MVG]",NULL); - (void) SetImageAttribute(image,"[MVG]",primitive); if (getenv("MAGICK_SKIP_RENDERING") != NULL) { MagickFreeMemory(primitive); @@ -2769,8 +2918,9 @@ DrawImage(Image *image,const DrawInfo *draw_info) { if (LocaleCompare("class",keyword) == 0) {/*class*/ - q = InsertAttributeIntoInputStream(q,&primitive,&primitive_extent,&token,&token_max_length,image, - &status,MagickFalse/*UndefAttrIsError*/); + q = InsertAttributeIntoInputStream(keyword,q,&primitive,&primitive_extent, + &token,&token_max_length,image, + &status,MagickFalse/*UndefAttrIsError*/); break; }/*class*/ if (LocaleCompare("clip-path",keyword) == 0) @@ -2900,7 +3050,7 @@ DrawImage(Image *image,const DrawInfo *draw_info) MagickGetToken(q,&q,token,token_max_length); if ( IsDrawInfoSVGCompliantClippingPath(graphic_context[n]) ) break; /* if drawing clip path, ignore changes to fill color */ - FormatString(pattern,"[%.1024s]",token); + FormatString(pattern,"[MVG:%.1024s]",token); if (GetImageAttribute(image,pattern) != (ImageAttribute *) NULL) (void) DrawPatternPath(image,draw_info,token, &graphic_context[n]->fill_pattern); @@ -3130,10 +3280,8 @@ DrawImage(Image *image,const DrawInfo *draw_info) break; } (void) CloneString(&graphic_context[n]->extra->composite_path,token); - if (DrawCompositeMask(image,graphic_context[n], - graphic_context[n]->extra->composite_path) - == MagickFail) - status=MagickFail; + status &= DrawCompositeMask(image,graphic_context[n], + graphic_context[n]->extra->composite_path); break; } if (LocaleCompare("matte",keyword) == 0) @@ -3285,7 +3433,11 @@ DrawImage(Image *image,const DrawInfo *draw_info) MagickGetToken(q,&q,token,token_max_length); if (LocaleCompare("class",token) == 0) /* added "push class" to support "defs" */ { - q = ExtractTokensBetweenPushPop(q,token,token_max_length,"class",image,0); + char *nq = ExtractTokensBetweenPushPop(q,token,token_max_length,"class",image,0); + if (nq != NULL) + q=nq; + else + status=MagickFail; break; } if (LocaleCompare("clip-path",token) == 0) @@ -3295,9 +3447,11 @@ DrawImage(Image *image,const DrawInfo *draw_info) into new function ExtractTokensBetweenPushPop(). */ size_t ExtractedLength; - q = ExtractTokensBetweenPushPop(q,token,token_max_length,"clip-path",image,&ExtractedLength); /* NULLED */ - if ( ExtractedLength == 0 ) + char *nq = ExtractTokensBetweenPushPop(q,token,token_max_length,"clip-path",image,&ExtractedLength); /* NULLED */ + if ( (ExtractedLength == 0) || (nq == NULL) ) status=MagickFail; + else + q=nq; break; } if (LocaleCompare("gradient",token) == 0) @@ -3438,11 +3592,11 @@ DrawImage(Image *image,const DrawInfo *draw_info) status=MagickFail; break; } - FormatString(key,"[%.1024s]",name); + FormatString(key,"[MVG:%.1024s]",name); /* SetImageAttribute concatenates values! Delete with NULL */ (void) SetImageAttribute(image,key,NULL); (void) SetImageAttribute(image,key,token); - FormatString(key,"[%.1024s-geometry]",name); + FormatString(key,"[MVG:%.1024s-geometry]",name); FormatString(geometry,"%gx%g%+g%+g", Max(AbsoluteValue(bounds.x2-bounds.x1+1),1), Max(AbsoluteValue(bounds.y2-bounds.y1+1),1), @@ -3456,17 +3610,28 @@ DrawImage(Image *image,const DrawInfo *draw_info) if (LocaleCompare("id",token) == 0) /* added "push id" (to support "defs") */ { if ( defsPushCount > 0 ) - q = ExtractTokensBetweenPushPop(q,token,token_max_length,"id",image,0); + { + char *nq = ExtractTokensBetweenPushPop(q,token,token_max_length,"id",image,0); + if (nq == NULL) + status=MagickFail; + else + q=nq; + break; + } else /* extract from "push id " */ - MagickGetToken(q,&q,token,token_max_length); + { + MagickGetToken(q,&q,token,token_max_length); + } break; } if (LocaleCompare("mask",token) == 0) /* added mask */ { size_t ExtractedLength; - q = ExtractTokensBetweenPushPop(q,token,token_max_length,"mask",image,&ExtractedLength); - if ( ExtractedLength == 0 ) + char *nq = ExtractTokensBetweenPushPop(q,token,token_max_length,"mask",image,&ExtractedLength); + if ( (ExtractedLength == 0) || (nq == NULL) ) status=MagickFail; + else + q=nq; break; } if (LocaleCompare("pattern",token) == 0) @@ -3487,7 +3652,7 @@ DrawImage(Image *image,const DrawInfo *draw_info) break; } dval=ceil(ordinate-0.5); - if (((dval < (double) LONG_MIN || dval > (double) LONG_MAX)) || + if ((dval < DTOLONG_MIN) || (dval > DTOLONG_MAX) || (AcquireMagickResource(WidthResource,AbsoluteValue((magick_int64_t) dval)) != MagickPass)) { char resource_str[MaxTextExtent]; @@ -3507,7 +3672,7 @@ DrawImage(Image *image,const DrawInfo *draw_info) break; } dval=ceil(ordinate-0.5); - if ((dval < (double) LONG_MIN || dval > (double) LONG_MAX) || + if ((dval < DTOLONG_MIN) || (dval > DTOLONG_MAX) || (AcquireMagickResource(WidthResource,AbsoluteValue((magick_int64_t) dval)) != MagickPass)) { char resource_str[MaxTextExtent]; @@ -3528,7 +3693,7 @@ DrawImage(Image *image,const DrawInfo *draw_info) break; } dval=floor(ordinate+0.5); - if ((dval > (double) LONG_MAX) || + if ((dval > DTOLONG_MAX) || (AcquireMagickResource(WidthResource,(magick_int64_t) dval) != MagickPass)) { char resource_str[MaxTextExtent]; @@ -3549,7 +3714,7 @@ DrawImage(Image *image,const DrawInfo *draw_info) break; } dval=floor(ordinate+0.5); - if ((dval > (double) LONG_MAX) || + if ((dval > DTOLONG_MAX) || (AcquireMagickResource(WidthResource,(magick_int64_t) dval) != MagickPass)) { char resource_str[MaxTextExtent]; @@ -3570,6 +3735,15 @@ DrawImage(Image *image,const DrawInfo *draw_info) status=MagickFail; break; } + if ((bounds.width == 0) || (bounds.height == 0)) + { + char resource_str[MaxTextExtent]; + FormatString(resource_str,"pattern dimensions %lux%lu", bounds.width,bounds.height); + ThrowException(&image->exception,DrawError, + InvalidPrimitiveArgument,resource_str); + status=MagickFail; + break; + } for (p=q; *q != '\0'; ) { MagickGetToken(q,&q,token,token_max_length); @@ -3587,11 +3761,11 @@ DrawImage(Image *image,const DrawInfo *draw_info) } (void) strncpy(token,p,q-p-4); token[q-p-4]='\0'; - FormatString(key,"[%.1024s]",name); + FormatString(key,"[MVG:%.1024s]",name); /* SetImageAttribute concatenates values! Delete with NULL */ (void) SetImageAttribute(image,key,NULL); (void) SetImageAttribute(image,key,token); - FormatString(key,"[%.1024s-geometry]",name); + FormatString(key,"[MVG:%.1024s-geometry]",name); FormatString(geometry,"%lux%lu%+ld%+ld",bounds.width, bounds.height,bounds.x,bounds.y); /* SetImageAttribute concatenates values! Delete with NULL */ @@ -3716,10 +3890,13 @@ DrawImage(Image *image,const DrawInfo *draw_info) MagickGetToken(q,&q,token,token_max_length); if ( IsDrawInfoSVGCompliantClippingPath(graphic_context[n]) ) break; /* if drawing clip path, ignore changes to stroke color */ - FormatString(pattern,"[%.1024s]",token); + FormatString(pattern,"[MVG:%.1024s]",token); if (GetImageAttribute(image,pattern) != (ImageAttribute *) NULL) - (void) DrawPatternPath(image,draw_info,token, - &graphic_context[n]->stroke_pattern); + { + if ((status &= DrawPatternPath(image,draw_info,token, + &graphic_context[n]->stroke_pattern)) == MagickFail) + break; + } else {/*stroke color, not pattern*/ @@ -3941,6 +4118,8 @@ DrawImage(Image *image,const DrawInfo *draw_info) double value; MagickGetToken(q,&q,token,token_max_length); status &= MagickAtoFChk(token,&value); + if (status == MagickFail) + break; /* value may be specified using "em" or "ex" units */ if (LocaleNCompare(q,"em",2) == 0) { @@ -3960,6 +4139,8 @@ DrawImage(Image *image,const DrawInfo *draw_info) double value; MagickGetToken(q,&q,token,token_max_length); status &= MagickAtoFChk(token,&value); + if (status == MagickFail) + break; /* value may be specified using "em" or "ex" units */ if (LocaleNCompare(q,"em",2) == 0) { @@ -4075,8 +4256,9 @@ DrawImage(Image *image,const DrawInfo *draw_info) { if (LocaleCompare("use",keyword) == 0) { - q = InsertAttributeIntoInputStream(q,&primitive,&primitive_extent,&token,&token_max_length,image, - &status,MagickTrue/*UndefAttrIsError*/); + q = InsertAttributeIntoInputStream(keyword,q,&primitive,&primitive_extent, + &token,&token_max_length,image, + &status,MagickTrue/*UndefAttrIsError*/); break; } status=MagickFail; @@ -4147,10 +4329,14 @@ DrawImage(Image *image,const DrawInfo *draw_info) break; MagickGetToken(q,&q,token,token_max_length); status &= MagickAtoFChk(token,&point.x); + if (status == MagickFail) + break; MagickGetToken(q,&q,token,token_max_length); if (*token == ',') MagickGetToken(q,&q,token,token_max_length); status &= MagickAtoFChk(token,&point.y); + if (status == MagickFail) + break; MagickGetToken(q,(char **) NULL,token,token_max_length); if (*token == ',') MagickGetToken(q,&q,token,token_max_length); @@ -4165,7 +4351,7 @@ DrawImage(Image *image,const DrawInfo *draw_info) if (i < number_points) continue; /* Array is full; double the array size */ - if ((status=PrimitiveInfoRealloc(&PIMgr,number_points)) == MagickFail) + if ((status &= PrimitiveInfoRealloc(&PIMgr,number_points)) != MagickPass) break; } if (status == MagickFail) @@ -4363,7 +4549,7 @@ DrawImage(Image *image,const DrawInfo *draw_info) status=MagickFail; break; } - if ((status=TracePoint(primitive_info+j,primitive_info[j].point)) == MagickFail) + if ((status &= TracePoint(primitive_info+j,primitive_info[j].point)) == MagickFail) break; PIMgr.StoreStartingAt=i=(long) (j+primitive_info[j].coordinates); break; @@ -4375,8 +4561,8 @@ DrawImage(Image *image,const DrawInfo *draw_info) status=MagickFail; break; } - if ((status=TraceLine(primitive_info+j,primitive_info[j].point, - primitive_info[j+1].point)) == MagickFail) + if ((status &= TraceLine(primitive_info+j,primitive_info[j].point, + primitive_info[j+1].point)) == MagickFail) break; PIMgr.StoreStartingAt=i=(long) (j+primitive_info[j].coordinates); break; @@ -4407,9 +4593,9 @@ DrawImage(Image *image,const DrawInfo *draw_info) status=MagickFail; break; } - if ((status=TraceRectangle(primitive_info+j, - /*start*/primitive_info[j].point, - /*end*/primitive_info[j+1].point)) == MagickFail) + if ((status &= TraceRectangle(primitive_info+j, + /*start*/primitive_info[j].point, + /*end*/primitive_info[j+1].point)) == MagickFail) break; PIMgr.StoreStartingAt=i=(long) (j+primitive_info[j].coordinates); break; @@ -4449,10 +4635,10 @@ DrawImage(Image *image,const DrawInfo *draw_info) break; } PIMgr.StoreStartingAt=j; - if ((status=TraceRoundRectangle(&PIMgr, - /*start*/primitive_info[j].point, - /*end*/primitive_info[j+1].point, - /*arc*/primitive_info[j+2].point)) == MagickFail) + if ((status &= TraceRoundRectangle(&PIMgr, + /*start*/primitive_info[j].point, + /*end*/primitive_info[j+1].point, + /*arc*/primitive_info[j+2].point)) == MagickFail) break; PIMgr.StoreStartingAt=i=(long) (j+primitive_info[j].coordinates); break; @@ -4465,8 +4651,8 @@ DrawImage(Image *image,const DrawInfo *draw_info) break; } PIMgr.StoreStartingAt=j; - if ((status=TraceArc(&PIMgr,primitive_info[j].point, - primitive_info[j+1].point,primitive_info[j+2].point)) == MagickFail) + if ((status &= TraceArc(&PIMgr,primitive_info[j].point, + primitive_info[j+1].point,primitive_info[j+2].point)) == MagickFail) break; PIMgr.StoreStartingAt=i=(long) (j+primitive_info[j].coordinates); break; @@ -4488,10 +4674,10 @@ DrawImage(Image *image,const DrawInfo *draw_info) break; } PIMgr.StoreStartingAt=j; - if ((status=TraceEllipse(&PIMgr, - /*start*/primitive_info[j].point, /*centerX,centerY*/ - /*stop*/primitive_info[j+1].point, /*radiusX,radiusY*/ - /*degrees*/primitive_info[j+2].point)) == MagickFail) /*arcStart,arcEnd*/ + if ((status &= TraceEllipse(&PIMgr, + /*start*/primitive_info[j].point, /*centerX,centerY*/ + /*stop*/primitive_info[j+1].point, /*radiusX,radiusY*/ + /*degrees*/primitive_info[j+2].point)) == MagickFail) /*arcStart,arcEnd*/ break; PIMgr.StoreStartingAt=i=(long) (j+primitive_info[j].coordinates); break; @@ -4504,8 +4690,8 @@ DrawImage(Image *image,const DrawInfo *draw_info) break; } PIMgr.StoreStartingAt=j; - if ((status=TraceCircle(&PIMgr,primitive_info[j].point, - primitive_info[j+1].point)) == MagickFail) + if ((status &= TraceCircle(&PIMgr,primitive_info[j].point, + primitive_info[j+1].point)) == MagickFail) break; PIMgr.StoreStartingAt=i=(long) (j+primitive_info[j].coordinates); break; @@ -4753,17 +4939,17 @@ DrawPatternPath(Image *image,const DrawInfo *draw_info,const char *name, *image_info; MagickPassFail - status; + status = MagickPass; assert(image != (Image *) NULL); assert(image->signature == MagickSignature); assert(draw_info != (const DrawInfo *) NULL); assert(name != (const char *) NULL); - FormatString(attribute,"[%.1024s]",name); + FormatString(attribute,"[MVG:%.1024s]",name); path=GetImageAttribute(image,attribute); if (path == (ImageAttribute *) NULL) return(MagickFail); - FormatString(attribute,"[%.1024s-geometry]",name); + FormatString(attribute,"[MVG:%.1024s-geometry]",name); geometry=GetImageAttribute(image,attribute); if (geometry == (ImageAttribute *) NULL) return(MagickFail); @@ -4784,7 +4970,12 @@ DrawPatternPath(Image *image,const DrawInfo *draw_info,const char *name, DestroyImage(clone_info->stroke_pattern); clone_info->stroke_pattern=(Image *) NULL; (void) CloneString(&clone_info->primitive,path->value); - status=DrawImage(*pattern,clone_info); + if ((status &= DrawImage(*pattern,clone_info)) == MagickFail) + { + /* Copy exception into base image */ + if ((*pattern)->exception.severity > image->exception.severity) + CopyException(&image->exception, &(*pattern)->exception); + } DestroyDrawInfo(clone_info); (void) LogMagickEvent(RenderEvent,GetMagickModule(),"end pattern-path"); return(status); @@ -5023,6 +5214,66 @@ GetPixelOpacity(PolygonInfo * restrict polygon_info,const double mid, return(subpath_opacity); } +static PolygonInfo* ClonePolygonInfo(const PolygonInfo* orig_polygon_info, ExceptionInfo *exception) +{ + PolygonInfo + *polygon_info = (PolygonInfo *) NULL; + + size_t + edge; + + if (orig_polygon_info == (PolygonInfo *) NULL) + return polygon_info; + + if ((polygon_info=MagickAllocateMemory(PolygonInfo *,sizeof(PolygonInfo))) == (PolygonInfo *) NULL) + { + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); + return polygon_info; + } + + polygon_info->number_edges=0; + + if ((polygon_info->edges= + MagickAllocateResourceLimitedArray(EdgeInfo *, + orig_polygon_info->number_edges, + sizeof(EdgeInfo))) == (EdgeInfo *) NULL) + { + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); + DestroyPolygonInfo(polygon_info); + polygon_info=(PolygonInfo *) NULL; + return polygon_info; + } + + (void) memcpy(polygon_info->edges,orig_polygon_info->edges, + orig_polygon_info->number_edges*sizeof(EdgeInfo)); + + for (edge = 0; edge < orig_polygon_info->number_edges; edge++) + polygon_info->edges[edge].points = (PointInfo *) NULL; + + polygon_info->number_edges=orig_polygon_info->number_edges; + for (edge = 0; edge < polygon_info->number_edges; edge++) + { + if ((polygon_info->edges[edge].points= + MagickAllocateResourceLimitedArray(PointInfo *, + polygon_info->edges[edge].number_points, + sizeof(PointInfo))) == (PointInfo *) NULL) + { + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); + DestroyPolygonInfo(polygon_info); + polygon_info=(PolygonInfo *) NULL; + return polygon_info; + } + + (void) memcpy(polygon_info->edges[edge].points,orig_polygon_info->edges[edge].points, + polygon_info->edges[edge].number_points*sizeof(PointInfo)); + } + + return polygon_info; +} + static MagickPassFail DrawPolygonPrimitive(Image *image,const DrawInfo *draw_info, const PrimitiveInfo *primitive_info) @@ -5037,9 +5288,16 @@ DrawPolygonPrimitive(Image *image,const DrawInfo *draw_info, ThreadViewDataSet * restrict polygon_set = (ThreadViewDataSet *) NULL; + magick_uint64_t + total_pixels; + MagickPassFail status = MagickPass; + int + max_threads, + num_threads; + assert(image != (Image *) NULL); assert(image->signature == MagickSignature); assert(draw_info != (DrawInfo *) NULL); @@ -5051,9 +5309,30 @@ DrawPolygonPrimitive(Image *image,const DrawInfo *draw_info, if (primitive_info->coordinates <= 1) /*single point polygons have zero area; don't draw*/ return(MagickPass); + /* + Determine the number of threads to use. + */ + total_pixels = ((magick_uint64_t) image->rows * image->columns); + + max_threads=omp_get_max_threads(); + num_threads=max_threads; + + if (total_pixels < 250000UL) + num_threads=Min(num_threads,1); + else if (total_pixels < 1000000UL) + num_threads=Min(num_threads,4); + else if (total_pixels < 9000000UL) + num_threads=Min(num_threads,8); + + /* fprintf(stderr,"Using %d threads\n", num_threads); */ + { /* Allocate and initialize thread-specific polygon sets. + + There are thread-specific sets because GetPixelOpacity modifies + Edges (via DestroyEdge() and modifies Edge scanline and + highwater) */ PathInfo * restrict path_info; @@ -5062,23 +5341,46 @@ DrawPolygonPrimitive(Image *image,const DrawInfo *draw_info, index; path_info=(PathInfo *) NULL; - if ((path_info=ConvertPrimitiveToPath(draw_info,primitive_info)) + if ((path_info=ConvertPrimitiveToPath(draw_info,primitive_info,&image->exception)) != (PathInfo *) NULL) { if ((polygon_set=AllocateThreadViewDataSet(DestroyPolygonInfo,image, &image->exception)) != (ThreadViewDataSet *) NULL) { + unsigned int + allocated_views; + + PolygonInfo + *polygon_info; + + allocated_views=GetThreadViewDataSetAllocatedViews(polygon_set); + if ((int) allocated_views > num_threads) + allocated_views=num_threads; + /* Assign polygon for each worker thread. + + Only the first polygon set needs to be from + ConvertPathToPolygon() since they start off the same. + Otherwise an optimized clone can be used instead. + + To that end, we have now written ClonePolygonInfo() + + FIXME: A better solution would be to figure out how + threads can share common data while adding minimal + locking. The current algorithms do unfriendly things + such as compacting the structure using memmove(). */ - for (index=0; index < GetThreadViewDataSetAllocatedViews(polygon_set); index++) - AssignThreadViewData(polygon_set,index,(void *) ConvertPathToPolygon(path_info)); + polygon_info=ConvertPathToPolygon(path_info,&image->exception); + for (index=0; index < allocated_views; index++) + AssignThreadViewData(polygon_set,index,index == 0 ? (void *) polygon_info : + ClonePolygonInfo(polygon_info,&image->exception)); /* Verify worker thread allocations. */ - for (index=0; index < GetThreadViewDataSetAllocatedViews(polygon_set); index++) + for (index=0; index < allocated_views; index++) if (AccessThreadViewDataById(polygon_set,index) == (void *) NULL) { DestroyThreadViewDataSet(polygon_set); @@ -5087,10 +5389,14 @@ DrawPolygonPrimitive(Image *image,const DrawInfo *draw_info, } } - MagickFreeMemory(path_info); + MagickFreeResourceLimitedMemory(path_info); } if (polygon_set == (ThreadViewDataSet *) NULL) - return MagickFail; + { + ThrowException3(&image->exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); + return MagickFail; + } } /* @@ -5197,11 +5503,12 @@ DrawPolygonPrimitive(Image *image,const DrawInfo *draw_info, x_stop=(long) floor(bounds.x2+0.5); /* rounds n.5 to n+1 */ y_start=(long) ceil(bounds.y1-0.5); y_stop=(long) floor(bounds.y2+0.5); + #if defined(HAVE_OPENMP) # if defined(TUNE_OPENMP) # pragma omp parallel for schedule(runtime) shared(status) # else -# pragma omp parallel for schedule(guided) shared(status) +# pragma omp parallel for num_threads(2) schedule(guided) shared(status) # endif #endif for (y=y_start; y <= y_stop; y++) @@ -5266,16 +5573,17 @@ DrawPolygonPrimitive(Image *image,const DrawInfo *draw_info, fill=(primitive_info->method == FillToBorderMethod) || (primitive_info->method == FloodfillMethod); - x_start=(long) ceil(bounds.x1-0.5); /* rounds n.5 to n */ - x_stop=(long) floor(bounds.x2+0.5); /* rounds n.5 to n+1 */ - y_start=(long) ceil(bounds.y1-0.5); - y_stop=(long) floor(bounds.y2+0.5); + x_start=(long) ceil(bounds.x1-0.5); /* FIXME: validate */ /* rounds n.5 to n */ + x_stop=(long) floor(bounds.x2+0.5); /* FIXME: validate */ /* rounds n.5 to n+1 */ + y_start=(long) ceil(bounds.y1-0.5); /* FIXME: validate */ + y_stop=(long) floor(bounds.y2+0.5); /* FIXME: validate */ + #if 1 #if defined(HAVE_OPENMP) # if defined(TUNE_OPENMP) # pragma omp parallel for schedule(runtime) shared(status) # else -# pragma omp parallel for schedule(static) shared(status) +# pragma omp parallel for num_threads(num_threads) schedule(dynamic) shared(status) # endif #endif #endif @@ -5321,6 +5629,8 @@ DrawPolygonPrimitive(Image *image,const DrawInfo *draw_info, Fill and/or stroke. The fill_opacity returned by GetPixelOpacity() handles partial pixel coverage at the edge of a polygon, where 0==no coverage and 1==full coverage + + GetPixelOpacity() modifies some properties referenced by polygon_info. */ fill_opacity=GetPixelOpacity(polygon_info,mid,fill, draw_info->fill_rule, @@ -5396,15 +5706,15 @@ DrawPolygonPrimitive(Image *image,const DrawInfo *draw_info, if (!SyncImagePixelsEx(image,&image->exception)) thread_status=MagickFail; - if (thread_status == MagickFail) - { - status=thread_status; + } /* if (thread_status != MagickFail) */ + if (thread_status == MagickFail) + { + status=thread_status; #if defined(HAVE_OPENMP) # pragma omp flush (status) #endif - } } - } + } /* for (y=y_start */ } (void) LogMagickEvent(RenderEvent,GetMagickModule()," end draw-polygon"); @@ -5579,7 +5889,7 @@ DrawPrimitive(Image *image,const DrawInfo *draw_info, return status; } dvalue=ceil(primitive_info->point.x-0.5); - if (MAGICK_ISNAN(dvalue) || ((dvalue < (double) LONG_MIN)) || (dvalue > (double) LONG_MAX)) + if (MAGICK_ISNAN(dvalue) || ((dvalue < DTOLONG_MIN)) || (dvalue > DTOLONG_MAX)) { char double_str[18]; FormatString(double_str,"%g",dvalue); @@ -5588,7 +5898,7 @@ DrawPrimitive(Image *image,const DrawInfo *draw_info, } x=(long) dvalue; dvalue=ceil(primitive_info->point.y-0.5); - if (MAGICK_ISNAN(dvalue) || ((dvalue < (double) LONG_MIN)) || (dvalue > (double) LONG_MAX)) + if (MAGICK_ISNAN(dvalue) || ((dvalue < DTOLONG_MIN)) || (dvalue > DTOLONG_MAX)) { char double_str[18]; FormatString(double_str,"%g",dvalue); @@ -5793,6 +6103,9 @@ DrawPrimitive(Image *image,const DrawInfo *draw_info, FIXME: AnnotateImage sometimes returns error status here without throwing exception and under conditions which should be ok when rendering (e.g. off-canvas drawing). + + AnnotateImage() recurses back to DrawImage(). + DrawImage--> DrawPrimitive() --> AnnotateImage() --> DrawImage */ status&=AnnotateImage(image,clone_info); DestroyDrawInfo(clone_info); @@ -5812,9 +6125,13 @@ DrawPrimitive(Image *image,const DrawInfo *draw_info, if (primitive_info->text == (char *) NULL) break; clone_info=CloneImageInfo((ImageInfo *) NULL); + clone_info->subimage=0; + clone_info->subrange=1; if (LocaleNCompare(primitive_info->text,"data:",5) == 0) - composite_image=ReadInlineImage(clone_info,primitive_info->text, - &image->exception); + { + composite_image=ReadInlineImage(clone_info,primitive_info->text, + &image->exception); + } else { /* @@ -5862,18 +6179,23 @@ DrawPrimitive(Image *image,const DrawInfo *draw_info, FormatString(geometry,"%gx%g!",primitive_info[1].point.x, primitive_info[1].point.y); handler=SetMonitorHandler((MonitorHandler) NULL); - TransformImage(&composite_image,(char *) NULL,geometry); + status&=TransformImage(&composite_image,(char *) NULL,geometry); (void) SetMonitorHandler(handler); + if (status == MagickFail) + { + DestroyImageList(composite_image); + break; + } } if (!composite_image->matte) - SetImageOpacity(composite_image,OpaqueOpacity); + status&=SetImageOpacity(composite_image,OpaqueOpacity); if (draw_info->opacity != OpaqueOpacity) - SetImageOpacity(composite_image,draw_info->opacity); + status&=SetImageOpacity(composite_image,draw_info->opacity); affine=draw_info->affine; affine.tx=x; affine.ty=y; status&=DrawAffineImage(image,composite_image,&affine); - DestroyImage(composite_image); + DestroyImageList(composite_image); break; } default: @@ -6067,14 +6389,14 @@ DrawStrokePolygon(Image *image,const DrawInfo *draw_info, significantly different from that for the first path, so my suspicion is that that's where the bug is. However, it could also be in DrawPolygonPrimitive(). */ - stroke_polygon=TraceStrokePolygon(image,draw_info,p); + stroke_polygon=TraceStrokePolygon(image,draw_info,p,&image->exception); if (stroke_polygon == (PrimitiveInfo *) NULL) { status=MagickFail; break; } status&=DrawPolygonPrimitive(image,clone_info,stroke_polygon); - MagickFreeMemory(stroke_polygon); + MagickFreeResourceLimitedMemory(stroke_polygon); if (status == MagickFail) break; q=p+p->coordinates-1; @@ -6475,7 +6797,7 @@ TraceBezier(PrimitiveInfoMgr *p_PIMgr, } primitive_info = *pp_PrimitiveInfo + p_PIMgr->StoreStartingAt; - coefficients=MagickAllocateArray(double *,number_coordinates,sizeof(double)); + coefficients=MagickAllocateResourceLimitedArray(double *,number_coordinates,sizeof(double)); if (coefficients == (double *) NULL) { ThrowException3(p_PIMgr->p_Exception,ResourceLimitError,MemoryAllocationFailed, @@ -6483,7 +6805,7 @@ TraceBezier(PrimitiveInfoMgr *p_PIMgr, status=MagickFail; goto trace_bezier_done; } - points=MagickAllocateArray(PointInfo *,control_points,sizeof(PointInfo)); + points=MagickAllocateResourceLimitedArray(PointInfo *,control_points,sizeof(PointInfo)); if (points == (PointInfo *) NULL) { ThrowException3(p_PIMgr->p_Exception,ResourceLimitError,MemoryAllocationFailed, @@ -6535,8 +6857,8 @@ TraceBezier(PrimitiveInfoMgr *p_PIMgr, p--; } trace_bezier_done:; - MagickFreeMemory(points); - MagickFreeMemory(coefficients); + MagickFreeResourceLimitedMemory(points); + MagickFreeResourceLimitedMemory(coefficients); return status; } @@ -7498,7 +7820,8 @@ TraceSquareLinecap(PrimitiveInfo *primitive_info, static PrimitiveInfo * TraceStrokePolygon(const Image *image, /* added Image* param so DrawInfo::stroke_width can be clamped */ const DrawInfo *draw_info, - const PrimitiveInfo *primitive_info) + const PrimitiveInfo *primitive_info, + ExceptionInfo *exception) { typedef struct _LineSegment { @@ -7568,10 +7891,13 @@ TraceStrokePolygon(const Image *image, /* added Image* param so DrawInfo::strok /* moved path_p and path_q mem alloc to later since we might not need them */ polygon_primitive= - MagickAllocateArray(PrimitiveInfo *,((size_t) number_vertices+2), - sizeof(PrimitiveInfo)); + MagickAllocateResourceLimitedArray(PrimitiveInfo *, + ((size_t) number_vertices+2), + sizeof(PrimitiveInfo)); if (polygon_primitive == (PrimitiveInfo *) NULL) { + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PrimitiveInfo *) NULL); } (void) memcpy(polygon_primitive,primitive_info,number_vertices* @@ -7608,10 +7934,19 @@ TraceStrokePolygon(const Image *image, /* added Image* param so DrawInfo::strok if ( !DoStroke ) {/*skip stroking*/ /* create polygon with one element and 0 coords; DrawPolygonPrimitive() will ignore it */ - stroke_polygon = MagickAllocateArray(PrimitiveInfo *,1,sizeof(PrimitiveInfo)); - stroke_polygon[0] = polygon_primitive[0]; - stroke_polygon[0].coordinates = 0; - MagickFreeMemory(polygon_primitive); + stroke_polygon = MagickAllocateResourceLimitedArray(PrimitiveInfo *, + 1,sizeof(PrimitiveInfo)); + if (stroke_polygon == (PrimitiveInfo *) NULL) + { + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); + } + else + { + stroke_polygon[0] = polygon_primitive[0]; + stroke_polygon[0].coordinates = 0; + } + MagickFreeResourceLimitedMemory(polygon_primitive); return(stroke_polygon); }/*skip stroking*/ n=number_vertices-1; @@ -7622,17 +7957,25 @@ TraceStrokePolygon(const Image *image, /* added Image* param so DrawInfo::strok /* Allocate paths. */ - path_p=MagickAllocateArray(PointInfo *,(size_t) max_strokes_p+max_strokes_extra,sizeof(PointInfo)); + path_p=MagickAllocateResourceLimitedArray(PointInfo *, + (size_t) max_strokes_p+max_strokes_extra, + sizeof(PointInfo)); if (path_p == (PointInfo *) NULL) { - MagickFreeMemory(polygon_primitive); + MagickFreeResourceLimitedMemory(polygon_primitive); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PrimitiveInfo *) NULL); } - path_q=MagickAllocateArray(PointInfo *,(size_t) max_strokes_q+max_strokes_extra,sizeof(PointInfo)); + path_q=MagickAllocateResourceLimitedArray(PointInfo *, + (size_t) max_strokes_q+max_strokes_extra, + sizeof(PointInfo)); if (path_q == (PointInfo *) NULL) { - MagickFreeMemory(path_p); - MagickFreeMemory(polygon_primitive); + MagickFreeResourceLimitedMemory(path_p); + MagickFreeResourceLimitedMemory(polygon_primitive); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PrimitiveInfo *) NULL); } @@ -7775,27 +8118,40 @@ TraceStrokePolygon(const Image *image, /* added Image* param so DrawInfo::strok } if (p >= max_strokes_p) {/*p pointing into extra; time to realloc*/ + PointInfo *new_path_p; max_strokes_p+=max_strokes_extra; - MagickReallocMemory(PointInfo *,path_p,MagickArraySize((size_t) max_strokes_p+max_strokes_extra,sizeof(PointInfo))); - if (path_p == (PointInfo *) NULL) - { - MagickFreeMemory(path_p); - MagickFreeMemory(path_q); - MagickFreeMemory(polygon_primitive); + new_path_p=MagickReallocateResourceLimitedArray(PointInfo *,path_p, + (size_t) max_strokes_p+ + max_strokes_extra, + sizeof(PointInfo)); + if (new_path_p == (PointInfo *) NULL) + { + MagickFreeResourceLimitedMemory(path_p); + MagickFreeResourceLimitedMemory(path_q); + MagickFreeResourceLimitedMemory(polygon_primitive); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PrimitiveInfo *) NULL); } + path_p=new_path_p; }/*p pointing into extra; time to realloc*/ if (q >= max_strokes_q) {/*q pointing into extra; time to realloc*/ + PointInfo *new_path_q; max_strokes_q+=max_strokes_extra; - MagickReallocMemory(PointInfo *,path_q,MagickArraySize((size_t) max_strokes_q+max_strokes_extra,sizeof(PointInfo))); - if (path_q == (PointInfo *) NULL) + new_path_q=MagickReallocateResourceLimitedArray(PointInfo *,path_q, + (size_t) max_strokes_q+max_strokes_extra, + sizeof(PointInfo)); + if (new_path_q == (PointInfo *) NULL) { - MagickFreeMemory(path_p); - MagickFreeMemory(path_q); - MagickFreeMemory(polygon_primitive); + MagickFreeResourceLimitedMemory(path_p); + MagickFreeResourceLimitedMemory(path_q); + MagickFreeResourceLimitedMemory(polygon_primitive); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PrimitiveInfo *) NULL); } + path_q=new_path_q; }/*q pointing into extra; time to realloc*/ dot_product=dx.q*dy.p-dx.p*dy.q; if (dot_product <= 0.0) @@ -7854,15 +8210,21 @@ TraceStrokePolygon(const Image *image, /* added Image* param so DrawInfo::strok /* in case arc_segments is big */ if ( (q+arc_segments) >= max_strokes_q ) {/*q+arc_segments will point into extra; time to realloc*/ + PointInfo *new_path_q; max_strokes_q+=arc_segments+max_strokes_extra; - MagickReallocMemory(PointInfo *,path_q,MagickArraySize((size_t) max_strokes_q+max_strokes_extra,sizeof(PointInfo))); - if (path_q == (PointInfo *) NULL) + new_path_q=MagickReallocateResourceLimitedArray(PointInfo *,path_q, + (size_t) max_strokes_q+max_strokes_extra, + sizeof(PointInfo)); + if (new_path_q == (PointInfo *) NULL) { - MagickFreeMemory(path_p); - MagickFreeMemory(path_q); - MagickFreeMemory(polygon_primitive); + MagickFreeResourceLimitedMemory(path_p); + MagickFreeResourceLimitedMemory(path_q); + MagickFreeResourceLimitedMemory(polygon_primitive); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PrimitiveInfo *) NULL); } + path_q=new_path_q; }/*q+arc_segments will point into extra; time to realloc*/ path_q[q].x=box_q[1].x; path_q[q].y=box_q[1].y; @@ -7938,15 +8300,21 @@ TraceStrokePolygon(const Image *image, /* added Image* param so DrawInfo::strok /* in case arc_segments is big */ if ( (p+arc_segments) >= max_strokes_p ) {/*p+arc_segments will point into extra; time to realloc*/ + PointInfo *new_path_p; max_strokes_p+=arc_segments+max_strokes_extra; - MagickReallocMemory(PointInfo *,path_p,MagickArraySize((size_t) max_strokes_p+max_strokes_extra,sizeof(PointInfo))); - if (path_p == (PointInfo *) NULL) + new_path_p=MagickReallocateResourceLimitedArray(PointInfo *,path_p, + (size_t) max_strokes_p+max_strokes_extra, + sizeof(PointInfo)); + if (new_path_p == (PointInfo *) NULL) { - MagickFreeMemory(path_p); - MagickFreeMemory(path_q); - MagickFreeMemory(polygon_primitive); + MagickFreeResourceLimitedMemory(path_p); + MagickFreeResourceLimitedMemory(path_q); + MagickFreeResourceLimitedMemory(polygon_primitive); + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); return((PrimitiveInfo *) NULL); } + path_p=new_path_p; }/*p+arc_segments will point into extra; time to realloc*/ path_p[p++]=box_p[1]; for (j=1; j < arc_segments; j++) @@ -7980,44 +8348,49 @@ TraceStrokePolygon(const Image *image, /* added Image* param so DrawInfo::strok Trace stroked polygon. */ stroke_polygon= - MagickAllocateArray(PrimitiveInfo *,MagickArraySize((size_t) p+q+2,(size_t) closed_path+2), + MagickAllocateResourceLimitedArray(PrimitiveInfo *, + MagickArraySize((size_t) p+q+2,(size_t) closed_path+2), sizeof(PrimitiveInfo)); - if (stroke_polygon != (PrimitiveInfo *) NULL) + if (stroke_polygon == (PrimitiveInfo *) NULL) + { + ThrowException3(exception,ResourceLimitError,MemoryAllocationFailed, + UnableToDrawOnImage); + goto trace_stroke_polygon_done; + } + + for (i=0; i < (long) p; i++) + { + stroke_polygon[i]=polygon_primitive[0]; + stroke_polygon[i].point=path_p[i]; + } + if (closed_path) { - for (i=0; i < (long) p; i++) - { - stroke_polygon[i]=polygon_primitive[0]; - stroke_polygon[i].point=path_p[i]; - } - if (closed_path) - { - stroke_polygon[i]=polygon_primitive[0]; - stroke_polygon[i].point=stroke_polygon[0].point; - i++; - } - for ( ; i < (long) (p+q+closed_path); i++) - { - stroke_polygon[i]=polygon_primitive[0]; - stroke_polygon[i].point=path_q[p+q+closed_path-(i+1)]; - } - if (closed_path) - { - stroke_polygon[i]=polygon_primitive[0]; - stroke_polygon[i].point=stroke_polygon[p+closed_path].point; - i++; - } stroke_polygon[i]=polygon_primitive[0]; stroke_polygon[i].point=stroke_polygon[0].point; i++; - stroke_polygon[i].primitive=UndefinedPrimitive; - stroke_polygon[0].coordinates=(size_t) p+q+(size_t) 2*closed_path+1; } + for ( ; i < (long) (p+q+closed_path); i++) + { + stroke_polygon[i]=polygon_primitive[0]; + stroke_polygon[i].point=path_q[p+q+closed_path-(i+1)]; + } + if (closed_path) + { + stroke_polygon[i]=polygon_primitive[0]; + stroke_polygon[i].point=stroke_polygon[p+closed_path].point; + i++; + } + stroke_polygon[i]=polygon_primitive[0]; + stroke_polygon[i].point=stroke_polygon[0].point; + i++; + stroke_polygon[i].primitive=UndefinedPrimitive; + stroke_polygon[0].coordinates=(size_t) p+q+(size_t) 2*closed_path+1; trace_stroke_polygon_done:; - MagickFreeMemory(path_p); - MagickFreeMemory(path_q); - MagickFreeMemory(polygon_primitive); + MagickFreeResourceLimitedMemory(path_p); + MagickFreeResourceLimitedMemory(path_q); + MagickFreeResourceLimitedMemory(polygon_primitive); return(stroke_polygon); } diff --git a/magick/resize.c b/magick/resize.c index cb6ea55..57f1de2 100644 --- a/magick/resize.c +++ b/magick/resize.c @@ -854,7 +854,11 @@ HorizontalFilter(const Image * restrict source,Image * restrict destination, if (IsEventLogging()) (void) LogMagickEvent(TransformEvent,GetMagickModule(), - "Enter HorizontalFilter() ..."); + "Horizontal Filter: %lux%lu => %lux%lu " + "(x_factor %g, blur %g, span %"MAGICK_SIZE_T_F"u) ...", + source->columns, source->rows, + destination->columns, destination->rows, + x_factor, blur, (MAGICK_SIZE_T) span); quantum = *quantum_p; @@ -1066,7 +1070,7 @@ HorizontalFilter(const Image * restrict source,Image * restrict destination, if (IsEventLogging()) (void) LogMagickEvent(TransformEvent,GetMagickModule(), - "%s exit HorizontalFilter()", + "%s exit Horizontal Filter", (status == MagickFail ? "Error" : "Normal")); *quantum_p = quantum; @@ -1102,7 +1106,11 @@ VerticalFilter(const Image * restrict source,Image * restrict destination, if (IsEventLogging()) (void) LogMagickEvent(TransformEvent,GetMagickModule(), - "Enter VerticalFilter() ..."); + "Vertical Filter: %lux%lu => %lux%lu " + "(y_factor %g, blur %g, span %"MAGICK_SIZE_T_F"u) ...", + source->columns, source->rows, + destination->columns, destination->rows, + y_factor, blur, (MAGICK_SIZE_T) span); quantum = *quantum_p; @@ -1318,7 +1326,7 @@ VerticalFilter(const Image * restrict source,Image * restrict destination, if (IsEventLogging()) (void) LogMagickEvent(TransformEvent,GetMagickModule(), - "%s exit VerticalFilter()", + "%s exit Vertical Filter", (status == MagickFail ? "Error" : "Normal")); *quantum_p = quantum; @@ -1409,7 +1417,10 @@ MagickExport Image *ResizeImage(const Image *image,const unsigned long columns, else source_image=CloneImage(resize_image,image->columns,rows,True,exception); if (source_image == (Image *) NULL) - return ((Image *) NULL); + { + DestroyImage(resize_image); + return ((Image *) NULL); + } /* Allocate filter contribution info. @@ -1453,6 +1464,10 @@ MagickExport Image *ResizeImage(const Image *image,const unsigned long columns, */ status=MagickPass; quantum=0; + if (IsEventLogging()) + (void) LogMagickEvent(TransformEvent,GetMagickModule(), + "Resize filter order: %s", + order ? "Horizontal/Vertical" : "Vertical/Horizontal"); if (order) { span=(size_t) source_image->columns+resize_image->rows; @@ -1498,7 +1513,8 @@ MagickExport Image *ResizeImage(const Image *image,const unsigned long columns, % % SampleImage() scales an image to the desired dimensions with pixel % sampling. Unlike other scaling methods, this method does not introduce -% any additional color into the scaled image. +% any additional color into the scaled image. SampleImage() is extremely +% fast and may be used where speed is most important. % % The format of the SampleImage method is: % @@ -1663,7 +1679,10 @@ SampleImage(const Image *image,const unsigned long columns, % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% ScaleImage() changes the size of an image to the given dimensions. +% ScaleImage() changes the size of an image to the specified dimensions. +% This method is reasonably fast but it is not currently multi-threaded +% and does not support image filters. The quality of the resized image +% is sufficient for most purposes. % % The format of the ScaleImage method is: % @@ -2103,8 +2122,10 @@ MagickExport Image *ScaleImage(const Image *image,const unsigned long columns, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % ThumbnailImage() changes the size of an image to the given dimensions. -% This method was designed by Bob Friesenhahn as a low cost thumbnail -% generator. +% This method was designed as a low cost thumbnail generator. +% ThumbnailImage() is typically very fast but an attempt is made to improve +% quality by first using a simple sampling algorithm for part of the +% reduction, and then a filtering algorithm to produce the final image. % % The format of the ThumbnailImage method is: % diff --git a/magick/segment.c b/magick/segment.c index 9c53237..09c94d5 100644 --- a/magick/segment.c +++ b/magick/segment.c @@ -286,530 +286,532 @@ Classify(Image * restrict image,short **extrema, ExtentPacket blue = { 0.0, 0, 0, 0}, green = { 0.0, 0, 0, 0}, - red = { 0.0, 0, 0, 0}; + red = { 0.0, 0, 0, 0}; - unsigned long - count; - - long - y; - - PixelPacket - * restrict colormap=0; - - register const PixelPacket - * restrict p; - - register double - * restrict squares; + unsigned long + count; - register IndexPacket - * restrict indexes; + long + y; - register long - i, - x; + register double + * restrict squares; - register PixelPacket - * restrict q; + register long + i, + x; - unsigned long - number_clusters; + unsigned long + number_clusters; - unsigned long - row_count=0; + unsigned long + row_count=0; - MagickBool - monitor_active; + MagickBool + monitor_active; - MagickPassFail - status=MagickPass; + MagickPassFail + status=MagickPass; - monitor_active=MagickMonitorActive(); + monitor_active=MagickMonitorActive(); - /* - Form clusters. - */ - cluster=(Cluster *) NULL; - head=(Cluster *) NULL; - red.index=0; - while (DefineRegion(extrema[Red],&red)) + /* + Form clusters. + */ + cluster=(Cluster *) NULL; + head=(Cluster *) NULL; + red.index=0; + while (DefineRegion(extrema[Red],&red)) + { + green.index=0; + while (DefineRegion(extrema[Green],&green)) { - green.index=0; - while (DefineRegion(extrema[Green],&green)) + blue.index=0; + while (DefineRegion(extrema[Blue],&blue)) { - blue.index=0; - while (DefineRegion(extrema[Blue],&blue)) + /* + Allocate a new class. + */ + if (head != (Cluster *) NULL) { - /* - Allocate a new class. - */ - if (head != (Cluster *) NULL) - { - cluster->next=MagickAllocateMemory(Cluster *,sizeof(Cluster)); - cluster=cluster->next; - } - else - { - cluster=MagickAllocateMemory(Cluster *,sizeof(Cluster)); - head=cluster; - } - if (cluster == (Cluster *) NULL) - { - ThrowException(&image->exception,ResourceLimitError,MemoryAllocationFailed, - image->filename); - goto classify_error_exit; - } - /* - Initialize a new class. - */ - (void) memset(cluster,0,sizeof(Cluster)); - cluster->count=0; - cluster->red=red; - cluster->green=green; - cluster->blue=blue; - cluster->next=(Cluster *) NULL; + cluster->next=MagickAllocateMemory(Cluster *,sizeof(Cluster)); + cluster=cluster->next; + } + else + { + cluster=MagickAllocateMemory(Cluster *,sizeof(Cluster)); + head=cluster; } + if (cluster == (Cluster *) NULL) + { + ThrowException(&image->exception,ResourceLimitError,MemoryAllocationFailed, + image->filename); + goto classify_error_exit; + } + /* + Initialize a new class. + */ + (void) memset(cluster,0,sizeof(Cluster)); + cluster->count=0; + cluster->red=red; + cluster->green=green; + cluster->blue=blue; + cluster->next=(Cluster *) NULL; } } - if (head == (Cluster *) NULL) - { - /* - No classes were identified-- create one. - */ - cluster=MagickAllocateMemory(Cluster *,sizeof(Cluster)); - if (cluster == (Cluster *) NULL) - { - ThrowException(&image->exception,ResourceLimitError,MemoryAllocationFailed, - image->filename); - goto classify_error_exit; - } - /* - Initialize a new class. - */ - (void) memset(cluster,0,sizeof(Cluster)); - cluster->count=0; - cluster->red=red; - cluster->green=green; - cluster->blue=blue; - cluster->next=(Cluster *) NULL; - head=cluster; - } + } + if (head == (Cluster *) NULL) + { /* - Build an array representation of the clusters. + No classes were identified-- create one. */ - number_clusters=0; - for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next) - number_clusters++; - cluster_array=MagickAllocateArray(Cluster **,number_clusters,sizeof(Cluster *)); - if (cluster_array == (Cluster **) NULL) + cluster=MagickAllocateMemory(Cluster *,sizeof(Cluster)); + if (cluster == (Cluster *) NULL) { ThrowException(&image->exception,ResourceLimitError,MemoryAllocationFailed, image->filename); goto classify_error_exit; } - number_clusters=0; - for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next) - cluster_array[number_clusters++]=cluster; /* - Count the pixels for each cluster. + Initialize a new class. */ - for (y=0; y < (long) image->rows; y++) + (void) memset(cluster,0,sizeof(Cluster)); + cluster->count=0; + cluster->red=red; + cluster->green=green; + cluster->blue=blue; + cluster->next=(Cluster *) NULL; + head=cluster; + } + /* + Build an array representation of the clusters. + */ + number_clusters=0; + for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next) + number_clusters++; + cluster_array=MagickAllocateArray(Cluster **,number_clusters,sizeof(Cluster *)); + if (cluster_array == (Cluster **) NULL) + { + ThrowException(&image->exception,ResourceLimitError,MemoryAllocationFailed, + image->filename); + goto classify_error_exit; + } + number_clusters=0; + for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next) + cluster_array[number_clusters++]=cluster; + /* + Count the pixels for each cluster. + */ + for (y=0; y < (long) image->rows; y++) + { + register const PixelPacket + * restrict p; + + p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception); + if (p == (const PixelPacket *) NULL) { - p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception); - if (p == (const PixelPacket *) NULL) - { - status=MagickFail; - break; - } - for (x=(long) image->columns; x != 0; x--) - { - double - r, - g, - b; + status=MagickFail; + break; + } + for (x=(long) image->columns; x != 0; x--) + { + double + r, + g, + b; - r=(double) ScaleQuantumToChar(p->red); - g=(double) ScaleQuantumToChar(p->green); - b=(double) ScaleQuantumToChar(p->blue); + r=(double) ScaleQuantumToChar(p->red); + g=(double) ScaleQuantumToChar(p->green); + b=(double) ScaleQuantumToChar(p->blue); - for (count=0 ; count < number_clusters; count++) + for (count=0 ; count < number_clusters; count++) + { + if ((r >= ((double) cluster_array[count]->red.left-SafeMargin)) && + (r <= ((double) cluster_array[count]->red.right+SafeMargin)) && + (g >= ((double) cluster_array[count]->green.left-SafeMargin)) && + (g <= ((double) cluster_array[count]->green.right+SafeMargin)) && + (b >= ((double) cluster_array[count]->blue.left-SafeMargin)) && + (b <= ((double) cluster_array[count]->blue.right+SafeMargin))) { - if ((r >= ((double) cluster_array[count]->red.left-SafeMargin)) && - (r <= ((double) cluster_array[count]->red.right+SafeMargin)) && - (g >= ((double) cluster_array[count]->green.left-SafeMargin)) && - (g <= ((double) cluster_array[count]->green.right+SafeMargin)) && - (b >= ((double) cluster_array[count]->blue.left-SafeMargin)) && - (b <= ((double) cluster_array[count]->blue.right+SafeMargin))) + /* + Count this pixel. + */ + cluster_array[count]->count++; + cluster_array[count]->red.center+=r; + cluster_array[count]->green.center+=g; + cluster_array[count]->blue.center+=b; + + if ((count > 0) && + (cluster_array[count]->count > cluster_array[count-1]->count)) { - /* - Count this pixel. - */ - cluster_array[count]->count++; - cluster_array[count]->red.center+=r; - cluster_array[count]->green.center+=g; - cluster_array[count]->blue.center+=b; - - if ((count > 0) && - (cluster_array[count]->count > cluster_array[count-1]->count)) - { - Cluster - *tmp_cluster; + Cluster + *tmp_cluster; - tmp_cluster=cluster_array[count-1]; - cluster_array[count-1]=cluster_array[count]; - cluster_array[count]=tmp_cluster; - } - break; + tmp_cluster=cluster_array[count-1]; + cluster_array[count-1]=cluster_array[count]; + cluster_array[count]=tmp_cluster; } + break; } - p++; } - if (QuantumTick(y,image->rows)) - if (!MagickMonitorFormatted(y,(size_t) image->rows*2,&image->exception, - SegmentImageText,image->filename)) - { - status=MagickFail; - break; - } + p++; } - if (status == MagickFail) - goto classify_error_exit; + if (QuantumTick(y,image->rows)) + if (!MagickMonitorFormatted(y,(size_t) image->rows*2,&image->exception, + SegmentImageText,image->filename)) + { + status=MagickFail; + break; + } + } + if (status == MagickFail) + goto classify_error_exit; - /* - Remove clusters that do not meet minimum cluster threshold. - */ - total_vectors=0.0; - for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next) - total_vectors+=(double) cluster->count; - threshold=cluster_threshold*0.01*total_vectors; - count=0; - last_cluster=head; - next_cluster=head; - for (cluster=head; cluster != (Cluster *) NULL; cluster=next_cluster) - { - next_cluster=cluster->next; - if ((cluster->count > 0) && - ((double) cluster->count >= threshold)) - { - /* - Initialize cluster. - */ - cluster->id=count; - cluster->red.center=(cluster->red.center/((double) cluster->count)); - cluster->green.center=(cluster->green.center/((double) cluster->count)); - cluster->blue.center=(cluster->blue.center/((double) cluster->count)); - count++; - last_cluster=cluster; - } - else - { - /* - Delete cluster. - */ - if (cluster == head) - head=next_cluster; - else - last_cluster->next=next_cluster; - - if (image->logging) - (void) LogMagickEvent - (TransformEvent,GetMagickModule(), - "Removing Cluster (usage count %lu, %.5f%%) %d-%d %d-%d %d-%d", - (unsigned long) cluster->count, - (((double) cluster->count/total_vectors) * 100.0), - cluster->red.left,cluster->red.right, - cluster->green.left,cluster->green.right, - cluster->blue.left,cluster->blue.right); - MagickFreeMemory(cluster); - } - } - number_clusters=count; - if (verbose && (head != (Cluster *) NULL)) + /* + Remove clusters that do not meet minimum cluster threshold. + */ + total_vectors=0.0; + for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next) + total_vectors+=(double) cluster->count; + threshold=cluster_threshold*0.01*total_vectors; + count=0; + last_cluster=head; + next_cluster=head; + for (cluster=head; cluster != (Cluster *) NULL; cluster=next_cluster) + { + next_cluster=cluster->next; + if ((cluster->count > 0) && + ((double) cluster->count >= threshold)) { /* - Print cluster statistics. - */ - (void) fprintf(stdout,"===============================================\n"); - (void) fprintf(stdout," Fuzzy c-Means Statistics\n"); - (void) fprintf(stdout,"===============================================\n"); - (void) fprintf(stdout,"Cluster Threshold = %g%%\n", cluster_threshold); - (void) fprintf(stdout,"Weighting Exponent = %g\n", weighting_exponent); - (void) fprintf(stdout,"Total Number of Clusters = %lu\n", - number_clusters); - (void) fprintf(stdout,"Total Number of Vectors = %g\n", - total_vectors); - (void) fprintf(stdout,"Cluster Threshold = %g vectors\n\n", - threshold); - /* - Print the total number of points per cluster. + Initialize cluster. */ - (void) fprintf(stdout,"Cluster Usage Extents Center\n"); - (void) fprintf(stdout,"======= ==================== ======================= =====================\n"); - for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next) - { - PixelPacket - color; - - char - tuple[MaxTextExtent]; - - color.red=ScaleCharToQuantum((unsigned int) (cluster->red.center + 0.5)); - color.green=ScaleCharToQuantum((unsigned int) (cluster->green.center + 0.5)); - color.blue=ScaleCharToQuantum((unsigned int) (cluster->blue.center + 0.5)); - color.opacity=OpaqueOpacity; - /* (void) QueryColorname(image,&color,X11Compliance,colorname,&image->exception); */ - GetColorTuple(&color,8,MagickFalse,MagickTrue,tuple); - (void) fprintf(stdout," %3d %10lu (%6.3f%%) %03d-%03d %03d-%03d %03d-%03d %03.0f %03.0f %03.0f (%s)\n", - cluster->id, - (unsigned long) cluster->count, - (((double) cluster->count/total_vectors) * 100.0), - cluster->red.left,cluster->red.right, - cluster->green.left,cluster->green.right, - cluster->blue.left,cluster->blue.right, - cluster->red.center, - cluster->green.center, - cluster->blue.center, - tuple); - } + cluster->id=count; + cluster->red.center=(cluster->red.center/((double) cluster->count)); + cluster->green.center=(cluster->green.center/((double) cluster->count)); + cluster->blue.center=(cluster->blue.center/((double) cluster->count)); + count++; + last_cluster=cluster; } - if ((number_clusters > 256) || (number_clusters == 0)) + else { - ThrowException3(&image->exception,ImageError,UnableToSegmentImage,TooManyClusters); - goto classify_error_exit; + /* + Delete cluster. + */ + if (cluster == head) + head=next_cluster; + else + last_cluster->next=next_cluster; + + if (image->logging) + (void) LogMagickEvent + (TransformEvent,GetMagickModule(), + "Removing Cluster (usage count %lu, %.5f%%) %d-%d %d-%d %d-%d", + (unsigned long) cluster->count, + (((double) cluster->count/total_vectors) * 100.0), + cluster->red.left,cluster->red.right, + cluster->green.left,cluster->green.right, + cluster->blue.left,cluster->blue.right); + MagickFreeMemory(cluster); } + } + number_clusters=count; + if (verbose && (head != (Cluster *) NULL)) + { /* - Speed up distance calculations. + Print cluster statistics. */ - squares_array=MagickAllocateMemory(double *,513*sizeof(double)); - if (squares_array == (double *) NULL) - { - ThrowException(&image->exception,ResourceLimitError, - MemoryAllocationFailed,image->filename); - goto classify_error_exit; - } - squares=squares_array+255; -#if defined(HAVE_OPENMP) -# pragma omp parallel for -#endif - for (i=(-255); i <= 255; i++) - squares[i]=(double)i*i; + (void) fprintf(stdout,"===============================================\n"); + (void) fprintf(stdout," Fuzzy c-Means Statistics\n"); + (void) fprintf(stdout,"===============================================\n"); + (void) fprintf(stdout,"Cluster Threshold = %g%%\n", cluster_threshold); + (void) fprintf(stdout,"Weighting Exponent = %g\n", weighting_exponent); + (void) fprintf(stdout,"Total Number of Clusters = %lu\n", + number_clusters); + (void) fprintf(stdout,"Total Number of Vectors = %g\n", + total_vectors); + (void) fprintf(stdout,"Cluster Threshold = %g vectors\n\n", + threshold); /* - Allocate image colormap. + Print the total number of points per cluster. */ - colormap=MagickAllocateMemory(PixelPacket *,number_clusters*sizeof(PixelPacket)); - if (colormap == (PixelPacket *) NULL) - { - ThrowException(&image->exception,ResourceLimitError, - MemoryAllocationFailed,image->filename); - goto classify_error_exit; - } - image->matte=False; - image->storage_class=PseudoClass; - MagickFreeMemory(image->colormap); - image->colormap=colormap; - image->colors=number_clusters; - i=0; + (void) fprintf(stdout,"Cluster Usage Extents Center\n"); + (void) fprintf(stdout,"======= ==================== ======================= =====================\n"); for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next) { - image->colormap[i].red=ScaleCharToQuantum((unsigned int) (cluster->red.center + 0.5)); - image->colormap[i].green=ScaleCharToQuantum((unsigned int) (cluster->green.center + 0.5)); - image->colormap[i].blue=ScaleCharToQuantum((unsigned int) (cluster->blue.center + 0.5)); - image->colormap[i].opacity=OpaqueOpacity; - i++; + PixelPacket + color; + + char + tuple[MaxTextExtent]; + + color.red=ScaleCharToQuantum((unsigned int) (cluster->red.center + 0.5)); + color.green=ScaleCharToQuantum((unsigned int) (cluster->green.center + 0.5)); + color.blue=ScaleCharToQuantum((unsigned int) (cluster->blue.center + 0.5)); + color.opacity=OpaqueOpacity; + /* (void) QueryColorname(image,&color,X11Compliance,colorname,&image->exception); */ + GetColorTuple(&color,8,MagickFalse,MagickTrue,tuple); + (void) fprintf(stdout," %3d %10lu (%6.3f%%) %03d-%03d %03d-%03d %03d-%03d %03.0f %03.0f %03.0f (%s)\n", + cluster->id, + (unsigned long) cluster->count, + (((double) cluster->count/total_vectors) * 100.0), + cluster->red.left,cluster->red.right, + cluster->green.left,cluster->green.right, + cluster->blue.left,cluster->blue.right, + cluster->red.center, + cluster->green.center, + cluster->blue.center, + tuple); } - /* - Rebuild cluster array. - */ - number_clusters=0; - for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next) - cluster_array[number_clusters++]=cluster; - /* - Do course grain storage_class. - */ - row_count=0; + } + if ((number_clusters > 256) || (number_clusters == 0)) + { + ThrowException3(&image->exception,ImageError,UnableToSegmentImage,TooManyClusters); + goto classify_error_exit; + } + /* + Speed up distance calculations. + */ + squares_array=MagickAllocateMemory(double *,513*sizeof(double)); + if (squares_array == (double *) NULL) + { + ThrowException(&image->exception,ResourceLimitError, + MemoryAllocationFailed,image->filename); + goto classify_error_exit; + } + squares=squares_array+255; + for (i=(-255); i <= 255; i++) + squares[i]=(double)i*i; + /* + Allocate image colormap. + */ + { + PixelPacket + * restrict colormap; + + colormap=MagickAllocateMemory(PixelPacket *,number_clusters*sizeof(PixelPacket)); + if (colormap == (PixelPacket *) NULL) + { + ThrowException(&image->exception,ResourceLimitError, + MemoryAllocationFailed,image->filename); + goto classify_error_exit; + } + MagickFreeMemory(image->colormap); + image->colormap=colormap; + image->colors=number_clusters; + } + image->matte=False; + image->storage_class=PseudoClass; + i=0; + for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next) + { + image->colormap[i].red=ScaleCharToQuantum((unsigned int) (cluster->red.center + 0.5)); + image->colormap[i].green=ScaleCharToQuantum((unsigned int) (cluster->green.center + 0.5)); + image->colormap[i].blue=ScaleCharToQuantum((unsigned int) (cluster->blue.center + 0.5)); + image->colormap[i].opacity=OpaqueOpacity; + i++; + } + /* + Rebuild cluster array. + */ + number_clusters=0; + for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next) + cluster_array[number_clusters++]=cluster; + /* + Do course grain storage_class. + */ + row_count=0; #if defined(HAVE_OPENMP) # if defined(TUNE_OPENMP) -# pragma omp parallel for schedule(runtime) shared(row_count, status) private(count,indexes,p,q,x) +# pragma omp parallel for schedule(runtime) shared(row_count, status) private(count,x) # else -# pragma omp parallel for schedule(static,8) shared(row_count, status) private(count,indexes,p,q,x) +# pragma omp parallel for schedule(static,8) shared(row_count, status) private(count,x) # endif #endif - for (y=0; y < (long) image->rows; y++) - { - MagickBool - thread_status; + for (y=0; y < (long) image->rows; y++) + { + register PixelPacket + * restrict q; + + register const PixelPacket + * restrict p; - int - num_threads; + register IndexPacket + * restrict indexes; - thread_status=status; - if (thread_status == MagickFail) - continue; + MagickBool + thread_status; - num_threads=omp_get_num_threads(); - q=GetImagePixelsEx(image,0,y,image->columns,1,&image->exception); - if (q == (PixelPacket *) NULL) - thread_status=MagickFail; + int + num_threads; + + thread_status=status; + if (thread_status == MagickFail) + continue; + + num_threads=omp_get_num_threads(); + q=GetImagePixelsEx(image,0,y,image->columns,1,&image->exception); + if (q == (PixelPacket *) NULL) + thread_status=MagickFail; - if (thread_status != MagickFail) + if (thread_status != MagickFail) + { + indexes=AccessMutableIndexes(image); + for (x=0; x < (long) image->columns; x++) { - indexes=AccessMutableIndexes(image); - for (x=0; x < (long) image->columns; x++) - { - MagickBool - classified=MagickFalse; + MagickBool + classified=MagickFalse; - long - r, - g, - b; - - r=(long) ScaleQuantumToChar(q[x].red); - g=(long) ScaleQuantumToChar(q[x].green); - b=(long) ScaleQuantumToChar(q[x].blue); - - for (count=0; count < number_clusters; count++) - if ((r >= (cluster_array[count]->red.left-SafeMargin)) && - (r <= (cluster_array[count]->red.right+SafeMargin)) && - (g >= (cluster_array[count]->green.left-SafeMargin)) && - (g <= (cluster_array[count]->green.right+SafeMargin)) && - (b >= (cluster_array[count]->blue.left-SafeMargin)) && - (b <= (cluster_array[count]->blue.right+SafeMargin))) + long + r, + g, + b; + + r=(long) ScaleQuantumToChar(q[x].red); + g=(long) ScaleQuantumToChar(q[x].green); + b=(long) ScaleQuantumToChar(q[x].blue); + + for (count=0; count < number_clusters; count++) + if ((r >= (cluster_array[count]->red.left-SafeMargin)) && + (r <= (cluster_array[count]->red.right+SafeMargin)) && + (g >= (cluster_array[count]->green.left-SafeMargin)) && + (g <= (cluster_array[count]->green.right+SafeMargin)) && + (b >= (cluster_array[count]->blue.left-SafeMargin)) && + (b <= (cluster_array[count]->blue.right+SafeMargin))) + { + /* + Classify this pixel. + */ + indexes[x]=(IndexPacket) cluster_array[count]->id; + q[x]=image->colormap[indexes[x]]; + classified=MagickTrue; + + /* + Re-sort array so that most frequent occurs first. + + Updating cluster_array causes a multithread race + condition so this chunk is only enabled in the + case of one thread. + */ + if ((num_threads == 1) && (count > 0) && + (cluster_array[count]->count > cluster_array[count-1]->count)) { - /* - Classify this pixel. - */ - indexes[x]=(IndexPacket) cluster_array[count]->id; - q[x]=image->colormap[indexes[x]]; - classified=MagickTrue; - - /* - Re-sort array so that most frequent occurs first. - - Updating cluster_array causes a multithread race - condition so this chunk is only enabled in the - case of one thread. - */ - if ((num_threads == 1) && (count > 0) && - (cluster_array[count]->count > cluster_array[count-1]->count)) - { - Cluster - *tmp_cluster; - - tmp_cluster=cluster_array[count-1]; - cluster_array[count-1]=cluster_array[count]; - cluster_array[count]=tmp_cluster; - } - - break; + Cluster + *tmp_cluster; + + tmp_cluster=cluster_array[count-1]; + cluster_array[count-1]=cluster_array[count]; + cluster_array[count]=tmp_cluster; } - if (classified == MagickFalse) + + break; + } + if (classified == MagickFalse) + { + double + local_minima, + sum; + + long + j, + k; + + /* + Compute fuzzy membership. + */ + local_minima=0.0; + for (j=0; j < (long) image->colors; j++) { double - local_minima, - sum; - - long - j, - k; - - /* - Compute fuzzy membership. - */ - local_minima=0.0; - for (j=0; j < (long) image->colors; j++) + distance_squared, + numerator, + ratio_squared; + + sum=0.0; + p=image->colormap+j; + distance_squared= + squares[r-(long) ScaleQuantumToChar(p->red)]+ + squares[g-(long) ScaleQuantumToChar(p->green)]+ + squares[b-(long) ScaleQuantumToChar(p->blue)]; + numerator=distance_squared; + for (k=0; k < (long) image->colors; k++) { - double - distance_squared, - numerator, - ratio_squared; - - sum=0.0; - p=image->colormap+j; + p=image->colormap+k; distance_squared= squares[r-(long) ScaleQuantumToChar(p->red)]+ squares[g-(long) ScaleQuantumToChar(p->green)]+ squares[b-(long) ScaleQuantumToChar(p->blue)]; - numerator=distance_squared; - for (k=0; k < (long) image->colors; k++) - { - p=image->colormap+k; - distance_squared= - squares[r-(long) ScaleQuantumToChar(p->red)]+ - squares[g-(long) ScaleQuantumToChar(p->green)]+ - squares[b-(long) ScaleQuantumToChar(p->blue)]; - ratio_squared=numerator/distance_squared;; + ratio_squared=numerator/distance_squared;; #if SquaredClassify - /* - Since SquaredClassify (using a weighting - exponent of 2.0) is normally defined to be - true, this is the normally active code. - Otherwise execution is even slower since - pow() is excruciatingly slow. - */ - sum+=ratio_squared; + /* + Since SquaredClassify (using a weighting + exponent of 2.0) is normally defined to be + true, this is the normally active code. + Otherwise execution is even slower since + pow() is excruciatingly slow. + */ + sum+=ratio_squared; #else - sum+=pow(ratio_squared,((double) (1.0/(weighting_exponent-1.0)))); + sum+=pow(ratio_squared,((double) (1.0/(weighting_exponent-1.0)))); #endif - } - if ((sum != 0.0) && ((1.0/sum) > local_minima)) - { - /* - Classify this pixel. - */ - local_minima=1.0/sum; - indexes[x]=(IndexPacket) j; - q[x]=image->colormap[indexes[x]]; - } + } + if ((sum != 0.0) && ((1.0/sum) > local_minima)) + { + /* + Classify this pixel. + */ + local_minima=1.0/sum; + indexes[x]=(IndexPacket) j; + q[x]=image->colormap[indexes[x]]; } } } - if (!SyncImagePixelsEx(image,&image->exception)) - thread_status=MagickFail; } + if (!SyncImagePixelsEx(image,&image->exception)) + thread_status=MagickFail; + } - if (monitor_active) - { - unsigned long - thread_row_count; + if (monitor_active) + { + unsigned long + thread_row_count; #if defined(HAVE_OPENMP) # pragma omp atomic #endif - row_count++; + row_count++; #if defined(HAVE_OPENMP) # pragma omp flush (row_count) #endif - thread_row_count=row_count; - if (QuantumTick(thread_row_count,image->rows)) - if (!MagickMonitorFormatted((size_t) thread_row_count+image->rows,(size_t) image->rows*2, - &image->exception, - SegmentImageText,image->filename)) - thread_status=MagickFail; - } + thread_row_count=row_count; + if (QuantumTick(thread_row_count,image->rows)) + if (!MagickMonitorFormatted((size_t) thread_row_count+image->rows,(size_t) image->rows*2, + &image->exception, + SegmentImageText,image->filename)) + thread_status=MagickFail; + } - if (thread_status == MagickFail) - { - status=MagickFail; + if (thread_status == MagickFail) + { + status=MagickFail; #if defined(HAVE_OPENMP) # pragma omp flush (status) #endif - } } - /* - Free memory. - */ + } + /* + Free memory. + */ classify_error_exit: - for (cluster=head; cluster != (Cluster *) NULL; cluster=next_cluster) - { - next_cluster=cluster->next; - MagickFreeMemory(cluster); - head=(Cluster *) NULL; - } - MagickFreeMemory(cluster_array); - MagickFreeMemory(squares_array); - return(status); + for (cluster=head; cluster != (Cluster *) NULL; cluster=next_cluster) + { + next_cluster=cluster->next; + MagickFreeMemory(cluster); + head=(Cluster *) NULL; + } + MagickFreeMemory(cluster_array); + MagickFreeMemory(squares_array); + return(status); } /* diff --git a/magick/statistics.c b/magick/statistics.c index 30c6d2e..40d152b 100644 --- a/magick/statistics.c +++ b/magick/statistics.c @@ -40,7 +40,7 @@ % The format of the GetImageStatistics method is: % % MagickPassFail GetImageStatistics(const Image *image, -% ImageStatistics *statistics +% ImageStatistics *statistics, % ExceptionInfo *exception) % % A description of each parameter follows: diff --git a/magick/symbols.h b/magick/symbols.h index 1a1077c..a29ee03 100644 --- a/magick/symbols.h +++ b/magick/symbols.h @@ -541,6 +541,7 @@ #define MagickConstrainColormapIndex GmMagickConstrainColormapIndex #define MagickCreateDirectoryPath GmMagickCreateDirectoryPath #define MagickDestroyCommandInfo GmMagickDestroyCommandInfo +#define MagickDoubleToLong GmMagickDoubleToLong #define MagickFindRawImageMinMax GmMagickFindRawImageMinMax #define MagickFmax GmMagickFmax #define MagickFmin GmMagickFmin @@ -816,6 +817,7 @@ #define RegisterICONImage GmRegisterICONImage #define RegisterIDENTITYImage GmRegisterIDENTITYImage #define RegisterINFOImage GmRegisterINFOImage +#define RegisterJBIGImage GmRegisterJBIGImage #define RegisterJNXImage GmRegisterJNXImage #define RegisterJP2Image GmRegisterJP2Image #define RegisterJPEGImage GmRegisterJPEGImage @@ -852,7 +854,6 @@ #define RegisterPREVIEWImage GmRegisterPREVIEWImage #define RegisterPS2Image GmRegisterPS2Image #define RegisterPS3Image GmRegisterPS3Image -#define RegisterPSDImage GmRegisterPSDImage #define RegisterPSImage GmRegisterPSImage #define RegisterPWPImage GmRegisterPWPImage #define RegisterRGBImage GmRegisterRGBImage @@ -933,6 +934,12 @@ #define SetImageProfile GmSetImageProfile #define SetImageType GmSetImageType #define SetImageVirtualPixelMethod GmSetImageVirtualPixelMethod +#define SetLogDefaultEventType GmSetLogDefaultEventType +#define SetLogDefaultFileName GmSetLogDefaultFileName +#define SetLogDefaultFormat GmSetLogDefaultFormat +#define SetLogDefaultGenerations GmSetLogDefaultGenerations +#define SetLogDefaultLimit GmSetLogDefaultLimit +#define SetLogDefaultOutputType GmSetLogDefaultOutputType #define SetLogEventMask GmSetLogEventMask #define SetLogFormat GmSetLogFormat #define SetMagickInfo GmSetMagickInfo @@ -1033,6 +1040,7 @@ #define UnregisterICONImage GmUnregisterICONImage #define UnregisterIDENTITYImage GmUnregisterIDENTITYImage #define UnregisterINFOImage GmUnregisterINFOImage +#define UnregisterJBIGImage GmUnregisterJBIGImage #define UnregisterJNXImage GmUnregisterJNXImage #define UnregisterJP2Image GmUnregisterJP2Image #define UnregisterJPEGImage GmUnregisterJPEGImage @@ -1069,7 +1077,6 @@ #define UnregisterPREVIEWImage GmUnregisterPREVIEWImage #define UnregisterPS2Image GmUnregisterPS2Image #define UnregisterPS3Image GmUnregisterPS3Image -#define UnregisterPSDImage GmUnregisterPSDImage #define UnregisterPSImage GmUnregisterPSImage #define UnregisterPWPImage GmUnregisterPWPImage #define UnregisterRGBImage GmUnregisterRGBImage diff --git a/magick/transform.c b/magick/transform.c index 40c5c04..6348667 100644 --- a/magick/transform.c +++ b/magick/transform.c @@ -1329,6 +1329,9 @@ MagickExport Image *FlopImage(const Image *image,ExceptionInfo *exception) % % */ + +static RectangleInfo GetImageMosaicDimensions(const Image *image) MAGICK_FUNC_PURE; + static RectangleInfo GetImageMosaicDimensions(const Image *image) { RectangleInfo @@ -1631,7 +1634,8 @@ MagickExport Image *ShaveImage(const Image *image, % % A description of each parameter follows: % -% o image: The image The transformed image is returned as this parameter. +% o image: The image to transform. The resulting transformed image is +% returned via this parameter. % % o crop_geometry: A crop geometry string. This geometry defines a % subregion of the image to crop. @@ -1764,10 +1768,7 @@ MagickExport MagickPassFail TransformImage(Image **image,const char *crop_geomet return status; } - previous=transform_image->previous; - resize_image->next=transform_image->next; - DestroyImage(transform_image); - transform_image=resize_image; + ReplaceImageInList(&transform_image,resize_image); *image=transform_image; return status; } diff --git a/magick/utility-private.h b/magick/utility-private.h index 7afb1c7..3a74dc3 100644 --- a/magick/utility-private.h +++ b/magick/utility-private.h @@ -31,6 +31,7 @@ extern MagickExport MagickPassFail MagickAtoIChk(const char *str, int *value); extern MagickExport MagickPassFail MagickAtoUIChk(const char *str, unsigned int *value); extern MagickExport MagickPassFail MagickAtoLChk(const char *str, long *value); extern MagickExport MagickPassFail MagickAtoULChk(const char *str, unsigned long *value); +extern MagickExport long MagickDoubleToLong(const double dval/*, ExceptionInfo *exception*/); /* Compute a value which is the next kilobyte power of 2 larger than diff --git a/magick/utility.c b/magick/utility.c index 7dc88c1..2fd0609 100644 --- a/magick/utility.c +++ b/magick/utility.c @@ -1071,9 +1071,12 @@ MagickExport MagickPassFail ExpandFilenames(int *argc,char ***argv) /* ListFiles() may change current directory without restoring. */ if ((strlen(current_directory) > 0) && (chdir(current_directory) != 0)) { - for (j=0; j < number_files; j++) - MagickFreeMemory(filelist[j]); - MagickFreeMemory(filelist); + if (filelist != (char **) NULL) + { + for (j=0; j < number_files; j++) + MagickFreeMemory(filelist[j]); + MagickFreeMemory(filelist); + } MagickFatalError(ConfigureFatalError,UnableToRestoreCurrentDirectory, NULL); } @@ -1088,9 +1091,12 @@ MagickExport MagickPassFail ExpandFilenames(int *argc,char ***argv) not matching anything (abc* and there's no file starting with abc). Do the same for behaviour consistent with that. */ - for (j=0; j < number_files; j++) - MagickFreeMemory(filelist[j]); - MagickFreeMemory(filelist); + if (filelist != (char **) NULL) + { + for (j=0; j < number_files; j++) + MagickFreeMemory(filelist[j]); + MagickFreeMemory(filelist); + } continue; } @@ -1109,7 +1115,9 @@ MagickExport MagickPassFail ExpandFilenames(int *argc,char ***argv) char filename_buffer[MaxTextExtent]; - *filename_buffer='\0'; + if (filelist[j] == (const char *) NULL) + continue; + filename_buffer[0]='\0'; if (strlcat(filename_buffer,path,sizeof(filename_buffer)) >= sizeof(filename_buffer)) MagickFatalError2(ResourceLimitFatalError,"Path buffer overflow", @@ -1228,11 +1236,13 @@ MagickExport void FormatSize(const magick_int64_t size,char *format) % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% Method FormatString prints formatted output of a variable argument list. +% Method FormatString prints formatted output of a variable argument list +% buffer, limiting its output to MaxTextExtent. +% The formatted size (as would be returned by strlen()) is returned. % % The format of the FormatString method is: % -% void FormatString(char *string,const char *format,...) +% size_t FormatString(char *string,const char *format,...) % % A description of each parameter follows. % @@ -1245,23 +1255,38 @@ MagickExport void FormatSize(const magick_int64_t size,char *format) % % */ -MagickExport void FormatStringList(char *string,const char *format, - va_list operands) +MagickExport size_t FormatStringList(char *string,const char *format, + va_list operands) { + size_t + fls = 0; + + int + fli; + #if defined(HAVE_VSNPRINTF) - (void) vsnprintf(string,MaxTextExtent,format,operands); + fli=vsnprintf(string,MaxTextExtent,format,operands); #else - (void) vsprintf(string,format,operands); + fli=vsprintf(string,format,operands); #endif + if (fli >= MaxTextExtent) + fls=MaxTextExtent-1; + else if (fli > 0) + fls=(size_t) fli; + return fls; } -MagickExport void FormatString(char *string,const char *format,...) +MagickExport size_t FormatString(char *string,const char *format,...) { va_list operands; + size_t + formatted_len; + va_start(operands,format); - FormatStringList(string, format, operands); + formatted_len=FormatStringList(string, format, operands); va_end(operands); + return formatted_len; } /* @@ -1674,7 +1699,7 @@ MagickExport int GetGeometry(const char *image_geometry,long *x,long *y, { /* Check for too many characters. */ i++; - if (i == sizeof(geometry)) + if (i == sizeof(geometry)-1) return NoValue; *q=*c; @@ -1699,7 +1724,7 @@ MagickExport int GetGeometry(const char *image_geometry,long *x,long *y, bounds.x=0; bounds.y=0; p=geometry; - while ((isspace((int)(*p)))) + while ((*p != '\0') && (isspace((int)(*p)))) p++; if (*p == '\0') return(flags); @@ -3603,6 +3628,49 @@ MagickExport MagickPassFail MagickAtoULChk(const char *str, unsigned long *value } /* + Convert a double to a long, with clipping. + Someday a warning or an error may be produced here. +*/ +MagickExport long MagickDoubleToLong(const double dval/*, ExceptionInfo *exception*/) +{ + long lval; + + do + { +#if defined(INFINITY) + if (dval == +INFINITY) + { + lval=LONG_MAX; + break; + } + if (dval == -INFINITY) + { + lval=LONG_MIN; + break; + } +#endif + if (isnan(dval)) + { + lval=0; + break; + } + if (dval > LONG_MAX) + { + lval=LONG_MAX; + break; + } + if (dval < LONG_MIN) + { + lval=LONG_MIN; + break; + } + lval=(long) dval; + } while (0); + + return lval; +} + +/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % @@ -3681,11 +3749,12 @@ double MagickFmax(const double x, const double y) % % Method MagickFormatString prints formatted output of a variable % argument list buffer, limiting its output to a specified buffer size. +% The formatted size (as would be returned by strlen()) is returned. % % The format of the MagickFormatString method is: % -% void MagickFormatString(char *string,const size_t length, -% const char *format,...) +% size_t MagickFormatString(char *string,const size_t length, +% const char *format,...) % % A description of each parameter follows. % @@ -3702,27 +3771,48 @@ double MagickFmax(const double x, const double y) % % */ -MagickExport void MagickFormatStringList(char *string, - const size_t length, - const char *format, - va_list operands) +MagickExport size_t MagickFormatStringList(char *string, + const size_t length, + const char *format, + va_list operands) { + size_t + fls = 0; + + int + fli; + + if (length > 0) + { #if defined(HAVE_VSNPRINTF) - (void) vsnprintf(string,length,format,operands); + fli=vsnprintf(string,length,format,operands); #else - (void) vsprintf(string,format,operands); + fli=vsprintf(string,format,operands); #endif + if (fli > 0) + { + if ((size_t) fli >= length) + fls=length-1; + else + fls=(size_t) fli; + } + } + return fls; } -MagickExport void MagickFormatString(char *string, - const size_t length, - const char *format,...) +MagickExport size_t MagickFormatString(char *string, + const size_t length, + const char *format,...) { va_list operands; + size_t + formatted_len; + va_start(operands,format); - MagickFormatStringList(string, length, format, operands); + formatted_len=MagickFormatStringList(string, length, format, operands); va_end(operands); + return formatted_len; } /* @@ -6362,11 +6452,16 @@ MagickExport char *TranslateTextEx(const ImageInfo *image_info, char key[MaxTextExtent]; - /* Extract attribute key string. */ + /* + Extract attribute key string. + + FIXME: does not handle nested specification so that + '%[[MVG]]' results in '[MVG]'. + */ p++; for (i=0; (i < MaxTextExtent-1) && (*p) && (*p != ']'); i++) { - key[i]=(*p++); + key[i]=(*p++); } if (']' != *p) break; diff --git a/magick/utility.h b/magick/utility.h index bedacc0..80bbda3 100644 --- a/magick/utility.h +++ b/magick/utility.h @@ -143,7 +143,7 @@ extern MagickExport void Strip(char *), SetGeometry(const Image *,RectangleInfo *); -extern MagickExport void +extern MagickExport size_t FormatString(char *string,const char *format,...) MAGICK_ATTRIBUTE((__format__ (__printf__,2,3))), FormatStringList(char *string,const char *format,va_list operands) MAGICK_ATTRIBUTE((__format__ (__printf__,2,0))), MagickFormatString(char *string,const size_t length,const char *format,...) MAGICK_ATTRIBUTE((__format__ (__printf__,3,4))), diff --git a/magick/version.h b/magick/version.h index 393861a..9bce058 100644 --- a/magick/version.h +++ b/magick/version.h @@ -35,11 +35,11 @@ extern "C" { */ #define MagickPackageName "GraphicsMagick" #define MagickCopyright "Copyright (C) 2002-2020 GraphicsMagick Group.\nAdditional copyrights and licenses apply to this software.\nSee http://www.GraphicsMagick.org/www/Copyright.html for details." -#define MagickLibVersion 0x242100 -#define MagickLibVersionText "1.3.35" -#define MagickLibVersionNumber 24,21,0 -#define MagickChangeDate "20200223" -#define MagickReleaseDate "2020-02-23" +#define MagickLibVersion 0x252200 +#define MagickLibVersionText "1.3.36" +#define MagickLibVersionNumber 25,22,0 +#define MagickChangeDate "20201226" +#define MagickReleaseDate "20201226" /* The MagickLibInterfaceNewest and MagickLibInterfaceOldest defines @@ -54,7 +54,7 @@ extern "C" { MagickLibVersionNumber, but these are broken out and simplified so that they can be easily used in C pre-processor logic. */ -#define MagickLibInterfaceNewest 24 +#define MagickLibInterfaceNewest 25 #define MagickLibInterfaceOldest 3 #if (QuantumDepth == 8) diff --git a/magick/xwindow.c b/magick/xwindow.c index e5c6cfb..24f78e6 100644 --- a/magick/xwindow.c +++ b/magick/xwindow.c @@ -1222,7 +1222,7 @@ MagickXBestPixel(Display *display,const Colormap colormap, #define MagickXVisualColormapSize(visual_info) Min( (int) (\ ((visual_info->class == TrueColor) || (visual_info->class == DirectColor)) ? \ (int) (visual_info->red_mask | visual_info->green_mask | visual_info->blue_mask) : \ - visual_info->colormap_size),(1 << visual_info->depth)) + visual_info->colormap_size),(1L << visual_info->depth)) MagickExport XVisualInfo * MagickXBestVisualInfo(Display *display, diff --git a/scripts/docutils_htmldeco_writer.py b/scripts/docutils_htmldeco_writer.py index 833d89d..ea3f119 100644 --- a/scripts/docutils_htmldeco_writer.py +++ b/scripts/docutils_htmldeco_writer.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab:tw=100: #* Author: Mark Mitchell @@ -65,6 +66,6 @@ class MmHtmlTranslator(html4css1.HTMLTranslator): self.body_prefix.append(html_fragments.banner) self.body_prefix.append(html_fragments.nav) - #self.body_suffix = [html_fragments.footer, '\n\n'] - self.body_suffix = ['\n\n'] + self.body_suffix = [html_fragments.footer, '\n\n'] + #self.body_suffix = ['\n\n'] diff --git a/scripts/format_c_api_doc.py b/scripts/format_c_api_doc.py index 9ec86a6..c222776 100755 --- a/scripts/format_c_api_doc.py +++ b/scripts/format_c_api_doc.py @@ -101,6 +101,9 @@ keywords = { 'ImageType' : '`ImageType`_', 'InterlaceType' : '`InterlaceType`_', 'LayerType' : '`LayerType`_', + 'LogEventType' : '`LogEventType`_', + 'LogMethod' : '`LogMethod`_', + 'LogOutputType' : '`LogOutputType`_', 'MagickInfo' : '`MagickInfo`_', 'MonitorHandler' : '`MonitorHandler`_', 'MontageInfo' : '`MontageInfo`_', diff --git a/scripts/html_fragments.py b/scripts/html_fragments.py index 7518325..de36559 100644 --- a/scripts/html_fragments.py +++ b/scripts/html_fragments.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab:tw=100: #* Author: Mark Mitchell @@ -25,15 +26,17 @@ banner_logo = 'images/gm-107x76.png' # relative to top directory # url_prefix attribute should already be fixed up. url_prefix = '' # trailing slash always needed +# For SF, substitute with: '
SourceForge' +sponsor_logo_html = '' banner_template = """ """ @@ -42,28 +45,31 @@ banner_template = """ nav_template = """ """ -footer_template = """ -
- +
+

How do I concatenate three images left-to-right with no borders, frames, or text?

+

Assume your three images are called image1.ppm, image2.ppm, and +image3.ppm. Type

+
+gm montage -mode concatenate -tile 3x1 image1.ppm image2.ppm \
+  image3.ppm concatenated.miff
+
+

To concatenate the images top-to-bottom, use -tile 1x3.

+

For more control over the placement of an image, use composite. First +create a matte image and position your images onto the matte. For +example,

+
+gm convert -size 350x500 xc:black composite.miff
+gm composite -geometry +0+0 composite.miff image1.gif composite.miff
+gm composite -geometry "+1"00+0 composite.miff image2.gif composite.miff
+gm composite -geometry +0+300 composite.miff image3.gif composite.miff
+gm composite -geometry +0+375 composite.miff image4.gif composite.miff
+
+
+
+

How do I create a GIF animation sequence to display within Firefox?

+

Use convert with the -delay and -page options. The -delay option +is used to specify the delay in 1/100ths of a second between the +display of each frame of the animation. For example,

+
+gm convert -delay 20 frame*.gif animation.gif
+
+

You can also declare specific delays for each frame of the image +sequence. For example, if the delay was 20, 10, and 5, use

+
+gm convert -delay 20 frame1.gif -delay 10 frame2.gif \
+  -delay 5 frame3.gif animation.gif
+
+

Use -page to specify the left and top locations of the image frame

+
+gm convert frame1.gif -page +50"+1"00 frame2.gif -page +0"+1"00 \
+  frame3.gif animation.gif
+
+

Finally, if you want the image to loop within FireFox, use -loop

+
+gm convert -loop 50 frame*.gif animation.gif
+
+

Note, that all the images are composited into a single multi-image GIF +animation. If you want a single image produced for each frame, use ++adjoin

+
+gm convert +adjoin images.* frames%d.gif
+
+
+
+

When I display a PostScript image, white borders are trimmed.

+

GraphicsMagick automatically trims any PostScript image as defined by +the bounding box. To preempt this behavior, remove the bounding box +statement from the Postscript or explicitly set the page size. For +example,

+
+gm display -page letter image.ps
+
+
+
+

What are visual image directories? How do I use them?

+

A visual image directory (VID) is an image that contains thumbnails of +one or more images in a file directory. Rather than displaying each +individual image at its full resolution, you can browse the visual image +directory and choose an image to display. You can create a VID with +either of these commands:

+
+gm montage *.jpg directory.vid
+gm convert 'vid:*.jpg' directory.vid
+
+

Of course you can substitute any filenames you desire. Montage has many +relevant command line options. You can exercise more control over the +appearance of the VID than with convert.

+

Next display the directory:

+
+gm display directory.vid
+
+

Finally browse and select an image to display. Move the pointer to the +image and press button 3.

+

You can create the VID directory with this command:

+
+gm display 'vid:*.jpg'
+
+

You can also select Visual Image... from the File menu of the command +widget.

+

Note, that creating a VID is time consuming. Creating them on-the-fly +within display may be less convenient than using montage or convert . +Also, if you create them with montage. or convert, you can reuse them +as often as necessary.

+

Note that a visual image directory is useful for looking at individual +frames of an image sequence:

+
+gm display vid:movie.mpg
+
+
+
+

How can I include the window frame when importing a window?

+

I use the window ID reported by xwininfo(1) with import and it does not +include the window manager frame as expected. How can I save the window +with its frame?

+

By default, xwininfo(1) returns the ID of the window you click on. Use +the -frame option to get the reparented window ID:

+
+xwininfo -frame
+
+

You can then use the returned window ID with import:

+
+gm import -frame -window ID window.miff
+
+
+
+

I displayed an image and it appears as one solid color. What did I do wrong?

+

A blank image generally means that the image is either corrupt or it has +a matte channel and the matte values are all zero. GraphicsMagick +treats a matte value of zero as completely transparent. To determine if +this is the problem, try

+
+gm display +matte image.miff
+
+
+
+

I received the following message, "???? library is not available...".

+

GraphicsMagick requires source libraries not included with the +distribution to view or convert certain image formats such as JPEG or +TIFF. The above message means you did not compile the required library +and link with the GraphicsMagick utilities. See README for the +location of these libraries and compiling instructions.

+
+
+

I want to inspect the values of the matte channel within my image.

+

View the matte image as a gray scale image. Suppose you have a TIFF image +that has a matte channel and is 640 pixels in width and 480 in height. +Type:

+
+gm convert image.tiff image.matte
+gm display -size 640x480 gray:image.matte
+
+
+
+

How can I add one of those cool bevels to my image that I see used on the Web?

+

There are four types of ornamental borders you can add to your image +with GraphicsMagick. Each is listed below with the procedure to use +them with your image.

+
    +
  • Surround the image with a border of color

    +

    Use -border followed by the width and height of the border. Set the +color of the border with -bordercolor. For example, to surround your +image with a red border that is 25 pixels wide on each side, use

    +
    +gm convert -bordercolor red -border 25x25 image.jpg image.gif
    +
    +
  • +
  • Lighten or darken image edges to create a 3-D effect

    +

    Use -raise followed by the width of the image edge. For example, to +create a raised edge effect of 25 pixels, use

    +
    +gm convert -raise 25 image.jpg image.gif
    +
    +
  • +
  • Surround the image with an ornamental frame

    +

    Use -frame followed by the width and height of the frame. Set the +color of the border with -mattecolor. For example, to surround your +image with a gray frame that is 25 pixels wide on each side, use

    +
    +gm convert -mattecolor gray -frame 25x25 image.jpg image.gif
    +
    +
  • +
  • Surround the image with a raised or sunken bevel

    +

    Use -frame followed by the width and height of the bevel. Set the +color of the border with -mattecolor. This is just like the +description above except you specify a bevel width that matches the +frame width. For example, to surround your image with a gray bevel +that is 25 pixels wide on each side, use

    +
    +gm convert -mattecolor gray -frame 25x25+0+25 image.jpg image.gif
    +gm convert -mattecolor gray -frame 25x25+25+0 image.jpg image.gif
    +
    +
  • +
+
+
+

I try to launch display from my window manager and it fails. What's up?

+

Display determines if it is executing interactively and behaves +differently depending on the result. To convince display <display.html> +you are running in an interactive environment when launching from a +window manager, use either of

+
+display logo:Untitled
+display < /dev/console
+
+

Note that this issue no longer exists as of GraphicsMagick 1.2.

+
+
+

How can I make Postscript text look good?

+

Simple. Increase the dots-per-inch when converting and sub-sample:

+
+gm convert -density 288 -geometry 25% image.ps image.gif
+
+

Change the density to 144 and geometry to 50% if the above command fails +due to insufficient memory. Alternatively, see the Ghostscript +documentation about using high-quality fonts.

+

The -density option increases the number of pixels (or dots) generated by +Ghostscript when processing the input postscript file. However as all +other images formats are generally displayed on screens which are +typically about 72 to 100 dots per inch, the output image will be larger.

+

The -geometry option reduces the large image output of ghostscript +image back to a normal 72 dpi resolution (25% of 288 dpi gives 72 dpi) +but in the process anti-aliases (or smooths) the fonts and lines of the +image so as to remove the jaggies you would otherwise get from a normal +postscript to image conversion.

+
+
+

How can I annotate an image with text that is 2 to 3 inches tall?

+

If you do not access to a particular named font that is large, try +scalable fonts. First see if you have any scalable fonts. Type

+
+xlsfonts -fn '*-0-0-0-0-*'
+
+

Or if you are using display, use the font pattern above within the Font +Browser (see Image Edit->Annotate). Next substitute the appropriate +resolution. Keep in mind that a scalable font must be fully qualified to +work. That is, all 14 fields must be specified. Here is one example where +we annotate an image with large Helvetica text:

+
+gm convert -font '-*-helvetica-*-*-*--300-300-*-*-*-*-iso8859-1' \
+  -fill green -draw 'text 50,300 Magick' image.gif annotated.gif
+
+

If you have the FreeType support built into GraphicsMagick, just +increase your pointsize and/or density:

+
+gm convert -font Helvetica -pointsize 100 -density 300 ...
+
+
+
+

How can I convert my GIF animation sequence to individual image files?

+

Use the scene embedded file format with convert:

+
+gm convert animation.gif +adjoin frame%02d.gif
+
+

The resulting image files are titled frame01.gif, frame02.gif, +frame03.gif, etc.

+
+
+

How can I remove the background that prints around my image when I display it with Firefox?

+

Use the +page option of the convert command:

+
+gm convert +page alpha.gif beta.gif
+
+

GIF allows for a page offset relative to some background. The page +offset information may have been in your GIF image already or it +could have been introduced by GraphicsMagick. Either way, +page +removes the unwanted page offset and FireFox should behave as +expected.

+
+
+

How do I create a GIF or PNG image with Web safe colors?

+

Web safe colors are not normally needed any more since almost all +computers now have true color displays. However, this FAQ may still be +useful since it demonstrates how a colormap from an image may be +applied to another image..

+

Use the -map option of the convert command:

+
+gm convert -map netscape: alpha.gif beta.gif
+
+

Netscape predefines 216 colors for colormapped displays. Use the above +command to ensure only these predefined colors are used. Otherwise +Netscape dithers your image with varying degrees of image fidelity.

+
+
+

How can I add a matte layer to my image?

+

One way is to use a bitmap as your transparency mask First, use the +-matte option to add an all-opaque opacity channel, then use the +composite utility to copy the graylevel samples from the mask file +into your new opacity channel:

+
+gm convert image.gif -matte temp.miff
+gm composite -compose CopyOpacity mask.xbm temp.miff transparent.gif
+
+

Note, GIF is limited to one transparent color. If your mask has +variable opacity, use a format like MIFF, TIFF, or PNG as your output +image format.

+
+
+

How can I draw with text using 'convert' under Windows NT?

+

The problem is that NT interprets the command line differently than +Unix does, causing the documented command to fail. The following +command has been reported to work correctly (all on one line):

+
+gm convert -font Arial -fill blue -draw "text 10,10 'your text here'" \
+   d:\test.tif png:d:\test.png
+
+

and here is another example which is reported to work (which relies +on Ghostscript's 'gs' program to installed):

+
+gm convert.exe -pointsize 18 -draw "text 0,0 "This is my text!"" \
+  C:\blank.gif c:\text.gif
+
+
+
+

Why are my JPEG files larger than expected?

+

Your JPEG files may contain embedded "profiles" such as Exif or IPTC, +or they may contain uncompressed thumbnails. You can use the +profile +"*" commandline option or an equivalent API method to remove them.

+
+
+

How do I extract a single image from a multi-image file?

+

Use a square-bracket syntax to indicate which frame or frames you +want. For example,

+
+gm convert "Image.gif[0]" first.gif
+
+

Will extract the first image (scene 0) from a GIF animation. Be sure +to surround the file specification with quotation marks, to prevent +the shell from interpreting the square brackets.

+
+
+

How can I extract and combine CMYK channels in a CMYK image?

+

GraphicsMagick 1.2.2 and later support combining multiple channels in of +any image file format in order to create a CMYK image file. For example, +starting with a CMYK JPEG file, we can create a set of separate files +with one file per channel:

+
+gm convert cmyk.jpg -channel cyan cyan.tiff
+gm convert cmyk.jpg -channel magenta magenta.tiff
+gm convert cmyk.jpg -channel yellow yellow.tiff
+gm convert cmyk.jpg -channel black black.tiff
+
+

and then we can join them back together:

+
+gm composite -compose CopyMagenta magenta.tiff cyan.tiff result.tiff
+gm composite -compose CopyYellow yellow.tiff result.tiff result.tiff
+gm composite -compose CopyBlack black.tiff result.tiff result.tiff
+
+

Perhaps it is possible to accomplish this in one composite command. We +will leave that as an exercise for later. Note that it is possible to +extract just one channel, manipulate it, and then insert it back into the +original image file.

+

There is also built-in support for a Partition interlace format which +can split to a set of files, and join a set of files, but the only +supported format is a raw format which is not easy to deal with.

+
+
+

How can I create a solid or patterned canvas image?

+

Canvas images may be created using the 'XC:' or 'TILE:' pseudo-image +formats. XC produces solid color images based on an color you specify +while TILE produces a tiled image based on an an image you specify. Both +of these require that the desired size be specified, and the desired +image type may be specified as well.

+

To create a solid red canvas image:

+
+gm convert -size 640x480 xc:red canvas.tiff
+
+

or using hex syntax to specify the color:

+
+gm convert -size 640x480 "xc:#f00" canvas.tiff
+
+

To create a solid red canvas image using truecolor pixels:

+
+gm convert -size 640x480 -type TrueColor xc:red canvas.tiff
+
+

To create a patterned canvas image using a built-in crosshatch pattern:

+
+gm convert -size 640x480 tile:image:CROSSHATCH45 canvas.tiff
+
+

To create a patterned canvas image using a user-supplied image:

+
+gm convert -size 640x480 tile:myimage.tiff canvas.tiff
+
+
+
+

What does identify report?

+

GraphicsMagick is sophisticated image handling software supporting +perhaps a hundred formats, and hundreds of subformats, yet it needs to +be able to apply image processing algorithms in a consistent way, and +save to many output formats. Some image types are radically different +from others. Due to this, GraphicsMagick normalizes images it reads +into only nine internal in-memory formats (see the description of +-type) which are a specialization of just two internal formats. The +identify command reports the characteristics of one of those +internal formats rather than the genuine properties of the input image +file. In fact, if the properties of all the input files were to be +reported, it would require a book to describe all of the properties. +For example, the WMF vector-drawing format is much different from the +PNG image file format, yet GraphicsMagick can read both.

+

Only limited original properties are preserved, and it depends on how +GraphicsMagick was built. For example, a "Q8" build can only report +up to a depth of 8 bits, but a "Q32" build can report a depth of up to +32 bits. The original image depth is reported if it is at least 8 +bits, and equal to or less than the build depth.

+

By default identify reports only the most basic properties:

+
+% gm identify seaworld.jpg
+seaworld.jpg JPEG 1530x1020+0+0 DirectClass 8-bit 204.0K 0.000u 0:01
+
+

but with -verbose it can report on a large number of properties.

+
+

Copyright © GraphicsMagick Group 2002 - 2020

+
+ + + diff --git a/www/FAQ.rst b/www/FAQ.rst index 76ddf88..390f3fd 100644 --- a/www/FAQ.rst +++ b/www/FAQ.rst @@ -111,25 +111,16 @@ will be no more need to develop specialized code for a GPU. Today 16 core CPUs are readily available for purchase in systems at reasonable prices, and this trend is certain to continue. -Intel's `Xeon Phi `_ offers a -61 core 'x86 CPU in a GPU-like plugin form-factor which provides over -a TeraFLOP of performance. Being based on power-hungry plug-in cards, -this solution suffers from many of the issues associated with GPUs. -However, since it supports OpenMP, it may be a suitable target for -executing some GraphicsMagick algorithms. Effective use of Xeon Phi -currently requires use of Intel's development tools so from that -standpoint it is not much more open than GPUs. - Future multi-core CPUs will use a similar amount of power to today's CPUs, will idle at very low power consumption levels, and will fit into a very small chassis. Due to this trend, there is no value obtained by expending energy toward developing specialized code for -today's GPUs. +today's GPUs in GraphicsMagick. What is the meaning of "magick"? -------------------------------- -According to the infamous British accultist `Aleister Crowley +According to the infamous British occultist `Aleister Crowley `_, the definition of `magick `_ is "the science and art of causing change to occur in conformity with the @@ -768,9 +759,3 @@ By default `identify` reports only the most basic properties:: seaworld.jpg JPEG 1530x1020+0+0 DirectClass 8-bit 204.0K 0.000u 0:01 but with -verbose it can report on a large number of properties. - --------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/GraphicsMagick.html b/www/GraphicsMagick.html index 41432db..6235b84 100644 --- a/www/GraphicsMagick.html +++ b/www/GraphicsMagick.html @@ -431,7 +431,7 @@ can tell if gm was compiled in 16-bit mode by typing "gm version" without any options, and looking for "Q:16" in the first line of output. -

+

Back to Contents  

@@ -510,7 +510,7 @@ prepend an at sign @ to a filename to read a list of image filenames from that file. This is convenient in the event you have too many image filenames to fit on the command line.
-

+

Back to Contents  

@@ -1531,12 +1531,17 @@ reading or writing the DPX files. Sometimes this is useful if the file is use different endianness.
dpx:swap-samples={true|false}
+
dpx:swap-samples-read={true|false}
+
dpx:swap-samples-write={true|false}
GraphicsMagick strives to adhere to the DPX standard but certain -aspects of the standard can be quite confusing. As a result, some 10-bit -DPX files have Red and Blue interchanged, or Cb and Cr interchanged due -to an different interpretation of the standard, or getting the wires -crossed. The swap-samples option may be supplied when reading or writing -in order to read or write using the necessary sample order. +aspects of the standard can be quite confusing. As a result, some +10-bit DPX files have Red and Blue interchanged, or Cb and Cr +interchanged due to an different interpretation of the standard, or +getting the wires crossed. The swap-samples option may be supplied +when reading or writing in order to read or write using the necessary +sample order. Use swap-samples-read when swapping should only occur +in the reader, or swap-samples-write when swapping should only occur +in the writer.
gradient:direction={South|North|West|East|NorthWest|NorthEast|SouthWest|SouthEast}
By default, the gradient coder produces a gradient from top to @@ -3549,8 +3554,15 @@ width=15>

If the image does not have a matte channel, create an opaque one.

-Use +matte to ignore the matte channel and to avoid writing a +Use +matte to ignore the matte channel (treats it as opaque) and to avoid writing a matte channel in the output file.
+

+For the compare command, -matte will add an opaque matte +channel to images if they do not already have a matte channel, and +matte will be enabled for both images. Likewise, if +matte is +used, the matte channel is disabled for both images. This makes it +easier to compare images regardless of if they already have a matte +channel.
@@ -3912,7 +3924,7 @@ result is a gray image.


Select an operator from Add, And, Assign, Depth, Divide, Gamma, Negate, LShift, Log, Max, Min, Multiply, -Or, Pow RShift, Subtract, +Or, Pow, RShift, Subtract, Threshold, Threshold-White, Threshold-White-Negate, Threshold-Black, Threshold-Black-Negate, Xor, Noise-Gaussian, @@ -5917,7 +5929,7 @@ See X Resources for details.
-

+

Back to Contents  

@@ -6306,7 +6318,7 @@ use to the number of processor cores available while others default to just one thread. See the OpenMP specification for other standard adjustments and your compiler's manual for vendor-specific settings.
-

+

Back to Contents  

@@ -6418,7 +6430,7 @@ width=15>
-

+

Back to Contents  

@@ -6444,7 +6456,7 @@ and many more.
 
-

+

Back to Contents  

@@ -6463,7 +6475,7 @@ copyrights apply. Please see see http://www.GraphicsMagick.org/Copyright.html for details.

-

+

Back to Contents  


diff --git a/www/Hg.html b/www/Hg.html index 015f99f..0b7e114 100644 --- a/www/Hg.html +++ b/www/Hg.html @@ -3,7 +3,7 @@ - + GraphicsMagick Mercurial @@ -15,23 +15,23 @@ GraphicMagick logo GraphicsMagick
- - -   + + + 
@@ -41,7 +41,7 @@
-

Contents

+

Contents

  • What is Mercurial?
  • Web Access
  • @@ -84,6 +84,15 @@ directory, issue the command:

     hg clone http://hg.code.sf.net/p/graphicsmagick/code GM
     
    +

    Please note that since the introduction of an HTTP load balancer, +SourceForge has become unreliable when cloning with the default http +protocol. Due to this, using ssh protocol may be required. Any +SourceForge user who has submitted a SSH private key to SourceForge +may use Mercurial over SSH to clone the repository. The ssh clone +syntax looks like this (replacing YOURID with your SourceForge user +name):

    +
    +hg clone ssh://YOURID@hg.code.sf.net/p/graphicsmagick/code GM

Selecting a version of the code

@@ -254,9 +263,12 @@ notified by email of changes when they occur.

  • Merge Tool Configuration
  • Keep "My" or "Their" files when doing a merge
  • -
    -

    Copyright © GraphicsMagick Group 2012 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/Hg.html.orig b/www/Hg.html.orig new file mode 100644 index 0000000..119af42 --- /dev/null +++ b/www/Hg.html.orig @@ -0,0 +1,262 @@ + + + + + + +GraphicsMagick Mercurial + + + + + + + + + +
    +

    GraphicsMagick Mercurial

    + + + + + +

    The GraphicsMagick source code is available via Mercurial. Mercurial +is a convenient way for developers from around the country or world to +download the GraphicsMagick source, fix bugs, or add new features. +Due to the way Mercurial works, it may also be used to manage local +changes to GraphicsMagick.

    +
    +

    What is Mercurial?

    +

    Mercurial (also known as Hg due to the abbreviation for Mercury in +the periodic table of the elements) is a modern source control system +which provides anyone who clones a repository with a stand-alone local +repository containing the full development history and the ability to +select any version of the code. Since the local repository is +fully-functional, you may use the same repository to manage your local +changes to GraphicsMagick code and you may use the repository to share +your changes with others.

    +
    +
    +

    Web Access

    +

    The GraphicsMagick repository at SourceForge web interface is +available which may be used to interactively view the latest versions +of files, or the changes to files, using your web browser.

    +
    +
    +

    Cloning the Mercurial Repository

    +

    To get the tree and place it in a sub-directory of your current working +directory, issue the command:

    +
    +hg clone http://hg.code.sf.net/p/graphicsmagick/code GM
    +
    +
    +
    +

    Selecting a version of the code

    +

    By default the cloned directory is populated with files from the +default (i.e. head) branch of the code, which is where active +development happens.

    +

    If you require a specific release of GraphicsMagick (e.g. 1.3.23), you may select it like:

    +
    +hg update -r GraphicsMagick-1_3_23
    +
    +

    or if you require a specific branch of GraphicsMagick (e.g. 1.3), you may use:

    +
    +hg update -r GraphicsMagick-1_3
    +
    +

    or you may request the files which were current on a specific date:

    +
    +hg update -d 2009-01-14
    +
    +

    Use:

    +
    +hg branches
    +
    +

    to see the available branches, and:

    +
    +hg tags
    +
    +

    to see the available release tags.

    +
    +
    +

    Updating from the Mercurial Repository

    +

    To pull more changes from the repository, execute:

    +
    +hg pull
    +
    +

    and to make them visible in your files (via a merge), execute:

    +
    +hg update
    +
    +

    or just:

    +
    +hg pull -u
    +
    +

    The latter pulls down any updates into your local repository and +automatically does a merge.

    +
    +
    +

    Mercurial Software

    +

    The best place to look for the latest version of Mercurial (Hg) is +at the Mercurial web site. Most free operating systems (e.g. Linux, +OpenIndiana, and *BSD) will offer a version of Mercurial as an +installable package and it may already be installed on your system. +We recommend use of TortoiseHg on Microsoft Windows systems since it +provides a very nice graphical interface. TortoiseHg is also +available on Linux and other systems.

    +
    +
    +

    Mercurial for GraphicsMagick Developers

    +

    Since Mercurial is a distributed revision control system, you may +clone the GraphicsMagick repository and work for days or weeks (making +your own local commits) before you decide to push some or all of your +changes to the GraphicsMagick development repository. GraphicsMagick +developers first commit changes to their own local respository, then +they push their changes to the GraphicsMagick development repository +at hg.graphicsmagick.org, later on (after testing and possible fixes) +I will push the changes to the stable repository at SourceForge. +Pushes to the stable repository at SourceForge should occur at least +as often as source code snapshots are produced.

    +

    The repository hierarchy is as follows:

    +
      +
    1. Local
    2. +
    +
    +The developer makes any local changes and commits what he likes in his +own repository. It is best to commit often and whenever all the +files have been updated to implement a coherent change or feature +(including the ChangeLog file!) since Mercurial stores related +changes as a changeset along with the change message you enter. +When you push your repository, these changesets and messages are +preserved.
    +
      +
    1. Unstable
    2. +
    +
    +

    The unstable development repository is available via ssh at +"ssh://yourid@hg.GraphicsMagick.org//hg/GraphicsMagick".

    +

    Where yourid is the Unix user ID on the GraphicsMagick server. +The yourid@ part may left out if your client system uses the same +user ID as on the GraphicsMagick server.

    +
    +
      +
    1. Stable
    2. +
    +
    +The stable repository is available via http at +"http://hg.code.sf.net/p/graphicsmagick/code". Any changes in the +unstable development repository are pushed to the stable repository +(by the developer responsible for this role) once any necessary +adjustments have been made, documentation files have been generated, +and the software test suite has passed on at least one machine.
    +

    To build your local development repository (as quickly as possible), +you may use these steps:

    +
      +
    1. Clone the stable respository at SourceForge:

      +
      +hg clone http://hg.code.sf.net/p/graphicsmagick/code GM
      +
      +
    2. +
    3. Adjust your local repository path default to use the unstable repository.

      +

      Edit .hg/hgrc in your local repository so that it contains:

      +
      +[paths]
      +default = ssh://yourid@hg.GraphicsMagick.org//hg/GraphicsMagick
      +
      +

      where yourid is the Unix user ID on the GraphicsMagick server.

      +
    4. +
    5. Pull any additional pending updates from the unstable repository:

      +
      +hg pull -u
      +
      +
    6. +
    +

    Please note that when ssh access is used, Mercurial uncompresses any +data and sends it in uncompressed form. Mercurial expects that +compression will be enabled in ssh when needed. One way to enable ssh +compression is to put this in your local .hgrc:

    +
    +[ui]
    +ssh = ssh -C
    +
    +

    but ssh also provides its own way to enable compression on a +site-by-site basis (e.g. via .ssh/config). For example an entry in +.ssh/config will enable use of compression:

    +
    +Host hg.GraphicsMagick.org
    +  Compression yes
    +
    +
    +
    +

    SSH Public Keys For hg.GraphicsMagick.org

    +

    For reference, these are the ssh public keys for the server at hg.GraphicsMagick.org:

    +

    DSS (DSA):

    +
    +ssh-dss AAAAB3NzaC1kc3MAAACBANZAsDZ9fUWQNwUoRw8HoNl8aLLs97KmyiaA6mSPeM1NeQKrxk0PAFEXMR05CNcZHSyopUx6B8PuTWE4+4rDhFCw7J0JkfFS4uIG3bu3YCRqQrg2k4VsDw60zK9sNum5BcLEWd+qs8X7DrEff5fGmXkc8IdMXPgHTzaJWCT9YJU1AAAAFQCJaFq4/7FqHcHm5abhW5qJyH0RgQAAAIEAgv6s3gfB8p/Elf0ZcIZ5eITCpI9aZFaSLSeKHMmhYps1uMuZ9LtWjZ11cotcuOh0tlwGUixlu/5soZqX6VbnJAuyvfI+7WSUFuJmRjsbXJVCBuSPZ7YgMNuLYlLst7sZLCs5hU61jxnaR2zmkUjDWP4GWROC6AYZXlbJX1qRJ7YAAACBAMsIbVVgz/aP95yCPk1Pw0FjoL5t6C3BpxdA9aiIFBMg14ElaHh+gaXQoZfjAuafZ8pc5woYtQLLkzinCQnmvH/EqqYCe+Fu7jcsYU7oWUXG1O9ZBKI7QZkeCTaYMXIWBplgVD+tkRpH/gxn5iweNMM9e43qPB0b2JYObliqD1E9 root@src
    +
    +

    RSA:

    +
    +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1IuJDYT85qz/w6+vn5hkpzM5Ju5dsMeJD9GnATj3op5dhBWyfbaJpS7yyK2Vhhz26GBUvUtO3LGm0dQvdj83P3DX3aUuzfnC3Bc9dWeARomQPtDy9MfDikD6kqjD9/Lemgvv8I4Na9vUEmYvXUpTrtawJ4S7A7IctPnvKLPGA5+qY5XzMSE0wcOSBdbeV1PAIDOXYH2hKakZwtxXlvfTv6CZphz/jG5nmf+/Zlkr4yopNvPFbtd3vbaaqSuCoGHXKfmpRko2gXf6EGF92wXzbsE1tW3AkSJ2xdhFHRNmQEu2y9F1l9zb8IETBtKMWRJWAsPPpUSkht0DRsTXt/f+Zw== root@src
    +
    +

    ECDSA:

    +
    +ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOrGQ6tjmZvm8w+GP7yLFJ1/vkImKkpXv7kPNxA0+Sfx6WCqAjV0pWP5MVCraP8SNbphL8jiS/x3WADXlf+R2KQ= root@src
    +
    +

    ED25519:

    +
    +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAtwIcJEBiSUWsB2sydInR76gE84Jp1rxmc8lTGPg5cB root@src
    +
    +
    +
    +

    Email Notifications

    +

    An email notification is sent to the graphicsmagick-commit mailing +list at SourceForge whenever a change is submitted to the development +(unstable) repository. Subscribe to this list if you would like to be +notified by email of changes when they occur.

    +
    +
    +

    Mercurial Topics

    + +
    +

    Copyright © GraphicsMagick Group 2012 - 2020

    +
    +
    + + diff --git a/www/Hg.rst b/www/Hg.rst index e1dc3f4..a56b019 100644 --- a/www/Hg.rst +++ b/www/Hg.rst @@ -58,6 +58,16 @@ directory, issue the command:: hg clone http://hg.code.sf.net/p/graphicsmagick/code GM +Please note that since the introduction of an HTTP load balancer, +SourceForge has become unreliable when cloning with the default http +protocol. Due to this, using ssh protocol may be required. Any +SourceForge user who has submitted a SSH private key to SourceForge +may use Mercurial over SSH to clone the repository. The ssh clone +syntax looks like this (replacing `YOURID` with your SourceForge user +name): + + hg clone ssh://YOURID@hg.code.sf.net/p/graphicsmagick/code GM + Selecting a version of the code ======================================== @@ -233,10 +243,3 @@ Mercurial Topics * `Merge Tool Configuration `_ * `Keep "My" or "Their" files when doing a merge `_ - - --------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2012 - 2020 diff --git a/www/INSTALL-unix.html b/www/INSTALL-unix.html index daf59d5..4aaf41e 100644 --- a/www/INSTALL-unix.html +++ b/www/INSTALL-unix.html @@ -3,7 +3,7 @@ - + UNIX/Cygwin/MinGW/MSYS2 Compilation @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -222,6 +222,19 @@ follows (execute 'configure --help' to see all options).

    + +--disable-compressed-files + + 

    disable reading and writing of gzip/bzip stream files

    +

    Normally support for being able to read and write gzip/bzip stream +files (files which are additionally compressed using gzip or bzip) +is a good thing, but for some formats it is necessary to +decompress an entire input file before it may be validated and +read. Decompressing the file may take a lot of time and disk +space. If input files are not trustworthy, an apparently small +file can take much more resources than expected. Use this option +to reject such files.

    + --enable-prof enable 'prof' profiling support (default disabled) @@ -911,14 +924,15 @@ pre-compiled components. Using the pre-compiled packages, it is almost as easy to compile GraphicsMagick under MSYS2 as it is under Linux!

    When using MSYS2, requesting to install these packages using 'pacman --S' (in addition to compilation tools for C/C++) should result in -getting up to speed very quicky with a featureful build:

    -

    mingw-w64-x86_64-bzip2, mingw-w64-x86_64-freetype, -mingw-w64-x86_64-ghostscript, mingw-w64-x86_64-jbigkit, -mingw-w64-x86_64-lcms2, mingw-w64-x86_64-libjpeg-turbo, -mingw-w64-x86_64-libpng, mingw-w64-x86_64-libtool, -mingw-w64-x86_64-libwebp mingw-w64-x86_64-libwmf, -mingw-w64-x86_64-libxml2, mingw-w64-x86_64-zlib

    +-S' should result in getting up to speed very quicky with a featureful +build:

    +

    mingw-w64-x86_64-toolchain, mingw-w64-x86_64-bzip2, +mingw-w64-x86_64-freetype, mingw-w64-x86_64-ghostscript, +mingw-w64-x86_64-jbigkit, mingw-w64-x86_64-lcms2, +mingw-w64-x86_64-libjpeg-turbo, mingw-w64-x86_64-libpng, +mingw-w64-x86_64-libtool, mingw-w64-x86_64-libwebp +mingw-w64-x86_64-libwmf, mingw-w64-x86_64-libxml2, +mingw-w64-x86_64-zlib

    GraphicsMagick may also be built using the free MinGW ("Minimalistic GNU for Windows") package, available from

    @@ -1065,9 +1079,13 @@ Build the package
    Install the package

    'make check'

    -Run tests using the uninstalled software. On some systems, 'make +

    Run tests using the uninstalled software. On some systems, 'make install' must be done before the test suite will work but usually -the software can be tested prior to installation.

    +the software can be tested prior to installation.

    +

    The test suite requires sufficient RAM memory to run. The memory +requirement is 128MB for the Q8 build, or 256MB for the Q16 +build, or 512MB for the Q32 build.

    +

    'make clean'

    Remove everything in the build directory created by 'make'
    @@ -1150,8 +1168,12 @@ the developer's environment environment and your own may include the compiler, the CPU type, and the library versions used. The GraphicsMagick developers use the current release of all dependent libraries.

    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/INSTALL-unix.html.orig b/www/INSTALL-unix.html.orig new file mode 100644 index 0000000..5863aed --- /dev/null +++ b/www/INSTALL-unix.html.orig @@ -0,0 +1,1157 @@ + + + + + + +UNIX/Cygwin/MinGW/MSYS2 Compilation + + + + + + + +
    +

    UNIX/Cygwin/MinGW/MSYS2 Compilation

    + + + + + +
    +

    Archive Formats

    +

    GraphicsMagick is distributed in a number of different archive formats. +The source code must be extracted prior to compilation as follows:

    +

    7z

    +
    +

    7-Zip archive format. The Z-Zip format may be extracted under Unix +using '7za' from the P7ZIP package (http://p7zip.sourceforge.net/). +Extract similar to:

    +
    +7za x GraphicsMagick-1.3.7z
    +
    +
    +

    .tar.bz2

    +
    +

    BZip2 compressed tar archive format. Requires that both the bzip2 +(http://www.sourceware.org/bzip2/) and tar programs to be available. Extract +similar to:

    +
    +bzip2 -d GraphicsMagick-1.3.tar.bz | tar -xvf -
    +
    +
    +

    .tar.gz

    +
    +

    Gzip compressed tar archive format. Requires that both the gzip +(http://www.gzip.org/) and tar programs to be available. Extract +similar to:

    +
    +gzip -d GraphicsMagick-1.3.tar.gz | tar -xvf -
    +
    +
    +

    .tar.lz

    +
    +

    Lzip compressed tar archive format. Requires that both the lzip +(http://lzip.nongnu.org/lzip.html) and tar programs to be +available. Extract similar to:

    +
    +lzip -d -c GraphicsMagick-1.3.tar.gz | tar -xvf -
    +
    +
    +

    .tar.xz

    +
    +

    LZMA compressed tar archive format. Requires that LZMA utils +(http://tukaani.org/lzma/) and tar programs to be available. Extract +similar to:

    +
    +xz -d GraphicsMagick-1.3.tar.xz | tar -xvf -
    +
    +
    +

    zip

    +
    +

    PK-ZIP archive format. Requires that the unzip program from Info-Zip +(http://www.info-zip.org/UnZip.html) be available. Extract similar to:

    +
    +unzip GraphicsMagick-1.3.zip
    +
    +
    +

    The GraphicsMagick source code is extracted into a subdirectory +similar to 'GraphicsMagick-1.3'. After the source code extracted, +change to the new directory (using the actual directory name) using +a command similar to:

    +
    +cd GraphicsMagick-1.3
    +
    +
    +
    +

    Build Configuration

    +

    Use 'configure' to automatically configure, build, and install +GraphicsMagick. The configure script may be executed from the +GraphicsMagick source directory (e.g ./configure) or from a separate +build directory by specifying the full path to configure (e.g. +/src/GraphicsMagick-1.3/configure). The advantage of using a separate +build directory is that multiple GraphicsMagick builds may share the +same GraphicsMagick source directory while allowing each build to use a +unique set of options. Using a separate directory also makes it easier +to keep track of any files you may have edited.

    +

    If you are willing to accept configure's default options (static +build, 8 bits/sample), and build from within the source directory, +type:

    +
    +./configure
    +
    +

    and watch the configure script output to verify that it finds everything +that you think it should. If it does not, then adjust your environment +so that it does.

    +

    By default, 'make install' will install the package's files +in '/usr/local/bin', '/usr/local/man', etc. You can specify an +installation prefix other than '/usr/local' by giving 'configure' +the option '--prefix=PATH'. This is valuable in case you don't have +privileges to install under the default paths or if you want to install +in the system directories instead.

    +

    If you are not happy with configure's choice of compiler, compilation +flags, or libraries, you can give 'configure' initial values for +variables by specifying them on the configure command line, e.g.:

    +
    +./configure CC=c99 CFLAGS=-O2 LIBS=-lposix
    +
    +

    Options which should be common to packages installed under the same +directory heirarchy may be supplied via a 'config.site' file located +under the installation prefix via the path ${prefix}/share/config.site +where ${prefix} is the installation prefix. This file is used for all +packages installed under that prefix. As an alternative, the CONFIG_SITE +environment variable may be used to specify the path of a site +configuration file to load. This is an example config.site file:

    +
    +# Configuration values for all packages installed under this prefix
    +CC=gcc
    +CXX=c++
    +CPPFLAGS='-I/usr/local/include'
    +LDFLAGS='-L/usr/local/lib -R/usr/local/lib'
    +
    +

    When the 'config.site' file is being used to supply configuration +options, configure will issue a message similar to:

    +
    +configure: loading site script /usr/local/share/config.site
    +
    +

    The configure variables you should be aware of are:

    +

    CC

    +
    +Name of C compiler (e.g. 'cc -Xa') to use
    +

    CXX

    +
    +Name of C++ compiler to use (e.g. 'CC')
    +

    CFLAGS

    +
    +Compiler flags (e.g. '-g -O2') to compile C code
    +

    CXXFLAGS

    +
    +Compiler flags (e.g. '-g -O2') to compile C++ code
    +

    CPPFLAGS

    +
    +Include paths (-I/somedir) to look for header files
    +

    LDFLAGS

    +
    +Library paths (-L/somedir) to look for libraries Systems that +support the notion of a library run-path may require an additional +argument in order to find shared libraries at run time. For +example, the Solaris linker requires an argument of the form +'-R/somedir', some Linux systems will work with '-rpath /somedir', +while some other Linux systems who's gcc does not pass -rpath to +the linker require an argument of the form '-Wl,-rpath,/somedir'.
    +

    LIBS

    +
    +Extra libraries (-lsomelib) required to link
    +

    Any variable (e.g. CPPFLAGS or LDFLAGS) which requires a directory +path must specify an absolute path rather than a relative path.

    +

    The build now supports a Linux-style "silent" build (default +disabled). To enable this, add the configure option +--enable-silent-rules or invoke make like 'make V=0'. If the build +has been configured for silent mode and it is necessary to see a +verbose build, then invoke make like 'make V=1'.

    +

    Configure can usually find the X include and library files +automatically, but if it doesn't, you can use the 'configure' options +'--x-includes=DIR' and '--x-libraries=DIR' to specify their locations.

    +

    The configure script provides a number of GraphicsMagick specific +options. When disabling an option --disable-something is equivalent +to specifying --enable-something=no and --without-something is +equivalent to --with-something=no. The configure options are as +follows (execute 'configure --help' to see all options).

    +
    +

    Optional Features

    + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +--enable-profenable 'prof' profiling support (default disabled)
    +--enable-gprofenable 'gprof' profiling support (default disabled)
    +--enable-gcovenable 'gcov' profiling support (default disabled)
    +--disable-installed
     disable building an installed GraphicsMagick (default enabled)
    +--enable-broken-coders
     enable broken/dangerous file formats support
    +--disable-largefile
     disable support for large (64 bit) file offsets
    +--disable-openmp
     disable use of OpenMP (automatic multi-threaded loops) at all
    +--enable-openmp-slow
     enable OpenMP for algorithms which sometimes run slower
    +--enable-symbol-prefix
     enable prefixing library symbols with "Gm"
    +--enable-magick-compat
     install ImageMagick utility shortcuts (default disabled)
    +--enable-maintainer-mode
     enable additional Makefile rules which update generated files +included in the distribution. Requires GNU make as well as a +number of utilities and tools.
    +--enable-quantum-library-names
     shared library name includes quantum depth to allow shared +libraries with different quantum depths to co-exist in same +directory (only one can be used for development)
    +
    +
    +

    Optional Packages/Options

    + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +--with-quantum-depth
     number of bits in a pixel quantum (default 8). Also see +'--enable-quantum-library-names.'
    +--with-modulesenable building dynamically loadable modules
    +--without-threads
     disable POSIX threads API support
    +--with-frozenpaths
     enable frozen delegate paths
    +--without-magick-plus-plus
     disable build/install of Magick++
    +--with-perlenable build/install of PerlMagick
    +--with-perl=PERL
     use specified Perl binary to configure PerlMagick
    +--with-perl-options=OPTIONS
     options to pass on command-line when generating PerlMagick's Makefile from Makefile.PL
    +--without-bzlib
     disable BZLIB support
    +--without-dpsdisable Display Postscript support
    +--with-fpxenable FlashPIX support
    +--without-jbigdisable JBIG support
    +--without-webpdisable WEBP support
    +--without-jp2disable JPEG v2 support
    +--without-jpegdisable JPEG support
    +--without-jp2disable JPEG v2 support
    +--without-lcms2
     disable lcms (v2.X) support
    +--without-lzmadisable LZMA support
    +--without-pngdisable PNG support
    +--without-tiffdisable TIFF support
    +--without-triodisable TRIO library support
    +--without-ttfdisable TrueType support
    +--with-tcmalloc
     enable Google perftools tcmalloc (minimal) memory allocation +library support
    +--with-mtmalloc
     enable Solaris mtmalloc memory allocation library support
    +--with-umemenable Solaris libumem memory allocation library support
    +--without-wmfdisable WMF support
    +--with-fontpath
     prepend to default font search path
    +--with-gs-font-dir
     directory containing Ghostscript fonts
    +--with-windows-font-dir
     directory containing MS-Windows fonts
    +--without-xmldisable XML support
    +--without-zlibdisable ZLIB support
    +--without-zstddisable Zstd support
    +--with-xuse the X Window System
    +--with-share-path=DIR
     Alternate path to share directory (default share/GraphicsMagick)
    +--with-libstdc=DIR
     use libstdc++ in DIR (for GNU C++)
    +

    GraphicsMagick options represent either features to be enabled, disabled, +or packages to be included in the build. When a feature is enabled (via +--enable-something), it enables code already present in GraphicsMagick. +When a package is enabled (via --with-something), the configure script +will search for it, and if is is properly installed and ready to use +(headers and built libraries are found by compiler) it will be included +in the build. The configure script is delivered with all features +disabled and all packages enabled. In general, the only reason to +disable a package is if a package exists but it is unsuitable for +the build (perhaps an old version or not compiled with the right +compilation flags).

    +

    Several configure options require special note:

    + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +--enable-shared
     

    The shared libraries are built and support for loading coder and +process modules is enabled. Shared libraries are preferred because +they allow programs to share common code, making the individual +programs much smaller. In addition shared libraries are required in +order for PerlMagick to be dynamically loaded by an installed PERL +(otherwise an additional PERL (PerlMagick) must be installed. This +option is not the default because all libraries used by +GraphicsMagick must also be dynamic libraries if GraphicsMagick +itself is to be dynamically loaded (such as for PerlMagick).

    +

    GraphicsMagick built with delegates (see MAGICK PLUG-INS below) +can pose additional challenges. If GraphicsMagick is built using +static libraries (the default without --enable-shared) then +delegate libraries may be built as either static libraries or +shared libraries. However, if GraphicsMagick is built using shared +libraries, then all delegate libraries must also be built as +shared libraries. Static libraries usually have the extension .a, +while shared libraries typically have extensions like .so, .sa, +or .dll. Code in shared libraries normally must compiled using +a special compiler option to produce Position Independent Code +(PIC). The only time this is not necessary is if the platform +compiles code as PIC by default.

    +

    PIC compilation flags differ from vendor to vendor (gcc's is +-fPIC). However, you must compile all shared library source with +the same flag (for gcc use -fPIC rather than -fpic). While static +libraries are normally created using an archive tool like 'ar', +shared libraries are built using special linker or compiler options +(e.g. -shared for gcc).

    +

    Building shared libraries often requires subtantial hand-editing +of Makefiles and is only recommended for those who know what they +are doing.

    +

    If --enable-shared is not specified, a new PERL interpreter +(PerlMagick) is built which is statically linked against the +PerlMagick extension. This new interpreter is installed into the +same directory as the GraphicsMagick utilities. If --enable-shared +is specified, the PerlMagick extension is built as a dynamically +loadable object which is loaded into your current PERL interpreter +at run-time. Use of dynamically-loaded extensions is preferable over +statically linked extensions so --enable-shared should be specified +if possible (note that all libraries used with GraphicsMagick must +be shared libraries!).

    +
    +--disable-static
     static archive libraries (with extension .a) are not built. If you +are building shared libraries, there is little value to building +static libraries. Reasons to build static libraries include: 1) they +can be easier to debug; 2) the clients do not have external +dependencies (i.e. libMagick.so); 3) building PIC versions of the +delegate libraries may take additional expertise and effort; 4) you +are unable to build shared libraries.
    +--disable-installed
     By default the GraphicsMagick build is configured to formally install +into a directory tree. This is the most secure and reliable way to +install GraphicsMagick. Specifying --disable-installed configures +GraphicsMagick so that it doesn't use hard-coded paths and locates +support files by computing an offset path from the executable (or +from the location specified by the MAGICK_HOME environment variable. +The uninstalled configuration is ideal for binary distributions which +are expected to extract and run in any location.
    +--enable-broken-coders
     The implementation of file format support for some formats is +incomplete or imperfectly implemented such that file corruption or a +security exploit might occur. These formats are not included in the +build by default but may be enabled using +--enable-broken-coders. The existing implementation may still +have value in controlled circumstances so it remains but needs to be +enabled. One of the formats currently controlled by this is Adobe +Photoshop bitmap format (PSD).
    +--with-modules

    Image coders and process modules are built as loadable modules which +are installed under the directory +[prefix]/lib/GraphicsMagick-X.X.X/modules-QN (where 'N' equals 8, 16, +or 32 depending on the quantum depth) in the subdirectories 'coders' +and 'filters' respectively. The modules build option is only +available in conjunction with --enable-shared. If --enable-shared is +not also specified, then support for building modules is disabled. +Note that if --enable-shared is specified, the module loader is +active (allowing extending an installed GraphicsMagick by simply +copying a module into place) but GraphicsMagick itself is not built +using modules.

    +

    Use of the modules build is recommended where it is possible to use +it. Using modules defers the overhead due to library dependencies +(searching the filesystem for libraries, shared library relocations, +initialized data, and constructors) until the point the libraries +are required to be used to support the file format requested. +Traditionally it has been thought that a 'static' program will be +more performant than one built with shared libraries, and perhaps +this may be true, but building a 'static' GraphicsMagick does not +account for the many shared libraries it uses on a typical +Unix/Linux system. These shared libraries may impose unexpected +overhead. For example, it was recently noted that libxml2 is now +often linked with the ICU (international character sets) libraries +which are huge C++ libraries consuming almost 30MB of disk space and +that simply linking with these libraries causes GraphicsMagick to +start up much more slowly. By using the modules build, libxml2 (and +therefore the huge ICU C++ libraries) are only loaded in the few +cases (e.g. SVG format) where it is needed.

    +

    When applications depend on the GraphicsMagick libraries, using the +modules build lessens the linkage overhead due to using +GraphicsMagick.

    +
    +--enable-symbol-prefix
     The GraphicsMagick libraries may contain symbols which conflict with +other libraries. Specifify this option to prefix "Gm" to all library +symbols, and use the C pre-processor to allow dependent code to still +compile as before.
    +--enable-magick-compat
     Normally GraphicsMagick installs only the 'gm' utility from which all +commands may be accessed. Existing packages may be designed to invoke +ImageMagick utilities (e.g. "convert"). Specify this option to +install ImageMagick utility compatibility links to allow +GraphicsMagick to substitute directly for ImageMagick. Take care when +selecting this option since if there is an existing ImageMagick +installation installed in the same directory, its utilities will be +replaced when GraphicsMagick is installed.
    +--with-quantum-depth
     

    This option allows the user to specify the number of bits to use per +pixel quantum (the size of the red, green, blue, and alpha pixel +components. When an image file with less depth is read, smaller +values are scaled up to this size for processing, and are scaled +down from this size when a file with lower depth is written. For +example, "--with-quantum-depth=8" builds GraphicsMagick using 8-bit +quantums. Most computer display adaptors use 8-bit +quantums. Currently supported arguments are 8, 16, or 32. The +default is 8. This option is the most important option in +determining the overall run-time performance of GraphicsMagick.

    +

    The number of bits in a quantum determines how many values it may +contain. Each quantum level supports 256 times as many values as +the previous level. The following table shows the range available +for various quantum sizes.

    +
    + +++++ + + + + + + + + + + + + + + + + + + + + +
    QuantumDepthValid Range (Decimal)Valid Range (Hex)
    80-25500-FF
    160-655350000-FFFF
    320-429496729500000000-FFFFFFFF
    +
    +

    Larger pixel quantums cause GraphicsMagick to run more slowly and to +require more memory. For example, using sixteen-bit pixel quantums +causes GraphicsMagick to run 15% to 50% slower (and take twice as +much memory) than when it is built to support eight-bit pixel +quantums. Regardless, the GraphicsMagick authors prefer to use +sixteen-bit pixel quantums since they support all common image +formats and assure that there is no loss of color precision.

    +

    The amount of virtual memory consumed by an image can be computed +by the equation (QuantumDepth*Rows*Columns*5)/8. This is an +important consideration when resources are limited, particularly +since processing an image may require several images to be in +memory at one time. The following table shows memory consumption +values for a 1024x768 image:

    +
    + ++++ + + + + + + + + + + + + + + + + +
    QuantumDepthVirtual Memory
    83MB
    168MB
    3215MB
    +
    +

    GraphicsMagick performs all image processing computations using +floating point or non-lossy integer arithmetic, so results are very +accurate. Increasing the quantum storage size decreases the amount +of quantization noise (usually not visible at 8 bits) and helps +prevent countouring and posterization in the image.

    +

    Consider also using the --enable-quantum-library-names configure +option so that installed shared libraries include the quantum depth +as part of their names so that shared libraries using different +quantum depth options may co-exist in the same directory.

    +
    +--without-magick-plus-plus
     Disable building Magick++, the C++ application programming interface +to GraphicsMagick. A suitable C++ compiler is required in order to +build Magick++. Specify the CXX configure variable to select the C++ +compiler to use (default "g++"), and CXXFLAGS to select the desired +compiler opimization and debug flags (default "-g -O2"). Antique C++ +compilers will normally be rejected by configure tests so specifying +this option should only be necessary if Magick++ fails to compile.
    +--with-frozenpaths
     Normally external program names are substituted into the +delegates.mgk file without full paths. Specify this option to enable +saving full paths to programs using locations determined by +configure. This is useful for environments where programs are stored +under multiple paths, and users may use different PATH settings than +the person who builds GraphicsMagick.
    +--without-threads
     By default, the GraphicsMagick library is compiled to be fully +thread safe by using thread APIs to implement required locking. +This is intended to allow the GraphicsMagick library to be used by +multi-threaded programs using native POSIX threads. If the locking +or dependence on thread APIs is undesireable, then specify +--without-threads. Testing shows that the overhead from thread +safety is virtually unmeasurable so usually there is no reason to +disable multi-thread support. While previous versions disabled +OpenMP support when this option was supplied, that is no longer the +case since then OpenMP locking APIs are used instead.
    +--disable-largefile
     By default, GraphicsMagick is compiled with support for large (> 2GB +on a 32-bit CPU) files if the operating system supports large files. +Applications which use the GraphicsMagick library might then also +need to be compiled to support for large files (operating system +dependent). Normally support for large files is a good thing. Only +disable this option if there is a need to do so.
    +--disable-openmp
     

    By default, GraphicsMagick is compiled with support for OpenMP +(http://www.openmp.org/) if the compilation environment supports it. +OpenMP automatically parallizes loops across concurrent threads +based on instructions in pragmas. OpenMP was introduced in GCC +4.2. OpenMP is a well-established standard and was implemented in +some other compilers in the late '90s, long before its appearance in +GCC. OpenMP adds additional build and linkage requirements. +GraphicsMagick supports OpenMP version 2.0 and later, primarily +using features defined by version 2.5, but will be optionally using +features from version 3.1 in the future since it is commonly +available.

    +

    By default, GraphicsMagick enables as many threads as there are CPU +cores (or CPU threads). According to the OpenMP standard, the +OMP_NUM_THREADS environment variable specifies how many threads +should be used and GraphicsMagick also honors this request. In order +to obtain the best single-user performance, set OMP_NUM_THREADS +equal to the number of available CPU cores. On a server with many +cores and many programs running at once, there may be benefit to +setting OMP_NUM_THREADS to a much smaller value than the number of +cores, and sometimes values as low as two (or even one, to disable +threading) will offer the best overall system performance. Tuning a +large system with OpenMP programs running in parallel (competing for +resources) is a complex topic and some research and experimentation +may be required in order to find the best parameters.

    +
    +--enable-openmp-slow
     On some systems, memory-bound algorithms run slower (rather than +faster) as threads are added via OpenMP. This may be due to CPU +cache and memory architecture implementation, or OS thread API +implementation. Since it is not known how a system will behave +without testing and pre-built binaries need to work well on all +systems, these algorithms are now disabled for OpenMP by default. +If you are using a well-threaded OS on a CPU with a good +high-performance memory architecture, you might consider enabling +this option based on experimentation.
    +--with-perl

    Use this option to include PerlMagick in the GraphicsMagick build +and test suite. While PerlMagick is always configured by default +(PerlMagick/Makefile.PL is generated by the configure script), +PerlMagick is no longer installed by GraphicsMagick's ''make +install''. The procedure to configure, build, install, and check +PerlMagick is described in PerlMagick/README.txt. When using a +shared library build of GraphicsMagick, it is necessary to formally +install GraphicsMagick prior to building PerlMagick in order to +achieve a working PerlMagick since otherwise the wrong +GraphicsMagick libraries may be used.

    +

    If the argument ''--with-perl=/path/to/perl'' is supplied, then +/path/to/perl will be taken as the PERL interpreter to use. This is +important in case the 'perl' executable in your PATH is not PERL5, +or is not the PERL you want to use. Experience suggests that static +PerlMagick builds may not be fully successful (at least for +executing the test suite) for Perl versions newer than 5.8.8.

    +
    +--with-perl-options
     The PerlMagick module is normally installed using the Perl +interpreter's installation PREFIX, rather than GraphicsMagick's. If +GraphicsMagick's installation prefix is not the same as PERL's +PREFIX, then you may find that PerlMagick's 'make install' step tries +to install into a directory tree that you don't have write +permissions to. This is common when PERL is delivered with the +operating system or on Internet Service Provider (ISP) web servers. +If you want PerlMagick to install elsewhere, then provide a PREFIX +option to PERL's configuration step via +"--with-perl-options=PREFIX=/some/place". Other options accepted by +MakeMaker are 'LIB', 'LIBPERL_A', 'LINKTYPE', and 'OPTIMIZE'. See the +ExtUtils::MakeMaker(3) manual page for more information on +configuring PERL extensions.
    +--without-xBy default, GraphicsMagick will use X11 libraries if they are +available. When --without-x is specified, use of X11 is disabled. The +display, animate, and import sub-commands are not included. The +remaining sub-commands have reduced functionality such as no access +to X11 fonts (consider using Postscript or TrueType fonts instead).
    +--with-gs-font-dir
     

    Specify the directory containing the Ghostscript Postscript Type 1 +font files (e.g. "n019003l.pfb") also known as the "URW Fonts" so +that they can be rendered using the FreeType library. These fonts +emulate the standard 35 fonts commonly available on printers +supporting Adobe Postscript so they are very useful to have. If the +font files are installed using the default Ghostscript installation +paths (${prefix}/share/ghostscript/fonts), they should be discovered +automatically by configure and specifying this option is not +necessary. Specify this option if the Ghostscript fonts fail to be +located automatically, or the location needs to be overridden.

    +

    The "Ghostscript" fonts (also known as "URW Standard postscript +fonts (cyrillicized)") are available from

    +
    +https://sourceforge.net/projects/gs-fonts/
    +

    These fonts may are often available as a package installed by a +package manager and installing from a package manager is easier than +installing from source:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    URW Font Packages
    DistributionPackage NameFonts Installation Path
    Cygwinurw-base35-fonts/usr/share/ghostscript/fonts
    Debian Linuxfonts-urw-base35/usr/share/fonts/type1/gsfonts
    Gentoo Linuxmedia-fonts/urw-fonts/usr/share/fonts/ghostscript
    Illumos/pkgsrcurw-fonts-2.0nb1/opt/local/share/fonts/urw
    NetBSD/pkgsrcurw-fonts-2.0nb1/share/fonts/urw
    OpenIndianagnu-gs-fonts-std/usr/share/ghostscript/fonts
    OS X/Homebrewfont-urw-base35[ TBD ]
    Red Hat Linuxurw-fonts-2.0/usr/share/fonts/default/Type1
    Ubuntu Linuxfonts-urw-base35/usr/share/fonts/type1/gsfonts
    +
    +--with-windows-font-dir
     Specify the directory containing MS-Windows-compatible fonts. This is +not necessary when GraphicsMagick is running under MS-Windows.
    +--with-tcmalloc
     The GNU libc malloc and some other mallocs exhibits poor concurrency +in multi-threaded OpenMP programs and this can severely impact +OpenMP speedup. The 'tcmalloc' library provided as part of Google +gperftools has been +observed to perform far better than the default GNU libc memory +allocator for multi-threaded use, and also for single-threaded use. +Overall benchmark performance improvements of up to a factor of two +are observed for some algorithms (even with just 12 cores) and it is +expected that the improvements will become much more apparent with +larger numbers of cores (e.g. 64 cores). Using tcmalloc may improve +performance dramatically for some work-loads on modern multi-core +systems.
    +--with-umemThe default Solaris memory allocator exhibits poor concurrency in +multi-threaded programs and this can impact OpenMP speedup under +Solaris (and systems derived from it such as Illumos). Use this +convenience option to enable use of the umem memory allocation +library, which is observed to be more performant in multi-threaded +programs. There is a port of umem available for Linux so this +option is not specific to Solaris.
    +--with-mtmalloc
     The default Solaris memory allocator exhibits poor concurrency in +multi-threaded programs and this can impact OpenMP speedup under +Solaris (and systems derived from it such as Illumos). Use this +convenience option to enable use of the mtmalloc memory allocation +library, which is more performant in multi-threaded programs than +the default libc memory allocator, and more performant in +multi-threaded programs than umem, but is less memory efficient.
    +
    +
    +
    +

    Building under Cygwin

    +

    GraphicsMagick may be built under the Windows '95-XP Cygwin +Unix-emulation environment available for free from

    +
    +http://www.cygwin.com/
    +

    It is suggested that the X11R6 package be installed since this enables +GraphicsMagick's X11 support (animate, display, and import +sub-commands will work) and it includes the Freetype v2 DLL required +to support TrueType and Postscript Type 1 fonts. Make sure that +/usr/X11R6/bin is in your PATH prior to running configure.

    +

    If you are using Cygwin version 1.3.9 or later, you may specify the +configure option '--enable-shared' to build Cygwin DLLs. Specifying +'--enable-shared' is required if you want to build PerlMagick under +Cygwin because Cygwin does not provide the libperl.a static library +required to create a static PerlMagick. Note that older Cygwin +compilers may not generate code which supports reliably catching C++ +exceptions thrown by DLL code. The Magick++ library requires that it +be possible to catch C++ exceptions thrown from DLLs. The test suite +make check includes several tests to verify that C++ exceptions +are working properly.

    +
    +
    +

    Building under MinGW & MSYS2

    +

    GraphicsMagick may easily be built using the free MSYS2 distribution which provides GCC compilers, +libraries, and headers, targeting native Windows along with a +Unix-like command shell and a package manager ('Pacman') to install +pre-compiled components. Using the pre-compiled packages, it is +almost as easy to compile GraphicsMagick under MSYS2 as it is under +Linux!

    +

    When using MSYS2, requesting to install these packages using 'pacman +-S' (in addition to compilation tools for C/C++) should result in +getting up to speed very quicky with a featureful build:

    +

    mingw-w64-x86_64-bzip2, mingw-w64-x86_64-freetype, +mingw-w64-x86_64-ghostscript, mingw-w64-x86_64-jbigkit, +mingw-w64-x86_64-lcms2, mingw-w64-x86_64-libjpeg-turbo, +mingw-w64-x86_64-libpng, mingw-w64-x86_64-libtool, +mingw-w64-x86_64-libwebp mingw-w64-x86_64-libwmf, +mingw-w64-x86_64-libxml2, mingw-w64-x86_64-zlib

    +

    GraphicsMagick may also be built using the free MinGW +("Minimalistic GNU for Windows") package, available from

    +
    +http://www.mingw.org/
    +

    or from

    +
    +http://mingw-w64.sourceforge.net/
    +

    which consist of GNU-based (GCC) compilation toolsets plus headers and +libraries required to build programs which are entirely based on +standard Microsoft Windows DLLs so that they may be used for +proprietary applications. MSYS provides a Unix-style console shell +window with sufficient functionality to run the GraphicsMagick +configure script and execute 'make', 'make check', and 'make install'. +GraphicsMagick may be executed from the MSYS shell, but since it is a +normal Windows application, it will work just as well from the Windows +command line.

    +

    Unlike the Cygwin build which creates programs based on a +Unix-emulation DLL, and which uses Unix-style paths to access Windows +files, the MinGW build creates native Windows console applications +similar to the Visual C++ build. Run-time performance is similar to the +Microsoft compilers.

    +

    The base MinGW (or MinGW-w64) package and the MSYS package should be +installed. Other MinGW packages are entirely optional. Once MSYS is +installed a MSYS icon (blue capital 'M') is added to the +desktop. Double clicking on this icon starts an instance of the MSYS +shell.

    +

    Start the MSYS console and follow the Unix configure and build +instructions. The configure and build for MinGW is the same as for +Unix. Any additional delegate libraries (e.g. libpng) will need to be +built under MinGW in order to be used. These libraries should be built +and installed prior to configuring GraphicsMagick. While some delegate +libraries are easy to configure and build under MinGW, others may be +quite a challenge.

    +

    Lucky for us, the most common delegate libraries are available +pre-built, as part of the GnuWin32 project, from

    +
    +http://gnuwin32.sourceforge.net/packages.html
    +

    The relevant packages are bzip2, freetype, jbigkit, libintl, jpeg, +libpng, libtiff, libwmf and zlib. However, note that for freetype +to be detected by configure, you must move the freetype directory +out of GnuWin32\include\freetype2 and into GnuWin32\include.

    +

    Note that older MinGW compilers may not generate code which supports +reliably catching C++ exceptions thrown by DLL code. The Magick++ +library requires that it be possible to catch C++ exceptions thrown +from DLLs. The test suite (make check) includes several tests to +verify that C++ exceptions are working properly. If the MinGW you are +using fails the C++ exception tests, then the solution is to either +find a MinGW with working C++ exceptions, configure a static build +with --disable-shared, or disable building Magick++ with +--without-magick-plus-plus.

    +

    Note that the default installation prefix is MSYS's notion of +/usr/local which installs the package into a MSYS directory. To +install outside of the MSYS directory tree, you may specify an +installation prefix like /c/GraphicsMagick which causes the package +to be installed under the Windows directory C:\GraphicsMagick. The +installation directory structure will look very much like the Unix +installation layout (e.g. C:\GraphicsMagick\bin, +C:\GraphicsMagick\lib, C:\GraphicsMagick\share, etc.). Paths +which may be embedded in libraries and configuration files are +transformed into Windows paths so they don't depend on MSYS.

    +
    +

    Cross-compilation On Unix/Linux Host

    +

    Given a modern and working MinGW32 or mingw-w64 installation, it is +easy to cross-compile GraphicsMagick from a Unix-type host to produce +Microsoft Windows executables.

    +

    This incantation produces a static WIN32 gm.exe executable on an +Ubuntu Linux host with the i686-w64 cross-compiler installed:

    +
    +./configure '--host=i686-w64-mingw32' '--disable-shared'
    +
    +

    and this incantation produces a static WIN64 gm.exe executable on an +Ubuntu Linux host with the x86_64-w64 cross-compiler installed:

    +
    +./configure '--host=x86_64-w64-mingw32' '--disable-shared'
    +
    +

    For a full-fledged GraphicsMagick program, normally one will want to +pre-install or cross-compile the optional libraries that +GraphicsMagick may depend on and install them where the cross-compiler +will find them, or add extra CPPFLAGS and LDFLAGS options so that +the compiler searches for header files and libraries in the correct +place.

    +

    Configuring for building with shared libraries (libGraphicsMagick, +libGraphicsMagickWand, and libGraphicsMagick++ DLLs) and modules +(coders as DLLs) is also supported by the cross-builds. A cross-built +libtool libltdl needs to be built in advance in order to use the +--with-modules modules option.

    +

    After configuring the software for cross-compilation, the software is +built using make as usual and everything should be as with native +compilation except that make check is likely not available (testing +might be possible on build system via WINE, not currently +tested/supported by GraphicsMagick authors).

    +

    Use of the DESTDIR approach as described in the Build & Install +section is recommended in order to install the build products into a +formal directory tree before preparing to copy onto the Windows target +system (e.g. by packaging via an installer).

    +
    +
    +
    +

    Dealing with configuration failures

    +

    While configure is designed to ease installation of GraphicsMagick, it +often discovers problems that would otherwise be encountered later +when compiling GraphicsMagick. The configure script tests for headers +and libraries by executing the compiler (CC) with the specified +compilation flags (CFLAGS), pre-processor flags (CPPFLAGS), and linker +flags (LDFLAGS). Any errors are logged to the file 'config.log'. If +configure fails to discover a header or library please review this +log file to determine why, however, please be aware that errors +in the config.log are normal because configure works by trying +something and seeing if it fails. An error in config.log is only a +problem if the test should have passed on your system. After taking +corrective action, be sure to remove the 'config.cache' file before +running configure so that configure will re-inspect the environment +rather than using cached values.

    +

    Common causes of configure failures are:

    +
      +
    1. A delegate header is not in the header include path (CPPFLAGS -I +option).
    2. +
    3. A delegate library is not in the linker search/run path (LDFLAGS +-L/-R option).
    4. +
    5. A delegate library is missing a function (old version?).OB
    6. +
    7. The compilation environment is faulty.
    8. +
    +

    If all reasonable corrective actions have been tried and the problem +appears to be due to a flaw in the configure script, please send a +bug report to the configure script maintainer (currently +bfriesen@graphicsmagick.org). All bug reports should contain the +operating system type (as reported by 'uname -a') and the +compiler/compiler-version. A copy of the configure script output +and/or the config.log file may be valuable in order to find the +problem. If you send a config.log, please also send a script of the +configure output and a description of what you expected to see (and +why) so the failure you are observing can be identified and resolved.

    +
    +
    +

    Makefile Build Targets

    +

    Once GraphicsMagick is configured, these standard build targets are +available from the generated Makefiles:

    +
    +

    'make'

    +
    +Build the package
    +

    'make install'

    +
    +Install the package
    +

    'make check'

    +
    +Run tests using the uninstalled software. On some systems, 'make +install' must be done before the test suite will work but usually +the software can be tested prior to installation.
    +

    'make clean'

    +
    +Remove everything in the build directory created by 'make'
    +

    'make distclean'

    +
    +Remove everything in the build directory created by 'configure' +and 'make'. This is useful if you want to start over from scratch.
    +

    'make uninstall'

    +
    +Remove all files from the system which are (or would be) installed +by 'make install' using the current configuration. Note that this +target does not work for PerlMagick since Perl no longer supports +an 'uninstall' target.
    +
    +
    +
    +

    Build & Install

    +

    Now that GraphicsMagick is configured, type

    +
    +make
    +
    +

    to build the package and

    +
    +make install
    +
    +

    to install it.

    +

    To install under a specified directory using the install directory +tree layout (e.g. as part of the process for packaging the built +software), specify DESTDIR like

    +
    +make DESTDIR=/my/dest/dir install
    +
    +
    +
    +

    Verifying The Build

    +

    To confirm your installation of the GraphicsMagick distribution was +successful, ensure that the installation directory is in your executable +search path and type

    +
    +gm display
    +
    +

    The GraphicsMagick logo should be displayed on your X11 display.

    +

    Verify that the expected image formats are supported by executing

    +
    +gm convert -list formats
    +
    +

    Verify that the expected fonts are available by executing

    +
    +gm convert -list fonts
    +
    +

    Verify that delegates (external programs) are configured as expected +by executing

    +
    +gm convert -list delegates
    +
    +

    Verify that color definitions may be loaded by executing

    +
    +gm convert -list colors
    +
    +

    If GraphicsMagick is built to use loadable coder modules, then verify +that the modules load via

    +
    +gm convert -list modules
    +
    +

    Verify that GraphicsMagick is properly identifying the resources of +your machine via

    +
    +gm convert -list resources
    +
    +

    For a thorough test, you should run the GraphicsMagick test suite by +typing

    +
    +make check
    +
    +

    Note that due to differences between the developer's environment and +your own, it is possible that some tests may be indicated as failed +even though the results are ok. Such failures should be rare, and if +they do occur, they should be reported as a bug. Differences between +the developer's environment environment and your own may include the +compiler, the CPU type, and the library versions used. The +GraphicsMagick developers use the current release of all dependent +libraries.

    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    + + diff --git a/www/INSTALL-unix.rst b/www/INSTALL-unix.rst index 8fa01ca..545d347 100644 --- a/www/INSTALL-unix.rst +++ b/www/INSTALL-unix.rst @@ -184,6 +184,19 @@ follows (execute 'configure --help' to see all options). Optional Features ~~~~~~~~~~~~~~~~~ +--disable-compressed-files + + disable reading and writing of gzip/bzip stream files + + Normally support for being able to read and write gzip/bzip stream + files (files which are additionally compressed using gzip or bzip) + is a good thing, but for some formats it is necessary to + decompress an entire input file before it may be validated and + read. Decompressing the file may take a lot of time and disk + space. If input files are not trustworthy, an apparently small + file can take much more resources than expected. Use this option + to reject such files. + --enable-prof enable 'prof' profiling support (default disabled) @@ -830,15 +843,16 @@ almost as easy to compile GraphicsMagick under MSYS2 as it is under Linux! When using MSYS2, requesting to install these packages using 'pacman --S' (in addition to compilation tools for C/C++) should result in -getting up to speed very quicky with a featureful build: +-S' should result in getting up to speed very quicky with a featureful +build: -mingw-w64-x86_64-bzip2, mingw-w64-x86_64-freetype, -mingw-w64-x86_64-ghostscript, mingw-w64-x86_64-jbigkit, -mingw-w64-x86_64-lcms2, mingw-w64-x86_64-libjpeg-turbo, -mingw-w64-x86_64-libpng, mingw-w64-x86_64-libtool, -mingw-w64-x86_64-libwebp mingw-w64-x86_64-libwmf, -mingw-w64-x86_64-libxml2, mingw-w64-x86_64-zlib +mingw-w64-x86_64-toolchain, mingw-w64-x86_64-bzip2, +mingw-w64-x86_64-freetype, mingw-w64-x86_64-ghostscript, +mingw-w64-x86_64-jbigkit, mingw-w64-x86_64-lcms2, +mingw-w64-x86_64-libjpeg-turbo, mingw-w64-x86_64-libpng, +mingw-w64-x86_64-libtool, mingw-w64-x86_64-libwebp +mingw-w64-x86_64-libwmf, mingw-w64-x86_64-libxml2, +mingw-w64-x86_64-zlib GraphicsMagick may also be built using the free MinGW ("Minimalistic GNU for Windows") package, available from @@ -1012,6 +1026,10 @@ available from the generated Makefiles: install' must be done before the test suite will work but usually the software can be tested prior to installation. + The test suite requires sufficient RAM memory to run. The memory + requirement is 128MB for the Q8 build, or 256MB for the Q16 + build, or 512MB for the Q32 build. + 'make clean' Remove everything in the build directory created by 'make' @@ -1098,8 +1116,3 @@ the developer's environment environment and your own may include the compiler, the CPU type, and the library versions used. The GraphicsMagick developers use the current release of all dependent libraries. - - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/INSTALL-windows.html b/www/INSTALL-windows.html index c69dabb..594c9ac 100644 --- a/www/INSTALL-windows.html +++ b/www/INSTALL-windows.html @@ -3,7 +3,7 @@ - + GraphicsMagick Windows Installation @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -779,9 +779,13 @@ double-clicking from Windows Explorer.
      GM\VisualMagick\bin\GraphicsMagick-1.3-Q8-dll.exe
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/INSTALL-windows.html.orig b/www/INSTALL-windows.html.orig new file mode 100644 index 0000000..72a6c8c --- /dev/null +++ b/www/INSTALL-windows.html.orig @@ -0,0 +1,787 @@ + + + + + + +GraphicsMagick Windows Installation + + + + + + + +
    +

    GraphicsMagick Windows Installation

    + + + + + +
    +

    Installing Using Installer Package

    +
    +This section provides information specific to GraphicsMagick installed +via a "setup.exe" style installation wizard under Microsoft Windows. It +applies only to the pre-built "binaries" package, and not to versions +compiled from source code. If you would like to install GraphicsMagick +from source code, then please refer to the Installing From Source Code +section.
    +
    +

    Prerequisites

    +
    +

    While multiple versions of GraphicsMagick may be installed at one +time, if your intention is to replace a prior installation of +GraphicsMagick with a newer version, then it is wise to uninstall +the existing GraphicsMagick (see uninstall procedure) prior to +installing the newer version.

    +

    While it is not a requirement, it is strongly recommended that the +Ghostscript +package (GraphicsMagick is tested with version 9.27) be +installed. GraphicsMagick uses Ghostscript to render Postscript and +PDF files, as well as formats where a translator to Postscript is +available. GraphicsMagick will use the Ghostscript Fonts (also known as "URW +Fonts") to support the standard set of Adobe Postscript fonts like +"Helvetica" and "Times Roman" if these fonts are not available as +TrueType fonts. The Ghostscript fonts need to manually installed +with administrator privileges in the Ghostscript installation +directory (e.g. as C:\Program Files\gs\fonts or C:Program +Files\gs\gs9.27\fonts).

    +

    The algorithm used to find the fonts consults the Windows registry +to learn Ghostscript installation paths, and then looks for a +"fonts/n019003l.pfb" file in each path until it finds a match.

    +

    Make sure to install a Ghostscript which is compatible with the +GraphicsMagick you are installing. For example, if you are +installing a 64-bit GraphicsMagick, you should install a 64-bit +Ghostscript. The installation order of the two packages is not +important. Both 32 and 64-bit versions of GraphicsMagick and +Ghostscript may be installed at the same time.

    +
    +
    +
    +

    Retrieve Install Package

    +
    +

    Retrieve the GraphicsMagick Windows binary install package from a one +of the ftp sites listed at the GraphicsMagick Download Sites page. The available install packages are as follows

    +

    Windows Dynamic-Multithread (DLL-based) install package with utilities, +ImageMagickObject COM object, and web pages:

    +
    +
    +GraphicsMagick-1.3-Q8-win32-dll.exe
    +GraphicsMagick-1.3-Q16-win32-dll.exe
    +GraphicsMagick-1.3-Q8-win64-dll.exe
    +GraphicsMagick-1.3-Q16-win64-dll.exe
    +
    +
    +

    Note that the QuantumDepth=8 version (Q8) which provides industry +standard 24/32 bit pixels consumes half the memory and about 30% less +CPU than the QuantumDepth=16 version (Q16) which provides 48/64 bit +pixels for high-resolution color. A Q8 version is fine for processing +typical photos intended for viewing on a computer screen. If you are +dealing with film, scientific, or medical images, use ICC color +profiles, or deal with images that have limited contrast, then the Q16 +version is recommended.

    +

    The win32 packages are for 32-bit or 64-bit Windows, whereas the +win64 packages are only for 64-bit Windows. The 64-bit version +allows processing larger images in memory (rather than disk files), +provided that the system has more than 2GB of RAM installed. Memory +access is 1000 times faster than disk access.

    +
    +
    +
    +

    Start Installation Wizard

    +
    +Execute the downloaded file from your browser or by double-clicking on +the filename from within Windows Explorer. The GraphicsMagick Setup +Wizard will appear. Click on "Next>" to continue.
    +
    +
    +

    Read Installation Information

    +
    +An informational screen is presented which provides a summary of things +you should know before you proceed. Please take care to read this +information. Once you have finished, Click on "Next>" to continue.
    +
    +
    +

    Select Destination Directory

    +
    +Specify what drive and directory to install GraphicsMagick into. +Approximately 15MB of free disk space is required to install all of +GraphicsMagick (you may choose to install a subset to save space). A +message at the bottom of the screen will tell you exactly how much +space is required to install the complete package. The default +installation directory is similar to C:\Program +Files\GraphicsMagick-1.3-Q8. Once you have entered the desired +installation directory, then select "Next>" to continue.
    +
    +
    +

    Select Start Menu Folder

    +
    +Select the folder where you would like the program's shortcuts to +appear. The default should normally be satisfactory. Click on "Next>" +to continue.
    +
    +
    +

    Select Additional Tasks

    +
    +

    A screen is displayed which presents some (or all) of the following +options:

    +
      +
    • Create a desktop icon
    • +
    • Update executable search path
    • +
    • Associate supported file extensions with GraphicsMagick
    • +
    +

    "Creating a desktop icon" and "Update the executable search path" +are selected by default. The remaining options default to +un-selected. Select the options you prefer.

    +

    Think twice before selecting "Associate supported file extensions +with GraphicsMagick" since this will set up approximately fifty +file associations, including common formats like JPEG, GIF, PNG, +TIFF, and PDF. These file associations will be to the 'gmdisplay' +program which is suitable for displaying images, but currently +offers little more than that. Associations for GraphicsMagick's +native formats (such as MIFF) will always be made.

    +

    Once you have made your selections, click on "Next>" to continue.

    +
    +
    +
    +

    Ready to Install

    +
    +A screen is displayed which displays the selected options. If you are +not satisfied with a selected option, then click on "<Back" to go back +to a previous screen so that the option may be adjusted. If you are +satisfied with the options and are ready to install, then select +"Install". To abort the installation entirely, select "Cancel".
    +
    +
    +

    Installation Progress

    +
    +While the install program is performing the installation, it will +display what it is doing in an installation progress window.
    +
    +
    +

    Final Information

    +
    +A summary of post-install steps is provided. These steps include some +commands you can execute to make sure that GraphicsMagick is working, +as well as some notes about what has been installed on your system, and +where to find additional information. Once you have read this +information, click on "Next>" to continue.
    +
    +
    +

    Finishing Up

    +
    +By default "View GraphicsMagick.html" is check-marked. This causes the +GraphicsMagick web pages to be displayed in your web browser when +"Finish" is selected. If you do not want to view the web pages, then +de-select "View GraphicsMagick.html". Select "Finish" to exit the +installation program.
    +
    +
    +

    Testing The Installation

    +
    +

    Select "Command Prompt" from the Windows Start menu. Within the window +type

    +
    +
    +gm convert logo: logo.miff
    +gm convert logo.miff win:
    +
    +
    +

    and the GraphicsMagick logo should be displayed in a window.

    +
    +
    +
    +

    Uninstall

    +
    +

    The GraphicsMagick package incorporates its own uninstall +functionality. Always remove an installed GraphicsMagick via its +uninstall function since manually removing it (such as by removing its +installation directory) will leave behind the registry entries and path +settings established at install time.

    +

    GraphicsMagick should be removed via the "Add or Remove Programs" +area of the Windows Control Panel. Select the GraphicsMagick package +from the list, and click on "Change/Remove" to uninstall it.

    +
    +
    +
    +

    Use From Another Package or Program

    +
    +

    The GraphicsMagick gm utility may be executed as a sub-process by +other programs. If gm utility is not in the systems executable +search path (it should be since the GraphicsMagick install extends +the path by default), then the utility should be executed via the +complete path to the executable.

    +

    The ImageMagickObject COM object may be +used to execute the gm sub-functions (e.g. "convert") without +spawning a new process or causing Windows to pop up a window. The +COM object supports multi-threaded concurrent use. Note that the +COM object (and other components depending on proprietary libraries) +is no longer included in the installation packages we create. If +you need this, then you will need to build GraphicsMagick from +source code.

    +

    When GraphicsMagick is installed, entries are added to the Windows +Registry so that other programs may obtain information regarding the +most recently installed GraphicsMagick. These entries are available +under the registry path HKEY_LOCAL_MACHINE\SOFTWARE\GraphicsMagick\Current.

    +

    These registry keys are currently available:

    + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Key NameKey TypeDescription
    BinPathREG_SZDirectory where GraphicsMagick executables +are installed
    ConfigurePathREG_SZDirectory where configuration files are +installed
    LibPathREG_SZDirectory where GraphicsMagick core DLLs +are installed
    CoderModulesPathREG_SZDirectory where GraphicsMagick loadable +coder modules are installed
    FilterModulesPathREG_SZDirectory where GraphicsMagick loadable +filter modules are installed
    SharePathREG_SZDirectory where configuration files are +installed
    +
    +
    +
    +
    +

    Installing From Source Code

    +
    +

    Applicability

    +
    +This section provides instructions for building GraphicsMagick +Microsoft Windows using the Visual C++ (Visual Studio, etc.) +IDE. For building using the free Cygwin or MinGW compilers (e.g. as +part of MSYS2), follow the instructions +in INSTALL-unix.txt.
    +
    +
    +

    Important Notes

    +
    +On some platforms Visual C++ may fail with an internal compiler +error. If this happens to you, then make sure that your compiler is +updated with the latest fixes from the Microsoft web site and the +problem will hopefully go away. If the problem does not go away, +then adjust the settings for the module which failed and disable +optimization, and the problem is likely to go away (but with less +performance).
    +
    +
    +

    Windows XP, Vista, 7 Visual C++ 6.0 through 19.0 Compilation

    +
    +

    The Visual C++ distribution targeted at Windows 2000 through Windows +10 does not provide any stock workspace (DSW) or project files (DSP) +except for those included with third party libraries. Instead, there +is a "configure" program that must run to create build +environments to satisfy various requirements.

    +

    The configure program resides in VisualMagick\configure in the +GraphicsMagick source tree. A pre-compiled configure.exe is +provided, as well as Visual Studio project files to recompile it +from source code if needed.

    +

    Once started, the configure program provides this configuration +dialog after proceeding past the initial notifications screen:

    +Configure program screen shot +

    In addition to (or as a replacement to) the above dialog, the +configure.exe program supports these command-line options:

    +
    +
    /Q8 /Q16 /Q32
    +
    Set quantum depth
    +
    /x64
    +
    Add x64 configuration
    +
    /mtd /sts /mts /mtsd
    +
    Set project type
    +
    /noWizard
    +
    Do not show the wizard
    +
    /openMP
    +
    Enable openMP
    +
    +

    The Visual C++ system provides three different types of "runtimes" +that must match across all application, library, and DLL code that is +built. The "configure" program creates a set of build files that are +consistent for a specific runtime selection.

    +

    The three options for runtime support are:

    +
      +
    1. Dynamic Multi-threaded DLL runtimes (VisualDynamicMT), /mtd option
    2. +
    3. Static Single-threaded runtimes (VisualStaticST), /sts option
    4. +
    5. Static Multi-threaded runtimes (VisualStaticMT), /mts option
    6. +
    7. Static Multi-threaded DLL runtimes (VisualStaticMTDLL), /mtsd option
    8. +
    +

    In addition to these runtimes, the VisualMagick build environment allows +you to select whether to include the X11 libraries in the build or not. +X11 DLLs and headers are provided with the VisualMagick build +environment. Most Windows users do not use X11 so they will prefer to +build without X11 support. When X11 is not supported, gm subcommands +'animate', 'display', and 'import' will not work.

    +

    This leads to five different possible build options, which should +cover almost any particular situation. The default binary +distribution is built using #1 from above with the X11 libraries +excluded. This results build using all DLL's for everything and +multi-threaded support (the only option for DLL's).

    +

    To do a build for your requirements, simply go to the configure sub- +directory under VisualMagick and open the configure.dsw workspace +(for Visual C++ 6.0) or configure.sln (for Visual C++ 7.X through +9.X). Set the build configuration to "Release" under the

    +
    +"Build..., Set Active Configuration..." menu.
    +

    Build and execute the configure program and follow the on-screen +instructions. You should not change any of the defaults unless you have a +specific reason to do so.

    +

    The configure program provides a button entitled

    +
    +Edit "magick_config.h"
    +

    Clicking this button brings up magick_config.h in Windows notepad +for optionally changing any preprocessor defines in GraphicsMagick's +magick_config.h file. This file is copied to +magick\magick_config.h. You may safely open +magick\magick_config.h, modify it, and recompile without +re-running the configure program. In fact, using Visual Studio to +edit the copied file may be preferable since it preserves the +original magick_config.h file.

    +

    Key user tunables in magick_config.h include:

    +
    +

    QuantumDepth (default 8)

    +
    +Specify size of PixelPacket color Quantums (8, 16, or 32) A value of +8 uses half the memory than 16 and may run 30% faster, but provides +256 times less color resolution than a value of 16.
    +

    UseInstalledMagick (default undefined)

    +
    +Define to build a GraphicsMagick which uses registry settings or +embedded paths to locate installed components (coder modules and +configuration files). The default is to look for all files in the +same directory as the executable.
    +

    ProvideDllMain (default undefined)

    +
    +Define to include a DllMain() function ensures that the GraphicsMagick +DLL is properly initialized without participation from dependent +applications. This avoids the requirement to invoke IntializeMagick() +from dependent applications but only works for DLL builds.
    +

    EnableBrokenCoders (default undefined)

    +
    +Define to enable broken/dangerous file format support. Only +enable this if you have complete control over the input files +and not for arbitrary files such as uploaded from untrusted +sources via the Internet. Currently this must be enabled to +enable Adobe Photoshop Format (PSD).
    +
    +

    After creating your build environment you can proceed to open the DSW (or +SLN) file that was generated in the VisualMagick directory and build +everything from there.

    +

    In the final DSW file you will find a project call "All". In order to +build everything in the distribution, select this project and make it +the "active" project. Set the build configuration to the desired one +(Debug, or Release) and do a "clean" followed by a "build". You should +do the build in a specific way:

    +
    +
      +
    1. Make the "All" project the active project (Bold) +Right click on the All project and select "Set As Active Project"
    2. +
    3. Select "Build..., Clean"
    4. +
    5. Select "Build..., Build"
    6. +
    7. Go get some coffee unless you have a very fast machine!.
    8. +
    +
    +

    The "Clean" step is needed in order to make sure that all of the target +support libraries are updated with any patches needed to get them to +compile properly under Visual C++.

    +

    All of the required files that are needed to run any of the command +line tools will be found in the "bin" subdirectory of the VisualMagick +subdirectory. This includes EXE, and DLL files. You should be able +to test the build directly from this directory without having to move +anything to any of the global SYSTEM or SYSTEM32 areas in the operating +system installation.

    +

    Note #1:

    +

    The Visual C++ distribution of GraphicsMagick comes with the Magick++ +C++ wrapper by default. This add-on layer has a large number of demo +and test files that can be found in GraphicsMagick\Magick++\demo, and +GraphicsMagick\Magick++\tests. There are also a variety of tests that +use the straight C API as well in GraphicsMagick\tests.

    +

    All of these programs are NOT configured to be built in the default +workspace created by the configure program. You can cause all of these +demos and test programs to be built by checking the box in configure +that says:

    +
    +"Include all demo and test programs"
    +

    In addition, there is another related checkbox (checked by default) +that causes all generated project files to be created standalone so +that they can be copied to other areas of you system.

    +

    This is the checkbox:

    +
    +"Generate all utility projects with full paths rather then relative +paths"
    +

    WOW - that a mouthfull - eh?

    +

    Visual C++ uses a concept of "dependencies" that tell it what other +components need to be build when a particular project is being build. This +mechanism is also used to ensure that components link properly. In my normal +development environment, I want to be able to make changes and debug the +system as a whole, so I like and NEED to use dependencies. However, most +end users don't want to work this way.

    +

    Instead they really just want to build the package and then get down +to business working on their application. The solution is to make all +the utility projects (UTIL_xxxx_yy_exe.dsp) use full absolute paths +to all the things they need. This way the projects stand on their own +and can actually be copied and used as templates to get a particular +custom application compiling with little effort.

    +

    With this feature enabled, you should be able to nab a copy of...

    +
    +

    VisualMagick\utilities\UTIL_gm_xxx_exe.dsp (for C)

    +
    +-or-
    +

    VisualMagick\Magick++\demo\UTIL_demo_xxx_exe.dsp (for C++)

    +
    +

    ... and pop it into notepad, modify it (carefully) to your needs and +be on your way to happy compiling and linking.

    +

    You can feel free to pick any of the standard utilities, tests, or +demo programs as the basis for a new program by copying the project +and the source and hacking away.

    +

    The choice of what to use as a starting point is very easy...

    +

    For straight C API command line applications use something from

    +
    +

    GraphicsMagick\tests or GraphicsMagick\utilities (source code)

    +

    GraphicsMagick\VisualMagick\tests or GraphicsMagick\Visualmagick\utilities +(project - DSP)

    +
    +

    For C++ and Magick++ command line applications use something from

    +
    +

    GraphicsMagick\Magick++\tests or GraphicsMagick\Magick++\demo (source code)

    +

    GraphicsMagick\VisualMagick\Magick++\tests or +GraphicsMagick\VisualMagick\Magick++\demo (project - DSP)

    +
    +

    For C++ and Magick++ and MFC windows applications use

    +
    +

    GraphicsMagick\win2k\IMDisplay (source code)

    +

    GraphicsMagick\VisualMagick\win32\NtMagick (project - DSP)

    +
    +

    Note #2:

    +

    The GraphicsMagick distribution is very modular. The default +configuration is there to get you rolling, but you need to make some +serious choices when you wish to change things around.

    +

    The default options are all targeted at having all the components in one +place (e.g. the "bin" directory of the VisualMagick build tree). These +components may be copied to another folder (such as to another computer).

    +

    The folder containing the executables and DLLs should contain the +following files:

    +
    +
      +
    1. colors.mgk
    2. +
    3. delegates.mgk
    4. +
    5. log.mgk
    6. +
    7. magic.mgk
    8. +
    9. modules.mgk
    10. +
    11. type.mgk
    12. +
    13. type-ghostscript.mgk (if Ghostscript is used)
    14. +
    +
    +

    The "bin" folder should contains all EXE's and DLL's as well as the +very important "modules.mgk" file.

    +

    With this default setup, you can use any of the command line tools +and run scripts as normal. You can actually get by quite nicely this +way by doing something like pushd e:\xxx\yyy\bin in any scripts you +write to execute "out of" this directory.

    +

    By default the core of GraphicsMagick on Win32 always looks in the place +were the exe program is run from in order to find all of the files as +well as the DLL's it needs.

    +
    +
    +
    +

    Environment Variables

    +
    +

    You can use the "System" control panel to allow you to add and delete +what is in any of the environment variables. You can even have user +specific environment variables if you wish.

    +

    PATH

    +
    +

    This sets the default list of places were Windows looks for EXE's and +DLL's. Windows CMD shell seems to look in the "current" directory first +- no matter what, which may make it unnecessary to update the PATH. If +you wish to run any of utilities from another location then you must +add the path to your "bin" directory in. For instance, you might add:

    +
    +D:\Devel\GraphicsMagick\VisualMagick\bin
    +

    to do this for the default build environment like I do.

    +
    +

    MAGICK_HOME

    +
    +

    If all you do is modify the PATH variable, the first problem you +will run into is that GraphicsMagick may not be able to find any of +its "modules. Modules are all the IM_MOD*.DLL files you see in the +distribution. There is one of these for each and every file format +that GraphicsMagick supports. This environment variable tells the system +were to look for these DLL's. The compiled in "default" is "execution +path" - which says - look in the same place that the application is +running "in". If you are running from somewhere other then "bin" - +this will no longer work and you must use this variable. If you elect +to leave the modules in the same place as the EXE's (a good idea) +then you can simply set this to the same place +as you did the PATH variable. In my case:

    +
    +D:\\GraphicsMagick\coders
    +

    This is also the place were GraphicsMagick expects to find the +"colors.mgk", "delegates.mgk", "magic.mgk", "modules.mgk", and +"type.mgk" files.

    +

    One cool thing about the modules build of GraphicsMagick is that you can +now leave out file formats and lighten you load. If all you ever need +is GIF and JPEG, then simply drop all the other DLL's into the local +trash can and get on with your life.

    +

    WARNING: Always keep the "xc" format, since GM uses it for internal +purposes.

    +
    +

    ALSO. You can elect to changes these things the good old "hard-coded" +way. Two #defines are applicable.

    +

    defines.h has

    +
    +#define MagickConfigurePath  "c:\\GraphicsMagick\\"
    +

    To view any image in a Microsoft window, type

    +
    +gm convert image.ext win:
    +

    Make sure Ghostscript is installed, otherwise, you will be unable to +convert or view a Postscript document, and Postscript standard fonts will +not be available.

    +

    You may use any standard web browser (e.g. Internet Explorer) to browse +the GraphicsMagick documentation.

    +

    The Win2K executables will work under Windows '98 and later.

    +
    +
    +
    +

    Windows Distribution Build Procedure

    +
    +

    The following are the instructions for how to build a Q:8 (or Q:16) +DLL-based distribution installer package using Visual Studio 2008 +Professional. This is the same procedure used to produce the +release packages. The PerlMagick steps are skipped as of +GraphicsMagick 1.3.26):

    +
      +
    1. Install prerequisite software:
    2. +
    +
    +
      +
    1. Install Microsoft Visual Studio.
    2. +
    3. Download and install Inno Setup 6 +<"http://www.jrsoftware.org/isinfo.php">.
    4. +
    5. Download and install ActiveState ActivePerl (optional) +<"http://www.activestate.com/activeperl/downloads/">.
    6. +
    +
    +
      +
    1. Disable automatic indexing and virus scanning for the +GraphicsMagick source tree. In particular, "Windows Defender" in +Windows 10 (and similar software in earlier Windows releases) has +been observed to cause Visual Studio builds to fail since the +virus scanner opens built libraries and executables to inspect +whem while Visual Studio is still using them. Indexing and +scanning also cause significant slowdowns since there are many +megabytes of files to index.

      +
    2. +
    3. Build GMVisualMagickconfigureconfigure.exe (if +missing/outdated)

      +
        +
      1. Open workspace GMVisualMagickconfigureconfigure.dsp by +double-clicking from Windows Explorer.
      2. +
      3. Upgrade Visual Studio project (as required)
      4. +
      5. Select Rebuild All to build configure.exe
      6. +
      7. Close the project.
      8. +
      +
    4. +
    5. Configure Initial GraphicsMagick Visual Studio Workspace

      +
        +
      1. Use Windows Explorer to navigate to GMVisualMagickconfigure.
      2. +
      3. Double-click on configure.exe to run configure program.
      4. +
      5. Select desired build options: DLL build, Quantum Depth, 64-bit, OpenMP)
      6. +
      7. Check Build demo and test programs.
      8. +
      9. Finish remaining configure wizard screens to complete.
      10. +
      11. File -> Close Workspace.
      12. +
      +
    6. +
    7. Open Workspace, set build configuration, build GraphicsMagick software.

      +
        +
      1. Open workspace GMVisualMagickconfigureconfigure.sln by +double-clicking from Windows Explorer.
      2. +
      3. Build -> "Set Active Configuration" -> "All - Win32 Release" -> OK
      4. +
      5. Optionally enable 64-bit (WIN64) compilation. "Build / +Configuration Manager... / Active Solution Platform / +New / x64".
      6. +
      7. Open CORE_magickmagickmagick_config.h and edit any +configuration settings you would like to change. For example, +you might change QuantumDepth to 16 for a"Q:16" build.
      8. +
      9. If using Visual Studio Professional Edition, and OpenMP +support is desired, then select CORE_magick in the Solution +Explorer pane and use the right mouse button menu to select +Properties. In Configuration Properties / C/C++ / +Language set OpenMP support to 'yes'.
      10. +
      11. Select "Rebuild All"
      12. +
      13. Click on '!' icon to run configure program
      14. +
      15. Select DLL build
      16. +
      17. Check Build demo and test programs.
      18. +
      19. Click on Edit magick_config.h and verify desired settings +such as QuantumDepth. You can also defer this step to later +by opening the header file +CORE_magick\include\magick_config.h in the Visual Studio +project.
      20. +
      21. Finish remaining configure wizard screens to complete.
      22. +
      23. File -> Close Workspace
      24. +
      +
    8. +
    9. Build ImageMagickObject

      +
        +
      1. Open Visual Studio Command Shell Window for WIN32 or WIN64
      2. +
      3. Change to GraphicsMagick project directory GM
      4. +
      5. cd GM\contrib\win32\ATL7\ImageMagickObject
      6. +
      7. BuildImageMagickObject clean
      8. +
      9. BuildImageMagickObject release
      10. +
      11. cd ..\..\..\..
      12. +
      +
    10. +
    11. Build PerlMagick extension (optional and now rarely done)

      +
        +
      1. Open Visual Studio Command Shell Window for WIN32 or WIN64

        +
      2. +
      3. Change to GraphicsMagick project directory GM

        +
      4. +
      5. cd GM\PerlMagick

        +
      6. +
      7. nmake clean (only if this is a rebuild)

        +
      8. +
      9. C:\Perl32\bin\perl.exe Makefile.nt (or Perl64)

        +

        Note that if multiple Perl's are installed, then it may be +necessary to specify the full path to perl.exe in order to use +the correct Perl.

        +
      10. +
      11. nmake release

        +
      12. +
      +
    12. +
    +

    NOTE: access to nmake requires that there be a path to it. Depending on +how the install of Visual Studio was done, this may not be the case. +Visual Studio provides a batch script in VC98Bin called VCVARS32.BAT +that can be used to do this manually after you open up a command prompt.

    +
      +
    1. Open GMVisualMagickinstallergm-win32-Q8-dll-full.iss (or +gm-win32-Q16-dll-full.iss if QuantumDepth=16) by +double-clicking from Windows Explorer.
        +
      1. File -> Compile
      2. +
      3. Test install by clicking on green triangle
      4. +
      +
    2. +
    3. Test PerlMagick (optional).
        +
      1. cd PerlMagick
      2. +
      3. nmake test (All tests must pass!)
      4. +
      +
    4. +
    5. Test file format read and write.
    6. +
    +
    +
      +
    1. cd VisualMagick\tests
    2. +
    3. run_rwfile.bat (All tests must pass!)
    4. +
    5. run_rwblob.bat (All tests must pass!)
    6. +
    +
    +
      +
    1. Run Magick++ test programs.
    2. +
    +
    +
      +
    1. cd Magick++/tests
    2. +
    3. run_tests.bat (All tests must pass!)
    4. +
    +
    +
      +
    1. Run Magick++ demo programs.
    2. +
    +
    +
      +
    1. cd Magick++/demo
    2. +
    3. run_demos.bat
    4. +
    5. Use gmdisplay to visually inspect all output files.
    6. +
    +
    +
      +
    1. Distribution package is available named similar to +GM\VisualMagick\bin\GraphicsMagick-1.3-Q8-dll.exe
    2. +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    +
    + + diff --git a/www/INSTALL-windows.rst b/www/INSTALL-windows.rst index 93460e6..479ecb5 100644 --- a/www/INSTALL-windows.rst +++ b/www/INSTALL-windows.rst @@ -764,8 +764,3 @@ Windows Distribution Build Procedure 13. Distribution package is available named similar to ``GM\VisualMagick\bin\GraphicsMagick-1.3-Q8-dll.exe`` - - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/ImageMagickObject.html b/www/ImageMagickObject.html index 398e8b7..d5ab303 100644 --- a/www/ImageMagickObject.html +++ b/www/ImageMagickObject.html @@ -3,7 +3,7 @@ - + ImageMagickObject @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -125,9 +125,12 @@ and is a great way to exercise ImageMagickObject to verify that it is working.

    Sometime in the future, MagickCMD may assume the place of gm.exe in the "utils" distribution in order to decrease the overall package size.

    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/ImageMagickObject.html.orig b/www/ImageMagickObject.html.orig new file mode 100644 index 0000000..e153c01 --- /dev/null +++ b/www/ImageMagickObject.html.orig @@ -0,0 +1,133 @@ + + + + + + +ImageMagickObject + + + + + + + +
    +

    ImageMagickObject

    + + + + +
    +

    Overview

    +

    The ImageMagickObject is a COM+ compatible component that may be +invoked from any language capable of using COM objects. The intended use +is for Windows Scripting Host VBS scripts and Visual Basic, but it can +also be used from C++, ASP, and other languages like Delphi, Perl and PHP.

    +

    The strategy with the ImageMagickObject COM+ component is not to the +same as with PerlMagick interface provided with ImageMagick. PerlMagick +is a low level API based system that defines a whole new way of scripting +IM operations. The IM COM+ component simply provides access to the +convert, composite, mogrify, identify, and montage tools, +efficiently executing them as part of your process, rather than as +external programs. The way you use it is exactly the same. You pass it a +list of strings including filenames and various options and it does the +job. In fact, you can take any existing batch scripts that use the +command line tools and translate them into the equivalent calls to the +COM+ object in a matter of minutes. Beyond that, there is also a way to +pass in and retrieve images in memory in the form of standard smart +arrays (byte arrays). Samples are provided, to show both the simple and +more elaborate forms of access.

    +

    GraphicsMagick provides a statically-built ImageMagick object as part of +its "utils" Windows installation package. When this package is +installed, ImageMagickObject and its sample programs are installed to

    +
    +c:\Program Files\GraphicsMagick-1.3-Q16\ImageMagickObject
    +
    +

    by default (path shown is for the Q:16 build). ImageMagickObject is +registered if the checkbox for "Register ImageMagickObject" is checked at +install time.

    +

    You may execute the sample program from the Windows Command Shell like:

    +
    +cscript SimpleTest.vbs
    +
    +

    Since the GraphicsMagick utility command line parsers are incorporated +within ImageMagickObject, please refer to the command line utility +documentation to learn how to use it. The sample VBS scripts show how +the object should be called and used and have lots of comments.

    +

    For C++ programmers - have a look at the MagickCMD.cpp command line +utility for an example of how to call the object from C++. This is a bit +complex because the object requires a variable size list of BSTR's to +emulate the command line argc, argv style calling conventions of the COM +component which is more complex in C++ then in VBS or VB.

    +
    +
    +

    Other goodies...

    +

    MagickCMD is a C++ sample, but it can also server as a replacement for +all the other command line utilities in most applications. Instead of +using "convert xxxx yyyy" you can use "MagickCMD convert xxxx +yyyy" instead. MagickCMD calls the COM object to get the job done. This +small tight combination replaces the entire usual binary distribution in +just a few megabytes.

    +
    +
    +

    Building ImageMagickObject From Source

    +

    The source code for ImageMagickObject is available from GraphicsMagick +CVS, or as part of the GraphicsMagick Windows source package. Once the +source code has been retrieved and extracted, the source for +ImageMagickObject may be found hidden in the directory +"GraphicsMagick\contrib\win32\ATL7ImageMagickObject", however, +GraphicsMagick itself must be built using the "static-multithread" +(VisualStaticMT) build configuration. Building ImageMagickObject +requires Microsoft Visual C++ 7.0 as delivered with Microsoft's Visual +Studio .net package. See the Windows compilation instructions in order to +get GraphicsMagick itself built before building ImageMagickObject.

    +

    Once the VisualStaticMT project has been built, ImageMagickObject may +be built by following the procedure:

    +
    +cd  GraphicsMagick\contrib\win32\ATL7ImageMagickObject
    +BuildImageMagickObject release
    +
    +

    This procedure assumes that the VisualStaticMT project has been built +using the "release" setting for an optimized build. If the "debug" +setting was used for a debug build, then specify the argument "debug" +instead.

    +

    To register the DLL as a COM+ server use

    +
    +regsvr32 /c /s ImageMagickObject.dll
    +
    +

    To unregister the DLL use

    +
    +regsvr32 /u /s ImageMagickObject.dll
    +
    +

    The MagickCMD sample program operates similarly to the gm.exe program, +and is a great way to exercise ImageMagickObject to verify that it is +working.

    +

    Sometime in the future, MagickCMD may assume the place of gm.exe in the +"utils" distribution in order to decrease the overall package size.

    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    + + diff --git a/www/ImageMagickObject.rst b/www/ImageMagickObject.rst index dbcc5c8..4fe8ea8 100644 --- a/www/ImageMagickObject.rst +++ b/www/ImageMagickObject.rst @@ -122,9 +122,3 @@ working. Sometime in the future, MagickCMD may assume the place of gm.exe in the "utils" distribution in order to decrease the overall package size. - -------------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/Magick++/Blob.html b/www/Magick++/Blob.html index e0f4d86..0fffcd5 100644 --- a/www/Magick++/Blob.html +++ b/www/Magick++/Blob.html @@ -3,7 +3,7 @@ - + Magick::Blob @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -117,5 +117,10 @@ public:

    Copyright © Bob Friesenhahn 1999 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/Magick++/Blob.html.orig b/www/Magick++/Blob.html.orig new file mode 100644 index 0000000..cdde8ad --- /dev/null +++ b/www/Magick++/Blob.html.orig @@ -0,0 +1,121 @@ + + + + + + +Magick::Blob + + + + + + + +
    +

    Magick::Blob

    + + + + +

    Blob provides the means to contain any opaque data. It is named after +the term Binary Large OBject commonly used to +describe unstructured data (such as encoded images) which are stored +in a database. While the function of Blob is very simple (store a +pointer and and size associated with allocated data), the Blob class +provides some very useful capabilities. In particular, it is fully +reference counted just like the Image class.

    +

    The Blob class supports value assignment while preserving any +outstanding earlier versions of the object. Since assignment is via a +pointer internally, Blob is efficient enough to be stored directly in +an STL container or any other data structure which requires +assignment. In particular, by storing a Blob in an associative +container +(such as STL's map) it is +possible to create simple indexed in-memory "database" of Blobs.

    +

    Magick++ currently uses Blob to contain encoded images (e.g. JPEG) as +well as ICC and IPTC profiles. Since Blob is a general-purpose class, +it may be used for other purposes as well.

    +

    The following is the definition of the Magick::Blob class:

    +
    +class Blob
    +{
    +
    +public:
    +
    +  enum Allocator
    +  {
    +    MallocAllocator,
    +    NewAllocator
    +  };
    +
    +  // Default constructor
    +  Blob ( void );
    +
    +  // Construct object with data, making a copy of the supplied data.
    +  Blob ( const void* data_, size_t length_ );
    +
    +  // Copy constructor (reference counted)
    +  Blob ( const Blob& blob_ );
    +
    +  // Destructor (reference counted)
    +  virtual       ~Blob ();
    +
    +  // Assignment operator (reference counted)
    +  Blob&         operator= ( const Blob& blob_ );
    +
    +  // Update object contents from Base64-encoded string representation.
    +  void          base64 ( const std::string base64_ );
    +  // Return Base64-encoded string representation.
    +  std::string   base64 ( void );
    +
    +  // Update object contents, making a copy of the supplied data.
    +  // Any existing data in the object is deallocated.
    +  void          update ( const void* data_, size_t length_ );
    +
    +  // Update object contents, using supplied pointer directly (no
    +  // copy). Any existing data in the object is deallocated.  The user
    +  // must ensure that the pointer supplied is not deleted or
    +  // otherwise modified after it has been supplied to this method.
    +  // Specify allocator_ as "MallocAllocator" if memory is allocated
    +  // via the C language malloc() function, or "NewAllocator" if
    +  // memory is allocated via C++ 'new'.
    +  void          updateNoCopy ( void* data_, size_t length_,
    +                               Allocator allocator_ = NewAllocator );
    +
    +  // Obtain pointer to data. The user should never try to modify or
    +  // free this data since the Blob class manages its own data. The
    +  // user must be finished with the data before allowing the Blob to
    +  // be destroyed since the pointer is invalid once the Blob is
    +  // destroyed.
    +  const void*   data ( void ) const;
    +
    +  // Obtain data length
    +  size_t length ( void ) const;
    +
    +};
    +
    +

    Copyright © Bob Friesenhahn 1999 - 2020

    +
    + + diff --git a/www/Magick++/ChangeLog.html b/www/Magick++/ChangeLog.html index 7886063..ee339e2 100644 --- a/www/Magick++/ChangeLog.html +++ b/www/Magick++/ChangeLog.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -2332,5 +2332,10 @@ blurry. Magick++ does not yet support the blur member.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/Magick++/ChangeLog.html.orig b/www/Magick++/ChangeLog.html.orig new file mode 100644 index 0000000..2d4b623 --- /dev/null +++ b/www/Magick++/ChangeLog.html.orig @@ -0,0 +1,2336 @@ + + + + + + + + + + + + + + +
    + + +

    2017-03-04 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (orientation): Update orientation in EXIF profile, +if it exists. +(attribute): Added Image attribute method which accepts a 'char *' +argument, and will remove the attribute if the value argument is +NULL.
    • +
    +
    +

    2014-11-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Geometry.h (Magick::Geometry): Add and document +limitPixels() and fillArea() methods to support '@' and '^' +geometry qualifiers. Fill area contributed by Long Ho and +limitPixels() by Bob Friesenhahn.
    • +
    • ../www/Magick++/Image.rst: Document extent and resize methods.
    • +
    • lib/STL.cpp (extentImage): New function object to invoke image +extent method. Original implementation contributed by Long Ho. +Subsequently modified by Bob Friesenhahn. +(resizeImage): New function object to invoke image resize +method. Contributed by Long Ho.
    • +
    • lib/Image.cpp (extent): New method to place image on sized +canvas of constant color using gravity. Contributed by Long Ho. +(resize): New method to resize image specifying geometry, filter, +and blur. Original implementation contributed by Long Ho. +Subsequently modified by Bob Friesenhahn.
    • +
    +
    +

    2014-01-05 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (thumbnail): New method for fast image resizing, +particularly to make thumbnails.
    • +
    +
    +

    2013-12-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableDashArray): DrawableDashArray now uses +C++ memory allocation rather than from GraphicsMagick library. +Also, implement direct copy constructor and assignment operator +rather than using dasyarray() method.
    • +
    +
    +

    2012-11-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • COPYING: Change Magick++ usage license to be exactly the MIT +license without the additional sentence about retention of +copyright (which was already legally implicit).
    • +
    +
    +

    2012-04-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (defineValue): Use AddDefinition() rather than +AddDefinitions().
    • +
    +
    +

    2012-03-17 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h (Magick): Added support for RandomNoise.
    • +
    +
    +

    2012-03-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/STL.cpp (stripImage): New unary function to to remove all +profiles and text attributes from the image.
    • +
    • lib/Image.cpp (strip): New method to remove all profiles and +text attributes from the image.
    • +
    +
    +

    2011-12-30 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h: Explicitly DLL import/export Magick++ +symbols when building under MinGW GCC.
    • +
    +
    +

    2010-12-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h (Magick): Add LZMACompression
    • +
    +
    +

    2010-12-07 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (InitializeMagick): Don't use atexit(). C++ +destructures are sufficient.
    • +
    +
    +

    2010-09-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (backgroundColor, borderColor, matteColor): +Opacity part of user-specified color needs to be preserved. +Problem was reported by Alexander Zheltov.
    • +
    +
    +

    2010-04-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/CoderInfo.h: Add default constructor, copy +constructor, and assignment operator.
    • +
    +
    +

    2010-01-31 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (Magick): Fix potential memory leak.
    • +
    +
    +

    2010-01-12 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • demo/shapes.cpp (main): Floodfill shape more agressively and +scale fuzz factor so that it provides the same results across +quantum depths.
    • +
    +
    +

    2009-10-14 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/STL.cpp, lib/Magick++/STL.h (shadeImage): ShadeImage was the +result of a botched cut-and-paste. Corrected now. Thanks to +Jukka Manner for making me aware of this.
    • +
    +
    +

    2009-09-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (cdl): New method to apply the ASC CDL. +(colorMatrix): New method to apply a color matrix to the image +channels. +(haldClut): New method to apply a color lookup table (Hald CLUT) +to the image.
    • +
    +
    +

    2009-07-06 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (attribute): Invoke modifyImage() to assure +exclusive access to image when updating attributes.
    • +
    +
    +

    2009-03-25 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (quantumOperator): New variant of method which +takes a 'double' argument, as it originally should. Previous +method taking a Quantum argument is still supported but marked +deprecated.
    • +
    +
    +

    2009-01-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h: If the user defines STATIC_MAGICK in his +project, then the Windows DLL decorations are ignored. Without +this, Windows DLL-based code can't use a static GraphicsMagick. +This is recommended by SourceForge bug 2537627.
    • +
    • lib/Magick++/Drawable.h: Apparently the only STL container which +may be DLL-exported is <vector> but we are using <list> so disable +DLL-export of list-based template objects.
    • +
    +
    +

    2008-10-27 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Color.cpp: Added an _isValid boolean to represent an invalid +color. Transparent black is no longer special and can be used in +drawing.
    • +
    • lib/Pixels.cpp: Update to use new cache view interfaces provided +by GraphicsMagick 1.3.
    • +
    +
    +

    2008-09-16 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (addNoiseChannel): New method to add noise to a +specified channel. +(blurChannel): New method to blur a specified channel. +(gaussianBlurChannel): New method to gaussian blur a specified +channel. +(motionBlur): New method to motion blur the image. +(randomThresholdChannel): New method to apply random thresholding +or ordered dithering to the image. +(randomThresholdChannel): New method to apply random thresholding +or ordered dithering to the specified image channels. +(sharpenChannel): New method to sharpen a specified image channel. +(unsharpmaskChannel): New method to unsharpmask a specified image +channel.
    • +
    +
    +

    2008-06-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (quantize): Error measurement support was being +performed incorrectly. SyncImage() is not needed here.
    • +
    +
    +

    2008-05-27 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • demo/demo.cpp (main): Fix segmentation parameters so they are +more suitable for our image.
    • +
    +
    +

    2008-04-23 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (depth): Remove 8/16/32 restriction on depth +value.
    • +
    +
    +

    2008-03-11 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Geometry.cpp, lib/Image.cpp: Include <strings.h> since it is +needed in order to use strcpy().
    • +
    +
    +

    2007-12-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/{Drawable.cpp, Geometry.cpp, BlobRef.cpp, Blob.cpp, +Montage.cpp, Options.cpp, Image.cpp}: Eliminate use of deprecated +GraphicsMagick functions.
    • +
    • lib/Magick++/{STL.h, Include.h}: Eliminate use of deprecated +GraphicsMagick functions.
    • +
    +
    +

    2007-07-21 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp: Include <cstdlib>
    • +
    +
    +

    2006-10-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (pixelColor): Don't enforce color "validity" when +setting the pixel color.
    • +
    +
    +

    2005-10-09 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (orientation): New accessor method to support +image orientation.
    • +
    +
    +

    2005-04-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/STL.cpp (levelImage): New function object for leveling the +image channels. +(levelChannelImage): New function object for leveling a specific +image channel.
    • +
    • lib/Image.cpp (level): New method for leveling the image +channels. +(levelChannel): New method for leveling a specific image channel.
    • +
    +
    +

    2005-04-13 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h (Magick): Import CineonLogRGBColorspace +into Magick namespace.
    • +
    +
    +

    2005-04-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h: Import Rec601LumaColorspace (was called +GRAYColorspace) and Rec709LumaColorspace into Magick +namespace. Use of GRAYColorspace is mapped via a macro into +Rec601LumaColorspace in order to avoid a user-visible API change.
    • +
    +
    +

    2004-08-17 Volker Lukas <vlukas@gmx.de>

    +
    +
      +
    • lib/Drawable.cpp: Fixes to ensure that drawable objects remain +coherent even if an exception is thrown within the assignment +operator.
    • +
    +
    +

    2004-07-22 Bob Friesenhahn <bfriesen@simple.dallas.tx.us> <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • demo/Makefile.am (AUTOMAKE_OPTIONS): Added nostdinc in order to +avoid accidentally using magick/list.h when including <list>.
    • +
    • tests/Makefile.am (AUTOMAKE_OPTIONS): Added nostdinc in order to +avoid accidentally using magick/list.h when including <list>.
    • +
    • tests/readWriteBlob.cpp: If MISSING_STD_IOS_BINARY is defined, +then ios::binary is not used. Use simple ifstream rather than +std::ifstream since we are already using the std namespace.
    • +
    +
    +

    2004-06-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h: Disable unavoidable warnings under +Visual C++ when instantiating STL templates within DLL +code. Consensus from postings on the net is that as long as the +same C++ compiler is used throughout, these warnings are of no +concern.
    • +
    +
    +

    2004-05-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (coderInfoList): Make error reporting a bit +more lenient so that if an error occurs while loading a module it +is not reported as an exception unless no coders were found at +all.
    • +
    +
    +

    2004-05-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (clipMask): Use GetImageClipMask.
    • +
    +
    +

    2004-04-14 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/CoderInfo.cpp (CoderInfo): Sense of isReadable() and +isWritable() was inverted.
    • +
    +
    +

    2004-04-06 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h: <inttypes.h> is not used. Inclusion +removed.
    • +
    +
    +

    2004-03-29 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Thread.cpp (lock): Have not been successful with using +MsgWaitForMultipleObjects() reliably, so back out usage of it for +now.
    • +
    +
    +

    2004-03-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Thread.cpp (lock): For MsgWaitForMultipleObjects, monitor +state change only. Otherwise lock may deadlock.
    • +
    +
    +

    2004-03-22 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (statistics): New method to obtain image +statistics (minimum, maximum, mean, variance, and standard +deviation).
    • +
    +
    +

    2004-03-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (quantumOperator): New image method to apply an +arithmetic or bitwise operator to the pixel quantums in an image. +Still needs documentation. +(quantumOperator): New image method to apply an arithmetic or +bitwise operator to the pixel quantums in an image region.
    • +
    +
    +

    2004-03-06 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • Makefile.am (../www/Magick++/ChangeLog.html): Fix execution of +txt2html.
    • +
    • lib/STL.cpp (composeImage): Added a function object to set/get +the Image composition option.
    • +
    • lib/Image.cpp (compose): Added a method to set/get the Image +composition option.
    • +
    +
    +

    2004-03-06 Vladimir Lukianov <lvm@integrum.ru>

    +
    +
      +
    • lib/Thread.cpp (lock): Use MsgWaitForMultipleObjects() rather +than WaitForSingleObject() in order to avoid possible deadlock +when application code directly or indirectly creates windows.
    • +
    +
    +

    2004-02-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (interlaceType): Retrieve interlace setting from +Image rather than ImageInfo.
    • +
    +
    +

    2004-02-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (Image): Delete the allocated image reference +object if a Magick::Error is thrown by the Image constructor. +Otherwise the image reference object becomes a memory leak.
    • +
    +
    +

    2004-01-27 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (WriteImages): Pass Blob::MallocAllocator to +updateNoCopy() in order to ensure that correct deallocator is +used.
    • +
    • tests/readWriteBlob.cpp (main): Needed to delete character array +using array [] reference.
    • +
    +
    +

    2004-01-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • demo/analyze.cpp (main): Fix a GNU C++ library portability +problem noticed under MinGW. The 'left' iostream manipulator seems +to be missing.
    • +
    +
    +

    2004-01-04 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • tests/Makefile.am: coderInfo test is expected to fail for moby +builds when the package is not yet installed since a .la file +exists in the coders directory, but there is no associated .so +file. Therefore failures of the coderInfo test are now ignored.
    • +
    +
    +

    2003-12-27 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (defineValue): New method to support setting +format-specific defines. +(defineSet): New method to support setting or testing for +format-specific flags.
    • +
    +
    +

    2003-12-21 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (iccColorProfile): Implementation now uses the +profile method with profile name "ICM". Note that this now +invokes the color profile if the image already has one. +(iccColorProfile): Reimplement using new GetImageProfile function. +(iptcProfile): Reimplement using the new GetImageProfile and +SetImageProfile functions. +(profile): Reimplement using new GetImageProfile function.
    • +
    +
    +

    2003-12-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Makefile.am (pkglibdir): Improve header file +install location logic.
    • +
    +
    +

    2003-12-04 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • demo/analyze.cpp (main): New program to demonstrate using the +'analyze' process module.
    • +
    • demo/Makefile.am: Add rules to build analyze program.
    • +
    • lib/Image.cpp (process): New method to execute process modules.
    • +
    • lib/Image.cpp (attribute): New method to get and set named image +attributes.
    • +
    +
    +

    2003-10-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Color.cpp: Ensure that all non-default constructors set +opacity to opaque.
    • +
    +
    +

    2003-09-17 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (colorHistogram): If map key is not const, +then implicit type conversion occurs. Sun's C++ compiler doesn't +seem to handle that. The map key is now defined as const in the +insert arguments.
    • +
    +
    +

    2003-09-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • tests/Makefile.am: Add build support for colorHistogram.cpp.
    • +
    • tests/colorHistogram.cpp: New test program to test retrieving +color histograms from the image using colorHistogram().
    • +
    • lib/Magick++/STL.h (colorHistogram): Added new template function +to retrieve a color histogram into a user-provided container. +Verified to work when using STL <vector> and <map> as the target +container types. When <map> is used, a user-specified color may +be used to perform lookups in the map to obtain the usage count +for that color.
    • +
    • lib/Color.cpp (operator >=): Insufficient resolution was being +provided in order to reliably sort color objects in STL +containers. The updated algorithm should be fail-safe.
    • +
    +
    +

    2003-08-31 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (channelDepth): New method to set or get the +modulus depth for a specified channel.
    • +
    +
    +

    2003-08-29 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h (Magick): Added support for +CopyCyanCompositeOp, CopyMagentaCompositeOp, +CopyYellowCompositeOp, and CopyBlackCompositeOp, composition +operators.
    • +
    +
    +

    2003-08-12 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (depth): Method now only updates the +Image/ImageInfo depth member and retrieves the value of the Image +depth member. +(modulusDepth): New method to inspect the pixels for actual +modulus depth, or update/reduce the pixels to a specified modulus +depth. The depth method was performing this function so any code +which depended on the depth method to compute or set the modulus +depth should be updated to use modulusDepth() instead.
    • +
    +
    +

    2003-08-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (matte): If a new matte channel is created, +initialize it to opaque. Likewise, if the matte channel is +eliminated, initialize the unused channel to opaque.
    • +
    +
    +

    2003-07-09 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • demo/demo.cpp (main): Don't crop logo image.
    • +
    • *.h, *.cpp: Include "Magick++/Include.h" before including any +compiler or system header in order to ensure that LFS defines are +properly applied. Inspired by patch from Albert Chin-A-Young.
    • +
    +
    +

    2003-06-29 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h: Needed to import ThrowLoggedException.
    • +
    • lib/Exception.cpp (throwException): Add originating source +module, source line, and function name (if available) to exception +report. This is useful in order to determine the exact conditions +that lead to the exception being thrown.
    • +
    • lib/Magick++/Exception.h: Added ErrorCoder, WarningCoder, +ErrorConfigure, WarningConfigure, ErrorDraw, WarningDraw, +ErrorImage, WarningImage, ErrorMonitor, WarningMonitor, +ErrorRegistry, WarningRegistry, ErrorStream, WarningStream, +ErrorType, and WarningType, exception classes to support the full +set of exceptions that GraphicsMagick can throw.
    • +
    +
    +

    2003-06-22 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/CoderInfo.cpp (CoderInfo): Applied compilation fix from Mike +Chiarappa to compile using Borland C++.
    • +
    +
    +

    2003-06-06 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Geometry.cpp (string): Throw an exception if a string is +requested from an invalid geometry object.
    • +
    +
    +

    2003-06-05 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Geometry.cpp (operator =): If GetGeometry returns NoValue, +then assign an invalid geometry object to cause an exception if +the geometry is then used.
    • +
    +
    +

    2003-06-04 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Exception.h (ErrorModule): Added class to handle +module errors.
    • +
    • lib/Magick++/Exception.h (WarningModule) Added class to handle +module warnings.
    • +
    +
    +

    2003-05-30 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (coderInfoList): Use GetMagickInfoArray to +access coder list.
    • +
    +
    +

    2003-05-22 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (affineTransformImage): Add function object +contributed by Vladimir Lukianov to apply an affine transform to +the image.
    • +
    • lib/Image.cpp (affineTransform): Added method contributed by +Vladimir Lukianov to apply an affine transform to the image.
    • +
    +
    +

    2003-05-16 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h: Decided to back out change which used +the _VISUALC_ define to trigger inclusion of <sys/types.h>.
    • +
    +
    +

    2003-05-14 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h: If _VISUALC_ is defined, include +<sys/types.h>. This ensures that this necessary header is included +even if HAVE_SYS_TYPES_H is not defined in magick_config.h.
    • +
    +
    +

    2003-05-04 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (InitializeMagick): InitializeMagick is now a C++ +function rather than a namespace inclusion. An atexit() handler +is registered to invoke DestroyMagick when the program +exits. Relying on static deconstruction to invoke DestroyMagick +proved to be unreliable due to translation unit destruction +uncertainty.
    • +
    +
    +

    2003-04-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (Image::Image (MagickLib::Image* image_)): +Incorporated recommended fix from Jukka Manner to avoid +a scenario which leaks an Options object.
    • +
    • tests/coalesceImages.cpp: Updated to use modified +coalesceImages() interface.
    • +
    • lib/Magick++/STL.h (coalesceImages): Replaced implementation +with one from Felix Heimbrecht. The template signature has changed +to return a new image sequence. This template API silently ceased +to funtion due to an ImageMagick CoalesceImages API change.
    • +
    +
    +

    2003-03-30 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • tests/readWriteBlob.cpp (main): Added check for stream read +failure when reading blob data. +(class myBlob): Use get rather than read.
    • +
    +
    +

    2003-03-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • tests/attributes.cpp : Change in the way that Magick++ retrieves +density caused tests to fail. Density now defaults to 72x72 +(GraphicsMagick default) rather than invalid.
    • +
    +
    +

    2003-03-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • demo/Makefile.am (CLEANFILES): Fix clean target to +remove *_out.mvg output files as well.
    • +
    • demo/zoom.cpp: Added a command-line parser for dash arguments as +well as an image "resample" capability.
    • +
    • lib/Image.cpp (density): Obtain density from Image rather than +ImageInfo if the Image is valid.
    • +
    +
    +

    2003-03-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Makefile.am : Added rules to install GraphicsMagick++.pc.
    • +
    • lib/GraphicsMagick++.pc.in : Added pkgconfig file for +-lGraphicsMagick++.
    • +
    +
    +

    2003-02-11 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (colorSpace): Pass image->colorspace to +TransformRGBColorspace.
    • +
    +
    +

    2003-01-22 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (writeImages): Should have been invoking +WriteImages rather than WriteImage!
    • +
    +
    +

    2003-01-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h: Add HSL and HWB colorspace +transformation support.
    • +
    +
    +

    2003-01-13 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (colorSpace): Support colorspace transforms other +than to and from RGB by translating to RGB as an intermediate +step.
    • +
    +
    +

    2002-11-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp: Added DrawablePushClipPath, +DrawablePopClipPath, and DrawableClipPath. Implementation +contributed by Vladimir <lvm@integrum.ru>.
    • +
    +
    +

    2002-11-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (colorMapSize): New method to set, or return the +colormap size.
    • +
    +
    +

    2002-11-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (adaptiveThreshold): New method.
    • +
    +
    +

    2002-10-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (coderInfoList): Intentionally ignore missing +delegate exceptions.
    • +
    +
    +

    2002-09-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Options.cpp (textEncoding): Had forgotten to implement +textEncoding!
    • +
    +
    +

    2002-09-16 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Color.cpp (Color): Use of 'new' and 'delete' in inlines was +causing memory allocation/deallocation problems for users of the +DLL build. Problem was identified by Marc Iwan.
    • +
    +
    +

    2002-09-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (compare): New method to compare current image +with a reference image.
    • +
    +
    +

    2002-08-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (textEncoding): New method to allow setting the +default text encoding (e.g. "UTF-8").
    • +
    • lib/Drawable.cpp (DrawableText): Added an alternate constructor +to allow specifying the text encoding (e.g. "UTF-8").
    • +
    +
    +

    2002-08-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • Overall: Now compiles as a DLL using Visual C++.
    • +
    +
    +

    2002-07-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (profile): Added method to store, delete, or +retrieve named application profiles.
    • +
    +
    +

    2002-07-17 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (type): Set the ImageInfo type attribute when +setting the image type. If the type attribute is set to something +other than UndefinedType (implying that the user has set a desired +output image type), then return that as the image type, otherwise +use GetImageType() to evaluate the image type.
    • +
    +
    +

    2002-05-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableTextUnderColor): New class to set the +text undercolor. When text undercolor is set, a rectangle of the +specified color is rendered under text annotations.
    • +
    +
    +

    2002-05-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • Magick++ library no longer depends on iostreams at all.
    • +
    +
    +

    2002-04-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (throwImageException): ExceptionInfo was not being +properly initialized. This could cause some errors to cause an +abort in error.c rather than throwing an exception.
    • +
    +
    +

    2002-04-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (draw): Use draw.h drawing APIs to draw on image. +This means that MVG output no longer comes from code in +Drawable.cpp.
    • +
    +
    +

    2002-04-25 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/STL.cpp: Moved function object implementations from STL.h to +STL.cpp.
    • +
    +
    +

    2002-04-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (getConstPixels): Changed offset parameter type +from 'unsigned int' to 'int'. +(getPixels): Changed offset parameter type from 'unsigned int' to +'int'. +(setPixels): Changed offset parameter type from 'unsigned int' to +'int'. +(cacheThreshold): Changed argument type from 'const long' to +'const int'. +(matteFloodfill): Changed offset parameter type from 'const long' +to 'const int'.
    • +
    • lib/Pixels.cpp (getConst): New method to return read-only +pixels. +(get): Offset parameter types changed from 'unsigned int' to +'int'.
    • +
    +
    +

    2002-04-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Drawable.h (DrawableDashOffset): Change dashoffset +type to 'double' rather than 'unsigned int' in order to match +ImageMagick.
    • +
    • lib/Drawable.cpp (DrawableDashArray): Change dasharray type to +'double' rather than 'unsigned int' in order to match +ImageMagick. Previous 'unsigned int' methods remain for +compatability reasons.
    • +
    +
    +

    2002-04-14 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableCompositeImage): Always output +composite images as inlined Base64.
    • +
    +
    +

    2002-04-13 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableCompositeImage): If magick attribute +string is specified, then composite image is supplied to +ImageMagick as inlined Base64 rather than by MPRI reference.
    • +
    • lib/Blob.cpp (base64): Added methods to update Blob with data +from Base64-encoded string, or to return a Base64-encoded string +from Blob. Still needs documentation.
    • +
    +
    +

    2002-04-09 Dom Lachowicz <cinamod@hotmail.com>

    +
    +
      +
    • lib/Image.cpp (Image::ping): Added PingBlob function
    • +
    +
    +

    2002-04-07 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableDashArray::operator=): Added missing +assignment operator (fixes a bug). +(DrawableDashArray::DrawableDashArray): Added missing copy +constructor (fixes a bug).
    • +
    • lib/Image.cpp (oilPaint): Changed argument type from unsigned +int to double. +(chromaBluePrimary): Changed argument type from float to double. +(chromaGreenPrimary): Changed argument type from float to double. +(chromaRedPrimary): Changed argument type from float to double. +(chromaWhitePoint): Changed argument type from float to double. +(getConstPixels): Changed argument type of x_ & _y from 'int' to +'unsigned int'. +(getPixels): Changed argument type of x_ & _y from 'int' to +'unsigned int'.
    • +
    +
    +

    2002-04-05 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (debug): Added method to set ImageMagick debug +flag so that it prints debugging information while it runs.
    • +
    +
    +

    2002-04-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp: Fixed a bunch of bugs related to +DrawableCompositeImage, DrawableFont, and inconsistencies +discovered by Gimpel lint.
    • +
    +
    +

    2002-04-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (draw): Properly delimit individual drawing +commands so that MVG output is correct.
    • +
    +
    +

    2002-03-30 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableViewbox): MVG syntax wasn't correct.
    • +
    • lib/Image.cpp (draw): Fix algorithm used to append newlines to +MVG commands so that draw() may be invoked multiple times while +still producing valid MVG.
    • +
    +
    +

    2002-03-29 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableViewbox): New class to allow setting +the MVG output size.
    • +
    +
    +

    2002-03-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (print): Changed "mpr:" to "mpri:" in order to +finally get DrawableCompositeImage to work as intended.
    • +
    • lib/Image.cpp (registerId): Bugfix. Register using +sizeof(MagickLib::Image) rather than sizeof(Image).
    • +
    +
    +

    2002-03-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableCompositeImage): Had failed to +initialize width and height in object to image width and height.
    • +
    +
    +

    2002-02-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (endianImage): New class to specify the +endian option for formats which support this notion (e.g. TIFF).
    • +
    • lib/Image.cpp (endian): New method to specify the endian option +for formats which support this notion (e.g. TIFF).
    • +
    +
    +

    2002-02-11 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableFont): Support specifying a font via +font-family, font-style, font-weight, and font-stretch. Wildcard +matches are supported.
    • +
    +
    +

    2002-02-06 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (charcoal): Replace Magick++'s charcoal effect +with the output of ImageMagick's CharcoalImage function in order +to ensure consistency.
    • +
    • lib/Magick++/CoderInfo.h (MatchType): Scope the MatchType +enumeration to the CoderInfo class so these enumeration names can +be re-used elsewhere without conflict. This results in a minor +API change to the coderInfoList() templated function since +enumerations must be specified like "CoderInfo::TrueMatch" rather +than just "TrueMatch". Hopefully not a problem since this +function and class were not documented outside of the headers +until this release.
    • +
    +
    +

    2002-02-05 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (coderInfoList): Finally wrote some +documentation.
    • +
    +
    +

    2002-01-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Options.cpp : Use DestroyImageList() rather than +DestroyImage().
    • +
    • lib/Geometry.cpp (operator =): Use GetPageGeometry() rather than +PostscriptGeometry() to parse geometry specifications containing a +page size.
    • +
    +
    +

    2002-01-21 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • Remove bogus cast of blob data in readImages().
    • +
    +
    +

    2002-01-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (throwImageException): Throwing exceptions was +leaking memory.
    • +
    • lib/Exception.cpp (throwException): Throwing exceptions was +leaking memory.
    • +
    • lib/Image.cpp (replaceImage): Updated to properly handle +registration ids. +(modifyImage): Updated to properly handle registration ids.
    • +
    +
    +

    2002-01-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (Magick::DrawableGravity::print): +Bugfix. Remove "Gravity" from the end of each gravity +specification string. Reported as PR#1084 by stefan@dotify.com.
    • +
    +
    +

    2002-01-12 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp, Magick++/Include.h: Use DestroyImageList() rather +than DestroyImages().
    • +
    +
    +

    2002-01-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Options.h (antiAlias): Bugfix, set +drawInfo->text_antialias to control text antialiasing.
    • +
    +
    +

    2002-01-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h : Imported new composition operators to +namespace: NoCompositeOp, DarkenCompositeOp, LightenCompositeOp, +HueCompositeOp, SaturateCompositeOp, ValueCompositeOp, +ColorizeCompositeOp, LuminizeCompositeOp, ScreenCompositeOp, +OverlayCompositeOp.
    • +
    +
    +

    2001-12-27 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (strokePattern): New method to specify image to +use as pattern while drawing stroked-outlines of drawn objects. +(fillPattern): New method to specify image to use as pattern while +filling drawn objects. +(penTexture): Method is officially deprecated. Don't use anymore. +(penColor): Method is officially deprecated. Don't use anymore.
    • +
    • lib/Drawable.cpp (DrawablePushPattern): Support pushing +(starting) pattern definition. +(DrawablePopPattern): Support popping (terminating) pattern +definition.
    • +
    +
    +

    2001-12-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableCompositeImage): Read image +immediately if provided by filename, register with peristent +registry, and pass as perisistant image type. +(DrawableCompositeImage): Support specifying Image in memory. +Passed as perisistant image type.
    • +
    +
    +

    2001-12-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Color.cpp (operator std::string): Color string buffer was +one character too short!
    • +
    +
    +

    2001-12-20 Bob Friesenhahn <bfriesen@sun1107.ssd.usa.alcatel.com>

    +
    +
      +
    • lib/TypeMetric.cpp (characterWidth): Eliminate method. +(characterHeight): Eliminate method. +(all remaining methods): Change return type to 'double'. Fix +documentation in source files to reflect that units are in pixels +rather than points. +(descent): Renamed method from 'decent' to 'descent'.
    • +
    +
    +

    2001-11-22 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (Magick): Invoke DestroyMagick() to clean up +ImageMagick allocations.
    • +
    • lib/Magick++/Include.h (ImageType): Added some missing enums to +Magick namespace.
    • +
    +
    +

    2001-11-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/CoderInfo.h (CoderInfo): Syntax fix. +ImageMagick bug #975.
    • +
    • lib/Image.cpp (draw): Delete ostrstream data when it is no +longer needed. ImageMagick bug #988.
    • +
    +
    +

    2001-11-07 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (pixelColor): Implementation didn't handle pixels +indexes correctly. Now it does.
    • +
    +
    +

    2001-11-04 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (matteFloodfill): Coordinates are long values. +(floodFillOpacity): New method to floodfill opacity across pixels +matching color (within fuzz-factor) at point. Similar to +matteFloodfill except that color is selected from starting point.
    • +
    +
    +

    2001-10-29 Bob Friesenhahn <bfriesen@sun1107.ssd.usa.alcatel.com>

    +
    +
      +
    • lib/Image.cpp (strokeDashArray): Change to type double. +(strokeDashOffset): Change to type double.
    • +
    +
    +

    2001-10-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Geometry.cpp (Geometry): Add constructor from +MagickLib::RectangleInfo.
    • +
    • lib/Image.cpp (boundingBox): Method to return smallest bounding +box enclosing non-border pixels.
    • +
    +
    +

    2001-10-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (getConstIndexes): Add method to obtain read-only +pixel indexes. +(getIndexes): Add method to obtain read-write pixel indexes. +(Image::Image): Send warnings from Image constructor to cerr +rather than throwing.
    • +
    • lib/Color.cpp (Color(PixelPacket&)): Change argument to const +PixelPacket& as it should have been from the beginning.
    • +
    • lib/Image.cpp (pixelColor): Reimplemented to be a const method.
    • +
    +
    +

    2001-10-13 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (getConstPixels): New method for returning a +read-only pixel view. Still requires documentation.
    • +
    • lib/Magick++/STL.h (coderInfoList): Fixed compilation problem +when compiling with Visual C++.
    • +
    +
    +

    2001-10-06 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Color.h (scaleQuantumToDouble): Add polymorphic +version that accepts double to avoid downconversion error.
    • +
    +
    +

    2001-10-05 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Color.h (scaleQuantumToDouble): Cast Quantum to +double prior to division. Hopefully fix bug.
    • +
    +
    +

    2001-10-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Color.h (Color(const std::string)): Pass argument by reference.
    • +
    • (operator=): Pass argument by const reference.
    • +
    +
    +

    2001-09-23 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (coderInfoList): New function to support +obtaining format coder information (as a list of type CoderInfo).
    • +
    • lib/CoderInfo.cpp (CoderInfo): New class to support obtaining +format coder information.
    • +
    +
    +

    2001-09-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (depth): Use GetImageDepth and SetImageDepth +rather than just getting/setting depth attributes.
    • +
    • lib/Magick++/STL.h (opacityImage): New unary function object to +set, or attenuate, image pixel opacity throughout the image.
    • +
    • lib/Image.cpp (opacity): New method to set, or attenuate, image +pixel opacity throughout the image.
    • +
    • lib/Magick++/STL.h (typeImage): New unary function object to set +image type.
    • +
    • lib/Image.cpp (type): Added ability to set image type.
    • +
    +
    +

    2001-09-12 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (write(Blob)): Tell blob to use malloc allocator.
    • +
    • lib/Blob.cpp (updateNoCopy): Added parameter so that user can +specify the allocation system (malloc or new) the memory came +from. Defaults to C++ memory allocator.
    • +
    +
    +

    2001-09-09 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (fileSize): Decided to change return type to off_t +for increased range and portability.
    • +
    +
    +

    2001-09-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (fileSize): Changed return value to double.
    • +
    +
    +

    2001-09-05 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (colorMap): Allocate a colormap if it does not +already exist.
    • +
    • lib/Pixels.cpp (indexes): Don't attempt to validate image type.
    • +
    • lib/Image.cpp (colorMap): Optimized more for performance.
    • +
    +
    +

    2001-09-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (fontTypeMetrics): New method to support +retrieving font metrics.
    • +
    • lib/TypeMetric.cpp : New class to support font metrics +information.
    • +
    +
    +

    2001-09-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Color.h (scaleDoubleToQuantum): Inline static +method made from previous ScaleDoubleToQuantum #define. +(scaleQuantumToDouble): Inline static method made from previous +ScaleQuantumToDouble #define. Helps avoid possibility of clash +with user code.
    • +
    +
    +

    2001-08-25 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (colorMap): Automatically extend colormap if +specified index is past end of current colormap. Colormap is +limited to a maximum depth of MaxRGB entries.
    • +
    +
    +

    2001-08-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (clipMask): New method to add a clip mask to the +image. Adds clipping to any image operation wherever the clip +mask image is tranparent.
    • +
    +
    +

    2001-08-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (print): Add single quotes around file names +and font specifications.
    • +
    +
    +

    2001-07-07 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (read): Ensure that only a single image frame is +read.
    • +
    +
    +

    2001-07-05 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (flattenImages): New function to flatten a +layered image.
    • +
    • lib/Montage.cpp (Montage): Montage initial defaults are no +longer drawn from ImageInfo. MontageInfo structure is entirely +filled out by updateMontageInfo();
    • +
    +
    +

    2001-07-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Montage.cpp (updateMontageInfo): Bugfix; colors which were +intentionally specified as invalid (unset) were being ignored. +This produced unattractive label text when doing a montage.
    • +
    +
    +

    2001-07-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (medianFilterImage): Changed argument from +unsigned int to const double. +(fillColorImage): New method. +(strokeColorImage): New method. +(isValidImage): New method.
    • +
    • lib/Magick++/Image.h (edge): Change argument from unsigned int +to double. +(medianFilter): Changed argument from unsigned int to const +double.
    • +
    • lib/Magick++/STL.h (edgeImage): Change argument from unsigned +int to double.
    • +
    • demo/demo.cpp (main): Updated to match PerlMagick demo.
    • +
    +
    +

    2001-06-23 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (shaveImage): New function to shave edges +from image.
    • +
    • lib/Image.cpp (shave): New method to shave edges from image.
    • +
    +
    +

    2001-06-22 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (quantize): Remove conditions on whether +quantization should be done. Now quantization is always done.
    • +
    +
    +

    2001-06-14 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Image.h (blur,charcoal,emboss,sharpen): Changed +radius and sigma parameters to match current ImageMagick defaults.
    • +
    +
    +

    2001-02-22 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Options.cpp (updateDrawInfo): The updateDrawInfo() method +was no longer needed. Due to ImageMagick changes, calling it was +causing some options to be lost.
    • +
    +
    +

    2001-01-31 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (fillRule): New method to specify the rule to use +when filling drawn objects.
    • +
    +
    +

    2001-01-25 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (erase): New method to reset image to background +color. +(strokeAntiAlias): New method to control antialiasing of stroked +objects.
    • +
    +
    +

    2001-01-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (channel): Renamed method from 'layer' to match +equivalent change in ImageMagick (ChannelImage). Enumeration +names *Layer renamed to *Channel.
    • +
    +
    +

    2001-01-13 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Montage.h (strokeColor): New method. +(fillColor): New method.
    • +
    • lib/Image.cpp (replaceImage): Revised logic so that an inValid +image should be returned if a NULL pointer is passed. Before this +change the existing image was preserved. +(label): Work-around ImageMagick SetImageAttribute bug.
    • +
    +
    +

    2001-01-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp : Adjusted to ImageMagick animation parameter API +change.
    • +
    +
    +

    2000-12-31 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableCompositeImage): Support specifying +composition rule.
    • +
    +
    +

    2000-12-27 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (draw): Bugfix - the primitive string was not +properly null terminated. It is a wonder that the code usually +worked at all. Thanks to afatela@marktest.pt for reporting it.
    • +
    +
    +

    2000-12-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (deconstructImages): New STL function for +deconstructing an image list to assist with creating an animation. +(mosaicImages): New STL function for inlaying an image list to +form a single coherent picture.
    • +
    +
    +

    2000-12-17 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (convolve): New method to convolve image using +user-supplied convolution matrix. +(unsharpmask): New method to replace image with a sharpened +version of the original image using the unsharp mask algorithm.
    • +
    +
    +

    2000-12-14 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • : Adapted to ImageMagick API change which eliminates +AnnotateInfo.
    • +
    +
    +

    2000-12-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (annotateImage): Brought into sync with +annotate methods in Image.
    • +
    +
    +

    2000-12-09 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (annotate): Usage of Geometry parameter was +incorrect. Geometry parameter is used to specify bounding +area. This changes the interpretation for two of the annotate +methods (which probably weren't usable before).
    • +
    +
    +

    2000-11-29 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Color.h (alphaQuantum): Bugfix. Due to change in +treatment of opacity member, alphaQuantum() was not allowing value +to be set.
    • +
    +
    +

    2000-11-25 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableFillRule): New class to specify fill +rule (see SVG's fill-rule). +(DrawableDashOffset): New class to specify initial offset in dash +array. +(DrawableDashArray): New class to specify a stroke dash pattern. +(DrawableStrokeLineCap): New class to specify the shape to be used +at the end of open subpaths when they are stroked. +(DrawableStrokeLineJoin): New class to specify the shape to be +used at the corners of paths (or other vector shapes) when they +are stroked. +(DrawableMiterLimit): New class to specify extension limit for +miter joins.
    • +
    +
    +

    2000-11-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (annotate): Reimplement text rotation using affine +member of AnnotateInfo. +(strokeDashOffset): New method for specifying the dash offset to +use for drawing vector objects. Similar to SVG stroke-dashoffset. +(strokeDashArray): New method for specifying the dash pattern to +use for drawing vector objects. Similar to SVG stroke-dasharray +(strokeLineCap): New method to specify the shape to be used at the +end of open subpaths when they are stroked. Similar to SVG +stroke-linecap. +(strokLineJoin): New method to specify the shape to be used at the +corners of paths (or other vector shapes) when they are +stroked. Similar to SVG stroke-linejoin. +(strokeMiterLimit): New method to specify the miter limit when +joining lines using MiterJoin. Similar to SVG stroke-miterlimit. +(strokeWidth): Renamed lineWidth method to strokeWidth.
    • +
    +
    +

    2000-10-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Drawable.h (DrawableCompositeImage): Add a +short-form constructor to support specifying image location and +name, but without specifying rendered size (use existing image +size).
    • +
    +
    +

    2000-10-16 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Drawable.h (DrawablePopGraphicContext): New class +to pop graphic context. +(DrawablePushGraphicContext): New class to push graphic context.
    • +
    • lib/Drawable.cpp (DrawableStrokeAntialias): New class to set +stroke antialiasing. +(DrawableTextAntialias): New class to set text antialiasing.
    • +
    +
    +

    2000-10-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (transformOrigin): New method to set origin of +coordinate system for use when annotating with text or drawing +(transformRotation): New method to set rotation for use when +annotating with text or drawing +(transformScale): New method to set scale for use when annotating +with text or drawing. +(transformSkewX): New method to set skew for use in X axis when +annotating with text or drawing. +(transformSkewY): New method to set skew for use in Y axis when +annotating with text or drawing. +(transformReset): New method to reset transformation to default.
    • +
    • lib/Drawable.cpp (DrawablePath): New class for drawing SVG-style +vector paths. +(PathArcArgs): New class. Argument for PathArcArgs & PathArcAbs. +(PathArcAbs): New class. Draw arc using absolute coordinates. +(PathArcRel): New class. Draw arc using relative coordinates. +(PathClosePath): New class. Close drawing path. +(PathCurvetoArgs): New class. Argument class for PathCurvetoAbs & +PathCurvetoRel. +(PathCurvetoAbs): New class. Cubic bezier, absolute coordinates +(PathCurvetoRel): New class. Cubic bezier, relative coordinates +(PathSmoothCurvetoAbs): New class. Cubic bezier, absolute +coordinates +(PathSmoothCurvetoRel): New class. Cubic bezier, relative +coordinates +(PathQuadraticCurvetoArgs): New class. Argument class for +PathQuadraticCurvetoAbs and PathQuadraticCurvetoRel. +(PathQuadraticCurvetoAbs): New class. Quadratic bezier, absolute +coordinates +(PathQuadraticCurvetoRel): New class. Quadratic bezier, relative +coordinates +(PathSmoothQuadraticCurvetoAbs): New class. Quadratic bezier, +absolute coordinates +(PathSmoothQuadraticCurvetoRel): New class. Quadratic bezier, +relative coordinates +(PathLinetoAbs): New class. Line to, absolute coordinates +(PathLinetoRel): New class. Line to, relative coordinates +(PathLinetoHorizontalAbs): New class. Horizontal lineto, absolute +coordinates +(PathLinetoHorizontalRel): New class. Horizontal lineto, relative +coordinates +(PathLinetoVerticalAbs): New class. Veritical lineto, absolute +coordinates. +(PathLinetoVerticalRel): New class. Vertical lineto, relative +coordinates. +(PathMovetoAbs): New class. Moveto, absolute coordinates +(PathMovetoRel): New class. Moveto, relative coordinates
    • +
    +
    +

    2000-10-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableSkewX): New object to apply skew in X +direction. +(DrawableSkewY): New object to apply skew in Y direction.
    • +
    +
    +

    2000-10-09 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (edge): Change argument from 'unsigned int' to +'double' in order to match ImageMagick API.
    • +
    +
    +

    2000-10-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableCompositeImage): Renamed from +DrawableImage. +(DrawableTextDecoration): Renamed form DrawableDecoration. +(all-classes): Complete re-write to write the drawing command to a +stream when draw() is invoked rather than at object construction +time. This may be somewhat slower for individual draw operations +but but should be at least as fast for lists of drawing commands, +and is more flexible going into the future. Drawable classes now +inherit from DrawableBase but are passed into STL lists and Image +draw() methods via the surrogate class Drawable. The upshot of +all this is that the existing published API has not been altered +but things work much differently under the covers.
    • +
    +
    +

    2000-10-05 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableStrokeColor): Renamed from +DrawableStroke +(DrawableFillColor): Renamed from DrawableFill +(DrawableRotation): New class to influence object rotation. +(DrawableScaling): New class to influence object scaling. +(DrawableTranslation): New class to influence object translation.
    • +
    +
    +

    2000-10-04 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableAffine): New class to influence object +scaling, rotation, and translation (as defined by SVG XML). +(DrawableAngle): New class to influence drawing angle. +(DrawableDecoration): New class to influence text decoration such +as underline. +(DrawableFill): New class to set object filling color. +(DrawableFillOpacity): New class to set opacity to use when +filling object. +(DrawableFont::): New class to set font. +(DrawableGravity): New class to set text placement gravity. +(DrawablePointSize): New class to set font point size. +(DrawableStroke): New class to set drawing stroke color. +(DrawableStrokeOpacity): New class to set drawing stroke opacity. +(DrawableStrokeWidth): New class to set drawing stroke width.
    • +
    +
    +

    2000-10-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableImage): Added width and height +parameters to specify size to scale rendered image to. This is +actually a bug-fix since it seems that the correct drawing command +was no longer being generated.
    • +
    +
    +

    2000-09-30 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (read): New overloaded method to read an image +based on an array of raw pixels, of specified type and mapping, in +memory. +(write): New overloaded method to write image to an array of +pixels, of specified type and mapping. +(Image): New overloaded constructor to construct an image based on +an array of raw pixels, of specified type and mapping, in memory.
    • +
    +
    +

    2000-09-27 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (colorize): API change to match change in +ImageMagick. Now accepts percentage of red, green, and blue to +colorize with using specified pen color.
    • +
    +
    +

    2000-09-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Drawable.h: Reverted Coordinate implemenation back +from and STL pair based implementation to a simple class. Maybe +this will improve portability. It is more understandable anyway.
    • +
    +
    +

    2000-09-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Options.cpp : Bugfix. Some DrawInfo attributes were not +being updated. This lead to options like fontPointsize not +changing the font.
    • +
    +
    +

    2000-08-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (blurImage, charcoalImage, embossImage, +sharpenImage): Expand order_ argument to radius_ & sigma_ +arguments for more control (matches ImageMagick API change).
    • +
    • lib/Image.cpp (blur, charcoal, emboss, sharpen): Expand order_ +argument to radius_ & sigma_ arguments for more control (matches +ImageMagick API change).
    • +
    +
    +

    2000-08-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (read): Check returned Image for embedded +exception, as well as the existing parameter check. This fixes +the bug that warnings are not reported.
    • +
    +
    +

    2000-07-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • test/*.cpp demo/*.cpp: Added call to MagickIncarnate() to set +ImageMagick install location for Windows. Hopefully this hack can +be removed someday.
    • +
    +
    +

    2000-07-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (colorFuzz): Changed type to 'double' from +'unsigned int' to match change in ImageMagick.
    • +
    • lib/Color.cpp (Color*): Added copy constructor from base class. +(operator =): Added assignment operator from base class.
    • +
    +
    +

    2000-06-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h : Changed enumeration FilterType to +FilterTypes, and QuantumTypes to QuantumType in order to match +last-minute API change in ImageMagick.
    • +
    +
    +

    2000-06-22 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Pixels.cpp (indexes): Bugfix, use +GetCacheViewIndexes() rather than GetIndexes().
    • +
    +
    +

    2000-05-23 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Montage.h (gravity): Type of gravity_ argument, and +return value changed from 'unsigned int' to GravityType.
    • +
    +
    +

    2000-04-17 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (DrawableArc, DrawableBezier, DrawablePolyline, +RoundRectangle): Added support for new drawing objects.
    • +
    +
    +

    2000-04-16 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp: Removed all public methods which accept +Coordinate arguments except those that accept lists of +Coordinates. Converted remaining drawable object methods into +individual classes which inherit from Drawable (e.g. "circle" +becomes "DrawableCircle"). The constructor for each class is +compatible with the original method. This results in annoying +changes to user code but provides more implementation flexibility.
    • +
    +
    +

    2000-04-09 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp +(fillEllipse,fillRectangle,fillCircle,fillPolygon): Removed +methods. Object filling is now based on whether fillColor or +penTexture are valid or not. This reflects ImageMagick internal +changes.
    • +
    • lib/Image.cpp (fillColor): New method to specify fill color when +drawing objects. +(strokeColor): New method to specify outline color when drawing +objects. +(penColor): Setting penColor now sets fillColor and +strokeColor. Getting penColor retrieves the value of +strokeColor. This supports backwards compatability.
    • +
    +
    +

    2000-03-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (lineWidth): Type changed from unsigned int to +double.
    • +
    +
    +

    2000-03-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (Magick):
    • +
    +
    +

    2000-03-07 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h +(blurImage,charcoalImage,edgeImage,embossImage, +reduceNoiseImage,sharpenImage): Modified to support order of the +pixel neighborhood. Backward compatable function objects +constructors are provided for embossImage, and reduceNoiseImage.
    • +
    • lib/Image.cpp (blur,charcoal,edge,emboss,reduceNoise,sharpen): +Now accept unsigned int argument which represents the order of the +pixel neighborhood (e.g. 3). This is not a backwards compatable +change, however, backward compatable methods are provided for +emboss, and reduceNoise.
    • +
    +
    +

    2000-03-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Pixels.h (Pixels): Moved Image pixel methods to +Pixels class.
    • +
    +
    +

    2000-02-29 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (annotate): Re-wrote to improve performance. +(draw): Re-wrote to improve performance.
    • +
    +
    +

    2000-02-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Drawable.cpp (text): Bugfix: support spaces in annotation +text.
    • +
    +
    +

    2000-02-23 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (gaussianBlurImage): New function object to +Gaussian blur image.
    • +
    • lib/Image.cpp (gaussianBlur): New method to Gaussian blur image.
    • +
    +
    +

    2000-02-16 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp : Call-back based LastError class is eliminated in +favor of ImageMagick 5.2's re-entrant ExceptionInfo reporting. +This should make Magick++ thread safe under Win32.
    • +
    +
    +

    2000-02-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (floodFillTexture): Fixed bug due to pixel pointer +becoming invalid in ImageMagick function.
    • +
    +
    +

    2000-01-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp : Added locking to reference counting to ensure +thread (pthread) safety.
    • +
    • lib/Blob.cpp : Added locking to reference counting to ensure +thread (pthread) safety.
    • +
    • lib/LastError.cpp: Added support for thread specific data +(pthreads) so that error reporting is thread safe.
    • +
    • lib/Magick++/Thread.h: Added thread wrapper class to provide +thread-safe locking (pthreads) to Magick++.
    • +
    +
    +

    2000-01-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp: Added methods getPixels, setPixels, syncPixels, +readPixels, and writePixels, in order to provide low-level access +to Image pixels. This approach (direct wrapper around ImageMagick +functions) does not mean that the planned object-oriented wrapper +has been forgotten, only that this wrapper is not ready yet, and +users need to manipulate pixels *now*.
    • +
    +
    +

    2000-01-16 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/LastError.cpp: Complete re-implementation of LastError so +that it hides its implementation. Also assures that all memory is +explicitly deallocated at program exit to avoid the appearance of +a leak.
    • +
    +
    +

    2000-01-11 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (size): Bug-fix. Set image columns and rows as +well as image options columns and rows.
    • +
    • lib/Image.cpp :Depth parameters are now all unsigned in for +consistency.
    • +
    • lib/Image.cpp (write): Parameters for writing Blobs re-arranged +again to hopefully be more sensible.
    • +
    • lib/Magick++/STL.h: Bug-fix. Re-number scenes from zero when +linking image range in container into a list. This provides +expected results.
    • +
    +
    +

    1999-12-31 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp +(write): Additional overloaded methods for BLOBs. +(read): Additional overloaded methods for BLOBs. Re-ordered +parameters for one existing method. +(Image): Additional overloaded methods for BLOBs. Re-ordered +parameters for one existing method.
    • +
    +
    +

    1999-12-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (floodFillTexture): Changed coordinates to +unsigned.
    • +
    +
    +

    1999-12-21 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (medianFilter): New method.
    • +
    +
    +

    1999-12-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (density): Bug fix. Was not setting image x & y +density.
    • +
    +
    +

    1999-11-30 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (page): psPageSize() is renamed to page() and now +properly returns the attribute from the image.
    • +
    +
    +

    1999-11-25 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp: Rename transformColorSpace() to colorSpace(). +Added colorSpace() accessor method.
    • +
    +
    +

    1999-11-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Color.cpp: Re-implemented PixelPacket pointer so that it is +never NULL and added a 'valid' field for tracking object validity.
    • +
    +
    +

    1999-11-13 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (quantizeError): Eliminated method.
    • +
    +
    +

    1999-11-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (annotate & draw): Changed implementation to +reflect change to the way AnnotateInfo is managed by ImageMagick.
    • +
    +
    +

    1999-11-07 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (cacheThreshold): New method to set the pixel +cache threshold.
    • +
    • lib/Magick++/Include.h (Magick): Added new enumerations from +classify.h.
    • +
    +
    +

    1999-10-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Options.h (fontPointsize): Argument is now a double +to match change in ImageMagick.
    • +
    • lib/Image.cpp (fontPointsize): Argument is now a double to match +change in ImageMagick.
    • +
    +
    +

    1999-10-21 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Blob.cpp (BlobRef): Bugfix -- start blob reference count at +one rather than zero.
    • +
    +
    +

    1999-10-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (Image): Fixed Image constructors from Blob. The +image reference was not being instantiated as it should have been, +causing a crash.
    • +
    +
    +

    1999-10-05 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Blob.cpp: All blob length parameters are now of type size_t.
    • +
    • lib/Image.cpp (write): Length estimate is now of type size_t.
    • +
    +
    +

    1999-09-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (rotate): No longer accepts a crop option since +ImageMagick no longer supports this. +(shear): No longer accepts a crop option since ImageMagick no +longer supports this.
    • +
    +
    +

    1999-09-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp: +(rotate): No longer accepts sharpen argument. User must sharpen +seperately if desired. This change is due to a similar change in +ImageMagick 5.0. +(condense): Removed method. +(uncondense): Removed method. +(condensed): Removed method. +(pixelColor): Adapted to 5.0.
    • +
    • lib/Magick++/Color.h : Rewrote to efficiently use ImageMagick +5.0's PixelPacket color representation.
    • +
    • lib/Color.cpp : Rewrote to efficiently use ImageMagick 5.0's +PixelPacket color representation.
    • +
    +
    +

    1999-09-12 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (condensed): Bug fix. The condensed() method was +returning the opposite bool value than it should. Oops!
    • +
    +
    +

    1999-09-07 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Include.h (MagickLib): Eliminated requirement for +including <magick/define.h>.
    • +
    +
    +

    1999-08-07 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp: Added accessor methods for other key ImageMagick +structs.
    • +
    • lib/Options.cpp (penTexture): Fixed bug with removing texture +caused by change in Image constructor.
    • +
    • lib/Image.cpp: Changed strategy such that an Image containing a +null MagickLib::Image pointer is never constructed except for +under error conditions. Removed existing checks for null image +pointer on attribute methods. +Use image() and constImage() accessor methods as part of Image +implementation in order to clean-up code and ensure +const-correctness.
    • +
    +
    +

    1999-08-03 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/STL.h (Magick): Added STL function readImages(). +Not tested yet. +(Magick): Added STL function writeImages(). Not tested yet.
    • +
    • lib/Image.cpp: Removed support for 'text' attribute as this is +no longer present in ImageMagick as of 4.2.8.
    • +
    +
    +

    1999-07-21 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Image.cpp (condense): Skip condensing image if already +condensed. +(uncondense): Skip uncondensing image if not condensed. +(condensed): New method to test if image is condensed. +(classType): New method which supports conversion of the image +storage class. May result in loss of color information +(quantization is used) if a DirectClass image is converted to +PseudoClass.
    • +
    +
    +

    1999-07-18 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Magick++/Color.h (Magick::Color): Color parameters are now +stored in a MagickLib::RunlengthPacket structure which is +referenced via a pointer. This structure is either allocated by a +Magick::Color constructor or passed as an argument to a +Magick::Color constructor so that it may refer to to a +MagickLib::Image pixel. The owner of the structure is managed so +that the structure is only deleted if it was allocated by +Magick::Color.
    • +
    +
    +

    1999-07-09 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • overall : Removed 'Magick' prefix from all source file +names. Moved class headers to Magick++ subdirectory. This should +not break any code using the documented interface (via +Magick++.h).
    • +
    +
    +

    1999-07-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickImage.cpp (composite): Support composition placement +by gravity like PerlMagick does.
    • +
    +
    +

    1999-07-07 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickImage.cpp (Image): Added constructors to construct an +Image from a BLOB.
    • +
    +
    +

    1999-07-06 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • tests/manipulate.cpp (main): Wrote a basic sanity test for +reading and writing BLOBS.
    • +
    +
    +

    1999-06-21 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickImage.cpp (read): Added support for reading an encoded +image stored in a BLOB. Uses new ImageMagick APIs introduced on +July 21, 1999. +(write): Added support for writing an encoded image to a BLOB.
    • +
    +
    +

    1999-06-16 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickInclude.h : Use new <magick/api.h> interface to +ImageMagick to avoid namespace-induced problems.
    • +
    • configure.in : CPPFLAGS and LDFLAGS specified via the +environment take precidence over flags from Magick-config.
    • +
    +
    +

    1999-05-31 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickSTL.h (mapImages): New algorithm to map the sequence +of images to the color map of a provided image. +(quantizeImages): New algorithm to quantize a sequence of images +to a common color map.
    • +
    +
    +

    1999-05-24 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickBlob.cpp (updateNoCopy): New method to allow derived +classes to insert data into the base class without making a copy +of the data. This represents a transfer of ownership of the data +from the derived class to the base class.
    • +
    +
    +

    1999-05-23 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickColor.cpp (operator =): Adapted to new ImageMagick +4.2.6 as of 5/23/99 which removes X11 compatability functions.
    • +
    • lib/MagickGeometry.cpp (operator =): Adapted to new ImageMagick +4.2.6 as of 5/23/99 which removes X11 compatability functions.
    • +
    +
    +

    1999-05-17 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickBlob.cpp (Blob): Support default constructor for Blob.
    • +
    +
    +

    1999-05-16 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickSTL.h (transformColorSpaceImage): New unary function +object to invoke transformColorSpace on STL container object.
    • +
    • lib/MagickImage.cpp (transformColorSpace): New method to +transform the image data to a new colorspace.
    • +
    +
    +

    1999-05-15 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickImage.cpp (ping): Re-implemented to match (requested) +API change in ImageMagick 4.2.5. Method signature has changed to +be like 'read'. +(annotate): Added two new overloaded methods for text annotation +in order to support the new rotated text capability in ImageMagick +4.2.5. To accomplish this, the default for gravity had to be +removed from several methods. This may impact existing code. +Still not sure if this is the best set of method signatures.
    • +
    +
    +

    1999-05-13 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickImage.cpp (ping): New method to obtain image size in +bytes and geometry without the overhead of reading the complete +image. +(uncondense): New method to uncompress run-length encoded pixels +into a simple array to make them easy to operate on.
    • +
    +
    +

    1999-05-12 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickImage.cpp (comment): Passing an empty string as the +comment results in no comment at all rather than a comment with no +data.
    • +
    +
    +

    1999-05-11 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickImage.cpp (iccColorProfile): Implemented method to set +ICC color profile from opaque object in memory (must be formatted +outside of Magick++). +(iptcProfile): Implemented method to set IPTC profile from opaque +object in memory (must be formatted outside of Magick++).
    • +
    • lib/MagickBlob.cpp: New class to support managing user-supplied +opaque Binary Large OBjects (BLOBS) in the API. Reference counted +to improve semantics and to possibly reduce memory consumption.
    • +
    +
    +

    1999-05-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/Makefile.am (libMagick): Updated to use libtool 1.3 so that +shared library can be built.
    • +
    +
    +

    1999-04-25 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickImage.cpp (montageGeometry): Return Magick::Geometry +rather than std::string.
    • +
    +
    +

    1999-04-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickColor.cpp (alpha): Added support for setting alpha via +scaled-double to the Color class. The new method name is 'alpha'.
    • +
    +
    +

    1999-04-13 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • lib/MagickColor.cpp: Added support for setting an alpha value +(unscaled Quantum only) for use on DirectColor images that have +matte enabled. This requires ImageMagick 4.2.2 dated April 13, +1999 or later to compile since Cristy added a special flag to +allow testing to see if the user has specified an opacity value: +"I added XColorFlags to magick/classify.h. If DoMatte is set in +color->flags then the opacity value is valid in color->pixel."
    • +
    +
    +

    1999-04-11 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • demo/flip.cpp (main): New file. Demonstrates use of flipImage +function object as well as morphImages algorithm.
    • +
    +
    +

    1999-04-10 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

    +
    +
      +
    • tests/color.cpp : New file to support testing the Magick::Color +classes.
    • +
    • lib/MagickOptions.cpp: The ImageInfo filter member is now +ignored by ImageMagick (as of ImageMagick 4.2.2 April 10, 1998) so +support for setting it is removed. The Image filter member is +still updated. According to Cristy, this ImageMagick version +removes automatic sharpening of resized images. The blur member +is added to the Image structure. A blur value < 1 causes the image +to be sharpened when resizing while a value > 1 leaves the image +blurry. Magick++ does not yet support the blur member.
    • +
    +
    +
    + + diff --git a/www/Magick++/CoderInfo.html b/www/Magick++/CoderInfo.html index fbce6ab..de71301 100644 --- a/www/Magick++/CoderInfo.html +++ b/www/Magick++/CoderInfo.html @@ -3,7 +3,7 @@ - + Magick::CoderInfo Class @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -116,5 +116,10 @@ namespace Magick

    Copyright © Bob Friesenhahn 1999 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/Magick++/CoderInfo.html.orig b/www/Magick++/CoderInfo.html.orig new file mode 100644 index 0000000..113f65b --- /dev/null +++ b/www/Magick++/CoderInfo.html.orig @@ -0,0 +1,120 @@ + + + + + + +Magick::CoderInfo Class + + + + + + + +
    +

    Magick::CoderInfo Class

    + + + + +

    The CoderInfo class supports obtaining information about +GraphicsMagick support for an image format (designated by a magick +string). It may be used to provide support for a specific named format +(provided as an argument to the constructor), or as an element of a +container when format support is queried using the coderInfoList() +templated function.

    +

    The following code fragment illustrates how CoderInfo may be used:

    +
    +CoderInfo info("GIF");
    +cout << info->name() << ": (" << info->description() << ") : ";
    +cout << "Readable = ";
    +if ( info->isReadable() )
    +  cout << "true";
    +else
    +  cout << "false";
    +cout << ", ";
    +cout << "Writable = ";
    +if ( info->isWritable() )
    +  cout << "true";
    +else
    +  cout << "false";
    +cout << ", ";
    +cout << "Multiframe = ";
    +if ( info->isMultiframe() )
    +  cout << "true";
    +else
    +  cout << "false";
    +cout << endl;
    +
    +

    The definition of class 'Magick::CoderInfo' is:

    +
    +namespace Magick
    +{
    +  class MagickDLLDecl CoderInfo
    +  {
    +  public:
    +
    +    enum MatchType {
    +      AnyMatch,       // match any coder
    +      TrueMatch,      // match coder if true
    +      FalseMatch      // match coder if false
    +    };
    +
    +    // Default constructor
    +    CoderInfo ( void );
    +
    +    // Copy constructor
    +    CoderInfo ( const CoderInfo &coder_ );
    +
    +    // Construct with coder name
    +    CoderInfo ( const std::string &name_ );
    +
    +    // Destructor
    +    ~CoderInfo ( void );
    +
    +    // Format name
    +    std::string name( void ) const;
    +
    +    // Format description
    +    std::string description( void ) const;
    +
    +    // Format is readable
    +    bool isReadable( void ) const;
    +
    +    // Format is writeable
    +    bool isWritable( void ) const;
    +
    +    // Format supports multiple frames
    +    bool isMultiFrame( void ) const;
    +
    +    // Assignment operator
    +    CoderInfo& operator= (const CoderInfo &coder_ );
    +
    +  };
    +}
    +
    +

    Copyright © Bob Friesenhahn 1999 - 2020

    +
    + + diff --git a/www/Magick++/Color.html b/www/Magick++/Color.html index 54b52ca..3b5e173 100644 --- a/www/Magick++/Color.html +++ b/www/Magick++/Color.html @@ -3,7 +3,7 @@ - + Magick::Color Class @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -380,5 +380,10 @@ public:

    Copyright © Bob Friesenhahn 1999 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/Magick++/Color.html.orig b/www/Magick++/Color.html.orig new file mode 100644 index 0000000..c5e4966 --- /dev/null +++ b/www/Magick++/Color.html.orig @@ -0,0 +1,384 @@ + + + + + + +Magick::Color Class + + + + + + + +
    +

    Magick::Color Class

    + + + + +

    Color is the base color class in Magick++. It is a simple container +class for the pixel red, green, blue, and alpha values scaled to fit +GraphicsMagick's Quantum (number of bits in a color component value) +size. Normally users will instantiate a class derived from Color which +supports the color model that fits the needs of the application. The +Color class may be constructed directly from an X11-style color +string. As a perhaps odd design decision, the value transparent black +is considered to represent an unset value (invalid color) in many +cases. This choice was made since it avoided using more memory. The +default Color constructor constructs an invalid color +(i.e. transparent black) and may be used as a parameter in order to +remove a color setting.

    +
    +

    Quantum

    +

    The base type used to represent color samples in GraphicsMagick is the +Quantum type. Pixels are represented by a structure of Quantum +values. For example, an RGB pixel contains red, green, and blue +quantums, while an RGBA pixel contains red, green, blue, and opacity +quantums. The maximum value that a Quantum can attain is specified by +a constant value represented by the MaxRGB define, which is itself +determined by the number of bits in a Quantum. The QuantumDepth build +option determines the number of bits in a Quantum.

    +
    +
    +

    PixelPacket

    +

    PixelPacket is the internal representation of a pixel in +GraphicsMagick. GraphicsMagick may be compiled to support 32, 64, or +128 bit pixels of type PixelPacket. This is controlled by the value of +the QuantumDepth define. The default is 32 bit pixels +(QuantumDepth=8), which provides the best performance and the least +resource consumption. If additional color precision or range is +desired, then GraphicsMagick may be compiled with QuantumDepth=16 or +QuantumDepth=32. The following table shows the relationship between +QuantumDepth, the type of Quantum, and the overall PixelPacket size:

    + + +++++ + + + + + + + + + + + + + + + + + + + + +
    Effect Of QuantumDepth Values
    QuantumDepthQuantum TypedefPixelPacket Size
    8unsigned char32 bits
    16unsigned short64 bits
    32unsigned int128 bits
    +
    +
    +

    Color Class

    +

    The Color base class is not intended to be used directly. Normally a +user will construct a derived class or inherit from this class. Color +arguments are must be scaled to fit the Quantum size according to the +range of MaxRGB. The Color class contains a pointer to a PixelPacket, +which may be allocated by the Color class, or may refer to an existing +pixel in an image.

    +

    An alternate way to construct the class is via an X11-compatible color +specification string (e.g. Color(“red”) or Color (“#FF0000”)). Since +the class may be constructed from a string, convenient strings may be +passed in place of an explicit Color object in methods which accept a +reference to Color. Color may also be converted to a std::string for +convenience in user interfaces, and for saving settings to a text +file.

    +

    The following is the definition of the Color class:

    +
    +// Compare two Color objects regardless of LHS/RHS
    +int MagickDLLDecl operator == ( const Magick::Color& left_, const Magick::Color& right_ );
    +int MagickDLLDecl operator != ( const Magick::Color& left_, const Magick::Color& right_ );
    +int MagickDLLDecl operator >  ( const Magick::Color& left_, const Magick::Color& right_ );
    +int MagickDLLDecl operator <  ( const Magick::Color& left_, const Magick::Color& right_ );
    +int MagickDLLDecl operator >= ( const Magick::Color& left_, const Magick::Color& right_ );
    +int MagickDLLDecl operator <= ( const Magick::Color& left_, const Magick::Color& right_ );
    +
    +// Base color class stores RGB components scaled to fit Quantum
    +class MagickDLLDecl Color
    +{
    +public:
    +  Color ( Quantum red_,
    +          Quantum green_,
    +          Quantum blue_ );
    +  Color ( Quantum red_,
    +          Quantum green_,
    +          Quantum blue_,
    +          Quantum alpha_ );
    +  Color ( const std::string &x11color_ );
    +  Color ( const char * x11color_ );
    +  Color ( void );
    +  virtual        ~Color ( void );
    +  Color ( const Color & color_ );
    +
    +  // Red color (range 0 to MaxRGB)
    +  void           redQuantum ( Quantum red_ );
    +  Quantum        redQuantum ( void ) const;
    +
    +  // Green color (range 0 to MaxRGB)
    +  void           greenQuantum ( Quantum green_ );
    +  Quantum        greenQuantum ( void ) const;
    +
    +  // Blue color (range 0 to MaxRGB)
    +  void           blueQuantum ( Quantum blue_ );
    +  Quantum        blueQuantum ( void ) const;
    +
    +  // Alpha level (range OpaqueOpacity=0 to TransparentOpacity=MaxRGB)
    +  void           alphaQuantum ( Quantum alpha_ );
    +  Quantum        alphaQuantum ( void ) const;
    +
    +  // Scaled (to 1.0) version of alpha for use in sub-classes
    +  // (range opaque=0 to transparent=1.0)
    +  void           alpha ( double alpha_ );
    +  double         alpha ( void ) const;
    +
    +  // Does object contain valid color?
    +  void           isValid ( bool valid_ );
    +  bool           isValid ( void ) const;
    +
    +  // Set color via X11 color specification string
    +  const Color& operator= ( const std::string &x11color_ );
    +  const Color& operator= ( const char * x11color_ );
    +
    +  // Assignment operator
    +  Color& operator= ( const Color& color_ );
    +
    +  // Return X11 color specification string
    +  /* virtual */ operator std::string() const;
    +
    +  // Return ImageMagick PixelPacket
    +  operator PixelPacket() const;
    +
    +  // Construct color via ImageMagick PixelPacket
    +  Color ( const PixelPacket &color_ );
    +
    +  // Set color via ImageMagick PixelPacket
    +  const Color& operator= ( const PixelPacket &color_ );
    +
    +};
    +
    +
    +
    +

    Color Derived Classes

    +

    Available derived color specification classes are shown in the following table:

    + + ++++ + + + + + + + + + + + + + + + + + + + + + + +
    Color Derived Classes
    ClassDescription
    ColorRGBRepresentation of RGB color with red, green, and blue specified +as ratios (0 to 1)
    ColorGrayRepresentation of grayscale RGB color (equal parts red, green, +and blue) specified as a ratio (0 to 1)
    ColorMonoRepresentation of a black/white color (true/false)
    ColorHSLRepresentation of a color in Hue/Saturation/Luminosity (HSL) +colorspace
    ColorYUVRepresentation of a color in the YUV colorspace
    +
    +
    +

    ColorRGB

    +

    Representation of an RGB color in floating point. All color arguments +have a valid range of 0.0 - 1.0. Note that floating point alpha may be +set via the alpha() method in the Color base class:

    +
    +class ColorRGB : public Color
    +{
    +public:
    +  ColorRGB ( double red_, double green_, double blue_ );
    +  ColorRGB ( void );
    +  ColorRGB ( const Color & color_ );
    +  /* virtual */  ~ColorRGB ( void );
    +
    +  void           red ( double red_ );
    +  double         red ( void ) const;
    +
    +  void           green ( double green_ );
    +  double         green ( void ) const;
    +
    +  void           blue ( double blue_ );
    +  double         blue ( void ) const;
    +
    +  // Assignment operator from base class
    +  ColorRGB& operator= ( const Color& color_ );
    +
    +protected:
    +  // Constructor to construct with PixelPacket*
    +  ColorRGB ( PixelPacket* rep_, PixelType pixelType_ );
    +};
    +
    +
    +
    +

    ColorGray

    +

    Representation of a floating point grayscale color (in RGB +colorspace). Grayscale is simply RGB with equal parts of red, green, +and blue. All double arguments have a valid range of 0.0 - 1.0:

    +
    +class ColorGray : public Color
    +{
    +public:
    +  ColorGray ( double shade_ );
    +  ColorGray ( void );
    +  ColorGray ( const Color & color_ );
    +  /* virtual */ ~ColorGray ();
    +
    +  void           shade ( double shade_ );
    +  double         shade ( void ) const;
    +
    +  // Assignment operator from base class
    +  ColorGray& operator= ( const Color& color_ );
    +
    +};
    +
    +
    +
    +

    ColorMono

    +

    Representation of a black/white pixel (in RGB colorspace). Color +arguments are constrained to 'false' (black pixel) and 'true' (white +pixel):

    +
    +class ColorMono : public Color
    +{
    +public:
    +  ColorMono ( bool mono_ );
    +  ColorMono ( void );
    +  ColorMono ( const Color & color_ );
    +  /* virtual */ ~ColorMono ();
    +
    +  void           mono ( bool mono_ );
    +  bool           mono ( void ) const;
    +
    +  // Assignment operator from base class
    +  ColorMono& operator= ( const Color& color_ );
    +
    +};
    +
    +
    +
    +

    ColorHSL

    +

    Representation of a color in Hue/Saturation/Luminosity (HSL) colorspace:

    +
    +class MagickDLLDecl ColorHSL : public Color
    +{
    +public:
    +  ColorHSL ( double hue_, double saturation_, double luminosity_ );
    +  ColorHSL ( void );
    +  ColorHSL ( const Color & color_ );
    +  /* virtual */  ~ColorHSL ( );
    +
    +  void           hue ( double hue_ );
    +  double         hue ( void ) const;
    +
    +  void           saturation ( double saturation_ );
    +  double         saturation ( void ) const;
    +
    +  void           luminosity ( double luminosity_ );
    +  double         luminosity ( void ) const;
    +
    +  // Assignment operator from base class
    +  ColorHSL& operator= ( const Color& color_ );
    +
    +};
    +
    +
    +
    +

    ColorYUV

    +

    Representation of a color in YUV colorspace (used to encode color for +television transmission). Argument ranges are

    +
    + ++++ + + + + + + + + + + + +
    Y0.0 through 1.0
    U-0.5 through 0.5
    V-0.5 through 0.5
    +
    +
    +class ColorYUV : public Color
    +{
    +public:
    +  ColorYUV ( double y_, double u_, double v_ );
    +  ColorYUV ( void );
    +  ColorYUV ( const Color & color_ );
    +  /* virtual */ ~ColorYUV ( void );
    +
    +  void           u ( double u_ );
    +  double         u ( void ) const;
    +
    +  void           v ( double v_ );
    +  double         v ( void ) const;
    +
    +  void           y ( double y_ );
    +  double         y ( void ) const;
    +
    +  // Assignment operator from base class
    +  ColorYUV& operator= ( const Color& color_ );
    +
    +};
    +
    +

    Copyright © Bob Friesenhahn 1999 - 2020

    +
    +
    + + diff --git a/www/Magick++/Drawable.html b/www/Magick++/Drawable.html index b29da8d..58b2d27 100644 --- a/www/Magick++/Drawable.html +++ b/www/Magick++/Drawable.html @@ -3,7 +3,7 @@ - + Magick::Drawable @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -39,7 +39,7 @@
    -

    Contents

    +

    Contents

    • Coordinate structure
    • Drawable classes
    • @@ -180,7 +180,7 @@ public:

      Drawable classes

      Drawable classes represent objects to be drawn on the image.

      -

      Drawable classes

      +

      Drawable classes

      • DrawableAffine
      • DrawableArc
      • @@ -752,7 +752,7 @@ the object may be positioned on the image by preceding it with a coordinate transforms may be used to translate the origin in order to position the object, rotate it, skew it, or scale it.

        -

        Vector path commands

        +

        Vector path commands

        -

        Curve Commands

        +

        Curve Commands

        • Cubic Bézier curve commands
        • Quadratic Bézier curve commands
        • @@ -914,7 +914,7 @@ point, and one control point.

          Cubic Bézier curve commands

          -

          Cubic Bézier curve commands

          +

          Cubic Bézier curve commands

          • PathCurvetoArgs
          • PathCurvetoAbs
          • @@ -1003,7 +1003,7 @@ PathSmoothCurvetoRel ( const CoordinateList &coordinates_ );

            Quadratic Bézier curve commands

            -

            Quadratic Bézier curve commands

            +

            Quadratic Bézier curve commands

            + +
            +
            +

            Copyright © GraphicsMagick Group 2002 - 2020

            +
            diff --git a/www/Magick++/Drawable.html.orig b/www/Magick++/Drawable.html.orig new file mode 100644 index 0000000..f8cd0a6 --- /dev/null +++ b/www/Magick++/Drawable.html.orig @@ -0,0 +1,1127 @@ + + + + + + +Magick::Drawable + + + + + + + +
            +

            Magick::Drawable

            + + + + + +

            Drawable provides a convenient interface for preparing vector, image, +or text arguments for the Image::draw() method. Each instance of a +Drawable sub-class represents a single drawable object. Drawable +objects may be drawn "one-by-one" via multiple invocations of the +Image draw() method, or may be drawn +"all-at-once" by passing a list of Drawable objects to the Image +draw() method. The one-by-one approach is +convenient for simple drawings, while the list-based approach is +appropriate for drawings which require more sophistication.

            +

            The following is an example using the Drawable subclasses with a +one-by-one approach to draw the following figure:

            +Figure showing drawing example +
            +#include <string>
            +#include <iostream>
            +#include <Magick++.h>
            +
            +using namespace std;
            +using namespace Magick;
            +
            +int main(int /*argc*/,char **argv)
            +{
            +  try {
            +    InitializeMagick(*argv);
            +
            +    // Create base image (white image of 300 by 200 pixels)
            +    Image image( Geometry(300,200), Color("white") );
            +
            +    // Set draw options
            +    image.strokeColor("red"); // Outline color
            +    image.fillColor("green"); // Fill color
            +    image.strokeWidth(5);
            +
            +    // Draw a circle
            +    image.draw( DrawableCircle(100,100, 50,100) );
            +
            +    // Draw a rectangle
            +    image.draw( DrawableRectangle(200,200, 270,170) );
            +
            +    // Display the result
            +    image.display( );
            +  }
            +  catch( exception &error_ )
            +    {
            +      cout << "Caught exception: " << error_.what() << endl;
            +      return 1;
            +    }
            +
            +  return 0;
            +}
            +
            +

            Since Drawable is an object it may be saved in an array or a list for +later (perhaps repeated) use. The following example shows how to draw +the same figure using the list-based approach:

            +
            +#include <string>
            +#include <iostream>
            +#include <list>
            +#include <Magick++.h>
            +
            +using namespace std;
            +using namespace Magick;
            +
            +int main(int /*argc*/,char **/*argv*/)
            +{
            +  try {
            +
            +    InitializeMagick(*argv);
            +
            +    // Create base image (white image of 300 by 200 pixels)
            +    Image image( Geometry(300,200), Color("white") );
            +
            +    // Construct drawing list
            +    std::list<Magick::Drawable> drawList;
            +
            +    // Add some drawing options to drawing list
            +    drawList.push_back(DrawableStrokeColor("red")); // Outline color
            +    drawList.push_back(DrawableStrokeWidth(5)); // Stroke width
            +    drawList.push_back(DrawableFillColor("green")); // Fill color
            +
            +    // Add a Circle to drawing list
            +    drawList.push_back(DrawableCircle(100,100, 50,100));
            +
            +    // Add a Rectangle to drawing list
            +    drawList.push_back(DrawableRectangle(200,100, 270,170));
            +
            +    // Draw everything using completed drawing list
            +    image.draw(drawList);
            +
            +    // Display the result
            +    image.display( );
            +  }
            +  catch( exception &error_ )
            +    {
            +      cout << "Caught exception: " << error_.what() << endl;
            +      return 1;
            +    }
            +
            +  return 0;
            +}
            +
            +
            +

            Coordinate structure

            +

            Drawable depends on the simple Coordinate structure which represents a +pair of x,y coodinates. The Coordinate structure is defined as +follows:

            +
            +class Coordinate
            +{
            +public:
            +
            +  // Default Constructor
            +  Coordinate ( void );
            +
            +  // Constructor, setting first & second
            +  Coordinate ( double x_, double y_ );
            +
            +  // Destructor
            +  virtual ~Coordinate ();
            +
            +  // x coordinate member
            +  void   x ( double x_ );
            +  double x ( void ) const;
            +
            +  // y coordinate member
            +  void   y ( double y_ );
            +  double y ( void ) const;
            +};
            +
            +
            +
            +

            Drawable classes

            +

            Drawable classes represent objects to be drawn on the image.

            + +
            +

            DrawableAffine

            +

            Specify a transformation matrix to adjust scaling, rotation, and +translation (coordinate transformation) for subsequently drawn objects +in the same or decendent drawing context. The sx_ & sy_ parameters +represent the x & y scale factors, the rx_ & ry_ parameters represent +the x & y rotation, and the tx_ & ty_ parameters represent the x & y +translation:

            +
            +DrawableAffine ( double sx_, double sy_,
            +                 double rx_, double ry_,
            +                 double tx_, double ty_ );
            +
            +

            Specify a transformation matrix to adjust scaling, rotation, and +translation (coordinate transformation) for subsequently drawn objects +in the same or decendent drawing context. Initialized to unity (no +effect) affine values. Use class methods (not currently documented but +defined in the Drawable.h header file) to adjust individual parameters +from their unity values:

            +
            +DrawableAffine ( void );
            +
            +
            +
            +

            DrawableArc

            +

            Draw an arc using the stroke color and based on the circle starting at +coordinates startX_,`startY_`, and ending with coordinates +endX_,`endY_`, and bounded by the rotational arc +startDegrees_,`endDegrees_`:

            +
            +DrawableArc ( double startX_, double startY_,
            +              double endX_, double endY_,
            +              double startDegrees_, double endDegrees_ );
            +
            +
            +
            +

            DrawableBezier

            +

            Draw a bezier curve using the stroke color and based on the +coordinates specified by the coordinates_ list:

            +
            +DrawableBezier ( const CoordinateList &coordinates_ );
            +
            +
            +
            +

            DrawableClipPath

            +

            Select a drawing clip path matching id_:

            +
            +DrawableClipPath ( const std::string &id_ );
            +
            +
            +
            +

            DrawableCircle

            +

            Draw a circle using the stroke color and thickness using specified +origin and perimeter coordinates. If a fill color is specified, then +the object is filled:

            +
            +DrawableCircle ( double originX_, double originY_,
            +                 double perimX_, double perimY_ )
            +
            +
            +
            +

            DrawableColor

            +

            Color image according to paintMethod. The point method recolors the +target pixel. The replace method recolors any pixel that matches the +color of the target pixel. Floodfill recolors any pixel that matches +the color of the target pixel and is a neighbor, whereas filltoborder +recolors any neighbor pixel that is not the border color. Finally, +reset recolors all pixels:

            +
            +DrawableColor ( double x_, double y_,
            +                PaintMethod paintMethod_ )
            +
            +
            +
            +

            DrawableCompositeImage

            +

            Composite current image with contents of specified image, at specified +coordinates. If the matte attribute is set to true, then the image +composition will consider an alpha channel, or transparency, present +in the image file so that non-opaque portions allow part (or all) of +the composite image to show through:

            +
            +DrawableCompositeImage ( double x_, double y_,
            +                         const std::string &filename_ );
            +DrawableCompositeImage ( double x_, double y_,
            +                         const Image &image_ );
            +
            +

            Composite current image with contents of specified image, rendered +with specified width and height, at specified coordinates. If the +matte attribute is set to true, then the image composition will +consider an alpha channel, or transparency, present in the image file +so that non-opaque portions allow part (or all) of the composite image +to show through. If the specified width or height is zero, then the +image is composited at its natural size, without enlargement or +reduction:

            +
            +DrawableCompositeImage ( double x_, double y_,
            +                         double width_, double height_,
            +                         const std::string &filename_ );
            +
            +DrawableCompositeImage ( double x_, double y_,
            +                         double width_, double height_,
            +                         const Image &image_ );
            +
            +

            Composite current image with contents of specified image, rendered +with specified width and height, using specified composition +algorithm, at specified coordinates. If the matte attribute is set to +true, then the image composition will consider an alpha channel, or +transparency, present in the image file so that non-opaque portions +allow part (or all) of the composite image to show through. If the +specified width or height is zero, then the image is composited at its +natural size, without enlargement or reduction:

            +
            +DrawableCompositeImage ( double x_, double y_,
            +                         double width_, double height_,
            +                         const std::string &filename_,
            +                         CompositeOperator composition_ );
            +
            +DrawableCompositeImage ( double x_, double y_,
            +                         double width_, double height_,
            +                         const Image &image_,
            +                         CompositeOperator composition_ );
            +
            +
            +
            +

            DrawableDashArray

            +

            Specify the pattern of dashes and gaps used to stroke paths. The +strokeDashArray represents a zero-terminated 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. A typical strokeDashArray_ array +might contain the members 5 3 2 0, where the zero value indicates the +end of the pattern array:

            +
            +DrawableDashArray( const double* dasharray_ );
            +
            +
            +
            +

            DrawableDashOffset

            +

            Specify the distance into the dash pattern to start the dash. See +documentation on SVG's stroke-dashoffset +property for usage details:

            +
            +DrawableDashOffset ( const double offset_ )
            +
            +
            +
            +

            DrawableEllipse

            +

            Draw an ellipse using the stroke color and thickness, specified +origin, x & y radius, as well as specified start and end of arc in +degrees. If a fill color is specified, then the object is filled:

            +
            +DrawableEllipse ( double originX_, double originY_,
            +                  double radiusX_, double radiusY_,
            +                  double arcStart_, double arcEnd_ )
            +
            +
            +
            +

            DrawableFillColor

            +

            Specify drawing object fill color:

            +
            +DrawableFillColor ( const Color &color_ );
            +
            +
            +

            DrawableFillRule

            +

            Specify the algorithm which is to be used to determine what parts of +the canvas are included inside the shape. See documentation on SVG's +fill-rule +property for usage details:

            +
            +DrawableFillRule ( const FillRule fillRule_ )
            +
            +
            +
            +

            DrawableFillOpacity

            +

            Specify opacity to use when drawing using fill color:

            +
            +DrawableFillOpacity ( double opacity_ )
            +
            +
            +
            +

            DrawableFont

            +

            Specify font family, style, weight (one of the set { 100 | 200 | 300 | +400 | 500 | 600 | 700 | 800 | 900 } with 400 being the normal size), +and stretch to be used to select the font used when drawing +text. Wildcard matches may be applied to style via the AnyStyle +enumeration, applied to weight if weight is zero, and applied to +stretch via the AnyStretch enumeration:

            +
            +DrawableFont ( const std::string &font_ );
            +
            +DrawableFont ( const std::string &family_,
            +               StyleType style_,
            +               const unsigned long weight_,
            +               StretchType stretch_ );
            +
            +
            +
            +

            DrawableGravity

            +

            Specify text positioning gravity:

            +
            +DrawableGravity ( GravityType gravity_ )
            +
            +
            +
            +

            DrawableLine

            +

            Draw a line using stroke color and thickness using starting and ending +coordinates:

            +
            +DrawableLine ( double startX_, double startY_,
            +               double endX_, double endY_ )
            +
            +
            +
            +

            DrawableMatte

            +

            Change the pixel matte value to transparent. The point method changes +the matte value of the target pixel. The replace method changes the +matte value of any pixel that matches the color of the target +pixel. Floodfill changes the matte value of any pixel that matches the +color of the target pixel and is a neighbor, whereas filltoborder +changes the matte value of any neighbor pixel that is not the border +color, Finally reset changes the matte value of all pixels:

            +
            +DrawableMatte ( double x_, double y_,
            +                PaintMethod paintMethod_ )
            +
            +
            +
            +

            DrawableMiterLimit

            +

            Specify 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'. The default value of this parameter is 4:

            +
            +DrawableMiterLimit ( unsigned int miterlimit_ )
            +
            +
            +
            +

            DrawablePath

            +

            Draw on image using vector path:

            +
            +DrawablePath ( const VPathList &path_ );
            +
            +
            +
            +

            DrawablePoint

            +

            Draw a point using stroke color and thickness at coordinate:

            +
            +DrawablePoint ( double x_, double y_ )
            +
            +
            +
            +

            DrawablePointSize

            +

            Set font point size:

            +
            +DrawablePointSize ( double pointSize_ )
            +
            +
            +
            +

            DrawablePolygon

            +

            Draw an arbitrary polygon using stroke color and thickness consisting +of three or more coordinates contained in an STL list. If a fill color +is specified, then the object is filled:

            +
            +DrawablePolygon ( const CoordinateList &coordinates_ )
            +
            +
            +
            +

            DrawablePolyline

            +

            Draw an arbitrary polyline using stroke color and thickness consisting +of three or more coordinates contained in an STL list. If a fill color +is specified, then the object is filled:

            +
            +DrawablePolyline ( const CoordinateList &coordinates_ )
            +
            +
            +
            +

            DrawablePopClipPath

            +

            Pop (terminate) clip path definition started by DrawablePushClipPath:

            +
            +DrawablePopClipPath ( void )
            +
            +
            +
            +

            DrawablePopGraphicContext

            +

            Pop Graphic Context. Removing the current graphic context from the +graphic context stack restores the options to the values they had +prior to the preceding DrawablePushGraphicContext operation:

            +
            +DrawablePopGraphicContext ( void )
            +
            +
            +
            +

            DrawablePushClipPath

            +

            Push (create) clip path definition with id_. Clip patch definition +consists of subsequent drawing commands, terminated by +DrawablePopClipPath:

            +
            +DrawablePushClipPath ( const std::string &id_)
            +
            +
            +
            +

            DrawablePushGraphicContext

            +

            Push Graphic Context. When a graphic context is pushed, options set +after the context is pushed (such as coordinate transformations, color +settings, etc.) are saved to a new graphic context. This allows +related options to be saved on a graphic context "stack" in order to +support heirarchical nesting of options. When +DrawablePopGraphicContext is used to pop the current graphic context, +the options in effect during the last DrawablePushGraphicContext +operation are restored:

            +
            +DrawablePushGraphicContext ( void )
            +
            +
            +
            +

            DrawablePushPattern

            +

            Start a pattern definition with arbitrary pattern name specified by +id_, pattern offset specified by x_ and y_, and pattern size +specified by width_ and height_. The pattern is defined within the +coordinate system defined by the specified offset and size. Arbitrary +drawing objects (including DrawableCompositeImage) may be specified +between DrawablePushPattern and DrawablePopPattern in order to draw +the pattern. Normally the pair DrawablePushGraphicContext & +DrawablePopGraphicContext are used to enclose a pattern +definition. Pattern definitions are terminated by a +DrawablePopPattern object:

            +
            +DrawablePushPattern ( const std::string &id_, long x_, long y_,
            +                      long width_, long height_ )
            +
            +
            +
            +

            DrawablePopPattern

            +

            Terminate a pattern definition started via DrawablePushPattern:

            +
            +DrawablePopPattern ( void )
            +
            +
            +
            +

            DrawableRectangle

            +

            Draw a rectangle using stroke color and thickness from upper-left +coordinates to lower-right coordinates. If a fill color is specified, +then the object is filled:

            +
            +DrawableRectangle ( double upperLeftX_, double upperLeftY_,
            +                    double lowerRightX_, double lowerRightY_ )
            +
            +
            +
            +

            DrawableRotation

            +

            Set rotation to use when drawing (coordinate transformation):

            +
            +DrawableRotation ( double angle_ )
            +
            +
            +
            +

            DrawableRoundRectangle

            +

            Draw a rounded rectangle using stroke color and thickness, with +specified center coordinate, specified width and height, and specified +corner width and height. If a fill color is specified, then the +object is filled:

            +
            +DrawableRoundRectangle ( double centerX_, double centerY_,
            +                         double width_, double hight_,
            +                         double cornerWidth_, double cornerHeight_ )
            +
            +
            +
            +

            DrawableScaling

            +

            Apply scaling in x and y direction while drawing objects (coordinate +transformation):

            +
            +DrawableScaling ( double x_, double y_ )
            +
            +
            +
            +

            DrawableSkewX

            +

            Apply Skew in X direction (coordinate transformation):

            +
            +DrawableSkewX ( double angle_ )
            +
            +
            +
            +

            DrawableSkewY

            +

            Apply Skew in Y direction:

            +
            +DrawableSkewY ( double angle_ )
            +
            +
            +
            +

            DrawableStrokeAntialias

            +

            Antialias while drawing lines or object outlines:

            +
            +DrawableStrokeAntialias ( bool flag_ )
            +
            +
            +
            +

            DrawableStrokeColor

            +

            Set color to use when drawing lines or object outlines:

            +
            +DrawableStrokeColor ( const Color &color_ )
            +
            +
            +
            +

            DrawableStrokeLineCap

            +

            Specify the shape to be used at the end of open subpaths when they are +stroked. Values of LineCap are UndefinedCap, ButtCap, RoundCap, and +SquareCap:

            +
            +DrawableStrokeLineCap ( LineCap linecap_ )
            +
            +
            +
            +

            DrawableStrokeLineJoin

            +

            Specify 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:

            +
            +DrawableStrokeLineJoin ( LineJoin linejoin_ )
            +
            +
            +
            +

            DrawableStrokeOpacity

            +

            Opacity to use when drawing lines or object outlines:

            +
            +DrawableStrokeOpacity ( double opacity_ )
            +
            +
            +
            +

            DrawableStrokeWidth

            +

            Set width to use when drawing lines or object outlines:

            +
            +DrawableStrokeWidth ( double width_ )
            +
            +
            +
            +

            DrawableText

            +

            Annotate image with text using stroke color, font, font pointsize, and +box color (text background color), at specified coordinates. If text +contains special format characters the +image filename, type, width, height, or other image attributes may be +incorporated in the text (see label()):

            +
            +DrawableText ( const double x_, const double y_,
            +               const std::string &text_ )
            +
            +

            Annotate image with text represented with text encoding, using current +stroke color, font, font pointsize, and box color (text background +color), at specified coordinates. If text contains special format +characters the image filename, type, width, +height, or other image attributes may be incorporated in the text (see +label()).

            +

            The text encoding 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:

            +
            +DrawableText ( const double x_, const double y_,
            +               const std::string &text_, const std::string &encoding_)
            +
            +
            +
            +

            DrawableTextAntialias

            +

            Antialias while drawing text (default true). The main reason to +disable text antialiasing is to avoid adding new colors to the image:

            +
            +DrawableTextAntialias ( bool flag_ )
            +
            +
            +
            +

            DrawableTextDecoration

            +

            Specify decoration (e.g. UnderlineDecoration) to apply to text:

            +
            +DrawableTextDecoration ( DecorationType decoration_ )
            +
            +
            +
            +

            DrawableTextUnderColor

            +

            Draw a box under rendered text using the specified color:

            +
            +DrawableTextUnderColor ( const Color &color_ )
            +
            +
            +
            +

            DrawableTranslation

            +

            Apply coordinate translation (set new coordinate origin):

            +
            +DrawableTranslation ( double x_, double y_ )
            +
            +
            +
            +

            DrawableViewbox

            +

            Dimensions of the output viewbox. If the image is to be written to a +vector format (e.g. MVG or SVG), then a DrawablePushGraphicContext +object should be pushed to the head of the list, followed by a +DrawableViewbox object to establish the output canvas size. A +matching DrawablePopGraphicContext object should be pushed to the +tail of the list:

            +
            +DrawableViewbox(unsigned long x1_, unsigned long y1_,
            +                unsigned long x2_, unsigned long y2_)
            +
            +
            +
            +
            +

            Vector Path Classes

            +

            The vector paths supported by Magick++ are based on those supported by +the SVG XML specification. Vector paths are not directly +drawable, they must first be supplied as a constructor argument to the +DrawablePath class in order to create a drawable object. The +DrawablePath class effectively creates a drawable compound component +which may be replayed as desired. If the drawable compound component +consists only of vector path objects using relative coordinates then +the object may be positioned on the image by preceding it with a +DrawablePath which sets the current drawing coordinate. Alternatively +coordinate transforms may be used to translate the origin in order to position the object, rotate it, +skew it, or scale it.

            + +
            +

            The "moveto" commands

            +

            The "moveto" commands establish a new current point. The effect is as +if the "pen" were lifted and moved to a new location. A path data +segment must begin with either one of the "moveto" commands or one of +the "arc" commands. Subsequent "moveto" commands (i.e., when the +"moveto" is not the first command) represent the start of a new +subpath.

            +

            Start a new sub-path at the given coordinate. PathMovetoAbs indicates +that absolute coordinates will follow; PathMovetoRel indicates that +relative coordinates will follow. If a relative moveto appears as the +first element of the path, then it is treated as a pair of absolute +coordinates. If a moveto is followed by multiple pairs of coordinates, +the subsequent pairs are treated as implicit lineto commands.

            +
            +

            PathMovetoAbs

            +

            Simple moveto:

            +
            +PathMovetoAbs ( const Magick::Coordinate &coordinate_ )
            +
            +

            Moveto followed by implicit linetos:

            +
            +PathMovetoAbs ( const CoordinateList &coordinates_ )
            +
            +
            +
            +

            PathMovetoRel

            +

            Simple moveto:

            +
            +PathMovetoRel ( const Magick::Coordinate &coordinate_ );
            +
            +

            Moveto followed by implicit linetos:

            +
            +PathMovetoRel ( const CoordinateList &coordinates_ );
            +
            +
            +
            +
            +

            The "closepath" command

            +

            The "closepath" command causes an automatic straight line to be drawn from the current point to the initial point of the current subpath.

            +
            +

            PathClosePath

            +

            Close the current subpath by drawing a straight line from the current +point to current subpath's most recent starting point (usually, the +most recent moveto point):

            +
            +PathClosePath ( void )
            +
            +
            +
            +
            +

            The "lineto" commands

            +

            The various "lineto" commands draw straight lines from the current +point to a new point.

            +
            +

            PathLinetoAbs

            +

            Draw a line from the current point to the given coordinate which +becomes the new current point. PathLinetoAbs indicates that absolute +coordinates are used. A number of coordinates pairs may be specified +in a list to draw a polyline. At the end of the command, the new +current point is set to the final set of coordinates provided.

            +

            Draw to a single point:

            +
            +PathLinetoAbs ( const Magick::Coordinate& coordinate_  );
            +
            +

            Draw to multiple points:

            +
            +PathLinetoAbs ( const CoordinateList &coordinates_ );
            +
            +
            +
            +

            PathLinetoRel

            +

            Draw a line from the current point to the given coordinate which +becomes the new current point. PathLinetoRel indicates that relative +coordinates are used. A number of coordinates pairs may be specified +in a list to draw a polyline. At the end of the command, the new +current point is set to the final set of coordinates provided.

            +

            Draw to a single point:

            +
            +PathLinetoRel ( const Magick::Coordinate& coordinate_ );
            +
            +

            Draw to multiple points:

            +
            +PathLinetoRel ( const CoordinateList &coordinates_ );
            +
            +
            +
            +

            PathLinetoHorizontalAbs

            +

            Draws a horizontal line from the current point (cpx, cpy) to (x, +cpy). PathLinetoHorizontalAbs indicates that absolute coordinates +are supplied. At the end of the command, the new current point +becomes (x, cpy) for the final value of x:

            +
            +PathLinetoHorizontalAbs ( double x_ )
            +
            +
            +
            +

            PathLinetoHorizontalRel

            +

            Draws a horizontal line from the current point (cpx, cpy) to (x, +cpy). PathLinetoHorizontalRel indicates that relative coordinates +are supplied. At the end of the command, the new current point becomes +(x, cpy) for the final value of x:

            +
            +PathLinetoHorizontalRel ( double x_ )
            +
            +
            +
            +

            PathLinetoVerticalAbs

            +

            Draws a vertical line from the current point (cpx, cpy) to (cpx, +y). PathLinetoVerticalAbs indicates that absolute coordinates are +supplied. At the end of the command, the new current point becomes +(cpx, y) for the final value of y:

            +
            +PathLinetoVerticalAbs ( double y_ )
            +
            +
            +
            +

            PathLinetoVerticalRel

            +

            Draws a vertical line from the current point (cpx, cpy) to (cpx, y). +PathLinetoVerticalRel indicates that relative coordinates are +supplied. At the end of the command, the new current point becomes +(cpx, y) for the final value of y:

            +
            +PathLinetoVerticalRel ( double y_ )
            +
            +
            +
            +
            +

            Curve commands

            +

            These three groups of commands draw curves:

            +
              +
            • Cubic Bézier commands.

              +

              A cubic Bézier segment is defined by a start point, an end point, +and two control points.

              +
            • +
            • Quadratic Bézier commands.

              +

              A quadratic Bézier segment is defined by a start point, an end +point, and one control point.

              +
            • +
            • Elliptical arc commands.

              +

              An elliptical arc segment draws a segment of an ellipse.

              +
            • +
            + +
            +

            Cubic Bézier curve commands

            + +
            +

            PathCurvetoArgs

            +

            The cubic Bézier commands depend on the PathCurvetoArgs argument +class, which has the constructor signature:

            +
            +PathCurvetoArgs( double x1_, double y1_,
            +                 double x2_, double y2_,
            +                 double x_, double y_ );
            +
            +

            PathCurveto:

            +

            Draws a cubic Bézier 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. PathCurvetoAbs indicates that absolutecoordinates will follow; +PathCurvetoRel indicates that relative coordinates will +follow. Multiple sets of coordinates may be specified to draw a +polybezier. At the end of the command, the new current point becomes +the final (x,*y*) coordinate pair used in the polybezier.

            +
            +
            +

            PathCurvetoAbs

            +

            Draw a single curve:

            +
            +PathCurvetoAbs ( const PathCurvetoArgs &args_ );
            +
            +

            Draw multiple curves:

            +
            +PathCurvetoAbs ( const PathCurveToArgsList &args_ );
            +
            +
            +
            +

            PathCurvetoRel

            +

            Draw a single curve:

            +
            +PathCurvetoRel ( const PathCurvetoArgs &args_ );
            +
            +

            Draw multiple curves:

            +
            +PathCurvetoRel ( const PathCurveToArgsList &args_ );
            +
            +

            PathSmoothCurveto:

            +

            Draws a cubic Bézier curve from the current point to (x,y). 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 +PathCurvetoAbs, PathCurvetoRel, PathSmoothCurvetoAbs or +PathSmoothCurvetoRel, 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). PathSmoothCurvetoAbs +indicates that absolute coordinates will follow; PathSmoothCurvetoRel +indicates that relative coordinates will follow. Multiple sets of +coordinates may be specified to draw a polybezier. At the end of the +command, the new current point becomes the final (x,y) coordinate pair +used in the polybezier.

            +
            +
            +

            PathSmoothCurvetoAbs

            +

            Draw a single curve:

            +
            +PathSmoothCurvetoAbs ( const Magick::Coordinate &coordinates_ );
            +
            +

            Draw multiple curves

            +
            +PathSmoothCurvetoAbs ( const CoordinateList &coordinates_ );
            +
            +
            +

            PathSmoothCurvetoRel

            +

            Draw a single curve:

            +
            +PathSmoothCurvetoRel ( const Coordinate &coordinates_ );
            +
            +

            Draw multiple curves:

            +
            +PathSmoothCurvetoRel ( const CoordinateList &coordinates_ );
            +
            +
            +
            +
            +

            Quadratic Bézier curve commands

            + +
            +

            PathQuadraticCurvetoArgs

            +

            The quadratic Bézier commands depend on the PathQuadraticCurvetoArgs +argument class, which has the constructor signature:

            +
            +PathQuadraticCurvetoArgs( double x1_, double y1_,
            +                          double x_, double y_ );
            +
            +
            +
            +

            PathQuadraticCurvetoAbs

            +

            Draw a single curve:

            +
            +PathQuadraticCurvetoAbs ( const Magick::PathQuadraticCurvetoArgs &args_ );
            +
            +

            Draw multiple curves:

            +
            +PathQuadraticCurvetoAbs ( const PathQuadraticCurvetoArgsList &args_ );
            +
            +
            +
            +

            PathQuadraticCurvetoRel

            +

            Draw a single curve:

            +
            +PathQuadraticCurvetoRel ( const Magick::PathQuadraticCurvetoArgs &args_ );
            +
            +

            Draw multiple curves:

            +
            +PathQuadraticCurvetoRel ( const PathQuadraticCurvetoArgsList &args_ );
            +
            +
            +
            +

            PathSmoothQuadraticCurvetoAbs

            +

            Draw a single curve:

            +
            +PathSmoothQuadraticCurvetoAbs ( const Magick::Coordinate &coordinate_ );
            +
            +

            Draw multiple curves:

            +
            +PathSmoothQuadraticCurvetoAbs ( const CoordinateList &coordinates_ );
            +
            +
            +
            +

            PathSmoothQuadraticCurvetoRel

            +

            Draw a single curve:

            +
            +PathSmoothQuadraticCurvetoRel ( const Magick::Coordinate &coordinate_ );
            +
            +

            Draw multiple curves:

            +
            +PathSmoothQuadraticCurvetoRel ( const CoordinateList &coordinates_ );
            +
            +
            +
            +
            +

            Elliptical arc curve commands

            +
            +

            Elliptical arc curve commands

            + +
            +
            +

            PathArcArgs

            +

            The elliptical arc curve commands depend on the PathArcArgs argument +class, which has the constructor signature:

            +
            +PathArcArgs( double radiusX_, double radiusY_,
            +             double xAxisRotation_, bool largeArcFlag_,
            +             bool sweepFlag_, double x_, double y_ );
            +
            +

            Draws an elliptical arc from the current point to (x, y). The size and +orientation of the ellipse are defined by two radii (radiusX, radiusY) +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 automatically 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.

            +
            +
            +

            PathArcAbs

            +

            Draw a single arc segment:

            +
            +PathArcAbs ( const PathArcArgs &coordinates_ );
            +
            +

            Draw multiple arc segments:

            +
            +PathArcAbs ( const PathArcArgsList &coordinates_ );
            +
            +
            +
            +

            PathArcRel

            +

            Draw a single arc segment:

            +
            +PathArcRel ( const PathArcArgs &coordinates_ );
            +
            +

            Draw multiple arc segments:

            +
            +PathArcRel ( const PathArcArgsList &coordinates_ );
            +
            +

            Copyright © Bob Friesenhahn 1999 - 2020

            +
            +
            +
            +
            +
            + + diff --git a/www/Magick++/Enumerations.html b/www/Magick++/Enumerations.html index ab813b0..6528a18 100644 --- a/www/Magick++/Enumerations.html +++ b/www/Magick++/Enumerations.html @@ -3,7 +3,7 @@ - + Enumerations @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
            - - -   + + + 
            @@ -39,7 +39,7 @@
            -

            Magick++ Enumerations

            +

            Magick++ Enumerations

            • ChannelType
            • ClassType
            • @@ -1317,5 +1317,10 @@ enumeration may be specified for a wildcard match.

              Copyright © Bob Friesenhahn 1999 - 2020

            + +
            +
            +

            Copyright © GraphicsMagick Group 2002 - 2020

            +
            diff --git a/www/Magick++/Enumerations.html.orig b/www/Magick++/Enumerations.html.orig new file mode 100644 index 0000000..f08d76d --- /dev/null +++ b/www/Magick++/Enumerations.html.orig @@ -0,0 +1,1321 @@ + + + + + + +Enumerations + + + + + + + +
            +

            Enumerations

            + + + + + +
            +

            ChannelType

            +

            ChannelType is used as an argument when doing color separations. Use +ChannelType when extracting a layer from an image. MatteChannel is +useful for extracting the opacity values from an image. Note that an +image may be represented in RGB, RGBA, CMYK, or CMYKA, pixel formats +and a channel may only be extracted if it is valid for the current +pixel format.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            ChannelType
            EnumerationDescription
            UndefinedChannelUnset value.
            RedChannelRGB Red channel
            CyanChannelCMYK Cyan channel
            GreenChannelRGB Green channel
            MagentaChannelCMYK Magenta channel
            BlueChannelRGB Blue channel
            YellowChannelCMYK Yellow channel
            OpacityChannelOpacity channel (inverse of transparency)
            BlackChannelCMYK Black (K) channel
            MatteChannelSame as Opacity channel (deprecated)
            AllChannelsAll color channels
            GrayChannelColor channels represent an intensity
            +
            +
            +

            ClassType

            +

            ClassType specifies the image storage class.

            + + ++++ + + + + + + + + + + + + + + + + +
            ClassType
            EnumerationDescription
            UndefinedClassUnset value.
            DirectClassImage is composed of pixels which represent +literal color values.
            PseudoClassImage is composed of pixels which specify an index +in a color palette.
            +
            +
            +

            ColorspaceType

            +

            The ColorspaceType enumeration is used to specify the colorspace that +quantization (color reduction and mapping) is done under or to specify +the colorspace when encoding an output image. Colorspaces are ways of +describing colors to fit the requirements of a particular application +(e.g. Television, offset printing, color monitors). Color reduction, +by default, takes place in the RGBColorspace. Empirical evidence +suggests that distances in color spaces such as YUVColorspace or +YIQColorspace correspond to perceptual color differences more closely +han do distances in RGB space. These color spaces may give better +results when color reducing an image. Refer to quantize for more +details.

            +

            When encoding an output image, the colorspaces RGBColorspace, +CMYKColorspace, GRAYColorspace, or YCbCrColorspace may be +specified. The CMYKColorspace option is only applicable when writing +TIFF, JPEG, and Adobe Photoshop bitmap (PSD) files.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            ColorspaceType
            EnumerationDescription
            UndefinedColorspaceUnset value.
            RGBColorspaceRed-Green-Blue colorspace.
            GRAYColorspaceGrayscale colorspace
            TransparentColorspaceThe Transparent color space behaves uniquely in +that it preserves the matte channel of the image +if it exists.
            OHTAColorspace 
            XYZColorspace 
            YCbCrColorspace 
            YCCColorspace 
            YIQColorspace 
            YPbPrColorspace 
            YUVColorspaceY-signal, U-signal, and V-signal colorspace. YUV is +most widely used to encode color for use in +television transmission.
            CMYKColorspaceCyan-Magenta-Yellow-Black colorspace. CYMK is a +subtractive color system used by printers and +photographers for the rendering of colors with ink +or emulsion, +normally on a white surface.
            sRGBColorspaceKodak PhotoCD sRGB
            +
            +
            +

            CompositeOperator

            +

            CompositeOperator is used to select the image composition algorithm +used to compose a composite image with an image. By default, each of +the composite image pixels are replaced by the corresponding image +tile pixel. Specify CompositeOperator to select a different +algorithm.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            CompositeOperator
            EnumerationDescription
            UndefinedCompositeOpNot defined.
            OverCompositeOpUnion of the two image shapes, with +opaque areas of change-image obscuring base-image +in the region of overlap.
            InCompositeOpChange-image cut by the shape of base-image. +None of the image data of base-image will be +in the result.
            OutCompositeOpChange-image with the shape of base-image cut out.
            AtopCompositeOpSame shape as base-image, with change-image +obscuring base-image where the image shapes +overlap. Note this differs from over because the +portion of change-image outside base-image's shape +does not appear in the result.
            XorCompositeOpImage data from both change-image and base-image +that is outside the overlap region. The overlap +region will be blank
            PlusCompositeOpSum of the image data. Output values are +cropped to MaxRGB (no overflow). This operation is +independent of the matte channels.
            MinusCompositeOpChange-image - base-image, with underflow cropped +to zero. The matte channel is ignored (set to +opaque, full coverage)
            AddCompositeOpChange-image + base-image, with overflow wrapping +around (mod MaxRGB+1)
            SubtractCompositeOpChange-image - base-image, with underflow wrapping +around (mod MaxRGB+1). The add and subtract +operators can be used to perform reversible +transformations
            DifferenceCompositeOpAbsolute value of change-image minus base-image.
            MultiplyCompositeOpChange-image * base-image. This is useful for the +creation of drop-shadows.
            BumpmapCompositeOpBase-image shaded by change-image
            CopyCompositeOpBase-image replaced with change-image. Here +the matte information is ignored
            CopyRedCompositeOpRed channel in base-image replaced with +the red channel in change-image. The other channels +are copied untouched
            CopyGreenCompositeOpGreen channel in base-image replaced with the green +channel in change-image. The other channels are +copied untouched.
            CopyBlueCompositeOpBlue channel in base-image replaced with the blue +channel in change-image. The other channels are +copied untouched.
            CopyOpacityCompositeOpOpacity channel in base-image replaced with the +opacity channel in change-image. The other +channels are copied untouched.
            ClearCompositeOpPixels are set to transparent.
            DissolveCompositeOp 
            DisplaceCompositeOp 
            ModulateCompositeOp 
            ThresholdCompositeOp 
            NoCompositeOp 
            DarkenCompositeOp 
            LightenCompositeOp 
            HueCompositeOp 
            SaturateCompositeOp 
            ColorizeCompositeOp 
            LuminizeCompositeOp 
            ScreenCompositeOpNot yet implemented (Photoshop & PDF)
            OverlayCompositeOpNot yet implemented (Photoshop & PDF)
            CopyCyanCompositeOp 
            CopyMagentaCompositeOp 
            CopyYellowCompositeOp 
            CopyBlackCompositeOpCopy CMYK Black (K) channel.
            DivideCompositeOpChange-image / base-image. This is useful for +improving the readability of text on unevenly +illuminated photos. (by using a gaussian blurred +copy of change-image as base-image)
            +
            +
            +

            CompressionType

            +

            CompressionType is used to express the desired compression type when +encoding an image. Be aware that most image types only support a +sub-set of the available compression types. If the compression type +specified is incompatable with the image, GraphicsMagick selects a +compression type compatable with the image type.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            CompressionType
            EnumerationDescription
            UndefinedCompressionUnset value.
            NoCompressionNo compression
            BZipCompressionBZip as used by bzip2 utilities
            FaxCompressionCCITT Group 3 FAX compression
            Group4CompressionCCITT Group 4 FAX compression (used only for TIFF)
            JPEGCompressionJPEG compression
            LZWCompressionLempel-Ziv-Welch (LZW) compression
            RLECompressionRun-Length encoded (RLE) compression
            ZipCompressionLempel-Ziv compression (LZ77) as used in GNU gzip.
            LZMACompressionLempel-Ziv-Markov chain algorithm
            JPEG2000CompressionISO/IEC std 15444-1
            JBIG1CompressionISO/IEC std 11544 / ITU-T rec T.82
            JBIG2CompressionISO/IEC std 14492 / ITU-T rec T.88
            +
            +
            +

            DecorationType

            +

            The DecorationType enumerations are used to specify line decorations +of rendered text.

            + + ++++ + + + + + + + + + + + + + + + + + + + +
            DecorationType
            EnumerationDescription
            NoDecorationNo decoration
            UnderlineDecorationUnderlined text
            OverlineDecorationOverlined text
            LineThroughDecorationStrike-through text
            +
            +
            +

            EndianType

            +

            The EndianType enumerations are used to specify the endian option +for formats which support it (e.g. TIFF).

            + + ++++ + + + + + + + + + + + + + + + + + + + +
            EndianType
            EnumerationDescription
            UndefinedEndianNot defined (default)
            LSBEndianLittle endian (like Intel X86 and DEC Alpha)
            MSBEndianBig endian (like Motorola 68K, Mac PowerPC, & +SPARC)
            NativeEndianUse native endian of this CPU
            +
            +
            +

            FillRule

            +

            FillRule specifies the algorithm which is to be used to determine +what parts of the canvas are included inside the shape. See the +documentation on SVG's fill-rule property +for usage details.

            + + ++++ + + + + + + + + + + + + + + + + +
            FillRule
            EnumerationDescription
            UndefinedRuleFill rule not specified
            EvenOddRuleSee SVG fill-rule evenodd rule.
            NonZeroRuleSee SVG fill-rule nonzero rule.
            +
            +
            +

            FilterTypes

            +

            FilterTypes is used to adjust the filter algorithm used when +resizing images. Different filters experience varying degrees of +success with various images and can take sipngicantly different +amounts of processing time. GraphicsMagick uses the LanczosFilter by +default since this filter has been shown to provide the best results +for most images in a reasonable amount of time. Other filter types +(e.g. TriangleFilter) may execute much faster but may show artifacts +when the image is re-sized or around diagonal lines. The only way to +be sure is to test the filter with sample images.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            FilterTypes
            EnumerationDescription
            UndefinedFilterUnset value.
            PointFilterPoint Filter
            BoxFilterBox Filter
            TriangleFilterTriangle Filter
            HermiteFilterHermite Filter
            HanningFilterHanning Filter
            HammingFilterHamming Filter
            BlackmanFilterBlackman Filter
            GaussianFilterGaussian Filter
            QuadraticFilterQuadratic Filter
            CubicFilterCubic Filter
            CatromFilterCatrom Filter
            MitchellFilterMitchell Filter
            LanczosFilterLanczos Filter
            BesselFilterBessel Filter
            SincFilterSinc Filter
            +
            +
            +

            GravityType

            +

            GravityType specifies positioning of an object (e.g. text, image) +within a bounding region (e.g. an image). Gravity provides a +convenient way to locate objects irrespective of the size of the +bounding region, in other words, you don't need to provide absolute +coordinates in order to position an object. A common default for +gravity is NorthWestGravity.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            GravityType
            EnumerationDescription
            ForgetGravityDon't use gravity.
            NorthWestGravityPosition object at top-left of region.
            NorthGravityPostiion object at top-center of region
            NorthEastGravityPosition object at top-right of region
            WestGravityPosition object at left-center of region
            CenterGravityPosition object at center of region
            EastGravityPosition object at right-center of region
            SouthWestGravityPosition object at left-bottom of region
            SouthGravityPosition object at bottom-center of region
            SouthEastGravityPosition object at bottom-right of region
            +
            +
            +

            ImageType

            +

            ImageType indicates the type classification of the image.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            ImageType
            EnumerationDescription
            UndefinedTypeUnset value.
            BilevelTypeMonochrome bi-level image
            GrayscaleTypeGrayscale image
            GrayscaleMatteTypeGrayscale image with opacity
            PaletteTypeIndexed color (palette) image
            PaletteMatteTypeIndexed color (palette) image with opacity
            TrueColorTypeTruecolor image
            TrueColorMatteTypeTruecolor image with opacity
            ColorSeparationTypeCyan/Yellow/Magenta/Black (CYMK) image
            OptimizeTypeOptimize type based on image characteristics
            +
            +
            +

            InterlaceType

            +

            InterlaceType specifies the ordering of the red, green, and blue +pixel information in the image. Interlacing is often used to make +image information available to the user faster by taking advantage of +the space vs time tradeoff. For example, interlacing allows images on +the Web to be recognizable sooner and satellite images to +accumulate/render with image resolution increasing over time.

            +

            Use LineInterlace or PlaneInterlace to create an interlaced GIF or +progressive JPEG image.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + +
            InterlaceType
            EnumerationDescription
            UndefinedInterlaceUnset value.
            NoInterlaceDon't interlace image (RGBRGBRGBRGBRGBRGB...)
            LineInterlaceUse scanline interlacing +(RRR...GGG...BBB...RRR...GGG...BBB...)
            PlaneInterlaceUse plane interlacing (RRRRRR...GGGGGG...BBBBBB...)
            PartitionInterlaceSimilar to plane interlaing except that the +different planes are saved to individual files +(e.g. image.R, image.G, and image.B)
            +
            +
            +

            ChannelType

            +

            ChannelType is used as an argument when doing color separations. Use +ChannelType when extracting a layer from an image. MatteLayer is +useful for extracting the opacity values from an image.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + +
            ChannelType
            EnumerationDescription
            UndefinedLayerUnset value.
            RedLayerSelect red layer
            GreenLayerSelect green layer
            BlueLayerSelect blue layer
            MatteLayerSelect matte (opacity values) layer
            +
            +
            +

            LineCap

            +

            The LineCap enumerations specify shape to be used at the end of open +subpaths when they are stroked. See SVG's stroke-linecap for +examples.

            + + ++++ + + + + + + + + + + + + + + + + + + + +
            LineCap
            EnumerationDescription
            UndefinedCapUnset value.
            ButtCapSquare ending.
            RoundCapRounded ending (half-circle end with radius of 1/2 +stroke width).
            SquareCapSquare ending, extended by 1/2 the stroke width at +end.
            +
            +
            +

            LineJoin

            +

            The LineJoin enumerations specify the shape to be used at the +corners of paths or basic shapes when they are stroked. See SVG's +stroke-linejoin for +examples.

            + + ++++ + + + + + + + + + + + + + + + + + + + +
            LineJoin
            EnumerationDescription
            UndefinedJoinUnset value.
            MiterJoinSharp-edged join
            RoundJoinRounded-edged join
            BevelJoinBeveled-edged join
            +
            +
            +

            NoiseType

            +

            NoiseType is used as an argument to select the type of noise to be +added to the image.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            NoiseType
            EnumerationDescription
            UndefinedNoiseUnset value.
            UniformNoiseUniform noise
            GaussianNoiseGaussian noise
            MultiplicativeGaussianNoiseMultiplicative Gaussian noise
            ImpulseNoiseImpulse noise
            LaplacianNoiseLaplacian noise
            PoissonNoisePoisson noise
            RandomNoiseRandom noise
            +
            +
            +

            OrientationType

            +

            OrientationType specifies the orientation of the image. Useful for +when the image is produced via a different ordinate system, the camera +was turned on its side, or the page was scanned sideways.

            + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            OrientationType
            EnumerationScanline DirectionFrame Direction
            UndefinedOrientationUnknownUnknown
            TopLeftOrientationLeft to rightTop to bottom
            TopRightOrientationRight to leftTop to bottom
            BottomRightOrientationRight to leftBottom to top
            BottomLeftOrientationLeft to rightBottom to top
            LeftTopOrientationTop to bottomLeft to right
            RightTopOrientationTop to bottomRight to left
            RightBottomOrientationBottom to topRight to left
            LeftBottomOrientationBottom to topLeft to right
            +
            +
            +

            PaintMethod

            +

            PaintMethod specifies how pixel colors are to be replaced in the +image. It is used to select the pixel-filling algorithm employed.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + +
            PaintMethod
            EnumerationDescription
            PointMethodReplace pixel color at point.
            ReplaceMethodReplace color for all image pixels matching +color at point.
            FloodfillMethodReplace color for pixels surrounding point +until encountering pixel that fails to match +color at point.
            FillToBorderMethodReplace color for pixels surrounding point +until encountering pixels matching border +color.
            ResetMethodReplace colors for all pixels in image with +pen color.
            +
            +
            +

            QuantumTypes

            +

            QuantumTypes is used to indicate the source or destination format of +entire pixels, or components of pixels ("Quantums") while they are +being read, or written to, a pixel cache. The validity of these format +specifications depends on whether the Image pixels are in RGB format, +RGBA format, or CMYK format. The pixel Quantum size is determined by +the Image depth (typically 8, 16, or 32 bits, but any value from 1-64 +bits integer or float is supported).

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + +
            RGB(A) Image Quantums
            EnumerationDescription
            IndexQuantumPseudoColor colormap indices
            RedQuantumRed pixel Quantum
            GreenQuantumGreen pixel Quantum
            BlueQuantumBlue pixel Quantum
            OpacityQuantumOpacity (Alpha) Quantum
            + + ++++ + + + + + + + + + + + + + + + + + + + +
            CMY(K) Image Quantum
            EnumerationDescription
            CyanQuantumCyan pixel Quantum
            MagentaQuantumMagenta pixel Quantum
            YellowQuantumYellow pixel Quantum
            BlackQuantumBlack pixel Quantum
            + + ++++ + + + + + + + + + + + + + +
            Grayscale Image Quantums
            EnumerationDescription
            GrayQuantumGray pixel
            GrayOpacityQuantumPixel opacity
            + + ++++ + + + + + + + + + + + + + + + + +
            Entire Pixels (Expressed in Byte Order)
            EnumerationDescription
            RGBQuantumRGB pixel (1 to 64 bits)
            RGBAQuantumRGBA pixel (1 to 64 bits)
            CMYKQuantumCMYK pixel (1 to 64 bits)
            +
            +
            +

            RenderingIntent

            +

            Rendering intent is a concept defined by ICC Spec ICC.1:1998-09, "File Format for Color +Profiles". GraphicsMagick uses RenderingIntent in order to support ICC +Color Profiles.

            +

            From the specification: "Rendering intent specifies the style of +reproduction to be used during the evaluation of this profile in a +sequence of profiles. It applies specifically to that profile in the +sequence and not to the entire sequence. Typically, the user or +application will set the rendering intent dynamically at runtime or +embedding time."

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + +
            RenderingIntent
            EnumerationDescription
            UndefinedIntentUnset value.
            SaturationIntentA rendering intent that specifies the saturation +of the pixels in the image is preserved perhaps +at the expense of accuracy in hue and lightness.
            PerceptualIntentA rendering intent that specifies the full gamut +of the image is compressed or expanded to fill +the gamut of the destination device. Gray +balance is preserved but colorimetric accuracy +might not be preserved.
            AbsoluteIntentAbsolute colorimetric
            RelativeIntentRelative colorimetric
            +
            +
            +

            ResolutionType

            +

            By default, GraphicsMagick defines resolutions in pixels per +inch. ResolutionType provides a means to adjust this.

            + + ++++ + + + + + + + + + + + + + + + + +
            ResolutionType
            EnumerationDescription
            UndefinedResolutionUnset value.
            PixelsPerInchResolutionDensity specifications are specified in units +of pixels per inch (english units).
            PixelsPerCentimeterResolutionDensity specifications are specified in units +of pixels per centimeter (metric units).
            +
            +
            +

            StorageType

            +

            The StorageType enumerations are used to specify the storage format +of pixels in the source or destination pixel array.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + +
            StorageType
            EnumerationDescription
            CharPixelCharacter type
            ShortPixelShort type
            IntegerPixelInteger type
            FloatPixelFloat type
            DoublePixelDouble type
            +
            +
            +

            StretchType

            +

            The StretchType enumerations are used to specify the relative width +of a font to the regular width for the font family. If the width is +not important, the AnyStretch enumeration may be specified for a +wildcard match.

            + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            StretchType
            EnumerationDescription
            AnyStretchWildcard match for font stretch
            NormalStretchNormal width font
            UltraCondensedStretchUltra-condensed (narrowest) font
            ExtraCondensedStretchExtra-condensed font
            CondensedStretchCondensed font
            SemiCondensedStretchSemi-Condensed font
            SemiExpandedStretchSemi-Expanded font
            ExpandedStretchExpanded font
            ExtraExpandedStretchExtra-Expanded font
            UltraExpandedStretchUltra-expanded (widest) font
            +
            +
            +

            StyleType

            +

            The StyleType enumerations are used to specify the style +(e.g. Italic) of a font. If the style is not important, the AnyStyle +enumeration may be specified for a wildcard match.

            + + ++++ + + + + + + + + + + + + + + + + + + + +
            StyleType
            EnumerationDescription
            AnyStyleWildcard match for font style
            NormalStyleNormal font style
            ItalicStyleItalic font style
            ObliqueStyleOblique font style
            +

            Copyright © Bob Friesenhahn 1999 - 2020

            +
            +
            + + diff --git a/www/Magick++/Exception.html b/www/Magick++/Exception.html index 864ff47..0c43bb7 100644 --- a/www/Magick++/Exception.html +++ b/www/Magick++/Exception.html @@ -3,7 +3,7 @@ - + Magick::Exception @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
            - - -   + + + 
          @@ -296,5 +296,10 @@ subordinate program is missing (but is needed). GraphicsMagick is unable to figure out how to open the file.

          Copyright © Bob Friesenhahn 1999 - 2020

          + +
          +
          +

          Copyright © GraphicsMagick Group 2002 - 2020

          +
          diff --git a/www/Magick++/Exception.html.orig b/www/Magick++/Exception.html.orig new file mode 100644 index 0000000..a6b4010 --- /dev/null +++ b/www/Magick++/Exception.html.orig @@ -0,0 +1,300 @@ + + + + + + +Magick::Exception + + + + + + + +
          +

          Magick::Exception

          + + + + +

          Exception represents the base class of objects thrown when +Magick++ reports an error. Magick++ throws C++ exceptions synchronous +with the operation where the error occurred. This allows errors to be +trapped within the enclosing code (perhaps the code to process a +single image) while allowing the code to be written with a simple +coding style.

          +

          A try/catch block should be placed around any sequence of operations +which can be considered an important body of work. For example, if +your program processes lists of images and some of these images may be +defective, by placing the try/catch block around the entire sequence +of code that processes one image (including instantiating the image +object), you can minimize the overhead of error checking while +ensuring that all objects created to deal with that object are safely +destroyed (C++ exceptions unroll the stack until the enclosing try +block, destroying any objects on the stack).

          +

          Note that any objects allocated via 'new' with a pointer on the stack +are not automatically destroyed by unrolling the stack via a C++ +exception so that it may be necessary to catch the exception at each +level, destroy any objects allocated via 'new' (or malloc()) and then +re-throw the exception. This includes constructors which might +encounter an exception while the object is being constructed and +should destroy any already-allocated data. Magick++ classes are +designed to be very tiny so it is recommended to automatically +allocate them on the stack when possible rather than via 'new'.

          +

          The pseudo code for the main loop of your program may look like:

          +
          + using namespace std;
          + for infile in list
          + {
          +   try {
          +     // Construct an image instance first so that we don't have to worry
          +     // about object construction failure due to a minor warning exception
          +     // being thrown.
          +     Magick::Image image;
          +
          +     // Determine if Warning exceptions are thrown.
          +     // Use is optional.  Set to true to block Warning exceptions.
          +     image.quiet( false );
          +
          +     try {
          +       // Try reading image file
          +       image.read(infile);
          +     }
          +     catch( Magick::WarningCoder &warning )
          +     {
          +       // Process coder warning while loading file (e.g. TIFF warning)
          +       // Maybe the user will be interested in these warnings (or not).
          +       // If a warning is produced while loading an image, the image
          +       // can normally still be used (but not if the warning was about
          +       // something important!)
          +       cerr << “Coder Warning: “ << warning.what() << endl;
          +     }
          +     catch( Magick::Warning &warning )
          +     {
          +       // Handle any other Magick++ warning.
          +       cerr << “Warning: “ << warning.what() << endl;
          +     }
          +     catch( Magick::ErrorFileOpen &error )
          +     {
          +       // Process Magick++ file open error
          +       cerr << “Error: “ << error.what() << endl;
          +       continue; // Try next image.
          +     }
          +     try {
          +       image.rotate(90);
          +       image.write(“outfile”);
          +     }
          +     catch ( MagickExeption & error)
          +     {
          +        // Handle problem while rotating or writing outfile.
          +        cerr << “Caught Magick++ exception: “ << error.what() << endl;
          +     }
          +   }
          +   catch( std::exception &error )
          +   {
          +      // Process any other exceptions derived from standard C++ exception
          +      cerr << “Caught C++ STD exception: “ << error.what() << endl;
          +   }
          +   catch( ... )
          +   {
          +     // Process *any* exception (last-ditch effort). There is not a lot
          +     // you can do here other to retry the operation that failed, or exit
          +     // the program.
          +   }
          + }
          +
          +The desired location and number of try/catch blocks in your program
          +depends how sophisticated its error handling must be. Very simple
          +programs may use just one try/catch block.
          +
          +

          The Exception class is derived from the C++ standard +std::exception class. This means that it contains a C++ string +containing additional information about the error (e.g to display to +the user). Obtain access to this string via the what() method. For +example:

          +
          +catch( Exception &error_ )
          +{
          +  cout << "Caught exception: " << error_.what() << endl;
          +}
          +
          +

          The classes Warning and Error derive from the Exception +class. Exceptions derived from Warning are thrown to represent +non-fatal errors which may effect the completeness or quality of the +result (e.g. one image provided as an argument to montage is +defective). In most cases, a Warning exception may be ignored by +catching it immediately, processing it (e.g. printing a diagnostic) +and continuing on. Exceptions derived from Error are thrown to +represent fatal errors that can not produce a valid result +(e.g. attempting to read a file which does not exist).

          +

          The specific derived exception classes are shown in the following tables:

          + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Warning (Suspect but completed) Sub-Classes
          WarningWarning Description
          WarningUndefinedUnspecified type.
          WarningBlobNOT CURRENTLY USED
          WarningCacheNOT CURRENTLY USED
          WarningCoderIssued by some coders.
          WarningConfigureNOT CURRENTLY USED
          WarningCorruptImageIssued when an image may be corrupt.
          WarningDelegateReported by a subordinate program.
          WarningDrawReported by the rendering subsystem.
          WarningFileOpenReported when file could not be opened.
          WarningImageNOT CURRENTLY USED
          WarningMissingDelegateNOT CURRENTLY USED
          WarningModuleNOT CURRENTLY USED
          WarningMonitorNOT CURRENTLY USED
          WarningOptionReported when an option is incorrect.
          WarningRegistryNOT CURRENTLY USED
          WarningResourceLimitReported when a resource is exhausted.
          WarningStreamNOT CURRENTLY USED
          WarningTypeNOT CURRENTLY USED
          WarningXServerWarnings reported by the X11 subsystem.
          + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Error (Failed) Sub-Classes
          ErrorError Description
          ErrorUndefinedUnspecified error type.
          ErrorBlobReported by BLOB I/O subsystem.
          ErrorCacheReported by the pixel cache subsystem.
          ErrorCoderReported by coders (image format support).
          ErrorConfigureReported while loading configuration files.
          ErrorCorruptImageReported when the image file is corrupt.
          ErrorDelegateReported by a subordinate program
          ErrorDrawReported while drawing on image.
          ErrorFileOpenReported when the image file can not be opened.
          ErrorImageReported while drawing.
          ErrorMissingDelegateReported when optional add-on library or +subordinate program is missing (but is needed).
          ErrorModuleReported by the module loader subsystem.
          ErrorMonitorReported by the progress monitor.
          ErrorOptionReported when option is malformed or out of range.
          ErrorRegistryReported by the image/BLOB registry subsystem.
          ErrorResourceLimitReported when a program resource is exhausted.
          ErrorStreamReported by the pixel stream subsystem.
          ErrorTypeReported by the type (font) rendering subsystem.
          ErrorXServerReported by the X11 subsystem.
          +

          Note that ErrorMissingDelegate is a "catch-all" error reported when +GraphicsMagick is unable to figure out how to open the file.

          +

          Copyright © Bob Friesenhahn 1999 - 2020

          +
          + + diff --git a/www/Magick++/FormatCharacters.html b/www/Magick++/FormatCharacters.html index c0383a7..74432bf 100644 --- a/www/Magick++/FormatCharacters.html +++ b/www/Magick++/FormatCharacters.html @@ -3,7 +3,7 @@ - + Special Format Characters @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
          - - -   + + + 
          @@ -103,5 +103,10 @@ table:

          Copyright © Bob Friesenhahn 1999 - 2020

          + +
          +
          +

          Copyright © GraphicsMagick Group 2002 - 2020

          +
          diff --git a/www/Magick++/FormatCharacters.html.orig b/www/Magick++/FormatCharacters.html.orig new file mode 100644 index 0000000..30395e1 --- /dev/null +++ b/www/Magick++/FormatCharacters.html.orig @@ -0,0 +1,107 @@ + + + + + + +Special Format Characters + + + + + + + +
          +

          Special Format Characters

          + + + + +

          The Magick::Image methods annotate, draw, label, and the template +function montageImages support special +format characters contained in the argument text. These format +characters work similar to C's printf. Whenever a format character +appears in the text, it is replaced with the equivalent attribute +text. The available format characters are shown in the following +table:

          + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Format Characters
          Format CharacterDescription
          %bfile size
          %ddirectory
          %efilename extension
          %ffilename
          %hheight
          %mmagick (e.g GIF)
          %ppage number
          %sscene number
          %ttop of filename
          %wwidth
          %xx resolution
          %yy resolution
          nnewline
          rcarriage return
          +

          Copyright © Bob Friesenhahn 1999 - 2020

          +
          + + diff --git a/www/Magick++/Geometry.html b/www/Magick++/Geometry.html index 5575e6e..470433a 100644 --- a/www/Magick++/Geometry.html +++ b/www/Magick++/Geometry.html @@ -3,7 +3,7 @@ - + Magick::Geometry @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
          - - -   + + + 
        @@ -423,5 +423,10 @@ public:

        Copyright © Bob Friesenhahn 1999 - 2020

        + +
        +
        +

        Copyright © GraphicsMagick Group 2002 - 2020

        +
        diff --git a/www/Magick++/Geometry.html.orig b/www/Magick++/Geometry.html.orig new file mode 100644 index 0000000..92e5e1a --- /dev/null +++ b/www/Magick++/Geometry.html.orig @@ -0,0 +1,427 @@ + + + + + + +Magick::Geometry + + + + + + + +
        +

        Magick::Geometry

        + + + + +

        Geometry provides a convenient means to specify a geometry +argument. The object may be initialized from a C string or C++ string +containing a geometry specification. It may also be initialized by +more efficient parameterized constructors.

        +
        +

        X11 Geometry Specifications

        +

        X11 geometry specifications are in the form +"<width>x<height>{+-}<xoffset>{+-}<yoffset>" (where width, height, +xoffset, and yoffset are numbers) for specifying the size and +placement location for an object.

        +

        The width and height parts of the geometry specification are measured +in pixels. The xoffset and yoffset parts are also measured in pixels +and are used to specify the distance of the placement coordinate from +the left and top and edges of the image, respectively. Both types of +offsets are measured from the indicated edge of the object to the +corresponding edge of the image. The X offset may be specified in the +following ways:

        + ++++ + + + + + + + + +
        +xoffsetThe left edge of the object is to be placed xoffset +pixels in from the left edge of the image.
        -xoffsetThe left edge of the object is to be placed outside the +image, xoffset pixels out from the left edge of the image.
        +

        The Y offset has similar meanings:

        + ++++ + + + + + + + + +
        +yoffsetThe top edge of the object is to be yoffset pixels below +the top edge of the image.
        -yoffsetThe top edge of the object is to be yoffset pixels above +the top edge of the image.
        +

        Offsets must be given as pairs; in other words, in order to specify +either xoffset or yoffset both must be present.

        +
        +
        +

        GraphicsMagick Extensions To X11 Geometry Specifications

        +

        GraphicsMagick has added a number of qualifiers to the standard +geometry string for use when resizing images. The form of an extended +geometry string is +"<width>x<height>{+-}<xoffset>{+-}<yoffset>{%}{@}{!}{^}{<}{>}". Extended +geometry strings should only be used when resizing an image. Using an +extended geometry string for other applications may cause the API call +to fail. The available qualifiers are shown in the following table:

        + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + +
        GraphicsMagick Geometry Qualifiers
        QualifierDescription
        %Interpret width and height as a percentage of the current size.
        !Resize to width and height exactly, loosing original aspect ratio.
        <Resize only if the image is smaller than the geometry specification.
        >Resize only if the image is greater than the geometry specification.
        @Resize such that width and height are a maximum area in total pixels.
        ^Dimensions are treated as minimum rather than maximum values.
        +
        +
        +

        Postscript Page Size Extension To Geometry Specifications

        +

        Any geometry string specification supplied to the Geometry constructor +is considered to be a Postscript page size nickname if the first +character is not numeric. The page size nickname is not case +sensitive. The Geometry constructor converts these page size +specifications into the equivalent numeric geometry string +specification (preserving any offset component) prior to conversion to +the internal object format. Postscript page size specifications are +short-hand for the pixel geometry required to fill a page of that +size. Since the 11x17 inch page size used in the US starts with a +digit, it is not supported as a Postscript page size +nickname. Instead, substitute the geometry specification "792x1224>" +when 11x17 output is desired.

        + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Postscript Page Size Nicknames
        Postscript NicknameEquivalent Extended Geometry Specification
        A02384x3370>
        A11684x2384>
        A1073x105>
        A21191x1684>
        A3842x1191>
        A4595x842>
        A4SMALL595x842>
        A5420x595>
        A6297x420>
        A7210x297>
        A8148x210>
        A9105x148>
        ARCHA648x864>
        ARCHB864x1296>
        ARCHC1296x1728>
        ARCHD1728x2592>
        ARCHE2592x3456>
        B02920x4127>
        B12064x2920>
        B1091x127>
        B21460x2064>
        B31032x1460>
        B4729x1032>
        B5516x729>
        B6363x516>
        B7258x363>
        B8181x258>
        B9127x181>
        C02599x3676>
        C11837x2599>
        C21298x1837>
        C3918x1296>
        C4649x918>
        C5459x649>
        C6323x459>
        C7230x323>
        EXECUTIVE540x720>
        FLSA612x936>
        FLSE612x936>
        FOLIO612x936>
        HALFLETTER396x612>
        ISOB02835x4008>
        ISOB12004x2835>
        ISOB1088x125>
        ISOB21417x2004>
        ISOB31001x1417>
        ISOB4709x1001>
        ISOB5499x709>
        ISOB6354x499>
        ISOB7249x354>
        ISOB8176x249>
        ISOB9125x176>
        LEDGER1224x792>
        LEGAL612x1008>
        LETTER612x792>
        LETTERSMALL612x792>
        QUARTO610x780>
        STATEMENT396x612>
        TABLOID792x1224>
        +

        The following is the definition of the Magick::Geometry class:

        +
        +class Geometry
        +{
        +public:
        +
        +  Geometry ( unsigned int width_,
        +             unsigned int height_,
        +             unsigned int xOff_ = 0,
        +             unsigned int yOff_ = 0,
        +             bool xNegative_ = false,
        +             bool yNegative_ = false );
        +  Geometry ( const std::string &geometry_ );
        +  Geometry ( const char * geometry_ );
        +  Geometry ( const Geometry &geometry_ );
        +  Geometry ( );
        +  ~Geometry ( void );
        +
        +  // Width
        +  void          width ( unsigned int width_ );
        +  unsigned int  width ( void ) const;
        +
        +  // Height
        +  void          height ( unsigned int height_ );
        +  unsigned int  height ( void ) const;
        +
        +  // X offset from origin
        +  void          xOff ( unsigned int xOff_ );
        +  unsigned int  xOff ( void ) const;
        +
        +  // Y offset from origin
        +  void          yOff ( unsigned int yOff_ );
        +  unsigned int  yOff ( void ) const;
        +
        +  // Sign of X offset negative? (X origin at right)
        +  void          xNegative ( bool xNegative_ );
        +  bool          xNegative ( void ) const;
        +
        +  // Sign of Y offset negative? (Y origin at bottom)
        +  void          yNegative ( bool yNegative_ );
        +  bool          yNegative ( void ) const;
        +
        +  // Width and height are expressed as percentages
        +  void          percent ( bool percent_ );
        +  bool          percent ( void ) const;
        +
        +  // Resize without preserving aspect ratio (!)
        +  void          aspect ( bool aspect_ );
        +  bool          aspect ( void ) const;
        +
        +  // Resize if image is greater than size (>)
        +  void          greater ( bool greater_ );
        +  bool          greater ( void ) const;
        +
        +  // Resize if image is less than size (<)
        +  void          less ( bool less_ );
        +  bool          less ( void ) const;
        +
        +  // Resize image to fit total pixel area specified by dimensions (@).
        +  void          limitPixels ( bool limitPixels_ );
        +  bool          limitPixels ( void ) const;
        +
        +  // Dimensions are treated as minimum rather than maximum values (^)
        +  void          fillArea ( bool fillArea_ );
        +  bool          fillArea ( void ) const;
        +
        +  // Does object contain valid geometry?
        +  void          isValid ( bool isValid_ );
        +  bool          isValid ( void ) const;
        +
        +  // Set via geometry string
        +  const Geometry& operator = ( const std::string &geometry_ );
        +  const Geometry& operator = ( const char * geometry_ );
        +
        +  // Assignment operator
        +  Geometry& operator= ( const Geometry& Geometry_ );
        +
        +  // Return geometry string
        +  operator std::string() const;
        +
        +};
        +
        +

        Copyright © Bob Friesenhahn 1999 - 2020

        +
        +
        + + diff --git a/www/Magick++/Image.html b/www/Magick++/Image.html index ad00ae4..9680c37 100644 --- a/www/Magick++/Image.html +++ b/www/Magick++/Image.html @@ -3,7 +3,7 @@ - + Magick::Image Class @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
        - - -   + + + 
      @@ -39,7 +39,7 @@
      @@ -72,12 +73,14 @@ Magick++.h header.

      any Magick++ objects. This used to be optional, but now it is absolutely required. This function initalizes semaphores and configuration information necessary for the software to work -correctly. Failing to invoke InitializeMagick() is likely to lead to -a program crash or thrown assertion. If the program resides in the -same directory as the GraphicsMagick files, then argv[0] may be passed -as an argument so that GraphicsMagick knows where its files reside, +correctly. Failing to invoke InitializeMagick() will lead to a +program crash or thrown assertion. If the program resides in the same +directory as the GraphicsMagick files, then argv[0] may be passed as +an argument so that GraphicsMagick knows where its files reside, otherwise NULL may be passed and GraphicsMagick will try to use other -means (if necessary).

      +means (if necessary). Even if an argument is passed, GraphicsMagick +may use more reliable location information gleaned from the operating +system, depending on build configuration.

      The preferred way to allocate Image objects is via automatic allocation (on the stack). There is no concern that allocating Image objects on the stack will excessively enlarge the stack since Magick++ @@ -314,13 +317,13 @@ Image& operator= ( const Image &image_ )

      Read Or Write An Image

      -

      ping

      +

      ping

      Ping is similar to read except only enough of the image is read to determine the image columns, rows, and filesize. Access the columns(), rows(), and fileSize() attributes after invoking ping. @@ -338,7 +341,7 @@ void ping ( const Blob &blob_ )

      -

      read

      +

      read

      Read single image frame into current object. Use ping instead if you want to obtain the basic attributes of the image without reading the whole file/blob:

      @@ -393,7 +396,7 @@ void read ( const unsigned int width_,
      -

      write

      +

      write

      Write single image frame to a file:

       void            write ( const std::string &imageSpec_ )
      @@ -442,104 +445,104 @@ image.write("myImage.tiff");
       

      The following image manipulation methods are available:

      -

      adaptiveThreshold

      +

      adaptiveThreshold

      Apply adaptive thresholding to the image (see http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm). Adaptive thresholding is useful if the ideal threshold level is not known in @@ -556,14 +559,14 @@ void adaptiveThreshold ( const unsigned int width,

      -

      addNoise

      +

      addNoise

      Add noise to image with the specified noise type:

       void            addNoise ( const NoiseType noiseType_ )
       
      -

      addNoiseChannel

      +

      addNoiseChannel

      Add noise to an image channel with the specified noise type. The channel parameter specifies the channel to add noise to. The noiseType parameter specifies the type of noise:

      @@ -573,14 +576,14 @@ void addNoiseChannel ( const ChannelType channel_,
      -

      affineTransform

      +

      affineTransform

      Transform image by specified affine (or free transform) matrix:

       void            affineTransform ( const DrawableAffine &affine )
       
      -

      annotate

      +

      annotate

      Annotate image (draw text on image)

      Gravity effects text placement in bounding area according to these rules:

      @@ -631,7 +634,7 @@ void annotate ( const std::string &text_,
      -

      autoOrient

      +

      autoOrient

      Automatically orient image to be right-side up based on its current orientation attribute. This allows the image to be viewed correctly when the orientation attribute is not available, or is not respected:

      @@ -640,7 +643,7 @@ void autoOrient( void )
      -

      blur

      +

      blur

      Blur an image with the specified blur factor.

      The radius parameter specifies the radius of the Gaussian, in pixels, not counting the center pixel. The sigma parameter @@ -651,7 +654,7 @@ void blur ( const double radius_ = 0.0,

      -

      blurChannel

      +

      blurChannel

      Blur an image channel with the specified blur factor.

      The channel parameter specifies the channel to modify. The radius parameter specifies the radius of the Gaussian, in pixels, not @@ -664,7 +667,7 @@ void blurChannel ( const ChannelType channel_,

      -

      border

      +

      border

      Border image (add border to image). The color of the border is specified by the borderColor attribute:

      @@ -673,7 +676,7 @@ void            border ( const Geometry &geometry_
       
      -

      cdl

      +

      cdl

      Bake in the ASC-CDL, which is a convention for the for the exchange of basic primary color grading information between for the exchange of basic primary color grading information between equipment and software @@ -684,7 +687,7 @@ void cdl ( const std::string &cdl_ )

      See CdlImage for more details on the ASC-CDL.

      -

      channel

      +

      channel

      Extract channel from image. Use this option to extract a particular channel from the image. MatteChannel for example, is useful for extracting the opacity values from an image:

      @@ -693,7 +696,7 @@ void channel ( const ChannelType channel_ )
      -

      channelDepth

      +

      channelDepth

      Set or obtain modulus channel depth:

       void            channelDepth ( const ChannelType channel_,
      @@ -703,7 +706,7 @@ unsigned int    channelDepth ( const ChannelType channel_ )
       
      -

      charcoal

      +

      charcoal

      Charcoal effect image (looks like charcoal sketch).

      The radius parameter specifies the radius of the Gaussian, in pixels, not counting the center pixel. The sigma parameter @@ -714,14 +717,14 @@ void charcoal ( const double radius_ = 0.0,

      -

      chop

      +

      chop

      Chop image (remove vertical or horizontal subregion of image):

       void            chop ( const Geometry &geometry_ )
       
      -

      colorize

      +

      colorize

      Colorize image with pen color, using specified percent opacity for red, green, and blue quantums:

      @@ -737,7 +740,7 @@ void            colorize ( const unsigned int opacity_,
       
      -

      colorMatrix

      +

      colorMatrix

      Apply a color matrix to the image channels. The user supplied matrix may be of order 1 to 5 (1x1 through 5x5):

      @@ -747,7 +750,7 @@ void            colorMatrix (const unsigned int order_,
       

      See ColorMatrixImage for more details.

      -

      comment

      +

      comment

      Comment image (add comment string to image). By default, each image is commented with its file name. Use this method to assign a specific comment to the image. Optionally you can include the image filename, @@ -758,7 +761,7 @@ void comment ( const std::string &comment_ )

      -

      compare

      +

      compare

      Compare current image with another image. Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError in the current image. False is returned if the images are identical. An ErrorOption @@ -769,7 +772,7 @@ bool compare ( const Image &reference_ )

      -

      composite

      +

      composite

      Compose an image onto another at specified x and y offset and using a specified algorithm:

      @@ -791,14 +794,14 @@ void            composite ( const Image &compositeImage_,
       
      -

      contrast

      +

      contrast

      Contrast image (enhance intensity differences in image):

       void            contrast ( const unsigned int sharpen_ )
       
      -

      convolve

      +

      convolve

      Convolve image. Applies a user-specified convolution to the image. The order parameter represents the number of columns and rows in the filter kernel while kernel is a two-dimensional array of doubles @@ -809,28 +812,28 @@ void convolve ( const unsigned int order_,

      -

      crop

      +

      crop

      Crop image (return subregion of original image):

       void            crop ( const Geometry &geometry_ )
       
      -

      cycleColormap

      +

      cycleColormap

      Cycle (rotate) image colormap:

       void            cycleColormap ( const int amount_ )
       
      -

      despeckle

      +

      despeckle

      Despeckle image (reduce speckle noise):

       void            despeckle ( void )
       
      -

      display

      +

      display

      Display image on screen. Caution: if an image format is is not compatible with the display visual (e.g. JPEG on a colormapped display) then the original image will be altered. Use a copy of the @@ -839,7 +842,7 @@ original if this is a problem:

      void display ( void )
      -

      draw

      +

      draw

      Draw shape or text on image using a single drawable object:

       void            draw ( const Drawable &drawable_ );
      @@ -853,7 +856,7 @@ void            draw ( const std::list<Magick::Drawable> &drawable_ );
       
      -

      edge

      +

      edge

      Edge image (hilight edges in image). The radius is the radius of the pixel neighborhood.. Specify a radius of zero for automatic radius selection:

      @@ -862,7 +865,7 @@ void edge ( const double radius_ = 0.0 )
      -

      emboss

      +

      emboss

      Emboss image (hilight edges with 3D effect). The radius parameter specifies the radius of the Gaussian, in pixels, not counting the center pixel. The sigma parameter specifies the standard deviation @@ -873,28 +876,28 @@ void emboss ( const double radius_ = 0.0,

      -

      enhance

      +

      enhance

      Enhance image (minimize noise):

       void            enhance ( void );
       
      -

      equalize

      +

      equalize

      Equalize image (histogram equalization):

       void            equalize ( void )
       
      -

      erase

      +

      erase

      Set all image pixels to the current background color:

       void            erase ( void )
       
      -

      extent

      +

      extent

      Create an image canvas using background color sized according to geometry and composite existing image on it, with image placement controlled by gravity. Parameters are obtained from existing image @@ -916,14 +919,14 @@ void extent ( const Geometry &geometry_,

      -

      flip

      +

      flip

      Flip image (reflect each scanline in the vertical direction):

       void            flip ( void )
       
      -

      floodFillColor

      +

      floodFillColor

      Flood-fill color across pixels that match the color of the target pixel and are neighbors of the target pixel. Uses current fuzz setting when determining color match:

      @@ -950,7 +953,7 @@ void floodFillColor( const Geometry &point_,
      -

      floodFillOpacity

      +

      floodFillOpacity

      Flood-fill pixels matching color (within fuzz factor) of target pixel(x,y) with replacement opacity value using method:

      @@ -961,7 +964,7 @@ void            floodFillOpacity ( const unsigned int x_,
       
      -

      floodFillTexture

      +

      floodFillTexture

      Flood-fill texture across pixels that match the color of the target pixel and are neighbors of the target pixel. Uses current fuzz setting when determining color match:

      @@ -988,14 +991,14 @@ void floodFillTexture( const Geometry &point_,
      -

      flop

      +

      flop

      Flop image (reflect each scanline in the horizontal direction):

       void            flop ( void );
       
      -

      frame

      +

      frame

      Draw a decorative frame around the image:

       void            frame ( const Geometry &geometry_ = frameGeometryDefault )
      @@ -1007,7 +1010,7 @@ void            frame ( const unsigned int width_,
       
      -

      gamma

      +

      gamma

      Gamma correct the image or individual image channels:

       void            gamma ( const double gamma_ )
      @@ -1018,7 +1021,7 @@ void            gamma ( const double gammaRed_,
       
      -

      gaussianBlur

      +

      gaussianBlur

      Gaussian blur image. The number of neighbor pixels to be included in the convolution mask is specified by width. The standard deviation of the gaussian bell curve is specified by sigma:

      @@ -1027,7 +1030,7 @@ void gaussianBlur ( const double width_, const double sigma_ )
      -

      gaussianBlurChannel

      +

      gaussianBlurChannel

      Gaussian blur image channel. The number of neighbor pixels to be included in the convolution mask is specified by width. The standard deviation of the gaussian bell curve is specified by @@ -1039,14 +1042,14 @@ void gaussianBlurChannel ( const ChannelType channel_,

      -

      implode

      +

      implode

      Implode image (special effect):

       void            implode ( const double factor_ )
       
      -

      haldClut

      +

      haldClut

      Apply a color lookup table (Hald CLUT) to the image:

       void            haldClut ( const Image &clutImage_ )
      @@ -1054,7 +1057,7 @@ void            haldClut ( const Image &clutImage_ )
       

      See HaldClutImage for more details.

      -

      label

      +

      label

      Assign a label to an image. Use this option to assign a specific label to the image. Optionally you can include the image filename, type, width, height, or scene number in the label by embedding special @@ -1067,7 +1070,7 @@ void label ( const std::string &label_ )

      -

      level

      +

      level

      Level image to increase image contrast, and/or adjust image gamma. Adjust the levels of the image by scaling the colors falling between specified white and black points to the full available quantum @@ -1086,7 +1089,7 @@ void level ( const double black_point,

      -

      levelChannel

      +

      levelChannel

      Level image channel to increase image contrast, and/or adjust image gamma. Adjust the levels of the image channel by scaling the colors falling between specified white and black points to the full available @@ -1106,14 +1109,14 @@ void levelChannel ( const ChannelType channel,

      -

      magnify

      +

      magnify

      Magnify image by integral size (double the dimensions):

       void            magnify ( void )
       
      -

      map

      +

      map

      Remap image colors with closest color from a reference image. Set dither to true in to apply Floyd/Steinberg error diffusion to the image. By default, color reduction chooses an optimal set of colors @@ -1125,7 +1128,7 @@ void map ( const Image &mapImage_ ,

      -

      matteFloodfill

      +

      matteFloodfill

      Floodfill designated area with a replacement opacity value:

       void            matteFloodfill ( const Color &target_ ,
      @@ -1135,7 +1138,7 @@ void            matteFloodfill ( const Color &target_ ,
       
      -

      medianFilter

      +

      medianFilter

      Filter image by replacing each pixel component with the median color in a circular neighborhood:

      @@ -1143,14 +1146,14 @@ void            medianFilter ( const double radius_ = 0.0 )
       
      -

      minify

      +

      minify

      Reduce image by integral (half) size:

       void            minify ( void )
       
      -

      modifyImage

      +

      modifyImage

      Prepare to update image (copy if reference > 1). Normally Magick++'s implicit reference counting takes care of all instance management. In the rare case that the automatic instance management does not work, @@ -1163,7 +1166,7 @@ void modifyImage ( void )

      -

      modulate

      +

      modulate

      Modulate percent hue, saturation, and brightness of an image. Modulation of saturation and brightness is as a ratio of the current value (1.0 for no change). Modulation of hue is an absolute rotation @@ -1176,7 +1179,7 @@ void modulate ( const double brightness_,

      -

      motionBlur

      +

      motionBlur

      Motion blur image with specified blur factor. The radius parameter specifies the radius of the Gaussian, in pixels, not counting the center pixel. The sigma parameter specifies the standard @@ -1190,7 +1193,7 @@ void motionBlur ( const double radius_,

      -

      negate

      +

      negate

      Negate colors in image. Set grayscale to only negate grayscale values in image:

      @@ -1198,7 +1201,7 @@ void            negate ( const bool grayscale_ = false )
       
      -

      normalize

      +

      normalize

      Normalize image (increase contrast by normalizing the pixel values to span the full range of color values):

      @@ -1206,14 +1209,14 @@ void            normalize ( void )
       
      -

      oilPaint

      +

      oilPaint

      Oilpaint image (image looks like an oil painting):

       void            oilPaint ( const double radius_ = 3.0 )
       
      -

      opacity

      +

      opacity

      Set or attenuate the opacity channel in the image. If the image pixels are opaque then they are set to the specified opacity value, otherwise they are blended with the supplied opacity value. The value of @@ -1225,7 +1228,7 @@ void opacity ( const unsigned int opacity_ )

      -

      opaque

      +

      opaque

      Change color of specified opaque pixel to specified pen color:

       void            opaque ( const Color &opaqueColor_,
      @@ -1233,7 +1236,7 @@ void            opaque ( const Color &opaqueColor_,
       
      -

      quantize

      +

      quantize

      Quantize image (reduce number of colors). Set measureError to true in order to calculate error attributes:

      @@ -1241,7 +1244,7 @@ void            quantize ( const bool measureError_ = false )
       
      -

      quantumOperator

      +

      quantumOperator

      Apply an arithmetic or bitwise operator to the image pixel quantums:

       void            quantumOperator ( const ChannelType channel_,
      @@ -1257,7 +1260,7 @@ void            quantumOperator ( const int x_,const int y_,
       
      -

      process

      +

      process

      Execute a named process module using an argc/argv syntax similar to that accepted by a C 'main' routine. An exception is thrown if the requested process module doesn't exist, fails to load, or fails during @@ -1269,7 +1272,7 @@ void process ( std::string name_,

      -

      raise

      +

      raise

      Raise image (lighten or darken the edges of an image to give a 3-D raised or lowered effect):

      @@ -1278,7 +1281,7 @@ void            raise ( const Geometry &geometry_ = "6x6+0+0",
       
      -

      randomThreshold

      +

      randomThreshold

      Random threshold image.

      Changes the value of individual pixels based on the intensity of each pixel compared to a random threshold. The result is a @@ -1293,7 +1296,7 @@ void randomThreshold( const Geometry &thresholds_ )

      -

      randomThresholdChannel

      +

      randomThresholdChannel

      Random threshold image channel.

      Changes the value of individual pixels based on the intensity of each pixel compared to a random threshold. The result is a low-contrast, @@ -1309,7 +1312,7 @@ void randomThresholdChannel( const Geometry &thresholds_,

      -

      reduceNoise

      +

      reduceNoise

      Reduce noise in image using a noise peak elimination filter:

       void            reduceNoise ( void )
      @@ -1318,7 +1321,7 @@ void            reduceNoise ( const double order_ )
       
      -

      resize

      +

      resize

      Resize image, specifying geometry, filter, and blur (blur > 1.0 is more blurry and < 1.0 is sharper):

      @@ -1339,7 +1342,7 @@ void            resize ( const Geometry &geometry_ );
       
      -

      roll

      +

      roll

      Roll image (rolls image vertically and horizontally) by specified number of columnms and rows):

      @@ -1350,21 +1353,21 @@ void            roll ( const unsigned int columns_,
       
      -

      rotate

      +

      rotate

      Rotate image counter-clockwise by specified number of degrees:

       void            rotate ( const double degrees_ )
       
      -

      sample

      +

      sample

      Resize image by using pixel sampling algorithm:

       void            sample ( const Geometry &geometry_ )
       
      -

      scale

      +

      scale

      Resize image by using simple ratio algorithm which provides good quality:

      @@ -1372,7 +1375,7 @@ void            scale ( const Geometry &geometry_ )
       
      -

      thumbnail

      +

      thumbnail

      Resize image using several algorithms to make smaller images very quickly. This is very useful to create thumbnails from large images but usually works well for any image resizing purpose:

      @@ -1381,7 +1384,7 @@ void thumbnail ( const Geometry &geometry_ );
      -

      segment

      +

      segment

      Segment (coalesce similar image components) by analyzing the histograms of the color components and identifying units that are homogeneous with the fuzzy c-means technique. A histogram is built @@ -1402,7 +1405,7 @@ void segment ( const double clusterThreshold_ = 1.0,

      -

      shade

      +

      shade

      Shade image using distant light source. Specify azimuth and elevation as the position of the light source. By default, the shading results as a grayscale image.. Set colorShading to true to @@ -1414,7 +1417,7 @@ void shade ( const double azimuth_ = 30,

      -

      sharpen

      +

      sharpen

      Sharpen pixels in image. The radius parameter specifies the radius of the Gaussian, in pixels, not counting the center pixel. The sigma parameter specifies the standard deviation of the Laplacian, @@ -1425,7 +1428,7 @@ void sharpen ( const double radius_ = 0.0,

      -

      sharpenChannel

      +

      sharpenChannel

      Sharpen pixels in image channel. The radius parameter specifies the radius of the Gaussian, in pixels, not counting the center pixel. The sigma parameter specifies the standard deviation of the Laplacian, @@ -1437,14 +1440,14 @@ void sharpenChannel ( const ChannelType channel_,

      -

      shave

      +

      shave

      Shave pixels from image edges:

       void            shave ( const Geometry &geometry_ )
       
      -

      shear

      +

      shear

      Shear image (create parallelogram by sliding image by X or Y axis). Shearing slides one edge of an image along the X or Y axis, creating a parallelogram. An X direction shear slides an edge along @@ -1460,7 +1463,7 @@ void shear ( const double xShearAngle_,

      -

      solarize

      +

      solarize

      Solarize image (similar to effect seen when exposing a photographic film to light during the development process):

      @@ -1468,21 +1471,21 @@ void            solarize ( const double factor_ = 50.0 )
       
      -

      spread

      +

      spread

      Spread pixels randomly within image by specified ammount:

       void            spread ( const unsigned int amount_ = 3 )
       
      -

      stegano

      +

      stegano

      Add a digital watermark to the image (based on second image):

       void            stegano ( const Image &watermark_ )
       
      -

      stereo

      +

      stereo

      Create an image which appears in stereo when viewed with red-blue glasses (Red image on left, blue on right):

      @@ -1490,27 +1493,27 @@ void            stereo ( const Image &rightImage_ )
       
      -

      strip

      +

      strip

      Remove all profiles and text attributes from the image.

      void strip ( void );
      -

      swirl

      +

      swirl

      Swirl image (image pixels are rotated by degrees):

       void            swirl ( const double degrees_ )
       
      -

      texture

      +

      texture

      Channel a texture on pixels matching image background color:

       void            texture ( const Image &texture_ )
       
      -

      threshold

      +

      threshold

      Threshold image channels (below threshold becomes black, above threshold becomes white). The range of the threshold parameter is 0 to MaxRGB:

      @@ -1519,7 +1522,7 @@ void threshold ( const double threshold_ )
      -

      transform

      +

      transform

      Transform image based on image and crop geometries. Crop geometry is optional:

      @@ -1530,7 +1533,7 @@ void            transform ( const Geometry &imageGeometry_,
       
      -

      transparent

      +

      transparent

      Add matte channel to image, setting pixels matching color to transparent:

      @@ -1538,14 +1541,14 @@ void            transparent ( const Color &color_ )
       
      -

      trim

      +

      trim

      Trim edges that are the background color from the image:

       void            trim ( void )
       
      -

      type

      +

      type

      Convert the image representation to the specified type or retrieve the current image type. If the image is reduced to an inferior type, then image information may be lost (e.g. color changed to grayscale).

      @@ -1581,7 +1584,7 @@ ImageType type ( void ) const
      -

      unsharpmask

      +

      unsharpmask

      Replace image with a sharpened version of the original image using the unsharp mask algorithm.

      @@ -1606,7 +1609,7 @@ void unsharpmask ( const double radius_,
      -

      unsharpmaskChannel

      +

      unsharpmaskChannel

      Replace image channel with a sharpened version of the original image using the unsharp mask algorithm.

      @@ -1634,7 +1637,7 @@ void unsharpmaskChannel ( const ChannelType channel_,
      -

      wave

      +

      wave

      Map image pixels to a sine wave:

       void            wave ( const double amplitude_ = 25.0,
      @@ -1642,7 +1645,7 @@ void            wave ( const double amplitude_ = 25.0,
       
      -

      zoom

      +

      zoom

      Zoom (resize) image to specified size:

       void            zoom ( const Geometry &geometry_ )
      @@ -1669,117 +1672,117 @@ image.write(filename)
       

      The following image attribute methods are available:

      -

      adjoin

      +

      adjoin

      Join images into a single multi-image file:

       void            adjoin ( const bool flag_ )
      @@ -1788,7 +1791,7 @@ bool            adjoin ( void ) const
       
      -

      antiAlias

      +

      antiAlias

      Control antialiasing of rendered Postscript and Postscript or TrueType fonts. Enabled by default:

      @@ -1798,7 +1801,7 @@ bool            antiAlias( void )
       
      -

      animationDelay

      +

      animationDelay

      Time in 1/100ths of a second (0 to 65535) which must expire before displaying the next image in an animated sequence. This option is useful for regulating the animation of a sequence of GIF images within @@ -1810,7 +1813,7 @@ unsigned int animationDelay ( void ) const

      -

      animationIterations

      +

      animationIterations

      Number of iterations to loop an animation (e.g. Netscape loop extension) for:

      @@ -1820,7 +1823,7 @@ unsigned int    animationIterations ( void ) const
       
      -

      attribute

      +

      attribute

      Access or update an arbitrary named image attribute. Any number of named attributes may be attached to the image. For example, the image comment is a named image attribute with the name "comment". If the @@ -1841,7 +1844,7 @@ std::string attribute ( const std::string name_ )

      -

      backgroundColor

      +

      backgroundColor

      Image background color:

       void            backgroundColor ( const Color &color_ )
      @@ -1850,7 +1853,7 @@ Color           backgroundColor ( void ) const
       
      -

      backgroundTexture

      +

      backgroundTexture

      Image file name to use as the background texture. Does not modify image pixels:

      @@ -1860,28 +1863,28 @@ std::string     backgroundTexture ( void ) const
       
      -

      baseColumns

      +

      baseColumns

      Base image width (before transformations):

       unsigned int    baseColumns ( void ) const
       
      -

      baseFilename

      +

      baseFilename

      Base image filename (before transformations):

       std::string     baseFilename ( void ) const
       
      -

      baseRows

      +

      baseRows

      Base image height (before transformations):

       unsigned int    baseRows ( void ) const
       
      -

      borderColor

      +

      borderColor

      Image border color:

       void            borderColor ( const Color &color_ )
      @@ -1890,7 +1893,7 @@ Color           borderColor ( void ) const
       
      -

      boundingBox

      +

      boundingBox

      Return smallest bounding box enclosing non-border pixels. The current fuzz value is used when discriminating between pixels. This is the crop bounding box used by crop(Geometry(0,0)):

      @@ -1899,7 +1902,7 @@ Geometry boundingBox ( void ) const
      -

      boxColor

      +

      boxColor

      Base color that annotation text is rendered on (default none):

       void            boxColor ( const Color &boxColor_ )
      @@ -1908,7 +1911,7 @@ Color           boxColor ( void ) const
       
      -

      cacheThreshold

      +

      cacheThreshold

      Pixel cache threshold in megabytes. Once this memory threshold is exceeded, all subsequent pixels cache operations are to/from disk. This setting is shared by all Image objects:

      @@ -1917,7 +1920,7 @@ static void cacheThreshold ( const unsigned int threshold_ )
      -

      chromaBluePrimary

      +

      chromaBluePrimary

      Chromaticity blue primary point (e.g. x=0.15, y=0.06):

       void            chromaBluePrimary ( const double x_, const double y_ )
      @@ -1926,7 +1929,7 @@ void            chromaBluePrimary ( double *x_, double *y_ ) const
       
      -

      chromaGreenPrimary

      +

      chromaGreenPrimary

      Chromaticity green primary point (e.g. x=0.3, y=0.6):

       void            chromaGreenPrimary ( const double x_, const double y_ )
      @@ -1935,7 +1938,7 @@ void            chromaGreenPrimary ( double *x_, double *y_ ) const
       
      -

      chromaRedPrimary

      +

      chromaRedPrimary

      Chromaticity red primary point (e.g. x=0.64, y=0.33):

       void            chromaRedPrimary ( const double x_, const double y_ )
      @@ -1944,7 +1947,7 @@ void            chromaRedPrimary ( double *x_, double *y_ ) const
       
      -

      chromaWhitePoint

      +

      chromaWhitePoint

      Chromaticity white point (e.g. x=0.3127, y=0.329):

       void            chromaWhitePoint ( const double x_, const double y_ )
      @@ -1952,7 +1955,7 @@ void            chromaWhitePoint ( double *x_, double *y_ ) const
       
      -

      classType

      +

      classType

      Image class (DirectClass or PseudoClass). NOTE: setting a DirectClass image to PseudoClass will result in the loss of color information if the number of colors in the image is greater than the maximum palette @@ -1965,7 +1968,7 @@ ClassType classType ( void ) const

      -

      clipMask

      +

      clipMask

      Associate a clip mask image with the current image. The clip mask image must have the same dimensions as the current image or an exception is thrown. Clipping occurs wherever pixels are transparent @@ -1978,7 +1981,7 @@ Image clipMask ( void ) const

      -

      colorFuzz

      +

      colorFuzz

      Colors within this distance are considered equal. A number of algorithms search for a target color. By default the color must be exact. Use this option to match colors that are close to the target @@ -1990,7 +1993,7 @@ double colorFuzz ( void ) const

      -

      colorMap

      +

      colorMap

      Color at colormap position index:

       void            colorMap ( const unsigned int index_,
      @@ -2000,7 +2003,7 @@ Color           colorMap ( const unsigned int index_ ) const
       
      -

      colorMapSize

      +

      colorMapSize

      Number of entries in the colormap. Setting the colormap size may extend or truncate the colormap. The maximum number of supported entries is specified by the MaxColormapSize constant, and is dependent @@ -2015,7 +2018,7 @@ unsigned int colorMapSize ( void )

      -

      colorSpace

      +

      colorSpace

      The colorspace (e.g. CMYK) used to represent the image pixel colors:

       void            colorSpace( const ColorspaceType colorSpace_ )
      @@ -2024,21 +2027,21 @@ ColorspaceType  colorSpace ( void ) const
       
      -

      columns

      +

      columns

      Image width:

       unsigned int    columns ( void ) const
       
      -

      comment

      +

      comment

      Image comment:

       std::string     comment ( void ) const
       
      -

      compose

      +

      compose

      Composition operator to be used when composition is implicitly used (such as for image flattening):

      @@ -2048,7 +2051,7 @@ CompositeOperator compose ( void ) const
       
      -

      compressType

      +

      compressType

      Image compresion type. The default is the compression type of the input image file:

      @@ -2058,7 +2061,7 @@ CompressionType compressType ( void ) const
       
      -

      debug

      +

      debug

      Enable printing of debug messages from GraphicsMagick as it executes:

       void            debug ( const bool flag_ )
      @@ -2067,7 +2070,7 @@ bool            debug ( void ) const
       
      -

      defineValue

      +

      defineValue

      Set or obtain a definition string to applied when encoding or decoding the specified format. The meanings of the definitions are format specific. The format is designated by the magick argument, the @@ -2084,7 +2087,7 @@ std::string defineValue ( const std::string &magick_,

      -

      defineSet

      +

      defineSet

      Set or obtain a definition flag to applied when encoding or decoding the specified format. Similar to the defineValue() method except that passing the flag value 'true' creates a value-less define with that @@ -2101,7 +2104,7 @@ bool defineSet ( const std::string &magick_,

      -

      density

      +

      density

      Vertical and horizontal resolution in pixels of the image. This option specifies an image density when decoding a Postscript or Portable Document page. Often used with psPageSize:

      @@ -2119,7 +2122,7 @@ floating point.

      The resolution units may be obtained via the resolutionUnits() method.

      -

      depth

      +

      depth

      Image depth (bits allocated to red/green/blue components). Used to specify the bit depth when reading or writing raw images or when the output format supports multiple depths. Defaults to the quantum depth @@ -2131,14 +2134,14 @@ unsigned int depth ( void ) const

      -

      directory

      +

      directory

      Tile names from within an image montage:

       std::string     directory ( void ) const
       
      -

      endian

      +

      endian

      Endianness (LSBEndian like Intel, MSBEndian like SPARC, or NativeEndian for what this computer uses) for image formats which support endian-specific options:

      @@ -2149,7 +2152,7 @@ EndianType endian ( void ) const
      -

      fileName

      +

      fileName

      Image file name:

       void            fileName ( const std::string &fileName_ )
      @@ -2158,14 +2161,14 @@ std::string     fileName ( void ) const
       
      -

      fileSize

      +

      fileSize

      Number of bytes of the image on disk:

       off_t          fileSize ( void ) const
       
      -

      fillColor

      +

      fillColor

      Color to use when filling drawn objects:

       void            fillColor ( const Color &fillColor_ )
      @@ -2174,7 +2177,7 @@ Color           fillColor ( void ) const
       
      -

      fillPattern

      +

      fillPattern

      Pattern to use while filling drawn objects:

       void            fillPattern ( const Image &fillPattern_ )
      @@ -2183,7 +2186,7 @@ Image           fillPattern ( void  ) const
       
      -

      fillRule

      +

      fillRule

      Rule to use when filling drawn objects:

       void            fillRule ( const FillRule &fillRule_ )
      @@ -2192,7 +2195,7 @@ FillRule        fillRule ( void ) const
       
      -

      filterType

      +

      filterType

      Filter to use when resizing image. The reduction filter employed has a sigificant effect on the time required to resize an image and the resulting quality. The default filter is Lanczos which has been shown @@ -2204,7 +2207,7 @@ FilterTypes filterType ( void ) const

      -

      font

      +

      font

      Text rendering font. If the font is a fully qualified X server font name, the font is obtained from an X server. To use a TrueType font, precede the TrueType filename with an @. Otherwise, specify a @@ -2216,7 +2219,7 @@ std::string font ( void ) const

      -

      fontPointsize

      +

      fontPointsize

      Text rendering font point size:

       void            fontPointsize ( const double pointSize_ )
      @@ -2225,7 +2228,7 @@ double          fontPointsize ( void ) const
       
      -

      fontTypeMetrics

      +

      fontTypeMetrics

      Obtain font metrics (see TypeMetric) for text string given current font, pointsize, and density settings. This information is necessary in order to do fancy layout of text:

      @@ -2235,14 +2238,14 @@ void fontTypeMetrics( const std::string &text_,
      -

      format

      +

      format

      Long image format description:

       std::string     format ( void ) const
       
      -

      formatExpression

      +

      formatExpression

      Format a string based on image properties similar to identify -format. For example, the format expression "%wx%h" is converted to a string containing image WIDTHxHEIGHT like "640x480":

      @@ -2254,7 +2257,7 @@ Image object and will assure a reference count of one) and it may throw an exception if there is an internal error.

      -

      gamma

      +

      gamma

      Gamma level of the image. Gamma is a pow() function which converts between the linear light representation and the representation for the computer display. Most computer images are gamma corrected to 2.2 @@ -2265,14 +2268,14 @@ double gamma ( void ) const

      -

      geometry

      +

      geometry

      Preferred size of the image when encoding:

       Geometry        geometry ( void ) const
       
      -

      gifDisposeMethod

      +

      gifDisposeMethod

      GIF disposal method. This option (specific to the GIF file format) is used to control how successive frames are rendered (how the preceding frame is disposed of) when creating a GIF animation:

      @@ -2283,7 +2286,7 @@ unsigned int gifDisposeMethod ( void ) const
      -

      iccColorProfile

      +

      iccColorProfile

      ICC color profile. Supplied via a Blob since Magick++/ and GraphicsMagick do not currently support formating this data structure directly.

      @@ -2304,7 +2307,7 @@ Blob iccColorProfile( void ) const
      -

      interlaceType

      +

      interlaceType

      The type of interlacing scheme (default NoInterlace ). This option is used to specify the type of interlacing scheme for raw image formats such as RGB or YUV. NoInterlace means do not interlace, @@ -2321,7 +2324,7 @@ InterlaceType interlaceType ( void ) const

      -

      iptcProfile

      +

      iptcProfile

      IPTC profile. Supplied via a Blob since Magick++ and GraphicsMagick do not currently support formating this data structure directly. Specifications are available from the International Press @@ -2333,7 +2336,7 @@ Blob iptcProfile( void ) const

      -

      isValid

      +

      isValid

      Does object contain valid image? Set to false in order to invalidate the image. Images constructed via the default constructor are invalid images and isValid() will return false:

      @@ -2344,14 +2347,14 @@ bool isValid ( void ) const
      -

      label

      +

      label

      Image label:

       std::string     label ( void ) const
       
      -

      lineWidth

      +

      lineWidth

      Stroke width for drawing vector objects (default one) This method is now deprecated. Please use strokeWidth instead:

      @@ -2361,7 +2364,7 @@ double          lineWidth ( void ) const
       
      -

      magick

      +

      magick

      File type magick identifier (.e.g "GIF"):

       void            magick ( const std::string &magick_ )
      @@ -2370,7 +2373,7 @@ std::string     magick ( void ) const
       
      -

      matte

      +

      matte

      Image supports transparency (matte channel):

       void            matte ( const bool matteFlag_ )
      @@ -2379,7 +2382,7 @@ bool            matte ( void ) const
       
      -

      matteColor

      +

      matteColor

      Image matte (frame) color:

       void            matteColor ( const Color &matteColor_ )
      @@ -2388,7 +2391,7 @@ Color           matteColor ( void ) const
       
      -

      meanErrorPerPixel

      +

      meanErrorPerPixel

      The mean error per pixel computed when an image is color reduced. This parameter is only valid if verbose is set to true and the image has just been quantized:

      @@ -2397,7 +2400,7 @@ double meanErrorPerPixel ( void ) const
      -

      modulusDepth

      +

      modulusDepth

      Image modulus depth (minimum number of bits required to support red/green/blue components without loss of accuracy). The pixel modulus depth may be decreased by supplying a value which is less than the @@ -2411,7 +2414,7 @@ unsigned int modulusDepth ( void ) const

      -

      monochrome

      +

      monochrome

      Transform image to black and white while color reducing (quantizing):

       void            monochrome ( const bool monochromeFlag_ )
      @@ -2420,7 +2423,7 @@ bool            monochrome ( void ) const
       
      -

      montageGeometry

      +

      montageGeometry

      Tile size and offset within an image montage. Only valid for montage images:

      @@ -2428,7 +2431,7 @@ Geometry        montageGeometry ( void ) const
       
      -

      normalizedMaxError

      +

      normalizedMaxError

      The normalized max error per pixel computed when an image is color reduced. This parameter is only valid if verbose is set to true and the image has just been quantized:

      @@ -2437,7 +2440,7 @@ double normalizedMaxError ( void ) const
      -

      normalizedMeanError

      +

      normalizedMeanError

      The normalized mean error per pixel computed when an image is color reduced. This parameter is only valid if verbose is set to true and the image has just been quantized:

      @@ -2446,7 +2449,7 @@ double normalizedMeanError ( void ) const
      -

      orientation

      +

      orientation

      Image orientation. Supported by some file formats such as DPX and TIFF. Useful for turning the right way up:

      @@ -2456,7 +2459,7 @@ OrientationType orientation ( void ) const
       
      -

      page

      +

      page

      Preferred size and location of an image canvas.

      Use this option to specify the dimensions and position of the Postscript page in dots per inch or a TEXT page in pixels. This option @@ -2470,7 +2473,7 @@ Geometry page ( void ) const

      -

      pixelColor

      +

      pixelColor

      Get/set pixel color at location x & y:

       void            pixelColor ( const unsigned int x_,
      @@ -2482,7 +2485,7 @@ Color           pixelColor ( const unsigned int x_,
       
      -

      profile

      +

      profile

      Add or remove a named profile to/from the image. Remove the profile by passing an empty Blob (e.g. Blob()). Valid names are "*", "8BIM", "ICM", "IPTC", or a user/format-defined profile name:

      @@ -2498,7 +2501,7 @@ Blob profile( const std::string name_ ) const
      -

      quality

      +

      quality

      JPEG/MIFF/PNG compression level (default 75):

       void            quality ( const unsigned int quality_ )
      @@ -2507,7 +2510,7 @@ unsigned int    quality ( void ) const
       
      -

      quantizeColors

      +

      quantizeColors

      Maximum number of colors to quantize to:

       void            quantizeColors ( const unsigned int colors_ )
      @@ -2516,7 +2519,7 @@ unsigned int    quantizeColors ( void ) const
       
      -

      quantizeColorSpace

      +

      quantizeColorSpace

      Colorspace to quantize in (default RGB). Empirical evidence suggests that distances in color spaces such as YUV or YIQ correspond to perceptual color differences more closely than do distances in RGB @@ -2529,7 +2532,7 @@ ColorspaceType quantizeColorSpace ( void ) const

      -

      quantizeDither

      +

      quantizeDither

      Apply Floyd/Steinberg error diffusion to the image. The basic strategy of dithering is to trade intensity resolution for spatial resolution by averaging the intensities of several neighboring pixels. Images @@ -2543,7 +2546,7 @@ bool quantizeDither ( void ) const

      -

      quantizeTreeDepth

      +

      quantizeTreeDepth

      Depth of the quantization color classification tree. Values of 0 or 1 allow selection of the optimal tree depth for the color reduction algorithm. Values between 2 and 8 may be used to manually adjust the @@ -2555,7 +2558,7 @@ unsigned int quantizeTreeDepth ( void ) const

      -

      quiet

      +

      quiet

      Determines if Warning exceptions will be thrown, or suppressed. The default is that warnings will be thrown (i.e. false):

      @@ -2564,7 +2567,7 @@ bool            quiet ( void ) const;
       
      -

      renderingIntent

      +

      renderingIntent

      The type of rendering intent (used when applying an ICC color profile using iccColorProfile):

      @@ -2574,14 +2577,14 @@ RenderingIntent renderingIntent ( void ) const
       
      -

      repage

      +

      repage

      Reset the image page canvas and position:

       void            repage();
       
      -

      resolutionUnits

      +

      resolutionUnits

      Units of image resolution:

       void            resolutionUnits ( const ResolutionType resolutionUnits_ )
      @@ -2590,14 +2593,14 @@ ResolutionType  resolutionUnits ( void ) const
       
      -

      rows

      +

      rows

      The number of pixel rows in the image:

       unsigned int    rows ( void ) const
       
      -

      scene

      +

      scene

      Image scene number:

       void            scene ( const unsigned int scene_ )
      @@ -2606,7 +2609,7 @@ unsigned int    scene ( void ) const
       
      -

      signature

      +

      signature

      Image textual signature. Set force to true in order to re-calculate the signature regardless of whether the image data has been modified:

      @@ -2614,7 +2617,7 @@ std::string     signature ( const bool force_ = false ) const
       
      -

      size

      +

      size

      Width and height of a raw image (an image which does not support width and height information). Size may also be used to affect the image size read from a multi-resolution format (e.g. Photo CD, JBIG, or @@ -2626,7 +2629,7 @@ Geometry size ( void ) const

      -

      statistics

      +

      statistics

      Obtain image statistics. Statistics are normalized to the range of 0.0 to 1.0 and are output to the specified ImageStatistics structure:

      @@ -2635,7 +2638,7 @@ void statistics ( ImageStatistics *statistics ) const
      -

      strokeAntiAlias

      +

      strokeAntiAlias

      Enable/disable stroke anti-aliasing:

       void            strokeAntiAlias( const bool flag_ )
      @@ -2644,7 +2647,7 @@ bool            strokeAntiAlias( void ) const
       
      -

      strokeColor

      +

      strokeColor

      Color to use when drawing object outlines:

       void            strokeColor ( const Color &strokeColor_ )
      @@ -2653,7 +2656,7 @@ Color           strokeColor ( void ) const
       
      -

      strokeDashArray

      +

      strokeDashArray

      Specify the pattern of dashes and gaps used to stroke paths. The strokeDashArray represents a zero-terminated array of numbers that specify the lengths of alternating dashes and gaps in pixels. If an @@ -2668,7 +2671,7 @@ const double* strokeDashArray ( void ) const

      -

      strokeDashOffset

      +

      strokeDashOffset

      While drawing using a dash pattern, specify distance into the dash pattern to start the dash (default 0):

      @@ -2678,7 +2681,7 @@ double          strokeDashOffset ( void ) const
       
      -

      strokeLineCap

      +

      strokeLineCap

      Specify the shape to be used at the end of open subpaths when they are stroked. Values of LineCap are UndefinedCap, ButtCap, RoundCap, and SquareCap:

      @@ -2689,7 +2692,7 @@ LineCap strokeLineCap ( void ) const
      -

      strokeLineJoin

      +

      strokeLineJoin

      Specify 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:

      @@ -2700,7 +2703,7 @@ LineJoin strokeLineJoin ( void ) const
      -

      strokeMiterLimit

      +

      strokeMiterLimit

      Specify 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 @@ -2714,7 +2717,7 @@ unsigned int strokeMiterLimit ( void ) const

      -

      strokePattern

      +

      strokePattern

      Pattern image to use while stroking object outlines:

       void            strokePattern ( const Image &strokePattern_ )
      @@ -2723,7 +2726,7 @@ Image           strokePattern ( void  ) const
       
      -

      strokeWidth

      +

      strokeWidth

      Stroke width for drawing vector objects (default one):

       void            strokeWidth ( const double strokeWidth_ )
      @@ -2732,7 +2735,7 @@ double          strokeWidth ( void ) const
       
      -

      subImage

      +

      subImage

      Subimage of an image sequence:

       void            subImage ( const unsigned int subImage_ )
      @@ -2741,7 +2744,7 @@ unsigned int    subImage ( void ) const
       
      -

      subRange

      +

      subRange

      Number of images relative to the base image:

       void            subRange ( const unsigned int subRange_ )
      @@ -2750,7 +2753,7 @@ unsigned int    subRange ( void ) const
       
      -

      textEncoding

      +

      textEncoding

      Annotation text encoding (e.g. "UTF-16"):

       void            textEncoding ( const std::string &encoding_ )
      @@ -2759,7 +2762,7 @@ std::string     textEncoding ( void ) const
       
      -

      tileName

      +

      tileName

      Tile name:

       void            tileName ( const std::string &tileName_ )
      @@ -2768,56 +2771,56 @@ std::string     tileName ( void ) const
       
      -

      totalColors

      +

      totalColors

      Number of colors in the image:

       unsigned long   totalColors ( void )
       
      -

      transformOrigin

      +

      transformOrigin

      Origin of coordinate system to use when annotating with text or drawing:

       void            transformOrigin ( const double x_,const  double y_ )
       
      -

      transformRotation

      +

      transformRotation

      Rotation to use when annotating with text or drawing:

       void            transformRotation ( const double angle_ )
       
      -

      transformReset

      +

      transformReset

      Reset transformation parameters to default:

       void            transformReset ( void )
       
      -

      transformScale

      +

      transformScale

      Scale to use when annotating with text or drawing:

       void            transformScale ( const double sx_, const double sy_ )
       
      -

      transformSkewX

      +

      transformSkewX

      Skew to use in X axis when annotating with text or drawing:

       void            transformSkewX ( const double skewx_ )
       
      -

      transformSkewY

      +

      transformSkewY

      Skew to use in Y axis when annotating with text or drawing:

       void            transformSkewY ( const double skewy_ )
       
      -

      verbose

      +

      verbose

      Print detailed information about the image:

       void            verbose ( const bool verboseFlag_ )
      @@ -2826,7 +2829,7 @@ bool            verbose ( void ) const
       
      -

      view

      +

      view

      FlashPix viewing parameters:

       void            view ( const std::string &view_ )
      @@ -2835,7 +2838,7 @@ std::string     view ( void ) const
       
      -

      x11Display

      +

      x11Display

      X11 display to display to, obtain fonts from, or to capture image from:

      @@ -2845,7 +2848,7 @@ std::string     x11Display ( void ) const
       
      -

      xResolution

      +

      xResolution

      x resolution of the image:

       void            xResolution ( const double x_resolution )
      @@ -2853,7 +2856,7 @@ double          xResolution ( void ) const
       
      -

      yResolution

      +

      yResolution

      y resolution of the image:

       void            yResolution ( const double y_resolution )
      @@ -2924,18 +2927,18 @@ image.write("horse.png");
       

      The image cache supports the following methods:

      -

      getConstPixels

      +

      getConstPixels

      Transfers read-only pixels from the image to the pixel cache as defined by the specified region:

      @@ -2945,21 +2948,21 @@ const PixelPacket* getConstPixels ( const int x_, const int y_,
       
      -

      getIndexes

      +

      getIndexes

      Obtain mutable image pixel indexes (valid for PseudoClass images):

       IndexPacket* getIndexes ( void )
       
      -

      getConstIndexes

      +

      getConstIndexes

      Obtain immutable image pixel indexes (valid for PseudoClass images):

       const IndexPacket* getConstIndexes ( void ) const
       
      -

      getPixels

      +

      getPixels

      Transfers pixels from the image to the pixel cache as defined by the specified region. Modified pixels may be subsequently transferred back to the image via syncPixels. This method is valid for DirectClass @@ -2971,7 +2974,7 @@ PixelPacket* getPixels ( const int x_, const int y_,

      -

      setPixels

      +

      setPixels

      Allocates a pixel cache region to store image pixels as defined by the region rectangle. This area is subsequently transferred from the pixel cache to the image via syncPixels:

      @@ -2982,14 +2985,14 @@ PixelPacket* setPixels ( const int x_, const int y_,
      -

      syncPixels

      +

      syncPixels

      Transfers the image cache pixels to the image:

       void syncPixels ( void )
       
      -

      readPixels

      +

      readPixels

      Transfers one or more pixel components from a buffer or file into the image pixel cache of an image. Used to support image decoders:

      @@ -2998,16 +3001,89 @@ void readPixels ( const QuantumType quantum_,
       
      -

      writePixels

      +

      writePixels

      Transfers one or more pixel components from the image pixel cache to a buffer or file. Used to support image encoders:

       void writePixels ( const QuantumType quantum_,
                          unsigned char *destination_ )
       
      +
      +
      +
      +

      Explicit Logging Configuration And Callbacks

      +

      It is sometimes useful for a program to not have to depend on a +configuration file for configuring logging ("tracing"). One reason +for this is because until a logging configuration file has been found +and loaded, default logging parameters are used. Another reason is +that in some configurations, it is useful for each instance of a +program to use its own logging configuration. To make this possible, +the Magick++ library provides pass-through functions which allow +setting the logging defaults before InitializeMagick() is called. +Setting logging defaults after InitializeMagick() is called has no +purpose since they will not be used.

      +

      The following C++ pass-through functions are available"

      +
      +

      SetLogDefaultEventType

      +

      Specify default events which will result in a log event (comma-comma-separated list):

      +
      +void SetLogDefaultEventType(const std::string &events_)
      +
      +
      +
      +

      SetLogDefaultGenerations

      +

      Specify default maximum log file generations before overwriting the first name:

      +
      +void SetLogDefaultGenerations(const unsigned int generations_)
      +
      +
      +
      +

      SetLogDefaultLimit

      +

      Specify default maximum number of logging events before creating a new log file:

      +
      +void SetLogDefaultLimit(const unsigned int limit_)
      +
      +
      +
      +

      SetLogDefaultFileName

      +

      Specify the file name, or file path, to be written to for each log event:

      +
      +void SetLogDefaultFileName(const std::string &filename_)
      +
      +
      +
      +

      SetLogDefaultFormat

      +

      Specify default log format using the same special format characters used by "log.mgk":

      +
      +void SetLogDefaultFormat(const std::string &format_)
      +
      +
      +
      +

      SetLogDefaultLogMethod

      +

      Specify default C-language call-back function to be invoked for each log event:

      +
      +void SetLogDefaultLogMethod(const Magick::LogMethod method_)
      +
      +

      Note that it is hoped that better mechanisms will be provided in the future.

      +
      +
      +

      SetLogDefaultOutputType

      +

      Specify default logging output type/destination:

      +
      +void SetLogDefaultOutputType(const Magick::LogOutputType output_type_)
      +
      +

      Available LogOutputType enumerations are DisabledOutput, +UndefinedOutput, StdoutOutput, StderrOutput, XMLFileOutput, +TXTFileOutput, Win32DebugOutput, Win32EventlogOutput, and +MethodOutput.

      Copyright © Bob Friesenhahn 1999 - 2020

      + +
      +
      +

      Copyright © GraphicsMagick Group 2002 - 2020

      +
      diff --git a/www/Magick++/Image.html.orig b/www/Magick++/Image.html.orig new file mode 100644 index 0000000..7bb7ce7 --- /dev/null +++ b/www/Magick++/Image.html.orig @@ -0,0 +1,3013 @@ + + + + + + +Magick::Image Class + + + + + + + +
      +

      Magick::Image Class

      + + + + + +
      +

      Introduction

      +

      Image is the primary object in Magick++ and represents a single image +frame (see image design). The STL interface must be used to +operate on image sequences or images (e.g. of format GIF, TIFF, MIFF, +Postscript, & MNG) which are comprized of multiple image +frames. Individual frames of a multi-frame image may be requested by +adding array-style notation to the end of the file name +(e.g. "animation.gif[3]" retrieves the fourth frame of a GIF +animation. Various image manipulation operations may be applied to +the image. Attributes may be set on the image to influence the +operation of the manipulation operations. The Pixels class provides +low-level access to image pixels. As a convenience, including +<Magick++.h> is sufficient in order to use the complete Magick++ +API. The Magick++ API is enclosed within the Magick namespace so you +must either add the prefix " Magick:: " to each class/enumeration name +or add the statement " using namespace Magick;" after including the +Magick++.h header.

      +

      The InitializeMagick() function MUST be invoked before constructing +any Magick++ objects. This used to be optional, but now it is +absolutely required. This function initalizes semaphores and +configuration information necessary for the software to work +correctly. Failing to invoke InitializeMagick() is likely to lead to +a program crash or thrown assertion. If the program resides in the +same directory as the GraphicsMagick files, then argv[0] may be passed +as an argument so that GraphicsMagick knows where its files reside, +otherwise NULL may be passed and GraphicsMagick will try to use other +means (if necessary).

      +

      The preferred way to allocate Image objects is via automatic +allocation (on the stack). There is no concern that allocating Image +objects on the stack will excessively enlarge the stack since Magick++ +allocates all large data objects (such as the actual image data) from +the heap. Use of automatic allocation is preferred over explicit +allocation (via new) since it is much less error prone and allows use +of C++ scoping rules to avoid memory leaks. Use of automatic +allocation allows Magick++ objects to be assigned and copied just like +the C++ intrinsic data types (e.g. 'int '), leading to clear and easy +to read code. Use of automatic allocation leads to naturally +exception-safe code since if an exception is thrown, the object is +automatically deallocated once the stack unwinds past the scope of the +allocation (not the case for objects allocated via new ).

      +

      Image is very easy to use. For example, here is a the source to a +program which reads an image, crops it, and writes it to a new file +(the exception handling is optional but strongly recommended):

      +
      +#include <Magick++.h>
      +#include <iostream>
      +using namespace std;
      +using namespace Magick;
      +int main(int argc,char **argv)
      +{
      +  // Initialize the API.  Can pass NULL if argv is not available.
      +  InitializeMagick(*argv);
      +
      +  // Construct the image object. Seperating image construction from the
      +  // the read operation ensures that a failure to read the image file
      +  // doesn't render the image object useless.
      +  Image image;
      +
      +  try {
      +    // Determine if Warning exceptions are thrown.
      +    // Use is optional.  Set to true to block Warning exceptions.
      +    image.quiet( false );
      +
      +    // Read a file into image object
      +    image.read( "girl.gif" );
      +
      +    // Crop the image to specified size (width, height, xOffset, yOffset)
      +    image.crop( Geometry(100,100, 100, 100) );
      +
      +    // Write the image to a file
      +    image.write( "x.gif" );
      +  }
      +  catch( Exception &error_ )
      +    {
      +      cout << "Caught exception: " << error_.what() << endl;
      +      return 1;
      +    }
      +  return 0;
      +}
      +
      +

      The following is the source to a program which illustrates the use of +Magick++'s efficient reference-counted assignment and copy-constructor +operations which minimize use of memory and eliminate unncessary copy +operations (allowing Image objects to be efficiently assigned, and +copied into containers). The program accomplishes the following:

      +
        +
      1. Read master image.
      2. +
      3. Assign master image to second image.
      4. +
      5. Zoom second image to the size 640x480.
      6. +
      7. Assign master image to a third image.
      8. +
      9. Zoom third image to the size 800x600.
      10. +
      11. Write the second image to a file.
      12. +
      13. Write the third image to a file.
      14. +
      +
      +#include <Magick++.h>
      +#include <iostream>
      +using namespace std;
      +using namespace Magick;
      +int main(int argc,char **argv)
      +{
      +    InitializeMagick(*argv);
      +    Image master("horse.jpg");
      +    Image second = master;
      +    second.zoom("640x480");
      +    Image third = master;
      +    third.zoom("800x600");
      +    second.write("horse640x480.jpg");
      +    third.write("horse800x600.jpg");
      +    return 0;
      +}
      +
      +

      During the entire operation, a maximum of three images exist in memory +and the image data is never copied.

      +

      The following is the source for another simple program which creates a +100 by 100 pixel white image with a red pixel in the center and writes +it to a file:

      +
      +#include <Magick++.h>
      +using namespace std;
      +using namespace Magick;
      +int main(int argc,char **argv)
      +{
      +    InitializeMagick(*argv);
      +    Image image( "100x100", "white" );
      +    image.pixelColor( 49, 49, "red" );
      +    image.write( "red_pixel.png" );
      +    return 0;
      +}
      +
      +

      If you wanted to change the color image to grayscale, you could add +the lines:

      +
      +image.quantizeColorSpace( GRAYColorspace );
      +image.quantizeColors( 256 );
      +image.quantize( );
      +
      +

      or, more simply:

      +
      +image.type( GrayscaleType );
      +
      +

      prior to writing the image.

      +
      +
      +

      BLOBs

      +

      While encoded images (e.g. JPEG) are most often written-to and +read-from a disk file, encoded images may also reside in +memory. Encoded images in memory are known as BLOBs (Binary Large +OBjects) and may be represented using the Blob class. The encoded +image may be initially placed in memory by reading it directly from a +file, reading the image from a database, memory-mapped from a disk +file, or could be written to memory by Magick++. Once the encoded +image has been placed within a Blob, it may be read into a Magick++ +Image via a constructor or read() . Likewise, a Magick++ image may be +written to a Blob via write().

      +

      An example of using Image to write to a Blob follows:

      +
      +#include <Magick++.h>
      +using namespace std;
      +using namespace Magick;
      +int main(int argc,char **argv)
      +{
      +    // Read GIF file from disk
      +    Image image( "giraffe.gif" );
      +
      +    // Write to BLOB in JPEG format
      +    Blob blob;
      +    image.magick( "JPEG" ) // Set JPEG output format
      +    image.write( &blob );
      +
      +    [ Use BLOB data (in JPEG format) here ]
      +
      +    return 0;
      +}
      +
      +

      likewise, to read an image from a Blob, you could use one of the +following examples:

      +

      [ Entry condition for the following examples is that data is pointer +to encoded image data and length represents the size of the data ]

      +
      +Blob blob( data, length );
      +Image image( blob );
      +
      +

      or

      +
      +Blob blob( data, length );
      +Image image;
      +image.read( blob);
      +
      +

      Some images do not contain their size or format so the size and format +must be specified in advance:

      +
      +Blob blob( data, length );
      +Image image;
      +image.size( "640x480")
      +image.magick( "RGBA" );
      +image.read( blob);
      +
      +
      +
      +

      Construct An Image

      +

      An Image may be constructed in a number of ways. It may be constructed +from a file, a URL, or an encoded image (e.g. JPEG) contained in an +in-memory Blob . The following Image constructors and assignment +operators are available:

      +

      Construct from image file or image specification:

      +
      +Image( const std::string &imageSpec_ )
      +
      +

      Construct a blank image canvas of specified size and color:

      +
      +Image( const Geometry &size_, const Color &color_ )
      +
      +

      Construct Image from in-memory Blob:

      +
      +Image ( const Blob &blob_ )
      +
      +

      Construct Image of specified size from in-memory Blob:

      +
      +Image ( const Blob &blob_, const Geometry &size_ )
      +
      +

      Construct Image of specified size and depth from in-memory Blob:

      +
      +Image ( const Blob &blob_, const Geometry &size,
      +        const unsigned int depth )
      +
      +

      Construct Image of specified size, depth, and format from in-memory Blob:

      +
      +Image ( const Blob &blob_, const Geometry &size,
      +        const unsigned int depth_,
      +        const std::string &magick_ )
      +
      +

      Construct Image of specified size, and format from in-memory Blob:

      +
      +Image ( const Blob &blob_, const Geometry &size,
      +        const std::string &magick_ )
      +
      +

      Construct an image based on an array of raw pixels, of specified type +and mapping, in memory:

      +
      +Image ( const unsigned int width_,
      +        const unsigned int height_,
      +        const std::string &map_,
      +        const StorageType type_,
      +        const void *pixels_ )
      +
      +

      Default constructor:

      +
      +Image( void )
      +
      +

      Copy constructor:

      +
      +Image ( const Image & image_ )
      +
      +

      Assignment operator:

      +
      +Image& operator= ( const Image &image_ )
      +
      +
      +
      +

      Read Or Write An Image

      +
      + +
      +
      +

      ping

      +

      Ping is similar to read except only enough of the image is read to +determine the image columns, rows, and filesize. Access the +columns(), rows(), and fileSize() attributes after invoking ping. +Other attributes may also be available. The image pixels are not +valid after calling ping:

      +
      +void            ping ( const std::string &imageSpec_ )
      +
      +

      Ping is similar to read except only enough of the image is read +to determine the image columns, rows, and filesize. Access the +columns(), rows(), and fileSize() attributes after invoking +ping. The image pixels are not valid after calling ping:

      +
      +void            ping ( const Blob &blob_ )
      +
      +
      +
      +

      read

      +

      Read single image frame into current object. Use ping instead if you +want to obtain the basic attributes of the image without reading the +whole file/blob:

      +
      +void            read ( const std::string &imageSpec_ )
      +
      +

      Read single image frame of specified size into current object:

      +
      +void            read ( const Geometry &size_,
      +                       const std::string &imageSpec_ )
      +
      +

      Read single image frame from in-memory Blob:

      +
      +void            read ( const Blob        &blob_ )
      +
      +

      Read single image frame of specified size from in-memory Blob:

      +
      +void            read ( const Blob        &blob_,
      +                       const Geometry    &size_ )
      +
      +

      Read single image frame of specified size and depth from in-memory +Blob:

      +
      +void            read ( const Blob         &blob_,
      +                       const Geometry     &size_,
      +                       const unsigned int depth_ )
      +
      +

      Read single image frame of specified size, depth, and format from +in-memory Blob:

      +
      +void            read ( const Blob         &blob_,
      +                       const Geometry     &size_,
      +                       const unsigned int depth_,
      +                       const std::string  &magick_ )
      +
      +

      Read single image frame of specified size, and format from in-memory +Blob:

      +
      +void            read ( const Blob         &blob_,
      +                       const Geometry     &size_,
      +                       const std::string  &magick_ )
      +
      +

      Read single image frame from an array of raw pixels, with +specified storage type (ConstituteImage), e.g. +image.read( 640, 480, "RGB", 0, pixels ):

      +
      +void            read ( const unsigned int width_,
      +                       const unsigned int height_,
      +                       const std::string &map_,
      +                       const StorageType  type_,
      +                       const void        *pixels_ )
      +
      +
      +
      +

      write

      +

      Write single image frame to a file:

      +
      +void            write ( const std::string &imageSpec_ )
      +
      +

      Write single image frame to in-memory Blob, with optional format and +adjoin parameters:

      +
      +void            write ( Blob *blob_ )
      +
      +void            write ( Blob *blob_,
      +                        const std::string &magick_ )
      +
      +void            write ( Blob *blob_,
      +                        const std::string &magick_,
      +                        const unsigned int depth_ )
      +
      +

      Write single image frame to an array of pixels with storage type +specified by user (DispatchImage), e.g. image.write( 0, 0, 640, 1, +"RGB", 0, pixels ):

      +
      +void            write ( const int x_,
      +                        const int y_,
      +                        const unsigned int columns_,
      +                        const unsigned int rows_,
      +                        const std::string& map_,
      +                        const StorageType type_,
      +                        void *pixels_ )
      +
      +
      +
      +
      +

      Manipulate An Image

      +

      Image supports access to all the single-image (versus image-list) +manipulation operations provided by the GraphicsMagick library. If you +must process a multi-image file (such as an animation), the STL +interface , which provides a multi-image abstraction on top of Image, +must be used.

      +

      Image manipulation methods are very easy to use. For example:

      +
      +Image image;
      +image.read("myImage.tiff");
      +image.addNoise(GaussianNoise);
      +image.write("myImage.tiff");
      +
      +

      adds gaussian noise to the image file "myImage.tiff".

      +

      The following image manipulation methods are available:

      + +
      +

      adaptiveThreshold

      +

      Apply adaptive thresholding to the image (see +http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm). Adaptive +thresholding is useful if the ideal threshold level is not known in +advance, or if the illumination gradient is not constant across the +image. Adaptive thresholding works by evaulating the mean (average) of +a pixel region (size specified by width and height) and using the mean +as the thresholding value. In order to remove residual noise from the +background, the threshold may be adjusted by subtracting a constant +offset (default zero) from the mean to compute the threshold:

      +
      +void            adaptiveThreshold ( const unsigned int width,
      +                                    const unsigned int height,
      +                                    const double offset = 0.0 )
      +
      +
      +
      +

      addNoise

      +

      Add noise to image with the specified noise type:

      +
      +void            addNoise ( const NoiseType noiseType_ )
      +
      +
      +
      +

      addNoiseChannel

      +

      Add noise to an image channel with the specified noise type. The +channel parameter specifies the channel to add noise to. The +noiseType parameter specifies the type of noise:

      +
      +void            addNoiseChannel ( const ChannelType channel_,
      +                                  const NoiseType noiseType_)
      +
      +
      +
      +

      affineTransform

      +

      Transform image by specified affine (or free transform) matrix:

      +
      +void            affineTransform ( const DrawableAffine &affine )
      +
      +
      +
      +

      annotate

      +

      Annotate image (draw text on image)

      +

      Gravity effects text placement in bounding area according to these +rules:

      +
      +
      NorthWestGravity
      +
      text bottom-left corner placed at top-left
      +
      NorthGravity
      +
      text bottom-center placed at top-center
      +
      NorthEastGravity
      +
      text bottom-right corner placed at top-right
      +
      WestGravity
      +
      text left-center placed at left-center
      +
      CenterGravity
      +
      text center placed at center
      +
      EastGravity
      +
      text right-center placed at right-center
      +
      SouthWestGravity
      +
      text top-left placed at bottom-left
      +
      SouthGravity
      +
      text top-center placed at bottom-center
      +
      SouthEastGravity
      +
      text top-right placed at bottom-right
      +
      +

      Annotate using specified text, and placement location:

      +
      +void            annotate ( const std::string &text_,
      +                           const Geometry &location_ )
      +
      +

      Annotate using specified text, bounding area, and placement gravity:

      +
      +void            annotate ( const std::string &text_,
      +                           const Geometry &boundingArea_,
      +                           const GravityType gravity_ )
      +
      +

      Annotate with text using specified text, bounding area, placement +gravity, and rotation:

      +
      +void            annotate ( const std::string &text_,
      +                           const Geometry &boundingArea_,
      +                           const GravityType gravity_,
      +                           const double degrees_ )
      +
      +

      Annotate with text (bounding area is entire image) and placement +gravity:

      +
      +void            annotate ( const std::string &text_,
      +                           const GravityType gravity_ )
      +
      +
      +
      +

      autoOrient

      +

      Automatically orient image to be right-side up based on its current +orientation attribute. This allows the image to be viewed correctly +when the orientation attribute is not available, or is not respected:

      +
      +void            autoOrient( void )
      +
      +
      +
      +

      blur

      +

      Blur an image with the specified blur factor.

      +

      The radius parameter specifies the radius of the Gaussian, in +pixels, not counting the center pixel. The sigma parameter +specifies the standard deviation of the Laplacian, in pixels:

      +
      +void            blur ( const double radius_ = 0.0,
      +                       const double sigma_ = 1.0  )
      +
      +
      +
      +

      blurChannel

      +

      Blur an image channel with the specified blur factor.

      +

      The channel parameter specifies the channel to modify. The radius +parameter specifies the radius of the Gaussian, in pixels, not +counting the center pixel. The sigma parameter specifies the +standard deviation of the Laplacian, in pixels:

      +
      +void            blurChannel ( const ChannelType channel_,
      +                              const double radius_ = 0.0,
      +                              const double sigma_ = 1.0  )
      +
      +
      +
      +

      border

      +

      Border image (add border to image). The color of the border is +specified by the borderColor attribute:

      +
      +void            border ( const Geometry &geometry_
      +                         = borderGeometryDefault )
      +
      +
      +
      +

      cdl

      +

      Bake in the ASC-CDL, which is a convention for the for the exchange of +basic primary color grading information between for the exchange of +basic primary color grading information between equipment and software +from different manufacturers. It is a useful transform for other +purposes as well:

      +
      +void cdl ( const std::string &cdl_ )
      +

      See CdlImage for more details on the ASC-CDL.

      +
      +
      +

      channel

      +

      Extract channel from image. Use this option to extract a particular +channel from the image. MatteChannel for example, is useful for +extracting the opacity values from an image:

      +
      +void            channel ( const ChannelType channel_ )
      +
      +
      +
      +

      channelDepth

      +

      Set or obtain modulus channel depth:

      +
      +void            channelDepth ( const ChannelType channel_,
      +                               const unsigned int depth_ )
      +
      +unsigned int    channelDepth ( const ChannelType channel_ )
      +
      +
      +
      +

      charcoal

      +

      Charcoal effect image (looks like charcoal sketch).

      +

      The radius parameter specifies the radius of the Gaussian, in +pixels, not counting the center pixel. The sigma parameter +specifies the standard deviation of the Laplacian, in pixels:

      +
      +void            charcoal ( const double radius_ = 0.0,
      +                           const double sigma_ = 1.0 )
      +
      +
      +
      +

      chop

      +

      Chop image (remove vertical or horizontal subregion of image):

      +
      +void            chop ( const Geometry &geometry_ )
      +
      +
      +
      +

      colorize

      +

      Colorize image with pen color, using specified percent opacity for +red, green, and blue quantums:

      +
      +void            colorize ( const unsigned int opacityRed_,
      +                           const unsigned int opacityGreen_,
      +                           const unsigned int opacityBlue_,
      +                           const Color &penColor_ )
      +
      +

      Colorize image with pen color, using specified percent opacity:

      +
      +void            colorize ( const unsigned int opacity_,
      +                           const Color &penColor_ )
      +
      +
      +
      +

      colorMatrix

      +

      Apply a color matrix to the image channels. The user supplied matrix +may be of order 1 to 5 (1x1 through 5x5):

      +
      +void            colorMatrix (const unsigned int order_,
      +                             const double *color_matrix_)
      +
      +

      See ColorMatrixImage for more details.

      +
      +
      +

      comment

      +

      Comment image (add comment string to image). By default, each image is +commented with its file name. Use this method to assign a specific +comment to the image. Optionally you can include the image filename, +type, width, height, or other image attributes by embedding special +format characters:

      +
      +void            comment ( const std::string &comment_ )
      +
      +
      +
      +

      compare

      +

      Compare current image with another image. Sets meanErrorPerPixel, +normalizedMaxError, and normalizedMeanError in the current +image. False is returned if the images are identical. An ErrorOption +exception is thrown if the reference image columns, rows, colorspace, +or matte differ from the current image:

      +
      +bool            compare ( const Image &reference_ )
      +
      +
      +
      +

      composite

      +

      Compose an image onto another at specified x and y offset and using a +specified algorithm:

      +
      +void            composite ( const Image &compositeImage_,
      +                            const int xOffset_,
      +                            const int yOffset_,
      +                            const CompositeOperator compose_
      +                            = InCompositeOp )
      +
      +void            composite ( const Image &compositeImage_,
      +                            const Geometry &offset_,
      +                            const CompositeOperator compose_
      +                            = InCompositeOp )
      +
      +void            composite ( const Image &compositeImage_,
      +                            const GravityType gravity_,
      +                            const CompositeOperator compose_
      +                            = InCompositeOp )
      +
      +
      +
      +

      contrast

      +

      Contrast image (enhance intensity differences in image):

      +
      +void            contrast ( const unsigned int sharpen_ )
      +
      +
      +
      +

      convolve

      +

      Convolve image. Applies a user-specified convolution to the image. +The order parameter represents the number of columns and rows in the +filter kernel while kernel is a two-dimensional array of doubles +representing the convolution kernel to apply:

      +
      +void            convolve ( const unsigned int order_,
      +                           const double *kernel_ )
      +
      +
      +
      +

      crop

      +

      Crop image (return subregion of original image):

      +
      +void            crop ( const Geometry &geometry_ )
      +
      +
      +
      +

      cycleColormap

      +

      Cycle (rotate) image colormap:

      +
      +void            cycleColormap ( const int amount_ )
      +
      +
      +
      +

      despeckle

      +

      Despeckle image (reduce speckle noise):

      +
      +void            despeckle ( void )
      +
      +
      +
      +

      display

      +

      Display image on screen. Caution: if an image format is is not +compatible with the display visual (e.g. JPEG on a colormapped +display) then the original image will be altered. Use a copy of the +original if this is a problem:

      +
      +void display ( void )
      +
      +
      +

      draw

      +

      Draw shape or text on image using a single drawable object:

      +
      +void            draw ( const Drawable &drawable_ );
      +
      +

      Draw shapes or text on image using a set of Drawable objects +contained in an STL list. Use of this method improves drawing +performance and allows batching draw objects together in a list for +repeated use:

      +
      +void            draw ( const std::list<Magick::Drawable> &drawable_ );
      +
      +
      +
      +

      edge

      +

      Edge image (hilight edges in image). The radius is the radius of the +pixel neighborhood.. Specify a radius of zero for automatic radius +selection:

      +
      +void            edge ( const double radius_ = 0.0 )
      +
      +
      +
      +

      emboss

      +

      Emboss image (hilight edges with 3D effect). The radius parameter +specifies the radius of the Gaussian, in pixels, not counting the +center pixel. The sigma parameter specifies the standard deviation +of the Laplacian, in pixels:

      +
      +void            emboss ( const double radius_ = 0.0,
      +                         const double sigma_ = 1.0)
      +
      +
      +
      +

      enhance

      +

      Enhance image (minimize noise):

      +
      +void            enhance ( void );
      +
      +
      +
      +

      equalize

      +

      Equalize image (histogram equalization):

      +
      +void            equalize ( void )
      +
      +
      +
      +

      erase

      +

      Set all image pixels to the current background color:

      +
      +void            erase ( void )
      +
      +
      +
      +

      extent

      +

      Create an image canvas using background color sized according to +geometry and composite existing image on it, with image placement +controlled by gravity. Parameters are obtained from existing image +properties if they are not specified via a method +parameter. Parameters which are supported by image properties (gravity +and backgroundColor) update those image properties as a side-effect:

      +
      +void            extent ( const Geometry &geometry_ )
      +
      +void            extent ( const Geometry &geometry_,
      +                         const GravityType &gravity_ )
      +
      +void            extent ( const Geometry &geometry_,
      +                         const Color &backgroundColor_ )
      +
      +void            extent ( const Geometry &geometry_,
      +                         const Color &backgroundColor_,
      +                         const GravityType &gravity_ );
      +
      +
      +
      +

      flip

      +

      Flip image (reflect each scanline in the vertical direction):

      +
      +void            flip ( void )
      +
      +
      +
      +

      floodFillColor

      +

      Flood-fill color across pixels that match the color of the target +pixel and are neighbors of the target pixel. Uses current fuzz +setting when determining color match:

      +
      +void            floodFillColor( const unsigned int x_,
      +                                const unsigned int y_,
      +                                const Color &fillColor_ )
      +
      +void            floodFillColor( const Geometry &point_,
      +                                const Color &fillColor_ )
      +
      +

      Flood-fill color across pixels starting at target-pixel and stopping +at pixels matching specified border color. Uses current fuzz setting +when determining color match:

      +
      +void            floodFillColor( const unsigned int x_,
      +                                const unsigned int y_,
      +                                const Color &fillColor_,
      +                                const Color &borderColor_ )
      +
      +void            floodFillColor( const Geometry &point_,
      +                                const Color &fillColor_,
      +                                const Color &borderColor_ )
      +
      +
      +
      +

      floodFillOpacity

      +

      Flood-fill pixels matching color (within fuzz factor) of target +pixel(x,y) with replacement opacity value using method:

      +
      +void            floodFillOpacity ( const unsigned int x_,
      +                                   const unsigned int y_,
      +                                   const unsigned int opacity_,
      +                                   const PaintMethod method_ )
      +
      +
      +
      +

      floodFillTexture

      +

      Flood-fill texture across pixels that match the color of the +target pixel and are neighbors of the target pixel. +Uses current fuzz setting when determining color match:

      +
      +void            floodFillTexture( const unsigned int x_,
      +                                  const unsigned int y_,
      +                                  const Image &texture_ )
      +
      +void            floodFillTexture( const Geometry &point_,
      +                                  const Image &texture_ )
      +
      +

      Flood-fill texture across pixels starting at target-pixel and +stopping at pixels matching specified border color. +Uses current fuzz setting when determining color match:

      +
      +void            floodFillTexture( const unsigned int x_,
      +                                  const unsigned int y_,
      +                                  const Image &texture_,
      +                                  const Color &borderColor_ )
      +
      +void            floodFillTexture( const Geometry &point_,
      +                                  const Image &texture_,
      +                                  const Color &borderColor_ )
      +
      +
      +
      +

      flop

      +

      Flop image (reflect each scanline in the horizontal direction):

      +
      +void            flop ( void );
      +
      +
      +
      +

      frame

      +

      Draw a decorative frame around the image:

      +
      +void            frame ( const Geometry &geometry_ = frameGeometryDefault )
      +
      +void            frame ( const unsigned int width_,
      +                        const unsigned int height_,
      +                        const int innerBevel_ = 6,
      +                        const int outerBevel_ = 6 )
      +
      +
      +
      +

      gamma

      +

      Gamma correct the image or individual image channels:

      +
      +void            gamma ( const double gamma_ )
      +
      +void            gamma ( const double gammaRed_,
      +                        const double gammaGreen_,
      +                        const double gammaBlue_ )
      +
      +
      +
      +

      gaussianBlur

      +

      Gaussian blur image. The number of neighbor pixels to be included in +the convolution mask is specified by width. The standard deviation +of the gaussian bell curve is specified by sigma:

      +
      +void            gaussianBlur ( const double width_, const double sigma_ )
      +
      +
      +
      +

      gaussianBlurChannel

      +

      Gaussian blur image channel. The number of neighbor pixels to be +included in the convolution mask is specified by width. The +standard deviation of the gaussian bell curve is specified by +sigma:

      +
      +void            gaussianBlurChannel ( const ChannelType channel_,
      +                                      const double width_,
      +                                      const double sigma_ )
      +
      +
      +
      +

      implode

      +

      Implode image (special effect):

      +
      +void            implode ( const double factor_ )
      +
      +
      +
      +

      haldClut

      +

      Apply a color lookup table (Hald CLUT) to the image:

      +
      +void            haldClut ( const Image &clutImage_ )
      +
      +

      See HaldClutImage for more details.

      +
      +
      +

      label

      +

      Assign a label to an image. Use this option to assign a specific label +to the image. Optionally you can include the image filename, type, +width, height, or scene number in the label by embedding special +format characters. If the first character of string is @, the image +label is read from a file titled by the remaining characters in the +string. When converting to Postscript, use this option to specify a +header string to print above the image:

      +
      +void            label ( const std::string &label_ )
      +
      +
      +
      +

      level

      +

      Level image to increase image contrast, and/or adjust image +gamma. Adjust the levels of the image by scaling the colors falling +between specified white and black points to the full available quantum +range. The parameters provided represent the black, mid (gamma), and +white points. The black point specifies the darkest color in the +image. Colors darker than the black point are set to zero. Mid point +(gamma) specifies a gamma correction to apply to the image. White +point specifies the lightest color in the image. Colors brighter than +the white point are set to the maximum quantum value. The black and +white point have the valid range 0 to MaxRGB while mid (gamma) has a +useful range of 0 to ten:

      +
      +void            level ( const double black_point,
      +                        const double white_point,
      +                        const double mid_point=1.0 )
      +
      +
      +
      +

      levelChannel

      +

      Level image channel to increase image contrast, and/or adjust image +gamma. Adjust the levels of the image channel by scaling the colors +falling between specified white and black points to the full available +quantum range. The parameters provided represent the black, mid +(gamma), and white points. The black point specifies the darkest +color in the image. Colors darker than the black point are set to +zero. Mid point (gamma) specifies a gamma correction to apply to the +image. White point specifies the lightest color in the image. Colors +brighter than the white point are set to the maximum quantum +value. The black and white point have the valid range 0 to MaxRGB +while mid (gamma) has a useful range of 0 to ten:

      +
      +void            levelChannel ( const ChannelType channel,
      +                               const double black_point,
      +                               const double white_point,
      +                               const double mid_point=1.0 )
      +
      +
      +
      +

      magnify

      +

      Magnify image by integral size (double the dimensions):

      +
      +void            magnify ( void )
      +
      +
      +
      +

      map

      +

      Remap image colors with closest color from a reference image. Set +dither to true in to apply Floyd/Steinberg error diffusion to the +image. By default, color reduction chooses an optimal set of colors +that best represent the original image. Alternatively, you can choose +a particular set of colors from an image file with this option:

      +
      +void            map ( const Image &mapImage_ ,
      +                      const bool dither_ = false )
      +
      +
      +
      +

      matteFloodfill

      +

      Floodfill designated area with a replacement opacity value:

      +
      +void            matteFloodfill ( const Color &target_ ,
      +                                 const unsigned int opacity_,
      +                                 const int x_, const int y_,
      +                                 const PaintMethod method_ )
      +
      +
      +
      +

      medianFilter

      +

      Filter image by replacing each pixel component with the median color +in a circular neighborhood:

      +
      +void            medianFilter ( const double radius_ = 0.0 )
      +
      +
      +
      +

      minify

      +

      Reduce image by integral (half) size:

      +
      +void            minify ( void )
      +
      +
      +
      +

      modifyImage

      +

      Prepare to update image (copy if reference > 1). Normally Magick++'s +implicit reference counting takes care of all instance management. In +the rare case that the automatic instance management does not work, +use this method to assure that there is only one reference to the +image to be modified. It should be used in the cases where a +GraphicsMagick C function is used directly on an image which may have +multiple references:

      +
      +void            modifyImage ( void )
      +
      +
      +
      +

      modulate

      +

      Modulate percent hue, saturation, and brightness of an image. +Modulation of saturation and brightness is as a ratio of the current +value (1.0 for no change). Modulation of hue is an absolute rotation +of -180 degrees to +180 degrees from the current position +corresponding to an argument range of 0 to 2.0 (1.0 for no change):

      +
      +void            modulate ( const double brightness_,
      +                           const double saturation_,
      +                           const double hue_ )
      +
      +
      +
      +

      motionBlur

      +

      Motion blur image with specified blur factor. The radius parameter +specifies the radius of the Gaussian, in pixels, not counting the +center pixel. The sigma parameter specifies the standard +deviation of the Laplacian, in pixels. The angle parameter +specifies the angle the object appears to be comming from (zero +degrees is from the right):

      +
      +void            motionBlur ( const double radius_,
      +                             const double sigma_,
      +                             const double angle_ )
      +
      +
      +
      +

      negate

      +

      Negate colors in image. Set grayscale to only negate grayscale +values in image:

      +
      +void            negate ( const bool grayscale_ = false )
      +
      +
      +
      +

      normalize

      +

      Normalize image (increase contrast by normalizing the pixel values to +span the full range of color values):

      +
      +void            normalize ( void )
      +
      +
      +
      +

      oilPaint

      +

      Oilpaint image (image looks like an oil painting):

      +
      +void            oilPaint ( const double radius_ = 3.0 )
      +
      +
      +
      +

      opacity

      +

      Set or attenuate the opacity channel in the image. If the image pixels +are opaque then they are set to the specified opacity value, otherwise +they are blended with the supplied opacity value. The value of +opacity ranges from 0 (completely opaque) to MaxRGB. The defines +OpaqueOpacity and TransparentOpacity are available to specify +completely opaque or completely transparent, respectively:

      +
      +void            opacity ( const unsigned int opacity_ )
      +
      +
      +
      +

      opaque

      +

      Change color of specified opaque pixel to specified pen color:

      +
      +void            opaque ( const Color &opaqueColor_,
      +                         const Color &penColor_ )
      +
      +
      +
      +

      quantize

      +

      Quantize image (reduce number of colors). Set measureError to true +in order to calculate error attributes:

      +
      +void            quantize ( const bool measureError_ = false )
      +
      +
      +
      +

      quantumOperator

      +

      Apply an arithmetic or bitwise operator to the image pixel quantums:

      +
      +void            quantumOperator ( const ChannelType channel_,
      +                                  const QuantumOperator operator_,
      +                                  double rvalue_)
      +
      +void            quantumOperator ( const int x_,const int y_,
      +                                  const unsigned int columns_,
      +                                  const unsigned int rows_,
      +                                  const ChannelType channel_,
      +                                  const QuantumOperator operator_,
      +                                  const double rvalue_)
      +
      +
      +
      +

      process

      +

      Execute a named process module using an argc/argv syntax similar to +that accepted by a C 'main' routine. An exception is thrown if the +requested process module doesn't exist, fails to load, or fails during +execution:

      +
      +void            process ( std::string name_,
      +                          const int argc_,
      +                          char **argv_ )
      +
      +
      +
      +

      raise

      +

      Raise image (lighten or darken the edges of an image to give a 3-D +raised or lowered effect):

      +
      +void            raise ( const Geometry &geometry_ = "6x6+0+0",
      +                        const bool raisedFlag_ = false )
      +
      +
      +
      +

      randomThreshold

      +

      Random threshold image.

      +

      Changes the value of individual pixels based on the intensity +of each pixel compared to a random threshold. The result is a +low-contrast, two color image. The thresholds argument is a +geometry containing LOWxHIGH thresholds. If the string +contains 2x2, 3x3, or 4x4, then an ordered dither of order 2, +3, or 4 will be performed instead. If a channel argument is +specified then only the specified channel is altered. This is +a very fast alternative to 'quantize' based dithering:

      +
      +void            randomThreshold( const Geometry &thresholds_ )
      +
      +
      +
      +

      randomThresholdChannel

      +

      Random threshold image channel.

      +

      Changes the value of individual pixels based on the intensity of each +pixel compared to a random threshold. The result is a low-contrast, +two color image. The thresholds argument is a geometry containing +LOWxHIGH thresholds. If the string contains 2x2, 3x3, or 4x4, then an +ordered dither of order 2, 3, or 4 will be performed instead. If a +channel argument is specified then only the specified channel is +altered. This is a very fast alternative to 'quantize' based +dithering:

      +
      +void            randomThresholdChannel( const Geometry &thresholds_,
      +                                        const ChannelType channel_ )
      +
      +
      +
      +

      reduceNoise

      +

      Reduce noise in image using a noise peak elimination filter:

      +
      +void            reduceNoise ( void )
      +
      +void            reduceNoise ( const double order_ )
      +
      +
      +
      +

      resize

      +

      Resize image, specifying geometry, filter, and blur (blur > 1.0 is +more blurry and < 1.0 is sharper):

      +
      +void            resize ( const Geometry &geometry_,
      +                         const FilterTypes filterType_,
      +                         const double blur_ )
      +
      +

      Resize image, specifying geometry and filter, with blur using Image +default:

      +
      +void            resize ( const Geometry &geometry_,
      +                         const FilterTypes filterType_ )
      +
      +

      Resize image, specifying only geometry, with filter and blur obtained +from Image default. Provides the same result as the zoom method:

      +
      +void            resize ( const Geometry &geometry_ );
      +
      +
      +
      +

      roll

      +

      Roll image (rolls image vertically and horizontally) by specified +number of columnms and rows):

      +
      +void            roll ( const Geometry &roll_ )
      +
      +void            roll ( const unsigned int columns_,
      +                       const unsigned int rows_ )
      +
      +
      +
      +

      rotate

      +

      Rotate image counter-clockwise by specified number of degrees:

      +
      +void            rotate ( const double degrees_ )
      +
      +
      +
      +

      sample

      +

      Resize image by using pixel sampling algorithm:

      +
      +void            sample ( const Geometry &geometry_ )
      +
      +
      +
      +

      scale

      +

      Resize image by using simple ratio algorithm which provides good +quality:

      +
      +void            scale ( const Geometry &geometry_ )
      +
      +
      +
      +

      thumbnail

      +

      Resize image using several algorithms to make smaller images very +quickly. This is very useful to create thumbnails from large images +but usually works well for any image resizing purpose:

      +
      +void            thumbnail ( const Geometry &geometry_ );
      +
      +
      +
      +

      segment

      +

      Segment (coalesce similar image components) by analyzing the +histograms of the color components and identifying units that are +homogeneous with the fuzzy c-means technique. A histogram is built +for the image. This histogram is filtered to reduce noise and a +second derivative of the histogram plot is built and used to identify +potential cluster colors (peaks in the histogram). The cluster colors +are then validated by scanning through all of the pixels to see how +many pixels fall within each cluster. Some candidate cluster colors +may not match any of the image pixels at all and should be discarded. +Specify clusterThreshold, as the number of pixels matching a cluster +color in order for the cluster to be considered +valid. SmoothingThreshold eliminates noise in the second derivative +of the histogram. As the value is increased, you can expect a smoother +second derivative. The default is 1.5:

      +
      +void            segment ( const double clusterThreshold_ = 1.0,
      +                          const double smoothingThreshold_ = 1.5 )
      +
      +
      +
      +

      shade

      +

      Shade image using distant light source. Specify azimuth and +elevation as the position of the light source. By default, the +shading results as a grayscale image.. Set colorShading to true to +shade the red, green, and blue components of the image:

      +
      +void            shade ( const double azimuth_ = 30,
      +                        const double elevation_ = 30,
      +                        const bool   colorShading_ = false )
      +
      +
      +
      +

      sharpen

      +

      Sharpen pixels in image. The radius parameter specifies the radius +of the Gaussian, in pixels, not counting the center pixel. The +sigma parameter specifies the standard deviation of the Laplacian, +in pixels:

      +
      +void            sharpen ( const double radius_ = 0.0,
      +                          const double sigma_ = 1.0 )
      +
      +
      +
      +

      sharpenChannel

      +

      Sharpen pixels in image channel. The radius parameter specifies the +radius of the Gaussian, in pixels, not counting the center pixel. The +sigma parameter specifies the standard deviation of the Laplacian, +in pixels:

      +
      +void            sharpenChannel ( const ChannelType channel_,
      +                                 const double radius_ = 0.0,
      +                                 const double sigma_ = 1.0 )
      +
      +
      +
      +

      shave

      +

      Shave pixels from image edges:

      +
      +void            shave ( const Geometry &geometry_ )
      +
      +
      +
      +

      shear

      +

      Shear image (create parallelogram by sliding image by X or Y +axis). Shearing slides one edge of an image along the X or Y axis, +creating a parallelogram. An X direction shear slides an edge along +the X axis, while a Y direction shear slides an edge along the Y axis. +The amount of the shear is controlled by a shear angle. For X +direction shears, x degrees is measured relative to the Y axis, and +similarly, for Y direction shears y degrees is measured relative to +the X axis. Empty triangles left over from shearing the image are +filled with the color defined as borderColor:

      +
      +void            shear ( const double xShearAngle_,
      +                        const double yShearAngle_ )
      +
      +
      +
      +

      solarize

      +

      Solarize image (similar to effect seen when exposing a photographic +film to light during the development process):

      +
      +void            solarize ( const double factor_ = 50.0 )
      +
      +
      +
      +

      spread

      +

      Spread pixels randomly within image by specified ammount:

      +
      +void            spread ( const unsigned int amount_ = 3 )
      +
      +
      +
      +

      stegano

      +

      Add a digital watermark to the image (based on second image):

      +
      +void            stegano ( const Image &watermark_ )
      +
      +
      +
      +

      stereo

      +

      Create an image which appears in stereo when viewed with red-blue +glasses (Red image on left, blue on right):

      +
      +void            stereo ( const Image &rightImage_ )
      +
      +
      +
      +

      strip

      +

      Remove all profiles and text attributes from the image.

      +
      +void strip ( void );
      +
      +
      +

      swirl

      +

      Swirl image (image pixels are rotated by degrees):

      +
      +void            swirl ( const double degrees_ )
      +
      +
      +
      +

      texture

      +

      Channel a texture on pixels matching image background color:

      +
      +void            texture ( const Image &texture_ )
      +
      +
      +
      +

      threshold

      +

      Threshold image channels (below threshold becomes black, above +threshold becomes white). The range of the threshold parameter is 0 +to MaxRGB:

      +
      +void            threshold ( const double threshold_ )
      +
      +
      +
      +

      transform

      +

      Transform image based on image and crop geometries. Crop geometry is +optional:

      +
      +void            transform ( const Geometry &imageGeometry_ )
      +
      +void            transform ( const Geometry &imageGeometry_,
      +                            const Geometry &cropGeometry_  )
      +
      +
      +
      +

      transparent

      +

      Add matte channel to image, setting pixels matching color to +transparent:

      +
      +void            transparent ( const Color &color_ )
      +
      +
      +
      +

      trim

      +

      Trim edges that are the background color from the image:

      +
      +void            trim ( void )
      +
      +
      +
      +

      type

      +

      Convert the image representation to the specified type or retrieve the +current image type. If the image is reduced to an inferior type, then +image information may be lost (e.g. color changed to grayscale).

      +

      Available enumerations for the type parameter:

      +
      +
      +
      BilevelType
      +
      black/white
      +
      GrayscaleType
      +
      grayscale
      +
      GrayscaleMatteType
      +
      grayscale with alpha (opacity) channel
      +
      PaletteType
      +
      colormapped
      +
      PaletteMatteType
      +
      colormapped with transparency
      +
      TrueColorType
      +
      true (full) color
      +
      TrueColorMatteType
      +
      true (full) color with alpha (opacity) channel
      +
      ColorSeparationType
      +
      Cyan, magenta, yellow, and black
      +
      ColorSeparationMatteType
      +
      Cyan, magenta, yellow, and black with alpha (opacity) channel
      +
      OptimizeType
      +
      Optimize the image type to best represent the existing pixels
      +
      +
      +
      +void            type ( const ImageType type_ )
      +
      +ImageType       type ( void ) const
      +
      +
      +
      +

      unsharpmask

      +

      Replace image with a sharpened version of the original image using the +unsharp mask algorithm.

      +
      +
      +
      radius
      +
      the radius of the Gaussian, in pixels, not counting the +center pixel.
      +
      sigma
      +
      the standard deviation of the Gaussian, in pixels.
      +
      amount
      +
      the percentage of the difference between the original and +the blur image that is added back into the original.
      +
      threshold
      +
      the threshold in pixels needed to apply the diffence amount.
      +
      +
      +
      +void            unsharpmask ( const double radius_,
      +                              const double sigma_,
      +                              const double amount_,
      +                              const double threshold_ )
      +
      +
      +
      +

      unsharpmaskChannel

      +

      Replace image channel with a sharpened version of the original image +using the unsharp mask algorithm.

      +
      +
      +
      channel
      +
      image channel to modify.
      +
      radius
      +
      the radius of the Gaussian, in pixels, not counting the +center pixel.
      +
      sigma
      +
      the standard deviation of the Gaussian, in pixels.
      +
      amount
      +
      the percentage of the difference between the original and +the blur image that is added back into the original.
      +
      threshold
      +
      the threshold in pixels needed to apply the diffence amount.
      +
      +
      +
      +void            unsharpmaskChannel ( const ChannelType channel_,
      +                                     const double radius_,
      +                                     const double sigma_,
      +                                     const double amount_,
      +                                     const double threshold_ );
      +
      +
      +
      +

      wave

      +

      Map image pixels to a sine wave:

      +
      +void            wave ( const double amplitude_ = 25.0,
      +                       const double wavelength_ = 150.0 )
      +
      +
      +
      +

      zoom

      +

      Zoom (resize) image to specified size:

      +
      +void            zoom ( const Geometry &geometry_ )
      +
      +
      +
      +
      +

      Set/Get Image Attributes

      +

      Image attributes are set and obtained via methods in Image. Except for +methods which accept pointer arguments (e.g. chromaBluePrimary) all +methods return attributes by value.

      +

      Image attributes are easily used. For example, to set the resolution +of the TIFF file "file.tiff" to 150 dots-per-inch (DPI) in both the +horizontal and vertical directions, you can use the following example +code:

      +
      +string filename("file.tiff");
      +Image image;
      +image.read(filename);
      +image.resolutionUnits(PixelsPerInchResolution);
      +image.density(Geometry(150,150));   // could also use image.density("150x150")
      +image.write(filename)
      +
      +

      The following image attribute methods are available:

      + +
      +

      adjoin

      +

      Join images into a single multi-image file:

      +
      +void            adjoin ( const bool flag_ )
      +
      +bool            adjoin ( void ) const
      +
      +
      +
      +

      antiAlias

      +

      Control antialiasing of rendered Postscript and Postscript or TrueType +fonts. Enabled by default:

      +
      +void            antiAlias( const bool flag_ )
      +
      +bool            antiAlias( void )
      +
      +
      +
      +

      animationDelay

      +

      Time in 1/100ths of a second (0 to 65535) which must expire before +displaying the next image in an animated sequence. This option is +useful for regulating the animation of a sequence of GIF images within +Netscape:

      +
      +void            animationDelay ( const unsigned int delay_ )
      +
      +unsigned int    animationDelay ( void ) const
      +
      +
      +
      +

      animationIterations

      +

      Number of iterations to loop an animation (e.g. Netscape loop +extension) for:

      +
      +void            animationIterations ( const unsigned int iterations_ )
      +
      +unsigned int    animationIterations ( void ) const
      +
      +
      +
      +

      attribute

      +

      Access or update an arbitrary named image attribute. Any number of +named attributes may be attached to the image. For example, the image +comment is a named image attribute with the name "comment". If the +named attribute already exists, the provided text is appended to the +existing attribute text. Pass NULL to remove an existing text +attribute, or to restart the text attribute from scratch.

      +

      EXIF tags are attached to the image as named attributes. Use the +syntax "EXIF:<tag>" to request an EXIF tag similar to +"EXIF:DateTime":

      +
      +void            attribute ( const std::string name_,
      +                            const char * value_ );
      +
      +void            attribute ( const std::string name_,
      +                            const std::string value_ )
      +
      +std::string     attribute ( const std::string name_ )
      +
      +
      +
      +

      backgroundColor

      +

      Image background color:

      +
      +void            backgroundColor ( const Color &color_ )
      +
      +Color           backgroundColor ( void ) const
      +
      +
      +
      +

      backgroundTexture

      +

      Image file name to use as the background texture. Does not modify +image pixels:

      +
      +void            backgroundTexture (const std::string &backgroundTexture_ )
      +
      +std::string     backgroundTexture ( void ) const
      +
      +
      +
      +

      baseColumns

      +

      Base image width (before transformations):

      +
      +unsigned int    baseColumns ( void ) const
      +
      +
      +
      +

      baseFilename

      +

      Base image filename (before transformations):

      +
      +std::string     baseFilename ( void ) const
      +
      +
      +
      +

      baseRows

      +

      Base image height (before transformations):

      +
      +unsigned int    baseRows ( void ) const
      +
      +
      +
      +

      borderColor

      +

      Image border color:

      +
      +void            borderColor ( const Color &color_ )
      +
      +Color           borderColor ( void ) const
      +
      +
      +
      +

      boundingBox

      +

      Return smallest bounding box enclosing non-border pixels. The +current fuzz value is used when discriminating between pixels. +This is the crop bounding box used by crop(Geometry(0,0)):

      +
      +Geometry        boundingBox ( void ) const
      +
      +
      +
      +

      boxColor

      +

      Base color that annotation text is rendered on (default none):

      +
      +void            boxColor ( const Color &boxColor_ )
      +
      +Color           boxColor ( void ) const
      +
      +
      +
      +

      cacheThreshold

      +

      Pixel cache threshold in megabytes. Once this memory threshold is +exceeded, all subsequent pixels cache operations are to/from disk. +This setting is shared by all Image objects:

      +
      +static void     cacheThreshold ( const unsigned int threshold_ )
      +
      +
      +
      +

      chromaBluePrimary

      +

      Chromaticity blue primary point (e.g. x=0.15, y=0.06):

      +
      +void            chromaBluePrimary ( const double x_, const double y_ )
      +
      +void            chromaBluePrimary ( double *x_, double *y_ ) const
      +
      +
      +
      +

      chromaGreenPrimary

      +

      Chromaticity green primary point (e.g. x=0.3, y=0.6):

      +
      +void            chromaGreenPrimary ( const double x_, const double y_ )
      +
      +void            chromaGreenPrimary ( double *x_, double *y_ ) const
      +
      +
      +
      +

      chromaRedPrimary

      +

      Chromaticity red primary point (e.g. x=0.64, y=0.33):

      +
      +void            chromaRedPrimary ( const double x_, const double y_ )
      +
      +void            chromaRedPrimary ( double *x_, double *y_ ) const
      +
      +
      +
      +

      chromaWhitePoint

      +

      Chromaticity white point (e.g. x=0.3127, y=0.329):

      +
      +void            chromaWhitePoint ( const double x_, const double y_ )
      +void            chromaWhitePoint ( double *x_, double *y_ ) const
      +
      +
      +
      +

      classType

      +

      Image class (DirectClass or PseudoClass). NOTE: setting a DirectClass +image to PseudoClass will result in the loss of color information if +the number of colors in the image is greater than the maximum palette +size (either 256 or 65536 entries depending on the value of +QuantumDepth when ImageMagick was built):

      +
      +void            classType ( const ClassType class_ )
      +
      +ClassType       classType ( void ) const
      +
      +
      +
      +

      clipMask

      +

      Associate a clip mask image with the current image. The clip mask +image must have the same dimensions as the current image or an +exception is thrown. Clipping occurs wherever pixels are transparent +in the clip mask image. Clipping Pass an invalid image to unset an +existing clip mask:

      +
      +void            clipMask ( const Image & clipMask_ )
      +
      +Image           clipMask ( void  ) const
      +
      +
      +
      +

      colorFuzz

      +

      Colors within this distance are considered equal. A number of +algorithms search for a target color. By default the color must be +exact. Use this option to match colors that are close to the target +color in RGB space:

      +
      +void            colorFuzz ( const double fuzz_ )
      +
      +double          colorFuzz ( void ) const
      +
      +
      +
      +

      colorMap

      +

      Color at colormap position index:

      +
      +void            colorMap ( const unsigned int index_,
      +                           const Color &color_ )
      +
      +Color           colorMap ( const unsigned int index_ ) const
      +
      +
      +
      +

      colorMapSize

      +

      Number of entries in the colormap. Setting the colormap size may +extend or truncate the colormap. The maximum number of supported +entries is specified by the MaxColormapSize constant, and is dependent +on the value of QuantumDepth when GraphicsMagick is compiled. An +exception is thrown if more entries are requested than may be +supported. Care should be taken when truncating the colormap to ensure +that the image colormap indexes reference valid colormap entries:

      +
      +void            colorMapSize ( const unsigned int entries_ )
      +
      +unsigned int    colorMapSize ( void )
      +
      +
      +
      +

      colorSpace

      +

      The colorspace (e.g. CMYK) used to represent the image pixel colors:

      +
      +void            colorSpace( const ColorspaceType colorSpace_ )
      +
      +ColorspaceType  colorSpace ( void ) const
      +
      +
      +
      +

      columns

      +

      Image width:

      +
      +unsigned int    columns ( void ) const
      +
      +
      +
      +

      comment

      +

      Image comment:

      +
      +std::string     comment ( void ) const
      +
      +
      +
      +

      compose

      +

      Composition operator to be used when composition is implicitly +used (such as for image flattening):

      +
      +void            compose (const CompositeOperator compose_)
      +
      +CompositeOperator compose ( void ) const
      +
      +
      +
      +

      compressType

      +

      Image compresion type. The default is the compression type of the +input image file:

      +
      +void            compressType ( const CompressionType compressType_ )
      +
      +CompressionType compressType ( void ) const
      +
      +
      +
      +

      debug

      +

      Enable printing of debug messages from GraphicsMagick as it executes:

      +
      +void            debug ( const bool flag_ )
      +
      +bool            debug ( void ) const
      +
      +
      +
      +

      defineValue

      +

      Set or obtain a definition string to applied when encoding or decoding +the specified format. The meanings of the definitions are format +specific. The format is designated by the magick argument, the +format-specific key is designated by key, and the associated value +is specified by value. See the defineSet() method if the key must be +removed entirely:

      +
      +void            defineValue ( const std::string &magick_,
      +                              const std::string &key_,
      +                              const std::string &value_ )
      +
      +std::string     defineValue ( const std::string &magick_,
      +                              const std::string &key_ ) const
      +
      +
      +
      +

      defineSet

      +

      Set or obtain a definition flag to applied when encoding or decoding +the specified format. Similar to the defineValue() method except that +passing the flag value 'true' creates a value-less define with that +format and key. Passing the flag value 'false' removes any existing +matching definition. The method returns 'true' if a matching key +exists, and 'false' if no matching key exists:

      +
      +void            defineSet ( const std::string &magick_,
      +                            const std::string &key_,
      +                            bool flag_ )
      +
      +bool            defineSet ( const std::string &magick_,
      +                            const std::string &key_ ) const
      +
      +
      +
      +

      density

      +

      Vertical and horizontal resolution in pixels of the image. This option +specifies an image density when decoding a Postscript or Portable +Document page. Often used with psPageSize:

      +
      +void            density ( const Geometry &geomery_ )
      +
      +Geometry        density ( void ) const
      +
      +

      Please note that the 'density' method suffers from a design problem in +that the Geometry object only supports integer dimensions, but the +underlying image resolution is a floating point value. This results +in rounding off the value. Please see the xResolution() and +yResolution() methods for a way to set and get the resolution in +floating point.

      +

      The resolution units may be obtained via the resolutionUnits() method.

      +
      +
      +

      depth

      +

      Image depth (bits allocated to red/green/blue components). Used to +specify the bit depth when reading or writing raw images or when the +output format supports multiple depths. Defaults to the quantum depth +that GraphicsMagick is compiled with:

      +
      +void            depth ( const unsigned int depth_ )
      +
      +unsigned int    depth ( void ) const
      +
      +
      +
      +

      directory

      +

      Tile names from within an image montage:

      +
      +std::string     directory ( void ) const
      +
      +
      +
      +

      endian

      +

      Endianness (LSBEndian like Intel, MSBEndian like SPARC, or +NativeEndian for what this computer uses) for image formats which +support endian-specific options:

      +
      +void            endian ( const EndianType endian_ )
      +
      +EndianType      endian ( void ) const
      +
      +
      +
      +

      fileName

      +

      Image file name:

      +
      +void            fileName ( const std::string &fileName_ )
      +
      +std::string     fileName ( void ) const
      +
      +
      +
      +

      fileSize

      +

      Number of bytes of the image on disk:

      +
      +off_t          fileSize ( void ) const
      +
      +
      +
      +

      fillColor

      +

      Color to use when filling drawn objects:

      +
      +void            fillColor ( const Color &fillColor_ )
      +
      +Color           fillColor ( void ) const
      +
      +
      +
      +

      fillPattern

      +

      Pattern to use while filling drawn objects:

      +
      +void            fillPattern ( const Image &fillPattern_ )
      +
      +Image           fillPattern ( void  ) const
      +
      +
      +
      +

      fillRule

      +

      Rule to use when filling drawn objects:

      +
      +void            fillRule ( const FillRule &fillRule_ )
      +
      +FillRule        fillRule ( void ) const
      +
      +
      +
      +

      filterType

      +

      Filter to use when resizing image. The reduction filter employed has a +sigificant effect on the time required to resize an image and the +resulting quality. The default filter is Lanczos which has been shown +to produce high quality results when reducing most images:

      +
      +void            filterType ( const FilterTypes filterType_ )
      +
      +FilterTypes     filterType ( void ) const
      +
      +
      +
      +

      font

      +

      Text rendering font. If the font is a fully qualified X server font +name, the font is obtained from an X server. To use a TrueType font, +precede the TrueType filename with an @. Otherwise, specify a +Postscript font name (e.g. "helvetica").:

      +
      +void            font ( const std::string &font_ )
      +
      +std::string     font ( void ) const
      +
      +
      +
      +

      fontPointsize

      +

      Text rendering font point size:

      +
      +void            fontPointsize ( const double pointSize_ )
      +
      +double          fontPointsize ( void ) const
      +
      +
      +
      +

      fontTypeMetrics

      +

      Obtain font metrics (see TypeMetric) for text string given current +font, pointsize, and density settings. This information is necessary +in order to do fancy layout of text:

      +
      +void            fontTypeMetrics( const std::string &text_,
      +                                 TypeMetric *metrics )
      +
      +
      +
      +

      format

      +

      Long image format description:

      +
      +std::string     format ( void ) const
      +
      +
      +
      +

      formatExpression

      +

      Format a string based on image properties similar to identify +-format. For example, the format expression "%wx%h" is converted to +a string containing image WIDTHxHEIGHT like "640x480":

      +
      +std::string     formatExpression( const std::string expression )
      +
      +

      Please note that this method is not a const method (may modify the +Image object and will assure a reference count of one) and it may +throw an exception if there is an internal error.

      +
      +
      +

      gamma

      +

      Gamma level of the image. Gamma is a pow() function which converts +between the linear light representation and the representation for the +computer display. Most computer images are gamma corrected to 2.2 +(1/0.4545) so that each step results in a visually linear step on a +computer or video display:

      +
      +double          gamma ( void ) const
      +
      +
      +
      +

      geometry

      +

      Preferred size of the image when encoding:

      +
      +Geometry        geometry ( void ) const
      +
      +
      +
      +

      gifDisposeMethod

      +

      GIF disposal method. This option (specific to the GIF file format) is +used to control how successive frames are rendered (how the preceding +frame is disposed of) when creating a GIF animation:

      +
      +void            gifDisposeMethod ( const unsigned int disposeMethod_ )
      +
      +unsigned int    gifDisposeMethod ( void ) const
      +
      +
      +
      +

      iccColorProfile

      +

      ICC color profile. Supplied via a Blob since Magick++/ and +GraphicsMagick do not currently support formating this data structure +directly.

      +

      If there is not already an ICC color profile, the profile is merely +attached to the image without transforming the pixels. If there is +already an ICC color profile (the source profile), the pixels are +translated according to the source and target profiles, and the +existing profile is replaced with the target profile.

      +

      Also see renderingIntent, which allows specifying the rendering +intent if the profile is executed.

      +

      Specifications for ICC color profiles and their usage are available +from the International Color Consortium for the format of ICC color +profiles:

      +
      +void            iccColorProfile( const Blob &colorProfile_ )
      +
      +Blob            iccColorProfile( void ) const
      +
      +
      +
      +

      interlaceType

      +

      The type of interlacing scheme (default NoInterlace ). This option +is used to specify the type of interlacing scheme for raw image +formats such as RGB or YUV. NoInterlace means do not interlace, +LineInterlace uses scanline interlacing, and PlaneInterlace uses +plane interlacing. PartitionInterlace is like PlaneInterlace +except the different planes are saved to individual files (e.g. +image.R, image.G, and image.B). Use LineInterlace or +PlaneInterlace to create an interlaced GIF or progressive JPEG +image:

      +
      +void            interlaceType ( const InterlaceType interlace_ )
      +
      +InterlaceType   interlaceType ( void ) const
      +
      +
      +
      +

      iptcProfile

      +

      IPTC profile. Supplied via a Blob since Magick++ and GraphicsMagick do +not currently support formating this data structure +directly. Specifications are available from the International Press +Telecommunications Council for IPTC profiles:

      +
      +void            iptcProfile( const Blob& iptcProfile_ )
      +
      +Blob            iptcProfile( void ) const
      +
      +
      +
      +

      isValid

      +

      Does object contain valid image? Set to false in order to invalidate +the image. Images constructed via the default constructor are invalid +images and isValid() will return false:

      +
      +void            isValid ( const bool isValid_ )
      +
      +bool            isValid ( void ) const
      +
      +
      +
      +

      label

      +

      Image label:

      +
      +std::string     label ( void ) const
      +
      +
      +
      +

      lineWidth

      +

      Stroke width for drawing vector objects (default one) +This method is now deprecated. Please use strokeWidth instead:

      +
      +void            lineWidth ( const double lineWidth_ )
      +
      +double          lineWidth ( void ) const
      +
      +
      +
      +

      magick

      +

      File type magick identifier (.e.g "GIF"):

      +
      +void            magick ( const std::string &magick_ )
      +
      +std::string     magick ( void ) const
      +
      +
      +
      +

      matte

      +

      Image supports transparency (matte channel):

      +
      +void            matte ( const bool matteFlag_ )
      +
      +bool            matte ( void ) const
      +
      +
      +
      +

      matteColor

      +

      Image matte (frame) color:

      +
      +void            matteColor ( const Color &matteColor_ )
      +
      +Color           matteColor ( void ) const
      +
      +
      +
      +

      meanErrorPerPixel

      +

      The mean error per pixel computed when an image is color reduced. This +parameter is only valid if verbose is set to true and the image has +just been quantized:

      +
      +double          meanErrorPerPixel ( void ) const
      +
      +
      +
      +

      modulusDepth

      +

      Image modulus depth (minimum number of bits required to support +red/green/blue components without loss of accuracy). The pixel modulus +depth may be decreased by supplying a value which is less than the +current value, updating the pixels (reducing accuracy) to the new +depth. The pixel modulus depth can not be increased over the current +value using this method:

      +
      +void            modulusDepth ( const unsigned int modulusDepth_ )
      +
      +unsigned int    modulusDepth ( void ) const
      +
      +
      +
      +

      monochrome

      +

      Transform image to black and white while color reducing (quantizing):

      +
      +void            monochrome ( const bool monochromeFlag_ )
      +
      +bool            monochrome ( void ) const
      +
      +
      +
      +

      montageGeometry

      +

      Tile size and offset within an image montage. Only valid for montage +images:

      +
      +Geometry        montageGeometry ( void ) const
      +
      +
      +
      +

      normalizedMaxError

      +

      The normalized max error per pixel computed when an image is color +reduced. This parameter is only valid if verbose is set to true and +the image has just been quantized:

      +
      +double          normalizedMaxError ( void ) const
      +
      +
      +
      +

      normalizedMeanError

      +

      The normalized mean error per pixel computed when an image is color +reduced. This parameter is only valid if verbose is set to true and +the image has just been quantized:

      +
      +double          normalizedMeanError ( void ) const
      +
      +
      +
      +

      orientation

      +

      Image orientation. Supported by some file formats such as DPX and +TIFF. Useful for turning the right way up:

      +
      +void            orientation ( const OrientationType orientation_ )
      +
      +OrientationType orientation ( void ) const
      +
      +
      +
      +

      page

      +

      Preferred size and location of an image canvas.

      +

      Use this option to specify the dimensions and position of the +Postscript page in dots per inch or a TEXT page in pixels. This option +is typically used in concert with density .

      +

      Page may also be used to position a GIF image (such as for a scene in +an animation):

      +
      +void            page ( const Geometry &pageSize_ )
      +
      +Geometry        page ( void ) const
      +
      +
      +
      +

      pixelColor

      +

      Get/set pixel color at location x & y:

      +
      +void            pixelColor ( const unsigned int x_,
      +                             const unsigned int y_,
      +                             const Color &color_ )
      +
      +Color           pixelColor ( const unsigned int x_,
      +                             const unsigned int y_ ) const
      +
      +
      +
      +

      profile

      +

      Add or remove a named profile to/from the image. Remove the +profile by passing an empty Blob (e.g. Blob()). Valid names are +"*", "8BIM", "ICM", "IPTC", or a user/format-defined profile name:

      +
      +void            profile( const std::string name_,
      +                         const Blob &colorProfile_ )
      +
      +

      Retrieve a named profile from the image. Valid names are: +"8BIM", "8BIMTEXT", "APP1", "APP1JPEG", "ICC", "ICM", & "IPTC" +or an existing user/format-defined profile name:

      +
      +Blob            profile( const std::string name_ ) const
      +
      +
      +
      +

      quality

      +

      JPEG/MIFF/PNG compression level (default 75):

      +
      +void            quality ( const unsigned int quality_ )
      +
      +unsigned int    quality ( void ) const
      +
      +
      +
      +

      quantizeColors

      +

      Maximum number of colors to quantize to:

      +
      +void            quantizeColors ( const unsigned int colors_ )
      +
      +unsigned int    quantizeColors ( void ) const
      +
      +
      +
      +

      quantizeColorSpace

      +

      Colorspace to quantize in (default RGB). Empirical evidence suggests +that distances in color spaces such as YUV or YIQ correspond to +perceptual color differences more closely than do distances in RGB +space. These color spaces may give better results when color reducing +an image:

      +
      +void            quantizeColorSpace ( const ColorspaceType colorSpace_ )
      +
      +ColorspaceType  quantizeColorSpace ( void ) const
      +
      +
      +
      +

      quantizeDither

      +

      Apply Floyd/Steinberg error diffusion to the image. The basic strategy +of dithering is to trade intensity resolution for spatial resolution +by averaging the intensities of several neighboring pixels. Images +which suffer from severe contouring when reducing colors can be +improved with this option. The quantizeColors or monochrome option +must be set for this option to take effect:

      +
      +void            quantizeDither ( const bool ditherFlag_ )
      +
      +bool            quantizeDither ( void ) const
      +
      +
      +
      +

      quantizeTreeDepth

      +

      Depth of the quantization color classification tree. Values of 0 or 1 +allow selection of the optimal tree depth for the color reduction +algorithm. Values between 2 and 8 may be used to manually adjust the +tree depth:

      +
      +void            quantizeTreeDepth ( const unsigned int treeDepth_ )
      +
      +unsigned int    quantizeTreeDepth ( void ) const
      +
      +
      +
      +

      quiet

      +

      Determines if Warning exceptions will be thrown, or suppressed. +The default is that warnings will be thrown (i.e. false):

      +
      +void            quiet ( const bool quiet_ );
      +bool            quiet ( void ) const;
      +
      +
      +
      +

      renderingIntent

      +

      The type of rendering intent (used when applying an ICC color +profile using iccColorProfile):

      +
      +void            renderingIntent ( const RenderingIntent renderingIntent_ )
      +
      +RenderingIntent renderingIntent ( void ) const
      +
      +
      +
      +

      repage

      +

      Reset the image page canvas and position:

      +
      +void            repage();
      +
      +
      +
      +

      resolutionUnits

      +

      Units of image resolution:

      +
      +void            resolutionUnits ( const ResolutionType resolutionUnits_ )
      +
      +ResolutionType  resolutionUnits ( void ) const
      +
      +
      +
      +

      rows

      +

      The number of pixel rows in the image:

      +
      +unsigned int    rows ( void ) const
      +
      +
      +
      +

      scene

      +

      Image scene number:

      +
      +void            scene ( const unsigned int scene_ )
      +
      +unsigned int    scene ( void ) const
      +
      +
      +
      +

      signature

      +

      Image textual signature. Set force to true in order to re-calculate +the signature regardless of whether the image data has been modified:

      +
      +std::string     signature ( const bool force_ = false ) const
      +
      +
      +
      +

      size

      +

      Width and height of a raw image (an image which does not support width +and height information). Size may also be used to affect the image +size read from a multi-resolution format (e.g. Photo CD, JBIG, or +JPEG:

      +
      +void            size ( const Geometry &geometry_ )
      +
      +Geometry        size ( void ) const
      +
      +
      +
      +

      statistics

      +

      Obtain image statistics. Statistics are normalized to the range +of 0.0 to 1.0 and are output to the specified ImageStatistics +structure:

      +
      +void            statistics ( ImageStatistics *statistics ) const
      +
      +
      +
      +

      strokeAntiAlias

      +

      Enable/disable stroke anti-aliasing:

      +
      +void            strokeAntiAlias( const bool flag_ )
      +
      +bool            strokeAntiAlias( void ) const
      +
      +
      +
      +

      strokeColor

      +

      Color to use when drawing object outlines:

      +
      +void            strokeColor ( const Color &strokeColor_ )
      +
      +Color           strokeColor ( void ) const
      +
      +
      +
      +

      strokeDashArray

      +

      Specify the pattern of dashes and gaps used to stroke paths. The +strokeDashArray represents a zero-terminated 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. A typical strokeDashArray array +might contain the members 5 3 2 0, where the zero value indicates the +end of the pattern array:

      +
      +void            strokeDashArray ( const double* strokeDashArray_ )
      +
      +const double*   strokeDashArray ( void ) const
      +
      +
      +
      +

      strokeDashOffset

      +

      While drawing using a dash pattern, specify distance into the +dash pattern to start the dash (default 0):

      +
      +void            strokeDashOffset ( const double strokeDashOffset_ )
      +
      +double          strokeDashOffset ( void ) const
      +
      +
      +
      +

      strokeLineCap

      +

      Specify the shape to be used at the end of open subpaths when +they are stroked. Values of LineCap are UndefinedCap, ButtCap, +RoundCap, and SquareCap:

      +
      +void            strokeLineCap ( const LineCap lineCap_ )
      +
      +LineCap         strokeLineCap ( void ) const
      +
      +
      +
      +

      strokeLineJoin

      +

      Specify 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:

      +
      +void            strokeLineJoin ( const LineJoin lineJoin_ )
      +
      +LineJoin        strokeLineJoin ( void ) const
      +
      +
      +
      +

      strokeMiterLimit

      +

      Specify 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'. The default +value of this parameter is 4:

      +
      +void            strokeMiterLimit ( const unsigned int miterLimit_ )
      +
      +unsigned int    strokeMiterLimit ( void ) const
      +
      +
      +
      +

      strokePattern

      +

      Pattern image to use while stroking object outlines:

      +
      +void            strokePattern ( const Image &strokePattern_ )
      +
      +Image           strokePattern ( void  ) const
      +
      +
      +
      +

      strokeWidth

      +

      Stroke width for drawing vector objects (default one):

      +
      +void            strokeWidth ( const double strokeWidth_ )
      +
      +double          strokeWidth ( void ) const
      +
      +
      +
      +

      subImage

      +

      Subimage of an image sequence:

      +
      +void            subImage ( const unsigned int subImage_ )
      +
      +unsigned int    subImage ( void ) const
      +
      +
      +
      +

      subRange

      +

      Number of images relative to the base image:

      +
      +void            subRange ( const unsigned int subRange_ )
      +
      +unsigned int    subRange ( void ) const
      +
      +
      +
      +

      textEncoding

      +

      Annotation text encoding (e.g. "UTF-16"):

      +
      +void            textEncoding ( const std::string &encoding_ )
      +
      +std::string     textEncoding ( void ) const
      +
      +
      +
      +

      tileName

      +

      Tile name:

      +
      +void            tileName ( const std::string &tileName_ )
      +
      +std::string     tileName ( void ) const
      +
      +
      +
      +

      totalColors

      +

      Number of colors in the image:

      +
      +unsigned long   totalColors ( void )
      +
      +
      +
      +

      transformOrigin

      +

      Origin of coordinate system to use when annotating with text or drawing:

      +
      +void            transformOrigin ( const double x_,const  double y_ )
      +
      +
      +
      +

      transformRotation

      +

      Rotation to use when annotating with text or drawing:

      +
      +void            transformRotation ( const double angle_ )
      +
      +
      +
      +

      transformReset

      +

      Reset transformation parameters to default:

      +
      +void            transformReset ( void )
      +
      +
      +
      +

      transformScale

      +

      Scale to use when annotating with text or drawing:

      +
      +void            transformScale ( const double sx_, const double sy_ )
      +
      +
      +
      +

      transformSkewX

      +

      Skew to use in X axis when annotating with text or drawing:

      +
      +void            transformSkewX ( const double skewx_ )
      +
      +
      +
      +

      transformSkewY

      +

      Skew to use in Y axis when annotating with text or drawing:

      +
      +void            transformSkewY ( const double skewy_ )
      +
      +
      +
      +

      verbose

      +

      Print detailed information about the image:

      +
      +void            verbose ( const bool verboseFlag_ )
      +
      +bool            verbose ( void ) const
      +
      +
      +
      +

      view

      +

      FlashPix viewing parameters:

      +
      +void            view ( const std::string &view_ )
      +
      +std::string     view ( void ) const
      +
      +
      +
      +

      x11Display

      +

      X11 display to display to, obtain fonts from, or to capture +image from:

      +
      +void            x11Display ( const std::string &display_ )
      +
      +std::string     x11Display ( void ) const
      +
      +
      +
      +

      xResolution

      +

      x resolution of the image:

      +
      +void            xResolution ( const double x_resolution )
      +double          xResolution ( void ) const
      +
      +
      +
      +

      yResolution

      +

      y resolution of the image:

      +
      +void            yResolution ( const double y_resolution )
      +double          yResolution ( void ) const
      +
      +
      +
      +
      +

      Low-Level Image Pixel Access

      +

      Image pixels (of type PixelPacket ) may be accessed directly via +the Image Pixel Cache . The image pixel cache is a rectangular window +into the actual image pixels (which may be in memory, memory-mapped +from a disk file, or entirely on disk). Two interfaces exist to access +the Image Pixel Cache. The interface described here (part of the Image +class) supports only one view at a time. See the Pixels class for a +more abstract interface which supports simultaneous pixel views (up to +the number of rows). As an analogy, the interface described here +relates to the Pixels class as stdio's gets() relates to +fgets(). The Pixels class provides the more general form of the +interface.

      +

      Obtain existing image pixels via getPixels(). Create a new pixel +region using setPixels().

      +

      In order to ensure that only the current generation of the image is +modified, the Image's modifyImage() method should be invoked to reduce +the reference count on the underlying image to one. If this is not +done, then it is possible for a previous generation of the image to be +modified due to the use of reference counting when copying or +constructing an Image.

      +

      Depending on the capabilities of the operating system, and the +relationship of the window to the image, the pixel cache may be a copy +of the pixels in the selected window, or it may be the actual image +pixels. In any case calling syncPixels() insures that the base image +is updated with the contents of the modified pixel cache. The method +readPixels() supports copying foreign pixel data formats into the +pixel cache according to the QuantumTypes. The method writePixels() +supports copying the pixels in the cache to a foreign pixel +representation according to the format specified by QuantumTypes.

      +

      The pixel region is effectively a small image in which the pixels may +be accessed, addressed, and updated, as shown in the following +example:

      +

      pixel_cache

      +
      +// Construct image based on an existing file
      +Image image("cow.png");
      +
      +// Ensure that there are no other references to this image.
      +image.modifyImage();
      +
      +// Set the image type to TrueColor DirectClass representation.
      +image.type(TrueColorType);
      +
      +// Request pixel region with size 60x40, and top origin at 20x30
      +int columns = 60;
      +PixelPacket *pixel_cache = image.getPixels(20,30,columns,40);
      +
      +// Set pixel at column 5, and row 10 in the pixel cache to red.
      +int column = 5;
      +int row = 10;
      +PixelPacket *pixel = pixel_cache+row*columns+column;
      +*pixel = Color("red");
      +
      +// Save changes to underlying image .
      +image.syncPixels();
      +
      + // Save updated image to file.
      +image.write("horse.png");
      +
      +

      The image cache supports the following methods:

      + +
      +

      getConstPixels

      +

      Transfers read-only pixels from the image to the pixel cache as +defined by the specified region:

      +
      +const PixelPacket* getConstPixels ( const int x_, const int y_,
      +                                    const unsigned int columns_,
      +                                    const unsigned int rows_ ) const
      +
      +
      +
      +

      getIndexes

      +

      Obtain mutable image pixel indexes (valid for PseudoClass images):

      +
      +IndexPacket* getIndexes ( void )
      +
      +
      +
      +

      getConstIndexes

      +

      Obtain immutable image pixel indexes (valid for PseudoClass images):

      +
      +const IndexPacket* getConstIndexes ( void ) const
      +
      +
      +
      +

      getPixels

      +

      Transfers pixels from the image to the pixel cache as defined by the +specified region. Modified pixels may be subsequently transferred back +to the image via syncPixels. This method is valid for DirectClass +images:

      +
      +PixelPacket* getPixels ( const int x_, const int y_,
      +                         const unsigned int columns_,
      +                         const unsigned int rows_ )
      +
      +
      +
      +

      setPixels

      +

      Allocates a pixel cache region to store image pixels as defined by the +region rectangle. This area is subsequently transferred from the +pixel cache to the image via syncPixels:

      +
      +PixelPacket* setPixels ( const int x_, const int y_,
      +                         const unsigned int columns_,
      +                         const unsigned int rows_ )
      +
      +
      +
      +

      syncPixels

      +

      Transfers the image cache pixels to the image:

      +
      +void syncPixels ( void )
      +
      +
      +
      +

      readPixels

      +

      Transfers one or more pixel components from a buffer or file into the +image pixel cache of an image. Used to support image decoders:

      +
      +void readPixels ( const QuantumType quantum_,
      +                  const unsigned char *source_ )
      +
      +
      +
      +

      writePixels

      +

      Transfers one or more pixel components from the image pixel cache to a +buffer or file. Used to support image encoders:

      +
      +void writePixels ( const QuantumType quantum_,
      +                   unsigned char *destination_ )
      +
      +

      Copyright © Bob Friesenhahn 1999 - 2020

      +
      +
      +
      + + diff --git a/www/Magick++/Image.rst b/www/Magick++/Image.rst index 820d14d..7931694 100644 --- a/www/Magick++/Image.rst +++ b/www/Magick++/Image.rst @@ -49,12 +49,14 @@ The InitializeMagick() function *MUST* be invoked before constructing any Magick++ objects. This used to be optional, but now it is absolutely required. This function initalizes semaphores and configuration information necessary for the software to work -correctly. Failing to invoke InitializeMagick() is likely to lead to -a program crash or thrown assertion. If the program resides in the -same directory as the GraphicsMagick files, then argv[0] may be passed -as an argument so that GraphicsMagick knows where its files reside, +correctly. Failing to invoke InitializeMagick() will lead to a +program crash or thrown assertion. If the program resides in the same +directory as the GraphicsMagick files, then argv[0] may be passed as +an argument so that GraphicsMagick knows where its files reside, otherwise NULL may be passed and GraphicsMagick will try to use other -means (if necessary). +means (if necessary). Even if an argument is passed, GraphicsMagick +may use more reliable location information gleaned from the operating +system, depending on build configuration. The preferred way to allocate Image objects is via automatic allocation (on the stack). There is no concern that allocating Image @@ -2820,6 +2822,77 @@ buffer or file. Used to support image encoders:: void writePixels ( const QuantumType quantum_, unsigned char *destination_ ) +Explicit Logging Configuration And Callbacks +-------------------------------------------- + +It is sometimes useful for a program to not have to depend on a +configuration file for configuring logging ("tracing"). One reason +for this is because until a logging configuration file has been found +and loaded, default logging parameters are used. Another reason is +that in some configurations, it is useful for each instance of a +program to use its own logging configuration. To make this possible, +the Magick++ library provides pass-through functions which allow +setting the logging defaults *before* InitializeMagick() is called. +Setting logging defaults after InitializeMagick() is called has no +purpose since they will not be used. + +The following C++ pass-through functions are available" + +SetLogDefaultEventType +++++++++++++++++++++++ + +Specify default events which will result in a log event (comma-comma-separated list):: + + void SetLogDefaultEventType(const std::string &events_) + +SetLogDefaultGenerations +++++++++++++++++++++++++ + +Specify default maximum log file generations before overwriting the first name:: + + void SetLogDefaultGenerations(const unsigned int generations_) + +SetLogDefaultLimit +++++++++++++++++++ + +Specify default maximum number of logging events before creating a new log file:: + + void SetLogDefaultLimit(const unsigned int limit_) + +SetLogDefaultFileName ++++++++++++++++++++++ + +Specify the file name, or file path, to be written to for each log event:: + + void SetLogDefaultFileName(const std::string &filename_) + +SetLogDefaultFormat +++++++++++++++++++++++ + +Specify default log format using the same special format characters used by "log.mgk":: + + void SetLogDefaultFormat(const std::string &format_) + +SetLogDefaultLogMethod +++++++++++++++++++++++ + +Specify default C-language call-back function to be invoked for each log event:: + + void SetLogDefaultLogMethod(const Magick::LogMethod method_) + +Note that it is hoped that better mechanisms will be provided in the future. + +SetLogDefaultOutputType ++++++++++++++++++++++++ + +Specify default logging output type/destination:: + + void SetLogDefaultOutputType(const Magick::LogOutputType output_type_) + +Available LogOutputType enumerations are DisabledOutput, +UndefinedOutput, StdoutOutput, StderrOutput, XMLFileOutput, +TXTFileOutput, Win32DebugOutput, Win32EventlogOutput, and +MethodOutput. .. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN diff --git a/www/Magick++/ImageDesign.html b/www/Magick++/ImageDesign.html index 1dcf0a9..e924c5b 100644 --- a/www/Magick++/ImageDesign.html +++ b/www/Magick++/ImageDesign.html @@ -3,7 +3,7 @@ - + Magick::Image Data Structures @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
      - - -   + + + 
    @@ -51,5 +51,10 @@ effective) form of garbage collection.

    Figure showing Image class design

    Copyright © Bob Friesenhahn 1999 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/Magick++/ImageDesign.html.orig b/www/Magick++/ImageDesign.html.orig new file mode 100644 index 0000000..0c13f4f --- /dev/null +++ b/www/Magick++/ImageDesign.html.orig @@ -0,0 +1,55 @@ + + + + + + +Magick::Image Data Structures + + + + + + + +
    +

    Magick::Image Data Structures

    + + + + +

    The class Magick::Image is a simple handle which points to a +reference-counted image representation. This allows multiple +Magick::Image instances to share the same image and attributes. At the +point in time that the image data, or image attributes are modified +and the current reference count is greater than one, the image data +and attributes are copied to create a new image with a reference count +of one and the reference count on the old image is decremented. If the +reference count on the old image becomes zero, then the associated +reference and data are deleted. This strategy represents a simple (but +effective) form of garbage collection.

    +Figure showing Image class design +

    Copyright © Bob Friesenhahn 1999 - 2020

    +
    + + diff --git a/www/Magick++/Montage.html b/www/Magick++/Montage.html index 91d2ced..6d9a7c0 100644 --- a/www/Magick++/Montage.html +++ b/www/Magick++/Montage.html @@ -3,7 +3,7 @@ - + Magick::Montage Class @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -204,5 +204,10 @@ public:

    Copyright © Bob Friesenhahn 1999 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/Magick++/Montage.html.orig b/www/Magick++/Montage.html.orig new file mode 100644 index 0000000..6ab9ae7 --- /dev/null +++ b/www/Magick++/Montage.html.orig @@ -0,0 +1,208 @@ + + + + + + +Magick::Montage Class + + + + + + + +
    +

    Magick::Montage Class

    + + + + +

    A montage is a single image which is composed of thumbnail images +composed in a uniform grid. The size of the montage image is +determined by the size of the individual thumbnails and the number of +rows and columns in the grid.

    +

    The following illustration shows a montage consisting of three columns +and two rows of thumbnails rendered on a gray background:

    +Figure showing framed montage +

    Montages may be either "plain" (undecorated thumbnails) or "framed" +(decorated thumbnails). In order to more easily understand the options +supplied to MontageImages(), montage options are supplied by two +different classes: Magick::Montage and Magick::MontageFramed.

    +
    +

    Plain Montages

    +

    Magick::Montage is the base class to provide montage options and +provides methods to set all options required to render simple +(unframed) montages. See Magick::MontageFramedif you would like to +create a framed montage.

    +

    Unframed thumbnails consist of four components: the thumbnail image, +the thumbnail border, an optional thumbnail shadow, and an optional +thumbnail label area.

    +Figure showing plain montage +

    The following is the definition of the Magick::Montage class:

    +
    +class Montage
    +{
    +public:
    +  Montage( void );
    +  virtual ~Montage( void );
    +
    +  // Specifies the background color that thumbnails are imaged upon.
    +  void              backgroundColor ( const Color &backgroundColor_ );
    +  Color             backgroundColor ( void ) const;
    +
    +  // Specifies the image composition algorithm for thumbnails. This
    +  // controls the algorithm by which the thumbnail image is placed
    +  // on the background. Use of OverCompositeOp is recommended for
    +  // use with images that have transparency. This option may have
    +  // negative side-effects for images without transparency.
    +  void              compose ( CompositeOperator compose_ );
    +  CompositeOperator compose ( void ) const;
    +
    +  // Specifies the image filename to be used for the generated
    +  // montage images. To handle the case were multiple montage images
    +  // are generated, a printf-style format may be embedded within the
    +  // filename. For example, a filename specification of
    +  // image%02d.miff names the montage images as image00.miff,
    +  // image01.miff, etc.
    +  void              fileName( const std::string &fileName_ );
    +  std::string       fileName( void ) const;
    +
    +  // Specifies the fill color to use for the label text.
    +  void              fillColor ( const Color &fill_ );
    +  Color             fillColor ( void ) const;
    +
    +  // Specifies the thumbnail label font.
    +  void              font ( const std::string &font_ );
    +  std::string       font ( void ) const;
    +
    +  // Specifies the size of the generated thumbnail.
    +  void              geometry ( const Geometry &geometry_ );
    +  Geometry          geometry ( void ) const;
    +
    +  // Specifies the thumbnail positioning within the specified
    +  // geometry area. If the thumbnail is smaller in any dimension
    +  // than the geometry, then it is placed according to this
    +  // specification
    +  void              gravity ( GravityType gravity_ );
    +  GravityType       gravity ( void ) const;
    +
    +  // Specifies the format used for the image label. Special format
    +  // characters may be embedded in the format string to include
    +  // information about the image.
    +  void              label( const std::string &label_ );
    +  std::string       label( void ) const;
    +
    +  // Specifies the pen color to use for the label text (same as fill).
    +  void              penColor ( const Color &pen_ );
    +  Color             penColor ( void ) const;
    +
    +  // Specifies the thumbnail label font size.
    +  void              pointSize ( unsigned int pointSize_ );
    +  unsigned int      pointSize ( void ) const;
    +
    +  // Enable/disable drop-shadow on thumbnails.
    +  void              shadow ( bool shadow_ );
    +  bool              shadow ( void ) const;
    +
    +  // Specifies the stroke color to use for the label text .
    +  void              strokeColor ( const Color &stroke_ );
    +  Color             strokeColor ( void ) const;
    +
    +  // Specifies a texture image to use as montage background. The
    +  // built-in textures "granite:" and "plasma:" are available. A
    +  // texture is the same as a background image.
    +  void              texture ( const std::string &texture_ );
    +  std::string       texture ( void ) const;
    +
    +  // Specifies the maximum number of montage columns and rows in the
    +  // montage. The montage is built by filling out all cells in a row
    +  // before advancing to the next row. Once the montage has reached
    +  // the maximum number of columns and rows, a new montage image is
    +  // started.
    +  void              tile ( const Geometry &tile_ );
    +  Geometry          tile ( void ) const;
    +
    +  // Specifies the montage title
    +  void              title ( const std::string &title_ );
    +  std::string       title ( void ) const;
    +
    +  // Specifies a montage color to set transparent. This option can
    +  // be set the same as the background color in order for the
    +  // thumbnails to appear without a background when rendered on an
    +  // HTML page. For best effect, ensure that the transparent color
    +  // selected does not occur in the rendered thumbnail colors.
    +  void              transparentColor ( const Color &transparentColor_ );
    +  Color             transparentColor ( void ) const;
    +
    +};
    +
    +
    +
    +

    Framed Montages

    +

    Magick::MontageFramed provides the means to specify montage options +when it is desired to have decorative frames around the image +thumbnails. MontageFramed inherits from Montage and therefore provides +all the methods of Montage as well as those shown in the table +"MontageFramed Methods".

    +

    Framed thumbnails consist of four components: the thumbnail image, the +thumbnail frame, the thumbnail border, an optional thumbnail shadow, +and an optional thumbnail label area.

    +Figure showing anatomy of a framed montage +

    The following is the definition of the Magick::MontageFramed class:

    +
    +class MontageFramed : public Montage
    +{
    +public:
    +  MontageFramed ( void );
    +  /* virtual */ ~MontageFramed ( void );
    +
    +  // Specifies the background color within the thumbnail frame.
    +  void           borderColor ( const Color &borderColor_ );
    +  Color          borderColor ( void ) const;
    +
    +  // Specifies the border (in pixels) to place between a thumbnail
    +  // and its surrounding frame. This option only takes effect if
    +  // thumbnail frames are enabled (via frameGeometry) and the
    +  // thumbnail geometry specification doesn't also specify the
    +  // thumbnail border width.
    +  void           borderWidth ( unsigned int borderWidth_ );
    +  unsigned int   borderWidth ( void ) const;
    +
    +  // Specifies the geometry specification for frame to place around
    +  // thumbnail. If this parameter is not specified, then the montage
    +  // is unframed.
    +  void           frameGeometry ( const Geometry &frame_ );
    +  Geometry       frameGeometry ( void ) const;
    +
    +  // Specifies the thumbnail frame color.
    +  void           matteColor ( const Color &matteColor_ );
    +  Color          matteColor ( void ) const;
    +
    +};
    +
    +

    Copyright © Bob Friesenhahn 1999 - 2020

    +
    +
    + + diff --git a/www/Magick++/PixelPacket.html b/www/Magick++/PixelPacket.html index 5d0c93b..0664860 100644 --- a/www/Magick++/PixelPacket.html +++ b/www/Magick++/PixelPacket.html @@ -3,7 +3,7 @@ - + Magick::PixelPacket Structure @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -134,5 +134,10 @@ totally opaque).

    the assocated IndexPacket.

    Copyright © Bob Friesenhahn 1999 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/Magick++/PixelPacket.html.orig b/www/Magick++/PixelPacket.html.orig new file mode 100644 index 0000000..746a80f --- /dev/null +++ b/www/Magick++/PixelPacket.html.orig @@ -0,0 +1,138 @@ + + + + + + +Magick::PixelPacket Structure + + + + + + + +
    +

    Magick::PixelPacket Structure

    + + + + +

    The PixelPacket structure is used to represent DirectClass pixels in +GraphicsMagick. GraphicsMagick may be compiled to support 32, 64, or +even 128 bit pixels. The size of PixelPacket is controlled by the +value of the QuantumDepth define. The default build depth is 32 bit +pixels, which provides minumum ("web standard") accuracy, least memory +consumption, and best performance. If deeper images need to be +supported or more mathematical accuracy is desired, then +GraphicsMagick may be compiled with QuantumDepth=16 or +QuantumDepth=32.

    +

    The following table shows the relationship between QuantumDepth, the +type of Quantum, and the overall PixelPacket size:

    + + +++++ + + + + + + + + + + + + + + + + + + + + +
    Effect Of QuantumDepth Values
    QuantumDepthQuantum TypePixelPacket Size
    8unsigned char32 bits
    16unsigned short64 bits
    32unsigned int128 bits
    +

    The members of the PixelPacket structure, and their interpretation, +are shown in the following table:

    + + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PixelPacket Structure Members
    MemberTypeInterpretation
     RGBColorspaceRGBColorspace + matteCMYKColorspace
    redQuantumRedRedCyan
    greenQuantumGreenGreenMagenta
    blueQuantumBlueBlueYellow
    opacityQuantumIgnoredOpacityBlack
    +

    Note that opacity is stored inverted from most other software +(i.e. maximum value is completely transparent and minum value is +totally opaque).

    +

    Note that for CMYKColorspace + matte (CMYKA), the opacity is stored in +the assocated IndexPacket.

    +

    Copyright © Bob Friesenhahn 1999 - 2020

    +
    + + diff --git a/www/Magick++/Pixels.html b/www/Magick++/Pixels.html index 704d84e..a2e4717 100644 --- a/www/Magick++/Pixels.html +++ b/www/Magick++/Pixels.html @@ -3,7 +3,7 @@ - + Magick::Pixels @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -166,5 +166,10 @@ public:

    Copyright © Bob Friesenhahn 1999 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/Magick++/Pixels.html.orig b/www/Magick++/Pixels.html.orig new file mode 100644 index 0000000..5d20aef --- /dev/null +++ b/www/Magick++/Pixels.html.orig @@ -0,0 +1,170 @@ + + + + + + +Magick::Pixels + + + + + + + +
    +

    Magick::Pixels

    + + + + +

    The Pixels class provides efficient access to raw image pixels. Image +pixels (of type PixelPacket) may be accessed +directly via the Image Pixel Cache. The image pixel cache is a +rectangular window (a view) into the actual image pixels (which may be +in memory, memory-mapped from a disk file, or entirely on +disk). Obtain existing image pixels via get(). Create a new pixel +region using set().

    +

    Depending on the capabilities of the operating system, and the +relationship of the window to the image, the pixel cache may be a copy +of the pixels in the selected window, or it may be the actual image +pixels. In any case calling sync() insures that the base image is +updated with the contents of the modified pixel cache. The method +decode()supports copying foreign pixel data formats into the pixel +cache according to the QuantumTypes. The method encode() supports +copying the pixels in the cache to a foreign pixel representation +according to the format specified by QuantumTypes.

    +

    Setting a view using the Pixels class does not cause the number of +references to the underlying image to be reduced to one. Therefore, in +order to ensure that only the current generation of the image is +modified, the Image's modifyImage() method should be invoked to reduce +the reference count on the underlying image to one. If this is not +done, then it is possible for a previous generation of the image to be +modified due to the use of reference counting when copying or +constructing an Image.

    +

    The PixelPacket* returned by the set and get methods, and the +IndexPacket* returned by the indexes method point to pixel data +managed by the Pixels class. The Pixels class is responsible for +releasing resources associated with the pixel view. This means that +the pointer should never be passed to delete() or free().

    +Figure showing pixel cache access + + +

    The pixel view is a small image in which the pixels may be accessed, +addressed, and updated, as shown in the following example, which +produces an image similar to the one on the right (minus lines and +text):

    +
    +// Create base image
    +Image image(Geometry(254,218), "white");
    +
    +// Set the image type to TrueColor DirectClass representation.
    +image.type(TrueColorType);
    +
    +// Ensure that there is only one reference to underlying image
    +// If this is not done, then image pixels will not be modified.
    +image.modifyImage();
    +
    +// Allocate pixel view
    +Pixels view(image);
    +
    +// Set all pixels in region anchored at 38x36, with size 160x230 to green.
    +unsigned int columns = 196; unsigned int rows = 162;
    +Color green("green");
    +PixelPacket *pixels = view.get(38,36,columns,rows);
    +for ( int row = 0; row < rows ; ++row )
    +for ( int column = 0; column < columns ; ++column )
    +*pixels++=green;
    +
    +// Save changes to image.
    +view.sync();
    +
    +// Set all pixels in region anchored at 86x72, with size 108x67 to yellow.
    +columns = 108; rows = 67;
    +Color yellow("yellow");
    +pixels = view.get(86,72,columns,rows);
    +for ( int row = 0; row < rows ; ++row )
    +for ( int column = 0; column < columns ; ++column )
    +*pixels++=yellow;
    +view.sync();
    +
    +// Set pixel at position 108,94 to red
    +*(view.get(108,94,1,1)) = Color("red");
    +
    +// Save changes to image.
    +view.sync();
    +
    +

    The following is the definition of the Magick::Pixels class:

    +
    +class Pixels
    +{
    +public:
    +
    +  // Construct pixel view using specified image.
    +  Pixels( Magick::Image &image_ );
    +
    +  // Destroy pixel view
    +  ~Pixels( void );
    +
    +  // Transfer pixels from the image to the pixel view as defined by
    +  // the specified region. Modified pixels may be subsequently
    +  // transferred back to the image via sync.
    +  PixelPacket* get ( const int x_, const int y_,
    +                     const unsigned int columns_,const  unsigned int rows_ );
    +
    +  // Transfer read-only pixels from the image to the pixel view as
    +  // defined by the specified region.
    +  const PixelPacket* getConst ( const int x_, const int y_,
    +                                const unsigned int columns_,
    +                                const unsigned int rows_ );
    +
    +  // Transfers the image view pixels to the image.
    +  void sync ( void );
    +
    +  // Allocate a pixel view region to store image pixels as defined
    +  // by the region rectangle.  This area is subsequently transferred
    +  // from the pixel view to the image via sync.
    +  PixelPacket* set ( const int x_, const int y_,
    +                     const unsigned int columns_, const unsigned int rows_ );
    +
    +  // Return pixel colormap index array
    +  IndexPacket* indexes ( void );
    +
    +  // Left ordinate of view
    +  int x ( void ) const;
    +
    +  // Top ordinate of view
    +  int y ( void ) const;
    +
    +  // Width of view
    +  unsigned int columns ( void ) const;
    +
    +  // Height of view
    +  unsigned int rows ( void ) const;
    +
    +};
    +
    +

    Copyright © Bob Friesenhahn 1999 - 2020

    +
    + + diff --git a/www/Magick++/TypeMetric.html b/www/Magick++/TypeMetric.html index 1810dc2..c002313 100644 --- a/www/Magick++/TypeMetric.html +++ b/www/Magick++/TypeMetric.html @@ -3,7 +3,7 @@ - + Magick::TypeMetric @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -91,5 +91,10 @@ public:

    Copyright © Bob Friesenhahn 1999 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/Magick++/TypeMetric.html.orig b/www/Magick++/TypeMetric.html.orig new file mode 100644 index 0000000..554eb2d --- /dev/null +++ b/www/Magick++/TypeMetric.html.orig @@ -0,0 +1,95 @@ + + + + + + +Magick::TypeMetric + + + + + + + +
    +

    Magick::TypeMetric

    + + + + +

    The TypeMetric class provides the means to pass data from the Image +class's TypeMetric method to the user. It provides information +regarding font metrics such as ascent, descent, text width, text +height, and maximum horizontal advance. The units of these font +metrics are in pixels, and that the metrics are dependent on the +current Image font (default Ghostscript's "Helvetica"), pointsize +(default 12 points), and x/y resolution (default 72 DPI) settings.

    +

    The pixel units may be converted to points (the standard +resolution-independent measure used by the typesetting industry) via +the following equation:

    +
    +size_points = (size_pixels * 72)/resolution
    +
    +

    where resolution is in dots-per-inch (DPI). This means that at the +default image resolution, there is one pixel per point.

    +

    Note that a font's pointsize is only a first-order approximation of +the font height (ascender + descender) in points. The relationship +between the specified pointsize and the rendered font height is +determined by the font designer.

    +

    See FreeType Glyph Conventions +for a detailed description of font metrics related issues.

    +

    The following is the definition of the Magick::TypeMetric class:

    +
    +class MagickDLLDecl TypeMetric
    +{
    +  friend class Image;
    +public:
    +
    +  TypeMetric ( void );
    +  ~TypeMetric ( void );
    +
    +  // Ascent, the distance in pixels from the text baseline to the
    +  // highest/upper grid coordinate used to place an outline point.
    +  double         ascent ( void ) const;
    +
    +  // Descent, the distance in pixels from the baseline to the lowest
    +  // grid coordinate used to place an outline point. Always a
    +  // negative value.
    +  double         descent ( void ) const;
    +
    +  // Text width in pixels.
    +  double         textWidth ( void ) const;
    +
    +  // Text height in pixels.
    +  double         textHeight ( void ) const;
    +
    +  // Maximum horizontal advance in pixels.
    +  double         maxHorizontalAdvance ( void ) const;
    +
    +};
    +
    +

    Copyright © Bob Friesenhahn 1999 - 2020

    +
    + + diff --git a/www/Magick++/index.html b/www/Magick++/index.html index 2b77271..a52c593 100644 --- a/www/Magick++/index.html +++ b/www/Magick++/index.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -234,5 +234,10 @@ regarding usage should be directed to +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/Magick++/index.html.orig b/www/Magick++/index.html.orig new file mode 100644 index 0000000..7c6310b --- /dev/null +++ b/www/Magick++/index.html.orig @@ -0,0 +1,238 @@ + + + + + + +Magick++ API for GraphicsMagick + + + + + + + +
    +

    Magick++ API for GraphicsMagick

    + + + + + +
    +

    Introduction

    +

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

    +

    Magick++ 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 is managed +automatically by Magick++. De-referenced copies are automatically +deleted. The image objects support value (rather than pointer) semantics +so it is trivial to support multiple generations of an image in memory at +one time.

    +

    Magick++ provides integrated support for the Standard Template +Library (STL) which is part of the standard C++ language so that +the powerful containers available (e.g. deque, vector, list, and +map) can be used to write programs similar to those possible with +PERL & PerlMagick. STL-compatible template versions of +GraphicsMagick's list-style operations are provided so that operations +may be performed on multiple images stored in STL containers.

    +
    +
    +

    API

    +

    Magick++ provides a simple C++ API to the GraphicsMagick 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 GraphicsMagick C API is complex and the data +structures are not well 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 +GraphicsMagick C library are imported under the MagickLib namespace to +avoid possible conflicts and GraphicsMagick macros are only included +within the Magick++ implementation so they won't impact the user's +application.

    +

    The InitializeMagick() function MUST be invoked before constructing +any Magick++ objects. This used to be optional, but now it is +absolutely required. This function initalizes semaphores and +configuration information necessary for the software to work +correctly. Failing to invoke InitializeMagick() is likely to lead to +a program crash or thrown assertion. If the program resides in the +same directory as the GraphicsMagick files, then argv[0] may be passed +as an argument so that GraphicsMagick knows where its files reside, +otherwise NULL may be passed and GraphicsMagick will try to use other +means (if necessary).

    +

    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 automatically 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:

    + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Magick++ User-Level Classes
    BlobBinary Large OBject container.
    CoderInfoReport information about supported image formats (use with +coderInfoList())
    ColorColor specification.
    DrawableDrawable shape (for input to 'draw').
    ExceptionC++ exception objects.
    GeometryGeometry specification.
    ImageImage frame. This is the primary object in Magick++.
    MontageMontage options for montageImages().
    PixelsLow-level access to image pixels.
    STLSTL algorithms and function objects for operating on +containers of image frames.
    TypeMetricContainer for font type metrics (use with +Image::fontTypeMetrics).
    +
    +
    +

    Obtaining Magick++

    +

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

    +
    +
    +

    Installation

    +

    Installation is very easy since Magick++ is part of GraphicsMagick and +is built by default. Once GraphicsMagick is built, then Magick++ is +available for use.

    +
    +
    +

    Usage

    +

    A helper script named GraphicsMagick++-config is installed in the same +directory as the GraphicsMagick gm program under Unix which assists +with recalling compilation options required to compile and link programs +which depend on Magick++. For example, the following command will +compile and link the source file example.cpp to produce the executable +example (notice that quotes are backward quotes):

    +
    +c++ -o example example.cpp `GraphicsMagick++-config --cppflags --cxxflags
    +  --ldflags --libs`
    +
    +

    Windows users may get started by manually editing a project file for one +of the Magick++ demo programs.

    +

    It is necessary to initialize the GraphicsMagick library prior to +using the Magick++ library. This initialization is performed by +passing the path to the GraphicsMagick DLLs (assumed to be in the same +directory as your program) to the InitializeMagick() function +call. This is commonly performed by providing the path to your program +(argv[0]) as shown in the following example:

    +
    +int main( int /*argc*/, char ** argv)
    +{
    +  InitializeMagick(*argv);
    +
    +

    If you don't have the path to your executable, then pass NULL and +usually the library will be found anyway. Besides helping to find the +GraphicsMagick DLL/library and configuration files, InitializeMagick() +initializes all of the semaphores and data necessary for a +multi-threaded program to be completely thread safe. This step used +to be optional, but it is now absolutely required. Failure to +initialize GraphicsMagick will result in an application crash.

    +
    +
    +

    Reporting Bugs

    +

    Please report any bugs via the GraphicsMagick Bug Tracker. Questions +regarding usage should be directed to Bob Friesenhahn.

    +

    Copyright © Bob Friesenhahn 1999 - 2020

    +
    +
    + + diff --git a/www/NEWS.html b/www/NEWS.html index 56b1fbf..77b0107 100644 --- a/www/NEWS.html +++ b/www/NEWS.html @@ -3,7 +3,7 @@ - + GraphicsMagick News @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -38,7 +38,7 @@ -

    This file was last updated to reflect changes up to February 23, 2020

    +

    This file was last updated to reflect changes up to December 26, 2020

    Please note that this file records news for the associated development branch and that each development branch has its own NEWS file. See the ChangeLog file, and/or the Mercurial changesets, for full details.

    @@ -47,49 +47,211 @@ every release, it is recommended to update to the most current release and not attempt to patch older releases.

    +
    +
    +

    1.3.36 (December 26, 2020)

    +

    Special Issues:

    +
      +
    • None
    • +
    +

    Security Fixes:

    +
      +
    • GraphicsMagick is participating in Google's oss-fuzz project due to +the contributions and assistance of Alex Gaynor. Since February 4 +2018, 454 issues have been opened by oss-fuzz (some of which were +benign build issues such as SourceForge Mercurial not working +correctly) and 7 issues remain open (all of which are marked in an +"unreproducible" state). The issues list is available at +https://bugs.chromium.org/p/oss-fuzz/issues/list under search term +"graphicsmagick". Issues are available for anyone to view and +duplicate if they have been in "Verified" status for 30 days, or if +they have been in "New" status for 90 days. Please consult the +GraphicsMagick ChangeLog file, Mercurial repository commit log, and +the oss-fuzz issues list for details.
    • +
    • WPG: Fixes for heap buffer overflow.
    • +
    +

    Bug fixes:

    +
      +
    • ConstituteImage(): Set image depth appropriately based on the +storage size specified by StorageType and QuantumDepth.
    • +
    • GetImageBoundingBox(): Fix problem that MagickTrimImage with extreme +fuzz values could produce an image with negative width.
    • +
    • ImageToFile(): Improve error handling to avoid possible deferred +deletion of temporary files, causing unexpected excessive use of +temporary file space.
    • +
    • JNG: Add validations for alpha compression method values and use +this information to enforce decoding using the appropriate +sub-format (rather than auto-detecting the format). Also, address +memory leaks which may occur if the sub-decoder does something other +than was expected.
    • +
    • MagickCondSignal(): Improvements to conditional signal handler +registration (which avoids over-riding signal handlers previously +registered by an API user).
    • +
    • ModifyCache(): Fix memory leak.
    • +
    • ReadCacheIndexes(): Don't blunder into accessing a null pointer if +the using code has ignored a previous error report bubled-up from +SetNexus().
    • +
    • MNG: When doing image scaling and the image width or height is 1 +then always use simple pixel replication as per the MNG +specification.
    • +
    • MVG: Fixes to 'push clip-path foo' and 'pop clip-path foo' parsing +to eliminate a class of malign behavior.
    • +
    • MVG: Place an aribrary limit on stroke dash polygon unit maximum +length in order to avoid possibly rendering "forever".
    • +
    • PCL: No longer attempt to handle reading HP PCL format via the +external 'hp2xx' program since it seems worthless for that task.
    • +
    • PS: Fix corrupt image when writing PseudoClass image with a colormap +larger than two entries as bilevel.
    • +
    • SVG: Memory leak fixes.
    • +
    • SVG reader: Now support 'ping' support so the identify command works +as expected.
    • +
    • TIFF: WEBP compression only supports a depth of 8 so force that +value.
    • +
    • Wand MagickSetSamplingFactors(): Correct formatting of sampling +factors string.
    • +
    +

    New Features:

    +
      +
    • Logging is now fully programmable.
    • +
    • DPX format: Support dpx:swap-samples-read define which behaves +similar to dpx:swap-samples, but is only applied when reading, as +well as dpx:swap-samples-write, which is only applied when +writing. This provides for use when there is both reading and +writing in the same operation (otherwise the final result was no +effect!).
    • +
    +

    API Updates:

    +
      +
    • magick/api.h: Add "magick/enum_strings.h" to API headers.
    • +
    • New log settings accessor C functions: SetLogDefaultFileName(), +SetLogDefaultFormat(), SetLogDefaultOutputType(), +SetLogDefaultLogMethod(), SetLogDefaultLimit(), +SetLogDefaultGenerations(), SetLogDefaultEventType(). These +functions allow a program to set the same parameters which may be +set by loading a "log.mgk" function. If a default logging callback +was provided via SetLogDefaultLogMethod() such that MethodOutput is +used, then the search for a "log.mgk" is avoided entirely.
    • +
    • New log settings accessor C++ functions: SetLogDefaultFileName(), +SetLogDefaultFormat(), SetLogDefaultOutputType(), +SetLogDefaultLogMethod(), SetLogDefaultLimit(), +SetLogDefaultGenerations(), SetLogDefaultEventType(). These C++ +functions just pass through to the equivalent C functions and +provide the same benefits.
    • +
    +

    Feature improvements:

    +
      +
    • A simple resource-limit respecting memory allocator has been +developed for internal use wherever arbitrarily-large amounts of +memory might be requested. This will gradually be added wherever it +appears to be needed. The memory resource limits are at the overall +process level. The MVG/SVG rendering code is updated to use this +new allocator. Almost all of the coders (image format +readers/writers) have now been updated to use this new allocator. +This means that '-limit memory 300MB' would be more complete and +meaningful now. Temporary allocations by the image processing +algorithms (other than for the images themselves) are still not +accounted for in the resource limiting.
    • +
    • MVG Renderer / DrawImage(): Use resource-limit respecting memory +allocators for remaining large memory allocations.
    • +
    • PNG writer: Don't skip optional Exif identifier code if it isn't present.
    • +
    • DPX reader/writer: decode/encode of 10-bit packed DPX is now twice +as fast due to code simplification.
    • +
    • TIFF reader: Apply the same resource limits to TIFF tile sizes as +apply to the image itself.
    • +
    +

    Windows Delegate Updates/Additions:

    +
      +
    • None
    • +
    +

    Build Changes:

    +
      +
    • configure.ac: Update syntax to avoid using deprecated syntax +according to Autoconf 2.69. Also added copious m4 quoting.
    • +
    • Magick++ Drawable base class no longer uses std::unary_function when +compiled using C++'17 or later, since this feature has been removed +from the language.
    • +
    • Support the configure option --disable-compressed-files to disable +automatic decompress of gzip and bzip2 compressed files (e.g. files +with extension 'gz' or 'bz2', and sometimes 'svgz', but sometimes +posing as some other format). It turns out that there are some +extremely compressed files (e.g. over 1000x compression ratio) which +can take a long time to decompress and produce large temporary +files. We currently normally wait for the whole file to be +decompressed before decoding it. The only exception is for coders +with native 'blob' support and which do not require seeking, and +that the user forced forced the format by adding a magick prefix +like "DPX:file.dpx" to avoid the automatic file format detection.
    • +
    • Support the configure option --without-gs to disable reading PS, +EPS, and PDF formats via an external Ghostscript delegate program. +This corresponds to the HasGS definition in the source code.
    • +
    • Support the configure option --without-gdi32 to support disabling +use of the Microsoft Windows gdi32 library if it is not wanted.
    • +
    • The Automake-based test suite now applies a memory limit of 128MB +for the Q8, or 256MB for the Q16, or 512MB for the Q32 build, as +well as setting a disk space limit of 0. The limits place an upper +bound on the resources required, while assuring that tests do pass +with resource limits applied, while also assuring that disk-based +pixel-cache files are not used.
    • +
    +

    Behavior Changes:

    +
      +
    • Previously the formatting settings from "log.mgk" were only used +when writing to a file, or to the console, via a file handle. Now +the log formatting has been normalized so that the settings provided +by "log.mgk" (or SetLogDefaultFormat()) will always be used. It is +possible this may result in some formatting changes.
    • +
    • In the Windows Visual Studio build, the ProvideDllMain option is now +disabled by default (can still be enabled) since it causes +InitializeMagick() to be invoked prior to when the program's main() +routine is called, thereby blocking configuration activities or use +of InitializeMagickEx(). With this change it is even more +imperative that InitializeMagick() be explicitly invoked by all +programs using GraphicsMagick.
    -

    1.3.35 (February 23, 2020)

    +

    1.3.35 (February 23, 2020)

    Special Issues:

    • It has been discovered that the 'ICU' library (a perhaps 30MB C++ @@ -199,7 +361,7 @@ notice and be concerned about it.
    -

    1.3.34 (December 24, 2019)

    +

    1.3.34 (December 24, 2019)

    Special Issues:

    • It has been discovered that the 'ICU' library (a perhaps 30MB C++ @@ -316,7 +478,7 @@ without "administrator" privileges.
    -

    1.3.33 (July 20, 2019)

    +

    1.3.33 (July 20, 2019)

    Special Issues:

    • It has been discovered that the 'ICU' library (a perhaps 30MB C++ @@ -400,7 +562,7 @@ color is marked as transparent.
    -

    1.3.32 (June 15, 2019)

    +

    1.3.32 (June 15, 2019)

    Special Issues:

    • It has been discovered that the 'ICU' library (a perhaps 30MB C++ @@ -617,7 +779,7 @@ advance on the text string using TranslateText() if need be.
    -

    1.3.31 (November 17, 2018)

    +

    1.3.31 (November 17, 2018)

    Special Issues:

    • Firmware and operating system updates to address the Spectre @@ -709,7 +871,7 @@ forever.
    -

    1.3.30 (June 23, 2018)

    +

    1.3.30 (June 23, 2018)

    Special Issues:

    • None
    • @@ -788,7 +950,7 @@ compilation via the MaxWarningCount definition in coders/jpeg.c.
    -

    1.3.29 (April 29, 2018)

    +

    1.3.29 (April 29, 2018)

    Special Issues:

    • None
    • @@ -882,7 +1044,7 @@ to the efforts of Greg Wolfe.
    -

    1.3.28 (January 20, 2018)

    +

    1.3.28 (January 20, 2018)

    Special Issues:

    • None
    • @@ -961,7 +1123,7 @@ renaming.
    -

    1.3.27 (December 9, 2017)

    +

    1.3.27 (December 9, 2017)

    Special Issues:

    • None
    • @@ -1119,7 +1281,7 @@ removed from shared library or DLL namespace.
    -

    1.3.26 (July 4, 2017)

    +

    1.3.26 (July 4, 2017)

    Special Issues:

    • None
    • @@ -1222,7 +1384,7 @@ source tree. All of these depend on proprietary components.
    -

    1.3.25 (September 5, 2016)

    +

    1.3.25 (September 5, 2016)

    Special Issues:

    • None
    • @@ -1299,7 +1461,7 @@ seconds precision in in elapsed time output.
    -

    1.3.24 (May 30, 2016)

    +

    1.3.24 (May 30, 2016)

    Special Issues:

    • A shell exploit (CVE-2016-5118) was discovered associated with a @@ -1421,7 +1583,7 @@ delegate.mgk file.
    -

    1.3.23 (November 7, 2015)

    +

    1.3.23 (November 7, 2015)

    Special Issues:

    • Due to GCC bug 53967, several key agorithms (e.g. convolution) @@ -1486,7 +1648,7 @@ available in recent Ghostscript.
    -

    1.3.22 (October 4, 2015)

    +

    1.3.22 (October 4, 2015)

    Thanks:

    • Coverity: We thank Coverity for providing free service for free @@ -1595,7 +1757,7 @@ The STL function-object equivalent of the deprecated method is removed entirely.

    -

    1.3.21 (February 28, 2015)

    +

    1.3.21 (February 28, 2015)

    Thanks:

      @@ -1832,7 +1994,7 @@ for an RGB image.
    -

    1.3.20 (August 16, 2014)

    +

    1.3.20 (August 16, 2014)

    Special Issues:

      @@ -1996,7 +2158,7 @@ optimizations since their implementations have been problematic.
    -

    1.3.19 (December 31, 2013)

    +

    1.3.19 (December 31, 2013)

    Special Issues:

      @@ -2155,7 +2317,7 @@ multiple Ghostscript versions.
    -

    1.3.18 (March 10, 2013)

    +

    1.3.18 (March 10, 2013)

    Special Issues:

      @@ -2269,7 +2431,7 @@ color is in the same colorspace as the image.
    -

    1.3.17 (October 13, 2012)

    +

    1.3.17 (October 13, 2012)

    Security Fixes:

      @@ -2356,7 +2518,7 @@ will search for firefox, google-chrome, mozilla (in that order).
    -

    1.3.16 (June 24, 2012)

    +

    1.3.16 (June 24, 2012)

    Security Fixes:

      @@ -2421,7 +2583,7 @@ include OpenMP support for it by default. None
    -

    1.3.15 (April 28, 2012)

    +

    1.3.15 (April 28, 2012)

    Security Fixes:

      @@ -2495,7 +2657,7 @@ anticipate the automatic file numbering.
    -

    1.3.14 (February 25, 2012)

    +

    1.3.14 (February 25, 2012)

    Security Fixes:

      @@ -2552,7 +2714,7 @@ was using the filter setting from the Image structure instead.
    -

    1.3.13 (December 24, 2011)

    +

    1.3.13 (December 24, 2011)

    Security Fixes:

    None
    @@ -2706,7 +2868,7 @@ static builds.
    -

    1.3.12 (March 8, 2010)

    +

    1.3.12 (March 8, 2010)

    Security Fixes:

      @@ -2750,7 +2912,7 @@ would be written.
    -

    1.3.11 (February 21, 2010)

    +

    1.3.11 (February 21, 2010)

    Security Fixes:

      @@ -2802,7 +2964,7 @@ opaque.
    -

    1.3.10 (February 10, 2010)

    +

    1.3.10 (February 10, 2010)

    Security Fixes:

      @@ -2849,7 +3011,7 @@ scene number substition is desired in the output file names.
    -

    1.3.9 (February 4, 2010)

    +

    1.3.9 (February 4, 2010)

    Security Fixes:

      @@ -2909,7 +3071,7 @@ image in the list if it is not already opaque.
    -

    1.3.8 (January 21, 2010)

    +

    1.3.8 (January 21, 2010)

    Security Fixes:

      @@ -3063,7 +3225,7 @@ distributed.
    -

    1.3.7 (September 17, 2009)

    +

    1.3.7 (September 17, 2009)

    Security Fixes:

      @@ -3153,7 +3315,7 @@ structure is clean prior to invoking a function.
    -

    1.3.6 (July 25, 2009)

    +

    1.3.6 (July 25, 2009)

    Security Fixes:

      @@ -3287,7 +3449,7 @@ progressive JPEG.
    -

    1.3.5 (January 26, 2009)

    +

    1.3.5 (January 26, 2009)

    Security Fixes:

      @@ -3326,7 +3488,7 @@ not available.
    -

    1.3.4 (January 13, 2009)

    +

    1.3.4 (January 13, 2009)

    Security Fixes:

      @@ -3365,7 +3527,7 @@ not available.
    -

    1.3.3 (December 9, 2008)

    +

    1.3.3 (December 9, 2008)

    Security Fixes:

      @@ -3397,7 +3559,7 @@ used in a directory containing a million files.
    -

    1.3.2 (November 29, 2008)

    +

    1.3.2 (November 29, 2008)

    Security Fixes:

      @@ -3431,7 +3593,7 @@ process the opacity channel unless the image has one.
    -

    1.3.1 (November 17, 2008)

    +

    1.3.1 (November 17, 2008)

    Security Fixes:

      @@ -3469,7 +3631,7 @@ encoding is used via jpeg:optimize-coding define.
    -

    1.3 (November 9, 2008)

    +

    1.3 (November 9, 2008)

    Security fixes:

      @@ -3677,7 +3839,7 @@ dither any named channel.
    -

    1.2 (April 29, 2008)

    +

    1.2 (April 29, 2008)

    Security fixes:

      @@ -3933,7 +4095,7 @@ distributed).
    -

    1.1 (Released April 4, 2004)

    +

    1.1 (Released April 4, 2004)

    Bug fixes:

      @@ -4173,7 +4335,7 @@ logging system.

    -

    1.0 (Released in May, 2003)

    +

    1.0 (Released in May, 2003)

    GraphicsMagick support services:

      @@ -4318,9 +4480,12 @@ ImageMagick, several days before the ImageMagick 5.5.2 release.

    • Maintain an accurate ChangeLog.
    -
    -

    Copyright © GraphicsMagick Group 2002 - 2018

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/OpenMP.html b/www/OpenMP.html index 1102dfd..9d13644 100644 --- a/www/OpenMP.html +++ b/www/OpenMP.html @@ -3,7 +3,7 @@ - + OpenMP in GraphicsMagick @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -197,14 +197,12 @@ the system but may be set lower to limit resource consumption or (in some cases) to improve execution efficiency. The GraphicsMagick commands also accept a -limit threads limit type option for specifying the maximum number of threads to use.

    -
    -
    -
    Copyright (C) 2008 - 2020 GraphicsMagick Group
    -

    This program is covered by multiple licenses, which are described in -Copyright.txt. You should have received a copy of Copyright.txt with this -package; otherwise see http://www.graphicsmagick.org/Copyright.html.

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/OpenMP.html.orig b/www/OpenMP.html.orig new file mode 100644 index 0000000..f64f7a9 --- /dev/null +++ b/www/OpenMP.html.orig @@ -0,0 +1,210 @@ + + + + + + +OpenMP in GraphicsMagick + + + + + + + +
    +

    OpenMP in GraphicsMagick

    + + + + + +
    +

    Overview

    +

    GraphicsMagick has been transformed to use OpenMP for the 1.3 release +series. OpenMP is a portable framework for accelerating CPU-bound and +memory-bound operations using multiple threads. OpenMP originates in +the super-computing world and has been available in one form or +another since the late '90s.

    +

    Since GCC 4.2 has introduced excellent OpenMP support via GOMP, +OpenMP has become available to the masses. Recently, Clang has +also implemented good OpenMP support. Microsoft Visual Studio +Professional 2005 and later support OpenMP so Windows users can +benefit as well. Any multi-CPU and/or multi-core system is potentially +a good candidate for use with OpenMP. Modern multi-core chipsets from +AMD, Intel, IBM, Oracle, and ARM perform very well with OpenMP.

    +

    Most image processing routines are comprised of loops which iterate +through the image pixels, image rows, or image regions. These loops +are accelerated using OpenMP by executing portions of the total loops +in different threads, and therefore on a different processor +core. CPU-bound algorithms benefit most from OpenMP, but memory-bound +algorithms may also benefit as well since the memory is accessed by +different CPU cores, and sometimes the CPUs have their own path to +memory. For example, the AMD Opteron is a NUMA (Non-Uniform Memory +Architecture) design such that multi-CPU systems split the system +memory across CPUs so each CPU adds more memory bandwidth as well. +Server-class CPUs offer more independent memory channels than desktop +CPUs do.

    +

    For severely CPU-bound algorithms, it is not uncommon to see a linear +speed-up (within the constraints of Amdahl's law) due to the number +of cores. For example, a two core system executes the algorithm twice +as fast, and a four core system executes the algorithm four times as +fast. Memory-bound algorithms scale based on the memory bandwith +available to the cores. For example, memory-bound algorithms scale up +to almost 1.5X on my four core Opteron system due to its NUMA +architecture. Some systems/CPUs are able to immediately context switch +to another thread if the core would be blocked waiting for memory, +allowing multiple memory accesses to be pending at once, and thereby +improving throughput. For example, typical speedup of 20-32X (average +24X) has been observed on the Sun SPARC T2 CPU, which provides 8 +cores, with 8 virtual CPUs per core (64 threads).

    +

    An approach used in GraphicsMagick is to recognize the various access +patterns in the existing code, and re-write the algorithms (sometimes +from scratch) to be based on a framework that we call "pixel iterators". +With this approach, the computation is restricted to a small unit (a +callback function) with very well defined properties, and no knowledge as +to how it is executed or where the data comes from. This approach removes +the loops from the code and puts the loops in the framework, which may be +adjusted based on experience. The continuing strategy will be to +recognize design patterns and build frameworks which support those +patterns. Sometimes algorithms are special/exotic enough that it is much +easier to instrument the code for OpenMP rather than to attempt to fit +the algorithm into a framework.

    +

    Since OpenMP is based on multi-threading, multiple threads access the +underlying pixel storage at once. The interface to this underlying +storage is called the "pixel cache". The original pixel cache code +(derived from ImageMagick) was thread safe only to the extent that it +allowed one thread per image. This code has now been re-written so that +multiple threads may safely and efficiently work on the pixels in one +image. The re-write also makes the pixel cache thread safe if a +multi-threaded application uses an OpenMP-fortified library.

    +

    GraphicsMagick provides its own built-in 'benchmark' driver utility +which may be used to execute a multi-threaded benchmark of any other +utility command.

    +

    Using the built-in 'benchmark' driver utility, the following is an +example of per-core speed-up due to OpenMP on a four-core AMD Opteron +system (with Firefox and other desktop software still running). The +image is generated dynamically based on the 'granite' pattern and all +the pixel quantum values have 30% gaussian noise added:

    +
    +% gm benchmark -stepthreads 1 -duration 10 convert \
    +  -size 2048x1080 pattern:granite -operator all Noise-Gaussian 30% null:
    +Results: 1 threads 5 iter 11.34s user 11.340000s total 0.441 iter/s 0.441 iter/cpu 1.00 speedup 1.000 karp-flatt
    +Results: 2 threads 9 iter 20.34s user 10.190000s total 0.883 iter/s 0.442 iter/cpu 2.00 speedup 0.000 karp-flatt
    +Results: 3 threads 14 iter 31.72s user 10.600000s total 1.321 iter/s 0.441 iter/cpu 3.00 speedup 0.001 karp-flatt
    +Results: 4 threads 18 iter 40.84s user 10.460000s total 1.721 iter/s 0.441 iter/cpu 3.90 speedup 0.008 karp-flatt
    +
    +

    Note that the "iter/s cpu" value is a measure of the number of +iterations given the amount of reported CPU time consumed. It is an +effective measure of relative efficacy since its value should ideally +not drop as iterations are added. The karp-flatt metric is another +useful metric for evaluating thread-speedup efficiency. In the above +example, the total speedup was about 3.9X with only a slight loss of +CPU efficiency as threads are added.

    +
    +
    +

    Limitations

    +

    Often it is noticed that the memory allocation functions (e.g. from +the standard C library such as GNU libc) significantly hinder +performance since they are designed or optimized for single-threaded +programs, or prioritize returning memory to the system over speed. +Memory allocators are usually designed and optimized for programs +which perform thousands of small allocations, and if they make a large +memory allocation, they retain that memory for a long time. +GraphicsMagick performs large memory allocations for raster image +storage interspersed with a limited number of smaller allocations for +supportive data structures. This memory is released very quickly +since GraphicsMagick is highly optimized and thus the time between +allocation and deallocation can be very short. It has been observed +that some memory allocators are much slower to allocate and deallocate +large amounts of memory (e.g. a hundred megabytes) than alternative +allocators, even in single-threaded programs. Under these conditions, +the program can spend considerable time mysteriously "sleeping".

    +

    In order to help surmount problems with the default memory allocators, +the configure script offers support for use of Google gperftools 'tcmalloc', Solaris mtmalloc, +and Solaris umem libraries via the --with-tcmalloc, --with-mtmalloc, +and --with-umem options, respectively. When the allocation functions +are behaving badly, the memory allocation/deallocation performance +does not scale as threads are added and thus additional threads spend +more time sleeping (e.g. on a lock, or in munmap()) rather than doing +more work. Performance improvements of a factor of two are not +uncommon even before contending with the hugh CPU core/thread counts +available on modern CPUs. Using more threads which are slowed by +poorly-matched memory allocation functions is wasteful of memory, +system resources, human patience, and electrical power.

    +

    Many modern CPUs support "Turbo" modes where the CPU clock rate is +boosted if only a few cores are active. When a CPU provides a "Turbo" +mode, this decreases the apparent speed-up compared to using one +thread because the one thread was executed at a much higher clock +rate. Likewise, when a CPU becomes very hot (due to being heavily +used), it may decrease its clock rates overall to avoid burning up, +and this may also decreases the actual speed-up when using many +threads compared to using one thread. Many CPUs support +"hyperthreads" or other mechanisms in which one physical core will +support multiple light-weight threads, and if the core is efficiently +used by one thread, then this will decrease the apparent per-thread +speed-up but the peak speed-up will hopefully still be bounded by the +number of physical cores.

    +

    In most cases, OpenMP does not speed-up loading an image from a file, +or writing an image to a file. It is common for file decode and +encode to take longer than processing the image. Using uncompressed +formats is recommended with a fast I/O subsystem (or in-memory 'blobs' +in order to obtain the greated speed-up from OpenMP.

    +

    It has been observed that sometimes it takes much longer to start and +stop GraphicsMagick than it takes for it to run the requested +algorithm. The slowness is due to inefficiencies of the libraries +that GraphicsMagick is linked with (especially the ICU library that +libxml2 is often linked with). If GraphicsMagick takes too long to +perform trivial operations, then consider using the 'modules' build, +and investigate the 'batch' utility which allows running many +GraphicsMagick commands as a 'batch' script. If a 'modules' build is +not feasible, then configuring GraphicsMagick to only support the +specific formats actually needed can help with its execution time and +improve opportunity for OpenMP speed-up.

    +
    +
    +

    OpenMP Variables

    +

    According to the OpenMP specification, the OMP_NUM_THREADS evironment +variable may be used to specify the number of threads available to the +application. Typically this is set to the number of processor cores on +the system but may be set lower to limit resource consumption or (in +some cases) to improve execution efficiency. The GraphicsMagick +commands also accept a -limit threads limit type option for +specifying the maximum number of threads to use.

    +
    +
    +
    Copyright (C) 2008 - 2020 GraphicsMagick Group
    +
    +

    This program is covered by multiple licenses, which are described in +Copyright.txt. You should have received a copy of Copyright.txt with this +package; otherwise see http://www.graphicsmagick.org/Copyright.html.

    +
    +
    + + diff --git a/www/OpenMP.rst b/www/OpenMP.rst index 4a40bca..98b4afd 100644 --- a/www/OpenMP.rst +++ b/www/OpenMP.rst @@ -186,12 +186,3 @@ the system but may be set lower to limit resource consumption or (in some cases) to improve execution efficiency. The GraphicsMagick commands also accept a ``-limit threads limit`` type option for specifying the maximum number of threads to use. - - --------------------------------------------------------------------------- - -| Copyright (C) 2008 - 2020 GraphicsMagick Group - -This program is covered by multiple licenses, which are described in -Copyright.txt. You should have received a copy of Copyright.txt with this -package; otherwise see http://www.graphicsmagick.org/Copyright.html. diff --git a/www/README.html b/www/README.html index 3705228..7a0b216 100644 --- a/www/README.html +++ b/www/README.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -414,9 +414,12 @@ distributed with ".xz" or ".lzma" extensions.

    likely that other purposes will be found for Zstd.

    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/animate.html b/www/animate.html index eeb8de4..88dbcdb 100644 --- a/www/animate.html +++ b/www/animate.html @@ -116,7 +116,7 @@ You can define a Standard Colormap with xstdcmap. See xstdcmap( for details. This method is recommended for colormapped X server because it eliminates the need to compute a global colormap. -

    +

    Back to Contents  

    @@ -149,7 +149,7 @@ use: gm animate +borderwidth -backdrop cockatoo.*
    -

    +

    Back to Contents  

    @@ -753,7 +753,7 @@ format is MIFF (refer to miff(5) and the is specified in the image. Otherwise the images will display in the order they appear on the command line.
    -

    +

    Back to Contents  

    @@ -770,7 +770,7 @@ color="#00B04F"> Press any button to map or unmap the Command widget. See the next section for more information about the Command widget.
    -

    +

    Back to Contents  

    @@ -816,7 +816,7 @@ desired sub-menu item, release the button and the command is executed. Move the pointer away from the sub-menu if you decide not to execute a particular command.
    -

    +

    Back to Contents  

    @@ -851,7 +851,7 @@ and the total number of unique colors in the image.
    Press to discard all images and exit program.
    -

    +

    Back to Contents  

    @@ -938,6 +938,6 @@ information is sometimes used by a window manager to provide some sort of header identifying the window. The default is the image file name.
    -

    +

    Back to Contents  

    diff --git a/www/api/Makefile.am b/www/api/Makefile.am index a9d7f9a..641ef82 100644 --- a/www/api/Makefile.am +++ b/www/api/Makefile.am @@ -39,6 +39,7 @@ WWWAPI_HTML_TARGETS = \ $(WWWAPIDIR)/image.html \ $(WWWAPIDIR)/import.html \ $(WWWAPIDIR)/list.html \ + $(WWWAPIDIR)/log.html \ $(WWWAPIDIR)/magick.html \ $(WWWAPIDIR)/memory.html \ $(WWWAPIDIR)/monitor.html \ @@ -92,6 +93,7 @@ WWWWAPI_FILES = \ www/api/image.html \ www/api/import.html \ www/api/list.html \ + www/api/log.html \ www/api/magick.html \ www/api/memory.html \ www/api/monitor.html \ diff --git a/www/api/animate.html b/www/api/animate.html index 9142a2b..1a4bb66 100644 --- a/www/api/animate.html +++ b/www/api/animate.html @@ -3,7 +3,7 @@ - + animate @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Interactively animate an image sequence

    -

    Contents

    +

    Contents

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/animate.html.orig b/www/api/animate.html.orig new file mode 100644 index 0000000..61d32b4 --- /dev/null +++ b/www/api/animate.html.orig @@ -0,0 +1,109 @@ + + + + + + +animate + + + + + + + +
    +

    animate

    +

    Interactively animate an image sequence

    + + +
    +

    MagickXAnimateBackgroundImage

    +
    +

    Synopsis

    +
    +void MagickXAnimateBackgroundImage( Display *display, MagickXResourceInfo *resource_info,
    +                                    Image *images );
    +
    +
    +
    +

    Description

    +

    MagickXAnimateBackgroundImage() animates an image sequence in the background of +a window.

    +

    The format of the MagickXAnimateBackgroundImage method is:

    +
    +void MagickXAnimateBackgroundImage( Display *display, MagickXResourceInfo *resource_info,
    +                                    Image *images );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    resource_info:
    +
    Specifies a pointer to a X11 MagickXResourceInfo structure.
    +
    images:
    +
    The image list.
    +
    +
    +
    +
    +

    MagickXAnimateImages

    +
    +

    Synopsis

    +
    +Image *MagickXAnimateImages( Display *display, MagickXResourceInfo *resource_info,
    +                             char ** argv, const int argc, Image *images );
    +
    +
    +
    +

    Description

    +

    MagickXAnimateImages() displays an image via X11.

    +

    The format of the MagickXAnimateImages method is:

    +
    +Image *MagickXAnimateImages( Display *display, MagickXResourceInfo *resource_info,
    +                             char ** argv, const int argc, Image *images );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    resource_info:
    +
    Specifies a pointer to a X11 MagickXResourceInfo structure.
    +
    argv:
    +
    Specifies the application's argument list.
    +
    argc:
    +
    Specifies the number of arguments.
    +
    images:
    +
    The image list.
    +
    +
    +
    +
    + + diff --git a/www/api/annotate.html b/www/api/annotate.html index d68e67a..30eb674 100644 --- a/www/api/annotate.html +++ b/www/api/annotate.html @@ -3,7 +3,7 @@ - + annotate @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Annotate an image with text

    -

    Contents

    +

    Contents

    • AnnotateImage
    • GetTypeMetrics
    • @@ -112,5 +112,10 @@ unsigned int GetTypeMetrics( +
      +

      Copyright © GraphicsMagick Group 2002 - 2020

      +
      diff --git a/www/api/annotate.html.orig b/www/api/annotate.html.orig new file mode 100644 index 0000000..bcd728c --- /dev/null +++ b/www/api/annotate.html.orig @@ -0,0 +1,116 @@ + + + + + + +annotate + + + + + + + +
      +

      annotate

      +

      Annotate an image with text

      + +
      +

      Contents

      + +
      +
      +

      AnnotateImage

      +
      +

      Synopsis

      +
      +MagickPassFail AnnotateImage( Image *image, DrawInfo *draw_info );
      +
      +
      +
      +

      Description

      +

      AnnotateImage() annotates an image with DrawInfo 'text' based on other +parameters from DrawInfo such as 'affine', 'align', 'decorate', and +'gravity'.

      +

      Originally this function additionally transformed 'text' using +TranslateText() but it no longer does so as of GraphicsMagick 1.3.32.

      +

      The format of the AnnotateImage method is:

      +
      +MagickPassFail AnnotateImage( Image *image, DrawInfo *draw_info );
      +
      +

      A description of each parameter follows:

      +
      +
      status:
      +
      Method AnnotateImage returns MagickPass if the image is annotated +otherwise MagickFail.
      +
      image:
      +
      The image.
      +
      draw_info:
      +
      The draw info.
      +
      +
      +
      +
      +

      GetTypeMetrics

      +
      +

      Synopsis

      +
      +unsigned int GetTypeMetrics( Image *image, const DrawInfo *draw_info,
      +                             TypeMetric *metrics );
      +
      +
      +
      +

      Description

      +

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

      +

      o character width +o character height +o ascent +o descent +o text width +o text height +o maximum horizontal advance +o underline position +o underline thickness

      +

      The format of the GetTypeMetrics method is:

      +
      +unsigned int GetTypeMetrics( Image *image, const DrawInfo *draw_info,
      +                             TypeMetric *metrics );
      +
      +
      +
      image:
      +
      The image.
      +
      draw_info:
      +
      The draw info.
      +
      metrics:
      +
      Return the font metrics in this structure.
      +
      +
      +
      +
      + + diff --git a/www/api/api.html b/www/api/api.html index 0e7a8e3..c5817b8 100644 --- a/www/api/api.html +++ b/www/api/api.html @@ -3,7 +3,7 @@ - + GraphicsMagick Core C API @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
      - - -   + + + 
    @@ -77,6 +77,7 @@ and normalize
  • Image: Miscellaneous image methods
  • Import : Import image pixels from common representations
  • List: Manage image lists
  • +
  • Log: Event logging support
  • Magick: Image format support interfaces
  • Memory: Memory allocation methods
  • Monitor: Progress monitor callbacks
  • @@ -89,6 +90,7 @@ and normalize
  • Profile: Attached profile access
  • Quantize: Reduce image colors or assign image colors from colormap
  • Registry: Store and retrieve images in memory by ID
  • +
  • Render: Render vector graphics
  • Resize: Resize an Image
  • Resource: Set and get resource limits
  • Segment: Coalese similar image colors
  • @@ -279,8 +281,11 @@ out.miff'.

    The GraphicsMagick-config script reproduces the options which were used to compile the GraphicsMagick utilities. Using compatible options ensures that your program will compile and run.

    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/api/api.html.orig b/www/api/api.html.orig new file mode 100644 index 0000000..215e40c --- /dev/null +++ b/www/api/api.html.orig @@ -0,0 +1,286 @@ + + + + + + +GraphicsMagick Core C API + + + + + + + +
    +

    GraphicsMagick Core C API

    + + + + +

    The GraphicsMagick core C library constitutes the implementation of +GraphicsMagick and provides the lowest-level C language programming +interface for GraphicsMagick. The core C API provides many functions +to read, manipulate, write, or display an image. To invoke the +functions, write your program in C (or C++) language while making +calls to the core library functions and link with libGraphicsMagick.a, +libGraphicsMagick.so, or GraphicsMagick.dll depending on your system.

    +

    The API is divided into a number of categories. While reading this +documentation, please reference the types documentation as required:

    +
    +
      +
    • Animate: Interactively animate an image sequence
    • +
    • Annotate: Annotate an image with text
    • +
    • Attribute: Access key, value image attributes
    • +
    • Average: Average several images together
    • +
    • ASC CDL : Apply ASC CDL to image
    • +
    • Blob: Read and write images to memory
    • +
    • Channel: Import and export image channels as well as compute channel depth
    • +
    • Color: Methods to deal with image colors
    • +
    • Colormap: Methods to deal with image colormaps
    • +
    • Compare: Compare images
    • +
    • Composite: Composite images
    • +
    • Confirm Access : Confirm access to files and URLs.
    • +
    • Constitute: Read, write, import, and export images
    • +
    • Decorate: Add fancy borders to images
    • +
    • Describe: Describe an image
    • +
    • Display: Interactively display and edit an image
    • +
    • Draw: Convenient methods to draw vectors and text
    • +
    • Effect:Threshold (various), blur, despeckle, edge, emboss, enhance, +gaussian blur ...
    • +
    • Enhance: Contrast, equalize, gamma, level, level channel, modulate, negate, +and normalize
    • +
    • Error: Error reporting methods
    • +
    • Export : Export image pixels to common representations
    • +
    • FX: Special effects methods
    • +
    • Hald CLUT : Apply Hald CLUT to image
    • +
    • Image: Miscellaneous image methods
    • +
    • Import : Import image pixels from common representations
    • +
    • List: Manage image lists
    • +
    • Magick: Image format support interfaces
    • +
    • Memory: Memory allocation methods
    • +
    • Monitor: Progress monitor callbacks
    • +
    • Montage: Create a montage of image thumbnails
    • +
    • Operator: Methods to apply mathematic or boolean operators to pixels
    • +
    • Paint: Fill pixel regions
    • +
    • Pixel Cache: Low-level access to image pixels
    • +
    • Pixel Iterator: Pixel iterator design pattern support functions
    • +
    • Plasma: Plasma fractal image generator
    • +
    • Profile: Attached profile access
    • +
    • Quantize: Reduce image colors or assign image colors from colormap
    • +
    • Registry: Store and retrieve images in memory by ID
    • +
    • Resize: Resize an Image
    • +
    • Resource: Set and get resource limits
    • +
    • Segment: Coalese similar image colors
    • +
    • Shear: Rotate image, shear image, or apply a 2D affine transformation
    • +
    • Signature: Compute an image signature (checksum)
    • +
    • Statistics: Compute image statistics
    • +
    • Texture: Create a tiled texture image or tile an image with a texture.
    • +
    • Transform: Chop, coalesce, deconstruct, flatten, flip, flop, mosiac, roll, +or shave image
    • +
    +
    +

    Here are a few sample programs to get you started.

    +

    This example program (convert.c) simply converts from one file name to +another (and will automatically change formats based on file +extension):

    +
    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <string.h>
    +#include <time.h>
    +#include <sys/types.h>
    +#include <magick/api.h>
    +
    +int main ( int argc, char **argv )
    +{
    +  Image
    +    *image = (Image *) NULL;
    +
    +  char
    +    infile[MaxTextExtent],
    +    outfile[MaxTextExtent];
    +
    +  int
    +    arg = 1,
    +    exit_status = 0;
    +
    +  ImageInfo
    +    *imageInfo;
    +
    +  ExceptionInfo
    +    exception;
    +
    +  InitializeMagick(NULL);
    +  imageInfo=CloneImageInfo(0);
    +  GetExceptionInfo(&exception);
    +
    +  if (argc != 3)
    +    {
    +      (void) fprintf ( stderr, "Usage: %s infile outfile\n", argv[0] );
    +      (void) fflush(stderr);
    +      exit_status = 1;
    +      goto program_exit;
    +    }
    +
    +  (void) strncpy(infile, argv[arg], MaxTextExtent-1 );
    +  arg++;
    +  (void) strncpy(outfile, argv[arg], MaxTextExtent-1 );
    +
    +  (void) strcpy(imageInfo->filename, infile);
    +  image = ReadImage(imageInfo, &exception);
    +  if (image == (Image *) NULL)
    +    {
    +      CatchException(&exception);
    +      exit_status = 1;
    +      goto program_exit;
    +    }
    +
    +  (void) strcpy(image->filename, outfile);
    +  if (!WriteImage (imageInfo,image))
    +    {
    +      CatchException(&image->exception);
    +      exit_status = 1;
    +      goto program_exit;
    +    }
    +
    + program_exit:
    +
    +  if (image != (Image *) NULL)
    +    DestroyImage(image);
    +
    +  if (imageInfo != (ImageInfo *) NULL)
    +    DestroyImageInfo(imageInfo);
    +  DestroyMagick();
    +
    +  return exit_status;
    +}
    +
    +

    This example program (demo.c) which reads multiple input files +(possibly animation files) specified on the command line, resizes the +image frames to 106x80, and writes the resulting animation to disk:

    +
    +#include <stdio.h>
    +#include <string.h>
    +#include <time.h>
    +#include <sys/types.h>
    +#include <magick/api.h>
    +
    +int main(int argc,char **argv)
    +{
    +  ExceptionInfo
    +    exception;
    +
    +  Image
    +    *image,
    +    *images,
    +    *resize_image,
    +    *thumbnails;
    +
    +  ImageInfo
    +    *image_info;
    +
    +  int
    +    i;
    +
    +  /*
    +    Initialize the image info structure and read the list of files
    +    provided by the user as a image sequence
    +  */
    +  InitializeMagick(*argv);
    +  GetExceptionInfo(&exception);
    +  image_info=CloneImageInfo((ImageInfo *) NULL);
    +  images=NewImageList();
    +  for (i=1; i< argc-1; i++)
    +    {
    +      (void) strcpy(image_info->filename,argv[i]);
    +      printf("Reading %s ...", image_info->filename);
    +      image=ReadImage(image_info,&exception);
    +      printf(" %lu frames\n", GetImageListLength(image));
    +      if (exception.severity != UndefinedException)
    +        CatchException(&exception);
    +      if (image)
    +        (void) AppendImageToList(&images,image);
    +    }
    +
    +  if (!images)
    +    {
    +      printf("Failed to read any images!\n");
    +      exit(1);
    +    }
    +  /*
    +    Create a thumbnail image sequence
    +  */
    +  thumbnails=NewImageList();
    +  while ((image=RemoveFirstImageFromList(&images)) != (Image *) NULL)
    +    {
    +      resize_image=ResizeImage(image,106,80,LanczosFilter,1.0,&exception);
    +      DestroyImage(image);
    +      if (resize_image == (Image *) NULL)
    +        {
    +          CatchException(&exception);
    +          continue;
    +        }
    +      (void) AppendImageToList(&thumbnails,resize_image);
    +    }
    +  /*
    +    Write the thumbnail image sequence to file
    +  */
    +  if (thumbnails)
    +    {
    +      (void) strcpy(thumbnails->filename,argv[argc-1]);
    +      image_info->adjoin=MagickTrue;
    +      printf("Writing %s ... %lu frames\n", thumbnails->filename,
    +             GetImageListLength(thumbnails));
    +      WriteImage(image_info,thumbnails);
    +    }
    +
    +  /*
    +    Release resources
    +  */
    +  DestroyImageList(thumbnails);
    +  DestroyImageInfo(image_info);
    +  DestroyExceptionInfo(&exception);
    +  DestroyMagick();
    +  return(0);
    +}
    +
    +

    To compile on Unix, the command would look something like this:

    +
    +gcc -o demo demo.c -O `GraphicsMagick-config --cppflags --ldflags --libs`
    +
    +

    As a usage example, with the input files in1.gif, in2.png, and in3.jpg, create +the animation file out.miff:

    +
    +demo in1.gif in2.png in3.jpg out.miff
    +
    +

    The resulting animation may be played on an X11 display using 'gm animate +out.miff'.

    +

    The GraphicsMagick-config script reproduces the options which were used to +compile the GraphicsMagick utilities. Using compatible options ensures that +your program will compile and run.

    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    + + diff --git a/www/api/api.rst b/www/api/api.rst index 694e1ad..dd33fb6 100644 --- a/www/api/api.rst +++ b/www/api/api.rst @@ -32,6 +32,7 @@ GraphicsMagick Core C API .. _Image : image.html .. _Import : import.html .. _List : list.html +.. _Log : log.html .. _Magick : magick.html .. _Memory : memory.html .. _Monitor : monitor.html @@ -44,6 +45,7 @@ GraphicsMagick Core C API .. _Profile : profile.html .. _Quantize : quantize.html .. _Registry : registry.html +.. _Render : render.html .. _Resize : resize.html .. _Resource : resource.html .. _Segment : segment.html @@ -93,6 +95,7 @@ documentation, please reference the types_ documentation as required: * Image_: Miscellaneous image methods * Import_ : Import image pixels from common representations * List_: Manage image lists + * Log_: Event logging support * Magick_: Image format support interfaces * Memory_: Memory allocation methods * Monitor_: Progress monitor callbacks @@ -105,6 +108,7 @@ documentation, please reference the types_ documentation as required: * Profile_: Attached profile access * Quantize_: Reduce image colors or assign image colors from colormap * Registry_: Store and retrieve images in memory by ID + * Render_: Render vector graphics * Resize_: Resize an Image * Resource_: Set and get resource limits * Segment_: Coalese similar image colors @@ -296,9 +300,3 @@ out.miff'. The GraphicsMagick-config script reproduces the options which were used to compile the GraphicsMagick utilities. Using compatible options ensures that your program will compile and run. - -------------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/api/api_hyperlinks.rst b/www/api/api_hyperlinks.rst index 2c6aada..fc2579e 100644 --- a/www/api/api_hyperlinks.rst +++ b/www/api/api_hyperlinks.rst @@ -26,6 +26,9 @@ .. _IndexPacket: ../api/types.html#indexpacket .. _InterlaceType: ../api/types.html#interlacetype .. _LayerType: ../api/types.html#layertype +.. _LogEventType: ../api/types.html#logeventtype +.. _LogMethod: ../api/types.html#logmethod +.. _LogOutputType: ../api/types.html#logoutputtype .. _MagickInfo: ../api/types.html#magickinfo .. _MonitorHandler: ../api/types.html#monitorhandler .. _MontageInfo: ../api/types.html#montageinfo diff --git a/www/api/attribute.html b/www/api/attribute.html index 92bec54..fdfa4a8 100644 --- a/www/api/attribute.html +++ b/www/api/attribute.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -190,5 +190,10 @@ attribute to replace or add to the list.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/average.html b/www/api/average.html index a83a480..c5429c4 100644 --- a/www/api/average.html +++ b/www/api/average.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -71,5 +71,10 @@ exception describes the reason for the failure.

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/average.html.orig b/www/api/average.html.orig new file mode 100644 index 0000000..07ac17f --- /dev/null +++ b/www/api/average.html.orig @@ -0,0 +1,75 @@ + + + + + + +average + + + + + + + +
    +

    average

    +

    Image averaging functions

    + +
    +

    Contents

    + +
    +
    +

    AverageImages

    +
    +

    Synopsis

    +
    +Image *AverageImages( Image *image, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    The Average() method takes a set of images and averages them together. +Each image in the set must have the same width and height. Average() +returns a single image with each corresponding pixel component of +each image averaged. On failure, a NULL image is returned and +exception describes the reason for the failure.

    +

    The format of the AverageImage method is:

    +
    +Image *AverageImages( Image *image, ExceptionInfo *exception );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image sequence.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    + + diff --git a/www/api/blob.html b/www/api/blob.html index e9e75d7..f3cf4f7 100644 --- a/www/api/blob.html +++ b/www/api/blob.html @@ -3,7 +3,7 @@ - + blob @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Read or write formatted images in memory (BLOBs)

    -

    Contents

    +

    Contents

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/blob.html.orig b/www/api/blob.html.orig new file mode 100644 index 0000000..b2c70d7 --- /dev/null +++ b/www/api/blob.html.orig @@ -0,0 +1,695 @@ + + + + + + +blob + + + + + + + +
    +

    blob

    +

    Read or write formatted images in memory (BLOBs)

    + + +
    +

    AttachBlob

    +
    +

    Synopsis

    +
    +void AttachBlob( BlobInfo *blob_info, const void *blob, const size_t length );
    +
    +
    +
    +

    Description

    +

    AttachBlob() attaches a blob to the BlobInfo structure.

    +

    The format of the AttachBlob method is:

    +
    +void AttachBlob( BlobInfo *blob_info, const void *blob, const size_t length );
    +
    +

    A description of each parameter follows:

    +
    +
    blob_info:
    +
    Specifies a pointer to a BlobInfo structure.
    +
    blob:
    +
    The address of a character stream in one of the image formats +understood by GraphicsMagick.
    +
    length:
    +
    This size_t integer reflects the length in bytes of the blob.
    +
    +
    +
    +
    +

    BlobIsSeekable

    +
    +

    Synopsis

    +
    +MagickBool BlobIsSeekable( const Image *image );
    +
    +
    +
    +

    Description

    +

    BlobIsSeekable() returns MagickTrue if the blob supports seeks +(SeekBlob() is functional).

    +

    The format of the BlobIsSeekable method is:

    +
    +MagickBool BlobIsSeekable( const Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    Image to query
    +
    +
    +
    +
    +

    BlobReserveSize

    +
    +

    Synopsis

    +
    +MagickPassFail BlobReserveSize( Image *image, magick_off_t size );
    +
    +
    +
    +

    Description

    +

    BlobReserveSize() sets the output size of the blob or file. This is used +as a means to minimize memory or filesystem fragmentation if the final +output size is known in advance. While it is possible that file +fragmentation is reduced, it is also possible that file write +performance is reduced by changing a write operation to a read, modify, +write operation.

    +

    The format of the BlobReserveSize method is:

    +
    +MagickPassFail BlobReserveSize( Image *image, magick_off_t size );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    Image to update
    +
    size:
    +
    New output size.
    +
    +
    +
    +
    +

    BlobToFile

    +
    +

    Synopsis

    +
    +MagickPassFail BlobToFile( const char *filename, const void *blob, const size_t length,
    +                           ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    BlobToFile() writes a blob to a file. It returns MagickFail if an error +occurs otherwise MagickPass.

    +

    The format of the BlobToFile method is:

    +
    +MagickPassFail BlobToFile( const char *filename, const void *blob, const size_t length,
    +                           ExceptionInfo *exception );
    +
    +
    +
    status:
    +
    BlobToFile returns MagickPass on success; otherwise, it +returns MagickFail if an error occurs.
    +
    filename:
    +
    Write the blob to this file.
    +
    blob:
    +
    The address of a blob.
    +
    length:
    +
    This length in bytes of the blob.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    BlobToImage

    +
    +

    Synopsis

    +
    +Image *BlobToImage( const ImageInfo *image_info, const void *blob,
    +                    const size_t length, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the BlobToImage method is:

    +
    +Image *BlobToImage( const ImageInfo *image_info, const void *blob,
    +                    const size_t length, ExceptionInfo *exception );
    +
    +
    +
    image_info:
    +
    The image info.
    +
    blob:
    +
    The address of a character stream in one of the image formats +understood by GraphicsMagick.
    +
    length:
    +
    This size_t integer reflects the length in bytes of the blob.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    CloneBlobInfo

    +
    +

    Synopsis

    +
    +BlobInfo *CloneBlobInfo( const BlobInfo *blob_info );
    +
    +
    +
    +

    Description

    +

    CloneBlobInfo() makes a duplicate of the given blob info structure, or if +blob info is NULL, a new one.

    +

    The format of the CloneBlobInfo method is:

    +
    +BlobInfo *CloneBlobInfo( const BlobInfo *blob_info );
    +
    +

    A description of each parameter follows:

    +
    +
    clone_info:
    +
    Method CloneBlobInfo returns a duplicate of the given +blob info, or if blob info is NULL a new one.
    +
    quantize_info:
    +
    a structure of type info.
    +
    +
    +
    +
    +

    DestroyBlob

    +
    +

    Synopsis

    +
    +void DestroyBlob( Image *image );
    +
    +
    +
    +

    Description

    +

    DestroyBlob() deallocates memory associated with a blob. The blob is +a reference counted object so the object is only destroyed once its +reference count decreases to zero.

    +

    The format of the DestroyBlob method is:

    +
    +void DestroyBlob( Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    +
    +
    +
    +

    DestroyBlobInfo

    +
    +

    Synopsis

    +
    +void DestroyBlobInfo( BlobInfo *blob );
    +
    +
    +
    +

    Description

    +

    DestroyBlobInfo() deallocates memory associated with an BlobInfo structure. +The blob is a reference counted object so the object is only destroyed once +its reference count decreases to zero. Use of DestroyBlob is preferred over +this function since it assures that the blob is closed prior to destruction.

    +

    This function is no longer used within GraphicsMagick.

    +

    The format of the DestroyBlobInfo method is:

    +
    +void DestroyBlobInfo( BlobInfo *blob );
    +
    +

    A description of each parameter follows:

    +
    +
    blob:
    +
    Specifies a pointer to a BlobInfo structure.
    +
    +
    +
    +
    +

    DetachBlob

    +
    +

    Synopsis

    +
    +void DetachBlob( BlobInfo *blob_info );
    +
    +
    +
    +

    Description

    +

    DetachBlob() detaches a blob from the BlobInfo structure.

    +

    The format of the DetachBlob method is:

    +
    +void DetachBlob( BlobInfo *blob_info );
    +
    +

    A description of each parameter follows:

    +
    +
    blob_info:
    +
    Specifies a pointer to a BlobInfo structure.
    +
    +
    +
    +
    +

    FileToBlob

    +
    +

    Synopsis

    +
    +void *FileToBlob( const char *filename, size_t *length, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    FileToBlob() returns the contents of a file in a buffer allocated via +MagickMalloc() (which is equivalent to the system malloc() by default). +The character '0' is appended to the buffer in case the buffer will be +accessed as a string. The length of the buffer (not including the extra +terminating '0' character) is returned via the 'length' parameter. +If an error occurs, a NULL pointer is returned. The returned buffer +must be freed by the user in a matter compatible with MagickMalloc() +(e.g. via MagickFree()).

    +

    The format of the FileToBlob method is:

    +
    +void *FileToBlob( const char *filename, size_t *length, ExceptionInfo *exception );
    +
    +
    +
    blob:
    +
    FileToBlob() returns the contents of a file as a blob. If +an error occurs NULL is returned.
    +
    filename:
    +
    The filename.
    +
    length:
    +
    This pointer to a size_t integer sets the initial length of the +blob. On return, it reflects the actual length of the blob.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    GetBlobFileHandle

    +
    +

    Synopsis

    +
    +FILE *GetBlobFileHandle( const Image *image );
    +
    +
    +
    +

    Description

    +

    GetBlobFileHandle() returns the stdio file handle associated with the +image blob. If there is no associated file handle, then a null pointer +is returned.

    +

    The format of the GetBlobFileHandle method is:

    +
    +FILE *GetBlobFileHandle( const Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    Image to query
    +
    +
    +
    +
    +

    GetBlobInfo

    +
    +

    Synopsis

    +
    +void GetBlobInfo( BlobInfo *blob_info );
    +
    +
    +
    +

    Description

    +

    GetBlobInfo() initializes the BlobInfo structure.

    +

    The format of the GetBlobInfo method is:

    +
    +void GetBlobInfo( BlobInfo *blob_info );
    +
    +

    A description of each parameter follows:

    +
    +
    blob_info:
    +
    Specifies a pointer to a BlobInfo structure.
    +
    +
    +
    +
    +

    GetBlobStatus

    +
    +

    Synopsis

    +
    +int GetBlobStatus( const Image *image );
    +
    +
    +
    +

    Description

    +

    GetBlobStatus() returns the blob error status. For GraphicsMagick +1.3.26 and earlier, this was only set by CloseBlob() but now it is +set immediately upon error.

    +

    The format of the GetBlobStatus method is:

    +
    +int GetBlobStatus( const Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    +
    +
    +
    +

    GetBlobFirstErrno

    +
    +

    Synopsis

    +
    +int GetBlobFirstErrno( const Image *image );
    +
    +
    +
    +

    Description

    +

    GetBlobFirstErrno() returns the errno present (if any) when the blob +first encountered as error, as indicated by GetBlobStatus(). The +the purpose of this function is to help improve the quality of error +reporting.

    +

    The format of the GetBlobFirstErrno method is:

    +
    +int GetBlobFirstErrno( const Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    +
    +
    +
    +

    GetBlobStreamData

    +
    +

    Synopsis

    +
    +unsigned char *GetBlobStreamData( const Image *image );
    +
    +
    +
    +

    Description

    +

    GetBlobStreamData() returns the stream data for the image. The data is only +available if the data is stored on the heap, or is memory mapped. +Otherwise a NULL value is returned.

    +

    The format of the GetBlobStreamData method is:

    +
    +unsigned char *GetBlobStreamData( const Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    +
    +
    +
    +

    GetBlobTemporary

    +
    +

    Synopsis

    +
    +MagickBool GetBlobTemporary( const Image *image );
    +
    +
    +
    +

    Description

    +

    GetBlobTemporary() returns MagickTrue if the file associated with the blob +is a temporary file and should be removed when the associated image is +destroyed.

    +

    The format of the GetBlobTemporary method is:

    +
    +MagickBool GetBlobTemporary( const Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    Image to query
    +
    +
    +
    +
    +

    GetConfigureBlob

    +
    +

    Synopsis

    +
    +void *GetConfigureBlob( const char *filename, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    GetConfigureBlob() returns the specified configure file as a blob.

    +

    The format of the GetConfigureBlob method is:

    +
    +void *GetConfigureBlob( const char *filename, ExceptionInfo *exception );
    +
    +

    A description of each parameter follows:

    +
    +
    filename:
    +
    The configure file name.
    +
    path:
    +
    return the full path information of the configure file.
    +
    length:
    +
    This pointer to a size_t integer sets the initial length of the +blob. On return, it reflects the actual length of the blob.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ImageToBlob

    +
    +

    Synopsis

    +
    +void *ImageToBlob( const ImageInfo *image_info, Image *image, size_t *length,
    +                   ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    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 function is the equivalent of WriteImage(), but writes the +formatted "file" to a memory buffer rather than to an actual file.

    +

    The format of the ImageToBlob method is:

    +
    +void *ImageToBlob( const ImageInfo *image_info, Image *image, size_t *length,
    +                   ExceptionInfo *exception );
    +
    +
    +
    image_info:
    +
    The image info.
    +
    image:
    +
    The image.
    +
    length:
    +
    This pointer to a size_t integer sets the initial length of the +blob. On return, it reflects the actual length of the blob.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ImageToFile

    +
    +

    Synopsis

    +
    +MagickPassFail ImageToFile( Image *image, const char *filename,
    +                            ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    ImageToFile() copies the input image from an open blob stream to a file. +It returns False if an error occurs otherwise True. This function is used +to handle coders which are unable to stream the data in using Blob I/O. +Instead of streaming the data in, the data is streammed to a temporary +file, and the coder accesses the temorary file directly.

    +

    The format of the ImageToFile method is:

    +
    +MagickPassFail ImageToFile( Image *image, const char *filename,
    +                            ExceptionInfo *exception );
    +
    +
    +
    status:
    +
    ImageToFile returns MagickPass on success; otherwise, it +returns MagickFail if an error occurs.
    +
    image:
    +
    The image.
    +
    filename:
    +
    Write the image to this file.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    PingBlob

    +
    +

    Synopsis

    +
    +Image *PingBlob( const ImageInfo *image_info, const void *blob, const size_t length,
    +                 ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the PingBlob method is:

    +
    +Image *PingBlob( const ImageInfo *image_info, const void *blob, const size_t length,
    +                 ExceptionInfo *exception );
    +
    +
    +
    image_info:
    +
    The image info.
    +
    blob:
    +
    The address of a character stream in one of the image formats +understood by GraphicsMagick.
    +
    length:
    +
    This size_t integer reflects the length in bytes of the blob.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ReferenceBlob

    +
    +

    Synopsis

    +
    +BlobInfo ReferenceBlob( BlobInfo *blob_info );
    +
    +
    +
    +

    Description

    +

    ReferenceBlob() increments the reference count associated with the pixel +blob, returning a pointer to the blob.

    +

    The format of the ReferenceBlob method is:

    +
    +BlobInfo ReferenceBlob( BlobInfo *blob_info );
    +
    +

    A description of each parameter follows:

    +
    +
    blob_info:
    +
    The blob_info.
    +
    +
    +
    +
    +

    SetBlobClosable

    +
    +

    Synopsis

    +
    +void SetBlobClosable( Image *image, MagickBool closeable );
    +
    +
    +
    +

    Description

    +

    SetBlobClosable() enables closing the blob if MagickTrue is passed, and +exempts the blob from being closed if False is passed. Blobs are closable +by default (default MagickTrue).

    +

    The format of the SetBlobClosable method is:

    +
    +void SetBlobClosable( Image *image, MagickBool closeable );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    Image to update
    +
    closeable:
    +
    Set to FALSE in order to disable closing the blob.
    +
    +
    +
    +
    +

    SetBlobTemporary

    +
    +

    Synopsis

    +
    +void SetBlobTemporary( Image *image, MagickBool isTemporary );
    +
    +
    +
    +

    Description

    +

    SetBlobTemporary() sets a boolean flag (default False) to specify if +the file associated with the blob is a temporary file and should be +removed when the associated image is destroyed.

    +

    The format of the SetBlobTemporary method is:

    +
    +void SetBlobTemporary( Image *image, MagickBool isTemporary );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    Image to update
    +
    isTemporary:
    +
    Set to True to indicate that the file associated with +the blob is temporary.
    +
    +
    +
    +
    + + diff --git a/www/api/cdl.html b/www/api/cdl.html index 271d26e..b416d14 100644 --- a/www/api/cdl.html +++ b/www/api/cdl.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -83,5 +83,10 @@ red green and blue channels, plus saturation.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/cdl.html.orig b/www/api/cdl.html.orig new file mode 100644 index 0000000..c46cb92 --- /dev/null +++ b/www/api/cdl.html.orig @@ -0,0 +1,87 @@ + + + + + + +cdl + + + + + + + +
    +

    cdl

    +

    Apply ASC CDL transform to image

    + +
    +

    Contents

    + +
    +
    +

    CdlImage

    +
    +

    Synopsis

    +
    +MagickPassFail CdlImage( Image *image, const char *cdl );
    +
    +
    +
    +

    Description

    +

    The CdlImage() method applies ("bakes in") the ASC-CDL which is a format +for the exchange of basic primary color grading information between +equipment and software from different manufacturers. The format defines +the math for three functions: slope, offset and power. Each function uses +a number for the red, green, and blue color channels for a total of nine +numbers comprising a single color decision. A tenth number for chrominance +(saturation) has been proposed but is not yet standardized.

    +

    The cdl argument string is comma delimited and is in the form (but +without invervening spaces or line breaks):

    +

    redslope, redoffset, redpower : +greenslope, greenoffset, greenpower : +blueslope, blueoffset, bluepower : +saturation

    +

    with the unity (no change) specification being:

    +

    "1.0,0.0,1.0:1.0,0.0,1.0:1.0,0.0,1.0:0.0"

    +

    See http://en.wikipedia.org/wiki/ASC_CDL for more information.

    +

    The format of the CdlImage method is:

    +
    +MagickPassFail CdlImage( Image *image, const char *cdl );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    cdl:
    +
    Define the coefficients for slope offset and power in the +red green and blue channels, plus saturation.
    +
    +
    +
    +
    + + diff --git a/www/api/channel.html b/www/api/channel.html index 0346938..c16cc92 100644 --- a/www/api/channel.html +++ b/www/api/channel.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -230,5 +230,10 @@ MagickPassFail SetImageChannelDepth( +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/channel.html.orig b/www/api/channel.html.orig new file mode 100644 index 0000000..d7e170f --- /dev/null +++ b/www/api/channel.html.orig @@ -0,0 +1,234 @@ + + + + + + +channel + + + + + + + +
    +

    channel

    +

    Image channel functions

    + + +
    +

    ChannelImage

    +
    +

    Synopsis

    +
    +unsigned int ChannelImage( Image *image, const ChannelType channel );
    +
    +
    +
    +

    Description

    +

    Transform an image so that the resulting image is a grayscale image +based on a specified image channel. The resulting image is returned in +the RGB colorspace. This function does not force or assume an input +image colorspace so it may be used to extract channels from images in +colorspaces other than RGB or CMYK. For example, if the image is currently +transformed to the HWB colorspace, the 'B' channel may be extracted by +specifying RedChannel as the ChannelType argument.

    +

    The format of the ChannelImage method is:

    +
    +unsigned int ChannelImage( Image *image, const ChannelType channel );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    channel:
    +
    Identify which channel to extract: Red, Cyan, Green, Magenta, +Blue, Yellow, or Opacity.
    +
    +
    +
    +
    +

    ExportImageChannel

    +
    +

    Synopsis

    +
    +Image *ExportImageChannel( const Image *image, const ChannelType channel,
    +                           ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    ExportImageChannel() exports a specified image channel as a new image.

    +

    The format of the ExportImageChannel method is:

    +
    +Image *ExportImageChannel( const Image *image, const ChannelType channel,
    +                           ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The source image.
    +
    channel:
    +
    The image channel to export
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    GetImageChannelDepth

    +
    +

    Synopsis

    +
    +unsigned long GetImageChannelDepth( const Image *image, const ChannelType channel,
    +                                    ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    GetImageChannelDepth() returns the minimum bit depth required to store +the specified image channel without actual loss of color resolution. +Pixel components are stored in a Quantum, which is 8, 16, or 32 bits +depending on the QuantumDepth value set when the software is compiled. +GetImageChannelDepth() returns the smallest modulus storage size which +supports the scale of the pixel within the range (i.e. no information is +lost). As an example, the value one is returned for a bilevel channel +since only one bit of resolution is required to represent a bilevel channel.

    +

    The format of the GetImageChannelDepth method is:

    +
    +unsigned long GetImageChannelDepth( const Image *image, const ChannelType channel,
    +                                    ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    channel:
    +
    Channel to test.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ImportImageChannel

    +
    +

    Synopsis

    +
    +MagickPassFail ImportImageChannel( const Image *source_image, Image *update_image,
    +                                   const ChannelType channel );
    +
    +
    +
    +

    Description

    +

    ImportImageChannel() imports an image into the specified image channel.

    +

    The format of the ImportImageChannel method is:

    +
    +MagickPassFail ImportImageChannel( const Image *source_image, Image *update_image,
    +                                   const ChannelType channel );
    +
    +
    +
    source_image:
    +
    The image to use as the replacement image channel.
    +
    update_image:
    +
    The image to import the channel into.
    +
    channel:
    +
    The image channel to import
    +
    +
    +
    +
    +

    ImportImageChannelsMasked

    +
    +

    Synopsis

    +
    +MagickPassFail ImportImageChannelsMasked( const Image *source_image,
    +                                          Image *update_image,
    +                                          const ChannelType channels );
    +
    +
    +
    +

    Description

    +

    ImportImageChannelsMasked() imports all the channels from a source +image to an update image, except for the channels specified.

    +

    The format of the ImportImageChannelsMasked method is:

    +
    +MagickPassFail ImportImageChannelsMasked( const Image *source_image,
    +                                          Image *update_image,
    +                                          const ChannelType channels );
    +
    +
    +
    source_image:
    +
    The image from which to extract the replacement channels.
    +
    update_image:
    +
    The image to import the channels into.
    +
    channel:
    +
    The image channel to import
    +
    +
    +
    +
    +

    SetImageChannelDepth

    +
    +

    Synopsis

    +
    +MagickPassFail SetImageChannelDepth( Image *image, const ChannelType channel,
    +                                     const unsigned int depth );
    +
    +
    +
    +

    Description

    +

    SetImageChannelDepth() translates the pixel quantums in the specified +channel so that if they are later divided to fit within the specified bit +depth, that no additional information is lost (i.e. no remainder resulting +from the division). Note that any subsequent image processing is likely +to increase the effective depth of the image channels. A non-zero +value is returned if the operation is successful. Check the exception +member of image to determine the cause for any failure.

    +

    The format of the SetImageChannelDepth method is:

    +
    +MagickPassFail SetImageChannelDepth( Image *image, const ChannelType channel,
    +                                     const unsigned int depth );
    +
    +
    +
    image:
    +
    The image to update.
    +
    channel:
    +
    Channel to modify.
    +
    depth:
    +
    Desired channel depth (range 1 to QuantumDepth)
    +
    +
    +
    +
    + + diff --git a/www/api/color.html b/www/api/color.html index e63b918..3e8aca4 100644 --- a/www/api/color.html +++ b/www/api/color.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -59,7 +59,7 @@ HistogramColorPacket *GetColorHistogram( const +is no longer needed.

    The format of the GetColorHistogram method is:

     HistogramColorPacket *GetColorHistogram( const Image *, unsigned long *colors,
    @@ -132,5 +132,10 @@ PseudoClass or has 256 color or less.
     
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/color.html.orig b/www/api/color.html.orig new file mode 100644 index 0000000..5ff43e7 --- /dev/null +++ b/www/api/color.html.orig @@ -0,0 +1,136 @@ + + + + + + +color + + + + + + + +
    +

    color

    + + + +
    +

    GetColorHistogram

    +
    +

    Synopsis

    +
    +HistogramColorPacket *GetColorHistogram( const Image *, unsigned long *colors,
    +                                         ExceptionInfo *);
    +
    +
    +
    +

    Description

    +

    Method GetColorHistogram returns an array of HistogramColorPacket structures +which specify the number of times each unique color occurs in the image. +The referenced colors parameter is updated with the number of unique colors +in the image. The returned array should be deallocated by the user once it +is no longer ndded.

    +

    The format of the GetColorHistogram method is:

    +
    +HistogramColorPacket *GetColorHistogram( const Image *, unsigned long *colors,
    +                                         ExceptionInfo *);
    +
    +
    +
    image:
    +
    The image.
    +
    colors:
    +
    The referenced value is updated with the with the number of +unique colors.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    GetNumberColors

    +
    +

    Synopsis

    +
    +unsigned long GetNumberColors( const Image *image, FILE *file,
    +                               ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    Method GetNumberColors returns the number of unique colors in an image.

    +

    The format of the GetNumberColors method is:

    +
    +unsigned long GetNumberColors( const Image *image, FILE *file,
    +                               ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    file:
    +
    Write a histogram of the color distribution to this file handle.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    IsPaletteImage

    +
    +

    Synopsis

    +
    +MagickBool IsPaletteImage( const Image *image, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    Method IsPaletteImage returns True if the image is PseudoClass and has 256 +unique colors or less.

    +

    The format of the IsPaletteImage method is:

    +
    +MagickBool IsPaletteImage( const Image *image, ExceptionInfo *exception );
    +
    +

    A description of each parameter follows.

    +
    +
    status:
    +
    Method IsPaletteImage returns True is the image is +PseudoClass or has 256 color or less.
    +
    image:
    +
    The image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    + + diff --git a/www/api/colormap.html b/www/api/colormap.html index 10c17c8..b652c72 100644 --- a/www/api/colormap.html +++ b/www/api/colormap.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -134,5 +134,10 @@ MagickPassFail ReplaceImageColormap( +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/colormap.html.orig b/www/api/colormap.html.orig new file mode 100644 index 0000000..2b8d061 --- /dev/null +++ b/www/api/colormap.html.orig @@ -0,0 +1,138 @@ + + + + + + +colormap + + + + + + + +
    +

    colormap

    + + + +
    +

    AllocateImageColormap

    +
    +

    Synopsis

    +
    +MagickPassFail AllocateImageColormap( Image *image, const unsigned long colors );
    +
    +
    +
    +

    Description

    +

    AllocateImageColormap() allocates an image colormap and initializes +it to a linear gray colorspace with increasing intensity. If the image +already has a colormap, it is replaced. AllocateImageColormap() returns +MagickPass if successful, otherwise MagickFail if there is not enough memory.

    +

    The format of the AllocateImageColormap method is:

    +
    +MagickPassFail AllocateImageColormap( Image *image, const unsigned long colors );
    +
    +
    +
    image:
    +
    The image.
    +
    colors:
    +
    The number of colors in the image colormap.
    +
    +
    +
    +
    +

    CycleColormapImage

    +
    +

    Synopsis

    +
    +MagickPassFail CycleColormapImage( Image *image, const int amount );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the CycleColormapImage method is:

    +
    +MagickPassFail CycleColormapImage( Image *image, const int amount );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    amount:
    +
    Offset the colormap this much.
    +
    +
    +
    +
    +

    ReplaceImageColormap

    +
    +

    Synopsis

    +
    +MagickPassFail ReplaceImageColormap( Image *image, const PixelPacket *colormap,
    +                                     const unsigned int colors );
    +
    +
    +
    +

    Description

    +

    ReplaceImageColormap() replaces an existing image colormap with a new +image colormap. The new image colormap is expected to contain all of the +colors from the existing colormap. The existing colormap indexes are +adjusted to conform with positions in the new colormap. If the new +colormap contains duplicate entries, then the associated colormap index +will point to the first entry found in the colormap and other matching +entries will not be used. MagickPass is returned if the operation is +successful, otherwise MagickFail is returned, and image->exception is +updated with the cause of the failure.

    +

    This function is useful in case colormap entries need to match across +multiple images or otherwise occupy specific locations.

    +

    The format of the ReplaceImageColormap method is:

    +
    +MagickPassFail ReplaceImageColormap( Image *image, const PixelPacket *colormap,
    +                                     const unsigned int colors );
    +
    +
    +
    image:
    +
    image in which to replace colormap.
    +
    colormap:
    +
    new colormap.
    +
    colors:
    +
    number of colors in new colormap.
    +
    +
    +
    +
    + + diff --git a/www/api/compare.html b/www/api/compare.html index 92b205d..decf7c8 100644 --- a/www/api/compare.html +++ b/www/api/compare.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -296,5 +296,10 @@ void InitializeDifferenceStatistics( DifferenceStatistics *options,
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/compare.html.orig b/www/api/compare.html.orig new file mode 100644 index 0000000..b9a4209 --- /dev/null +++ b/www/api/compare.html.orig @@ -0,0 +1,300 @@ + + + + + + +compare + + + + + + + +
    +

    compare

    +

    Compare images

    + + +
    +

    DifferenceImage

    +
    +

    Synopsis

    +
    +Image *DifferenceImage( const Image *reference_image, const Image *compare_image,
    +                        const DifferenceImageOptions *difference_options,
    +                        ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    DifferenceImage() returns an annotated difference image based on the +the difference between a reference image and a compare image.

    +

    The format of the DifferenceImage method is:

    +
    +Image *DifferenceImage( const Image *reference_image, const Image *compare_image,
    +                        const DifferenceImageOptions *difference_options,
    +                        ExceptionInfo *exception );
    +
    +
    +
    reference_image:
    +
    the reference image.
    +
    compare_image:
    +
    the comparison image.
    +
    difference_options:
    +
    options to use when differencing.
    +
    channel:
    +
    the channel(s) to compare.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    GetImageChannelDifference

    +
    +

    Synopsis

    +
    +MagickPassFail GetImageChannelDifference( const Image *reference_image,
    +                                          const Image *compare_image,
    +                                          const MetricType metric,
    +                                          DifferenceStatistics *statistics,
    +                                          ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    GetImageChannelDifference() updates a user provided statistics structure +with per-channel, and totalized, difference statistics corresponding +to a specified comparison metric.

    +

    The format of the GetImageChannelDifference method is:

    +
    +MagickPassFail GetImageChannelDifference( const Image *reference_image,
    +                                          const Image *compare_image,
    +                                          const MetricType metric,
    +                                          DifferenceStatistics *statistics,
    +                                          ExceptionInfo *exception );
    +
    +
    +
    reference_image:
    +
    the reference image.
    +
    compare_image:
    +
    the comparison image.
    +
    metric:
    +
    metric to use when differencing.
    +
    statistics:
    +
    the statistics structure to populate.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    GetImageChannelDistortion

    +
    +

    Synopsis

    +
    +MagickPassFail GetImageChannelDistortion( const Image *reference_image,
    +                                          const Image *compare_image,
    +                                          const ChannelType channel,
    +                                          const MetricType metric, double *distortion,
    +                                          ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    GetImageChannelDistortion() updates a distortion parameter with the +distortion (error) computed according to the specified comparison metric. +The value returned is only for the channel specified.

    +

    The format of the GetImageChannelDistortion method is:

    +
    +MagickPassFail GetImageChannelDistortion( const Image *reference_image,
    +                                          const Image *compare_image,
    +                                          const ChannelType channel,
    +                                          const MetricType metric, double *distortion,
    +                                          ExceptionInfo *exception );
    +
    +
    +
    reference_image:
    +
    the reference image.
    +
    compare_image:
    +
    the comparison image.
    +
    channel:
    +
    the channel to obtain error data for.
    +
    metric:
    +
    metric to use when differencing.
    +
    distortion:
    +
    updated with the computed distortion.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    GetImageDistortion

    +
    +

    Synopsis

    +
    +MagickPassFail GetImageDistortion( const Image *reference_image,
    +                                   const Image *compare_image, const MetricType metric,
    +                                   double *distortion, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    GetImageDistortion() updates a distortion parameter with the distortion +(error) computed according to the specified comparison metric. The value +returned reflects all enabled channels.

    +

    The format of the GetImageDistortion method is:

    +
    +MagickPassFail GetImageDistortion( const Image *reference_image,
    +                                   const Image *compare_image, const MetricType metric,
    +                                   double *distortion, ExceptionInfo *exception );
    +
    +
    +
    reference_image:
    +
    the reference image.
    +
    compare_image:
    +
    the comparison image.
    +
    channel:
    +
    the channel to obtain error data for.
    +
    metric:
    +
    metric to use when differencing.
    +
    distortion:
    +
    updated with the computed distortion.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    IsImagesEqual

    +
    +

    Synopsis

    +
    +MagickBool IsImagesEqual( Image *image, const Image *reference );
    +
    +
    +
    +

    Description

    +

    IsImagesEqual() measures the difference between colors at each pixel +location of two images. A value other than 0 means the colors match +exactly. Otherwise an error measure is computed by summing over all +pixels in an image the distance squared in RGB space between each image +pixel and its corresponding pixel in the reference image. The error +measure is assigned to these image members:

    +

    o mean_error_per_pixel: The mean error for any single pixel in +the image.

    +

    o normalized_mean_error: The normalized mean quantization error for +any single pixel in the image. This distance measure is normalized to +a range between 0 and 1. It is independent of the range of red, green, +and blue values in the image.

    +

    o normalized_maximum_error: The normalized maximum quantization +error for any single pixel in the image. This distance measure is +normalized to a range between 0 and 1. It is independent of the range +of red, green, and blue values in your image.

    +

    A small normalized mean square error, accessed as +image->normalized_mean_error, suggests the images are very similiar in +spatial layout and color.

    +

    The format of the IsImagesEqual method is:

    +
    +MagickBool IsImagesEqual( Image *image, const Image *reference );
    +
    +

    A description of each parameter follows.

    +
    +
    image:
    +
    The image.
    +
    reference:
    +
    The reference image.
    +
    +
    +
    +
    +

    InitializeDifferenceImageOptions

    +
    +

    Synopsis

    +
    +void InitializeDifferenceImageOptions( DifferenceImageOptions *options,
    +                                       ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    InitializeDifferenceImageOptions() assigns default options to a user-provided +DifferenceImageOptions structure. This function should always be used +to initialize the DifferenceImageOptions structure prior to making any +changes to it.

    +

    The format of the InitializeDifferenceImageOptions method is:

    +
    +void InitializeDifferenceImageOptions( DifferenceImageOptions *options,
    +                                       ExceptionInfo *exception );
    +
    +
    +
    options:
    +
    pointer to DifferenceImageOptions structure to initialize.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    InitializeDifferenceStatistics

    +
    +

    Synopsis

    +
    +void InitializeDifferenceStatistics( DifferenceStatistics *options,
    +                                     ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    InitializeDifferenceStatistics() assigns default options to a user-provided +DifferenceStatistics structure.

    +

    The format of the InitializeDifferenceStatistics method is:

    +
    +void InitializeDifferenceStatistics( DifferenceStatistics *options,
    +                                     ExceptionInfo *exception );
    +
    +
    +
    options:
    +
    pointer to DifferenceStatistics structure to initialize.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    + + diff --git a/www/api/composite.html b/www/api/composite.html index d578399..c51f7d7 100644 --- a/www/api/composite.html +++ b/www/api/composite.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -89,5 +89,10 @@ ThresholdCompositeOp, XorCompositeOp, HardLightCompositeOp.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/composite.html.orig b/www/api/composite.html.orig new file mode 100644 index 0000000..fc85811 --- /dev/null +++ b/www/api/composite.html.orig @@ -0,0 +1,93 @@ + + + + + + +composite + + + + + + + +
    +

    composite

    +

    Merge image pixels using a specified algorithm

    + +
    +

    Contents

    + +
    +
    +

    CompositeImage

    +
    +

    Synopsis

    +
    +MagickPassFail CompositeImage( Image *canvas_image, const CompositeOperator compose,
    +                               const Image *composite_image, const long x_offset,
    +                               const long y_offset );
    +
    +
    +
    +

    Description

    +

    CompositeImage() composites the second image (composite_image) onto the +first (canvas_image) at the specified offsets.

    +

    The format of the CompositeImage method is:

    +
    +MagickPassFail CompositeImage( Image *canvas_image, const CompositeOperator compose,
    +                               const Image *composite_image, const long x_offset,
    +                               const long y_offset );
    +
    +
    +
    canvas_image:
    +
    The image to be updated.
    +
    compose:
    +
    This operator affects how the composite is applied to +the image. Choose from one of these operators: AddCompositeOp, +AtopCompositeOp, BumpmapCompositeOp, ClearCompositeOp, +ColorizeCompositeOp, CopyBlackCompositeOp, CopyBlueCompositeOp, +CopyCompositeOp, CopyCyanCompositeOp,CopyGreenCompositeOp, +CopyMagentaCompositeOp, CopyOpacityCompositeOp, CopyRedCompositeOp, +CopyYellowCompositeOp, DarkenCompositeOp, DifferenceCompositeOp, +DisplaceCompositeOp, DissolveCompositeOp, DivideCompositeOp, +HueCompositeOp, InCompositeOp, LightenCompositeOp, LuminizeCompositeOp, +MinusCompositeOp, ModulateCompositeOp, MultiplyCompositeOp, +NoCompositeOp, OutCompositeOp, OverlayCompositeOp, PlusCompositeOp, +SaturateCompositeOp, ScreenCompositeOp, SubtractCompositeOp, +ThresholdCompositeOp, XorCompositeOp, HardLightCompositeOp.
    +
    composite_image:
    +
    The composite image.
    +
    x_offset:
    +
    The column offset of the composited image.
    +
    y_offset:
    +
    The row offset of the composited image.
    +
    +
    +
    +
    + + diff --git a/www/api/confirm_access.html b/www/api/confirm_access.html index b561cad..52e6c40 100644 --- a/www/api/confirm_access.html +++ b/www/api/confirm_access.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -106,5 +106,10 @@ ConfirmAccessHandler MagickSetConfirmAccessHandler( ConfirmAccessHandler handler
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/confirm_access.html.orig b/www/api/confirm_access.html.orig new file mode 100644 index 0000000..418c873 --- /dev/null +++ b/www/api/confirm_access.html.orig @@ -0,0 +1,110 @@ + + + + + + +confirm_access + + + + + + + +
    +

    confirm_access

    +

    Access confirmation functions

    + + +
    +

    MagickConfirmAccess

    +
    +

    Synopsis

    +
    +MagickPassFail MagickConfirmAccess( const ConfirmAccessMode mode, const char *path,
    +                                    ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    MagickConfirmAccess() calls the access confirmation handler method with +parameters which describe the requested access mode and path/URL, as well +as an ExceptionInfo structure to update with any error information. A +user-provided callback (set by MagickSetConfirmAccessHandler()) is +invoked. If the callback returns MagickFail, then this function also +returns MagickFail, which is intended to determine if the operation may +continue. The callback is expected to report the reason access is denied +by filling out the ExceptionInfo structure. If the callback fails to do +so, then a generic "access denied" error is reported.

    +

    The format of the MagickConfirmAccess method is:

    +
    +MagickPassFail MagickConfirmAccess( const ConfirmAccessMode mode, const char *path,
    +                                    ExceptionInfo *exception );
    +
    +
    +
    mode:
    +
    The type of access to be performed.
    +
    path:
    +
    The local path or URL requested to be accessed.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    MagickSetConfirmAccessHandler

    +
    +

    Synopsis

    +
    +ConfirmAccessHandler MagickSetConfirmAccessHandler( ConfirmAccessHandler handler );
    +
    +
    +
    +

    Description

    +

    MagickSetConfirmAccessHandler() sets the access confirmation handler to +the specified method and returns the previous access confirmation handler. +This access confirmation handler is used to "approve" access to files and +URLs. If the handler returns MagickFalse, then access is denied. This +mechanism may be used to enforce security policies and/or may be used to +monitor file and URL accesses.

    +

    The format of the MagickSetConfirmAccessHandler method is:

    +
    +ConfirmAccessHandler MagickSetConfirmAccessHandler( ConfirmAccessHandler handler );
    +
    +

    A description of each parameter follows:

    +
    +
    handler:
    +
    Specifies a pointer to a method to handle access confirmation.
    +
    +
    +
    +
    + + diff --git a/www/api/constitute.html b/www/api/constitute.html index 8d61562..595ae32 100644 --- a/www/api/constitute.html +++ b/www/api/constitute.html @@ -3,7 +3,7 @@ - + constitute @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Read or write an image

    -

    Contents

    +

    Contents

    • ConstituteImage
    • DispatchImage
    • @@ -352,5 +352,10 @@ unsigned int WriteImagesFile( const +
      +

      Copyright © GraphicsMagick Group 2002 - 2020

      +
      diff --git a/www/api/constitute.html.orig b/www/api/constitute.html.orig new file mode 100644 index 0000000..02a5c1e --- /dev/null +++ b/www/api/constitute.html.orig @@ -0,0 +1,356 @@ + + + + + + +constitute + + + + + + + +
      +

      constitute

      +

      Read or write an image

      + + +
      +

      ConstituteImage

      +
      +

      Synopsis

      +
      +Image *ConstituteImage( const unsigned long width, const unsigned long height,
      +                        const char *map, const StorageType type, const void *pixels,
      +                        ExceptionInfo *exception );
      +
      +
      +
      +

      Description

      +

      ConstituteImage() returns an Image corresponding to an image stored +in a raw memory array format. The pixel data must be in scanline order +top-to-bottom. The data can be unsigned char, unsigned short int, unsigned +int, unsigned long, float, or double. Float and double require the pixels +to be normalized to the range [0..1], otherwise the range is [0..MaxVal] +where MaxVal is the maximum possible value for that type.

      +

      Note that for most 32-bit architectures the size of an unsigned long is +the same as unsigned int, but for 64-bit architectures observing the LP64 +standard, an unsigned long is 64 bits, while an unsigned int remains 32 +bits. This should be considered when deciding if the data should be +described as "Integer" or "Long".

      +

      For example, to create a 640x480 image from unsigned red-green-blue +character data, use

      +

      image=ConstituteImage(640,480,"RGB",CharPixel,pixels,&exception);

      +

      The format of the Constitute method is:

      +
      +Image *ConstituteImage( const unsigned long width, const unsigned long height,
      +                        const char *map, const StorageType type, const void *pixels,
      +                        ExceptionInfo *exception );
      +
      +
      +
      width:
      +
      width in pixels of the image.
      +
      height:
      +
      height in pixels of the image.
      +
      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 (same as Transparency), O = Opacity, T = Transparency, +C = cyan, Y = yellow, M = magenta, K = black, or I = intensity +(for grayscale). Specify "P" = pad, to skip over a quantum which is +intentionally ignored. Creation of an alpha channel for CMYK images +is currently not supported.
      +
      type:
      +
      Define the data type of the pixels. Float and double types are +expected to be normalized [0..1] otherwise [0..MaxRGB]. 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.
      +
      exception:
      +
      Return any errors or warnings in this structure.
      +
      +
      +
      +
      +

      DispatchImage

      +
      +

      Synopsis

      +
      +MagickPassFail DispatchImage( const Image *image, const long x_offset, const long y_offset,
      +                              const unsigned long columns, const unsigned long rows,
      +                              const char *map, const StorageType type, void *pixels,
      +                              ExceptionInfo *exception );
      +
      +
      +
      +

      Description

      +

      DispatchImage() extracts pixel data from an Image into a raw memory array. +The pixel data is written in scanline order top-to-bottom using an +arbitrary quantum order specified by 'map', and with quantum size +specified by 'type'.

      +

      The output array data may be unsigned char, unsigned short int, unsigned +int, unsigned long, float, or double. Float and double require the pixels +to be normalized to the range [0..1], otherwise the range is [0..MaxVal] +where MaxVal is the maximum possible value for that type.

      +

      The method returns MagickPass on success or MagickFail if an error is +encountered.

      +

      Suppose we want want to extract the first scanline of a 640x480 image as +character data in red-green-blue order:

      +

      DispatchImage(image,0,0,640,1,"RGB",0,pixels,exception);

      +

      The format of the DispatchImage method is:

      +
      +MagickPassFail DispatchImage( const Image *image, const long x_offset, const long y_offset,
      +                              const unsigned long columns, const unsigned long rows,
      +                              const char *map, const StorageType type, void *pixels,
      +                              ExceptionInfo *exception );
      +
      +
      +
      image:
      +
      The image.
      +
      x_offset, y_offset, 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 (same as Transparency), O = Opacity, T = Transparency, +C = cyan, Y = yellow, M = magenta, K = black, I = intensity (for +grayscale). Specify "P" = pad, to output a pad quantum. Pad quantums +are zero-value.
      +
      type:
      +
      Define the data type of the pixels. Float and double types are +expected to be normalized [0..1] otherwise [0..MaxRGB]. 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.
      +
      exception:
      +
      Return any errors or warnings in this structure.
      +
      +
      +
      +
      +

      PingImage

      +
      +

      Synopsis

      +
      +Image *PingImage( const ImageInfo *image_info, ExceptionInfo *exception );
      +
      +
      +
      +

      Description

      +

      PingImage() returns all the attributes 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.

      +

      The format of the PingImage method is:

      +
      +Image *PingImage( const ImageInfo *image_info, ExceptionInfo *exception );
      +
      +

      A description of each parameter follows:

      +
      +
      image_info:
      +
      Ping the image defined by the file or filename members of +this structure.
      +
      exception:
      +
      Return any errors or warnings in this structure.
      +
      +
      +
      +
      +

      ReadImage

      +
      +

      Synopsis

      +
      +Image *ReadImage( const ImageInfo *image_info, ExceptionInfo *exception );
      +
      +
      +
      +

      Description

      +

      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.

      +

      The format of the ReadImage method is:

      +
      +Image *ReadImage( const ImageInfo *image_info, ExceptionInfo *exception );
      +
      +

      A description of each parameter follows:

      +
      +
      image_info:
      +
      Read the image defined by the file or filename members of +this structure.
      +
      exception:
      +
      Return any errors or warnings in this structure.
      +
      +
      +
      +
      +

      ReadInlineImage

      +
      +

      Synopsis

      +
      +Image *ReadInlineImage( const ImageInfo *image_info, const char *content,
      +                        ExceptionInfo *exception );
      +
      +
      +
      +

      Description

      +

      ReadInlineImage() reads a Base64-encoded inline image or image sequence. +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.

      +

      The format of the ReadInlineImage method is:

      +
      +Image *ReadInlineImage( const ImageInfo *image_info, const char *content,
      +                        ExceptionInfo *exception );
      +
      +
      +
      image_info:
      +
      The image info.
      +
      content:
      +
      The image encoded in Base64.
      +
      exception:
      +
      Return any errors or warnings in this structure.
      +
      +
      +
      +
      +

      WriteImage

      +
      +

      Synopsis

      +
      +MagickPassFail WriteImage( const ImageInfo *image_info, Image *image );
      +
      +
      +
      +

      Description

      +

      Use WriteImage() to write an image or an image sequence to a file or +filehandle. If writing to a file on disk, the name is defined by the +filename member of the image structure. WriteImage() returns +MagickFailure 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.

      +

      The format of the WriteImage method is:

      +
      +MagickPassFail WriteImage( const ImageInfo *image_info, Image *image );
      +
      +

      A description of each parameter follows:

      +
      +
      image_info:
      +
      The image info.
      +
      image:
      +
      The image.
      +
      +
      +
      +
      +

      WriteImages

      +
      +

      Synopsis

      +
      +MagickPassFail WriteImages( const ImageInfo *image_info, Image *image,
      +                            const char *filename, ExceptionInfo *exception );
      +
      +
      +
      +

      Description

      +

      WriteImages() writes an image sequence into one or more files. While +WriteImage() will also write an image sequence, it is limited to writing +the sequence into a single file using a format which supports multiple +frames. WriteImages() does not have that limitation since it will +generate 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. +"image%02d.miff") so that the frames may be written.

      +

      The format of the WriteImages method is:

      +
      +MagickPassFail WriteImages( const ImageInfo *image_info, Image *image,
      +                            const char *filename, ExceptionInfo *exception );
      +
      +
      +
      image_info:
      +
      The image info.
      +
      images:
      +
      The image list.
      +
      filename:
      +
      The image filename.
      +
      exception:
      +
      Return any errors or warnings in this structure.
      +
      +
      +
      +
      +

      WriteImagesFile

      +
      +

      Synopsis

      +
      +unsigned int WriteImagesFile( const ImageInfo *image_info, Image *image, FILE *file,
      +                              ExceptionInfo *exception );
      +
      +
      +
      +

      Description

      +

      WriteImagesFile() writes an image or image sequence to a stdio +FILE handle. This may be used to append an encoded image to an already +existing appended image sequence if the file seek position is at the end +of an existing file.

      +

      The format of the WriteImagesFile method is:

      +
      +unsigned int WriteImagesFile( const ImageInfo *image_info, Image *image, FILE *file,
      +                              ExceptionInfo *exception );
      +
      +
      +
      image_info:
      +
      The image info.
      +
      images:
      +
      The image list.
      +
      file:
      +
      The open (and positioned) file handle.
      +
      exception:
      +
      Return any errors or warnings in this structure.
      +
      +
      +
      +
      + + diff --git a/www/api/decorate.html b/www/api/decorate.html index 948ce68..1d648b2 100644 --- a/www/api/decorate.html +++ b/www/api/decorate.html @@ -3,7 +3,7 @@ - + decorate @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
      - - -   + + + 
    @@ -137,5 +137,10 @@ otherwise it has a lowered effect.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/decorate.html.orig b/www/api/decorate.html.orig new file mode 100644 index 0000000..c048b54 --- /dev/null +++ b/www/api/decorate.html.orig @@ -0,0 +1,141 @@ + + + + + + +decorate + + + + + + + +
    +

    decorate

    +

    Add decorative frames and borders

    + +
    +

    Contents

    + +
    +
    +

    BorderImage

    +
    +

    Synopsis

    +
    +Image *BorderImage( const Image *image, const RectangleInfo *border_info,
    +                    ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the BorderImage method is:

    +
    +Image *BorderImage( const Image *image, const RectangleInfo *border_info,
    +                    ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    border_info:
    +
    Define the width and height of the border.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    FrameImage

    +
    +

    Synopsis

    +
    +Image *FrameImage( const Image *image, const FrameInfo *frame_info,
    +                   ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the FrameImage method is:

    +
    +Image *FrameImage( const Image *image, const FrameInfo *frame_info,
    +                   ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    frame_info:
    +
    Define the width and height of the frame and its bevels.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    RaiseImage

    +
    +

    Synopsis

    +
    +unsigned int RaiseImage( Image *image, const RectangleInfo *raise_info,
    +                         const int raise_flag );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the RaiseImage method is:

    +
    +unsigned int RaiseImage( Image *image, const RectangleInfo *raise_info,
    +                         const int raise_flag );
    +
    +
    +
    image:
    +
    The image.
    +
    raise_info:
    +
    Define the width and height of the raise area.
    +
    raise_flag:
    +
    A value other than zero creates a 3-D raise effect, +otherwise it has a lowered effect.
    +
    +
    +
    +
    + + diff --git a/www/api/deprecate.html b/www/api/deprecate.html index 25db018..adb357b 100644 --- a/www/api/deprecate.html +++ b/www/api/deprecate.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -334,5 +334,10 @@ MagickPassFail SyncCacheView( +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/deprecate.html.orig b/www/api/deprecate.html.orig new file mode 100644 index 0000000..56a7b2a --- /dev/null +++ b/www/api/deprecate.html.orig @@ -0,0 +1,338 @@ + + + + + + +deprecate + + + + + + + +
    +

    deprecate

    +

    Methods which should no longer be used

    + + +
    +

    AcquireCacheView

    +
    +

    Synopsis

    +
    +const PixelPacket *AcquireCacheView( ViewInfo *view, const long x, const long y,
    +                                     const unsigned long columns, const unsigned long rows,
    +                                     ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    Method AcquireCacheView gets pixels from the in-memory or disk pixel cache +as defined by the geometry parameters for read-only access. A pointer to +the pixels is returned if the pixels are transferred, otherwise NULL is +returned.

    +

    The format of the AcquireCacheView method is:

    +
    +const PixelPacket *AcquireCacheView( ViewInfo *view, const long x, const long y,
    +                                     const unsigned long columns, const unsigned long rows,
    +                                     ExceptionInfo *exception );
    +
    +
    +
    pixels:
    +
    Method AcquireCacheView returns a null pointer if an error +occurs, otherwise a pointer to the view pixels.
    +
    view:
    +
    The address of a structure of type ViewInfo.
    +
    x,y,columns,rows:
    +
    These values define the perimeter of a region of +pixels.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    AcquireMemory

    +
    +

    Synopsis

    +
    +void *AcquireMemory( const size_t size );
    +
    +
    +
    +

    Description

    +

    AcquireMemory() returns a pointer to a block of memory of at least size +bytes suitably aligned for any use. NULL is returned if insufficient +memory is available or the requested size is zero.

    +

    The format of the AcquireMemory method is:

    +
    +void *AcquireMemory( const size_t size );
    +
    +

    A description of each parameter follows:

    +
    +
    size:
    +
    The size of the memory in bytes to allocate.
    +
    +
    +
    +
    +

    CloneMemory

    +
    +

    Synopsis

    +
    +void *CloneMemory( void *destination, const void *source, const size_t size );
    +
    +
    +
    +

    Description

    +

    CloneMemory() copies size bytes from memory area source to the +destination. Copying between objects that overlap will take place +correctly. It returns destination.

    +

    The format of the CloneMemory method is:

    +
    +void *CloneMemory( void *destination, const void *source, const size_t size );
    +
    +

    A description of each parameter follows:

    +
    +
    size:
    +
    The size of the memory in bytes to allocate.
    +
    +
    +
    +
    +

    GetCacheView

    +
    +

    Synopsis

    +
    +PixelPacket *GetCacheView( ViewInfo *view, const long x, const long y,
    +                           const unsigned long columns, const unsigned long rows );
    +
    +
    +
    +

    Description

    +

    GetCacheView() gets writeable 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.

    +

    The format of the GetCacheView method is:

    +
    +PixelPacket *GetCacheView( ViewInfo *view, const long x, const long y,
    +                           const unsigned long columns, const unsigned long rows );
    +
    +
    +
    pixels:
    +
    Method GetCacheView returns a null pointer if an error +occurs, otherwise a pointer to the view pixels.
    +
    view:
    +
    The address of a structure of type ViewInfo.
    +
    x,y,columns,rows:
    +
    These values define the perimeter of a region of +pixels.
    +
    +
    +
    +
    +

    LiberateMemory

    +
    +

    Synopsis

    +
    +void LiberateMemory( void ** memory );
    +
    +
    +
    +

    Description

    +

    LiberateMemory() frees memory that has already been allocated, and +NULLs the pointer to it.

    +

    The format of the LiberateMemory method is:

    +
    +void LiberateMemory( void ** memory );
    +
    +

    A description of each parameter follows:

    +
    +
    memory:
    +
    A pointer to a block of memory to free for reuse.
    +
    +
    +
    +
    +

    PopImagePixels

    +
    +

    Synopsis

    +
    +unsigned int PopImagePixels( const Image *, const QuantumType quantum,
    +                             unsigned char *destination );
    +
    +
    +
    +

    Description

    +

    PopImagePixels() transfers one or more pixel components from the image pixel +cache to a user supplied buffer. True is returned if the pixels are +successfully transferred, otherwise False.

    +

    The format of the PopImagePixels method is:

    +
    +unsigned int PopImagePixels( const Image *, const QuantumType quantum,
    +                             unsigned char *destination );
    +
    +
    +
    status:
    +
    Method PopImagePixels returns True if the pixels are +successfully transferred, otherwise False.
    +
    image:
    +
    The image.
    +
    quantum:
    +
    Declare which pixel components to transfer (RGB, RGBA, etc).
    +
    destination:
    +
    The components are transferred to this buffer.
    +
    +
    +
    +
    +

    PushImagePixels

    +
    +

    Synopsis

    +
    +unsigned int PushImagePixels( Image *image, const QuantumType quantum_type,
    +                              const unsigned char *source );
    +
    +
    +
    +

    Description

    +

    PushImagePixels() transfers one or more pixel components from a user +supplied buffer into the image pixel cache of an image. It returns True if +the pixels are successfully transferred, otherwise False.

    +

    The format of the PushImagePixels method is:

    +
    +unsigned int PushImagePixels( Image *image, const QuantumType quantum_type,
    +                              const unsigned char *source );
    +
    +
    +
    status:
    +
    Method PushImagePixels returns True if the pixels are +successfully transferred, otherwise False.
    +
    image:
    +
    The image.
    +
    quantum_type:
    +
    Declare which pixel components to transfer (red, green, +blue, opacity, RGB, or RGBA).
    +
    source:
    +
    The pixel components are transferred from this buffer.
    +
    +
    +
    +
    +

    ReacquireMemory

    +
    +

    Synopsis

    +
    +void ReacquireMemory( void ** memory, const size_t size );
    +
    +
    +
    +

    Description

    +

    ReacquireMemory() changes the size of the memory and returns a +pointer to the (possibly moved) block. The contents will be unchanged +up to the lesser of the new and old sizes.

    +

    The format of the ReacquireMemory method is:

    +
    +void ReacquireMemory( void ** memory, const size_t size );
    +
    +

    A description of each parameter follows:

    +
    +
    memory:
    +
    A pointer to a memory allocation. On return the pointer +may change but the contents of the original allocation will not.
    +
    size:
    +
    The new size of the allocated memory.
    +
    +
    +
    +
    +

    SetCacheView

    +
    +

    Synopsis

    +
    +PixelPacket *SetCacheView( ViewInfo *view, const long x, const long y,
    +                           const unsigned long columns, const unsigned long rows );
    +
    +
    +
    +

    Description

    +

    SetCacheView() 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.

    +

    The format of the SetCacheView method is:

    +
    +PixelPacket *SetCacheView( ViewInfo *view, const long x, const long y,
    +                           const unsigned long columns, const unsigned long rows );
    +
    +
    +
    view:
    +
    The address of a structure of type ViewInfo.
    +
    x,y,columns,rows:
    +
    These values define the perimeter of a region of +pixels.
    +
    +
    +
    +
    +

    SyncCacheView

    +
    +

    Synopsis

    +
    +MagickPassFail SyncCacheView( ViewInfo *view );
    +
    +
    +
    +

    Description

    +

    SyncCacheView() saves the view pixels to the in-memory or disk cache. +The method returns MagickPass if the pixel region is synced, otherwise +MagickFail.

    +

    The format of the SyncCacheView method is:

    +
    +MagickPassFail SyncCacheView( ViewInfo *view );
    +
    +

    A description of each parameter follows:

    +
    +
    view:
    +
    The address of a structure of type ViewInfo.
    +
    +
    +
    +
    + + diff --git a/www/api/describe.html b/www/api/describe.html index 6d8a774..7d4c8fa 100644 --- a/www/api/describe.html +++ b/www/api/describe.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -72,5 +72,10 @@ colors in the image.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/display.html b/www/api/display.html index 01ab772..061e383 100644 --- a/www/api/display.html +++ b/www/api/display.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -115,5 +115,10 @@ returned from ReadImage.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/display.html.orig b/www/api/display.html.orig new file mode 100644 index 0000000..f229e8f --- /dev/null +++ b/www/api/display.html.orig @@ -0,0 +1,119 @@ + + + + + + +display + + + + + + + +
    +

    display

    +

    Interactively display and edit an image

    + + +
    +

    MagickXDisplayBackgroundImage

    +
    +

    Synopsis

    +
    +unsigned int MagickXDisplayBackgroundImage( Display *display,
    +                                            MagickXResourceInfo *resource_info,
    +                                            Image *image );
    +
    +
    +
    +

    Description

    +

    MagickXDisplayBackgroundImage() displays an image in the background of a window.

    +

    The format of the MagickXDisplayBackgroundImage method is:

    +
    +unsigned int MagickXDisplayBackgroundImage( Display *display,
    +                                            MagickXResourceInfo *resource_info,
    +                                            Image *image );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    resource_info:
    +
    Specifies a pointer to a X11 MagickXResourceInfo structure.
    +
    image:
    +
    Specifies a pointer to an Image structure; returned from +ReadImage.
    +
    +
    +
    +
    +

    MagickXDisplayImage

    +
    +

    Synopsis

    +
    +Image *MagickXDisplayImage( Display *display, MagickXResourceInfo *resource_info,
    +                            char ** argv, int argc, Image ** image,
    +                            unsigned long *state );
    +
    +
    +
    +

    Description

    +

    MagickXDisplayImage() displays an image via X11. A new image is created and +returned if the user interactively transforms the displayed image.

    +

    The format of the MagickXDisplayImage method is:

    +
    +Image *MagickXDisplayImage( Display *display, MagickXResourceInfo *resource_info,
    +                            char ** argv, int argc, Image ** image,
    +                            unsigned long *state );
    +
    +
    +
    nexus:
    +
    Method MagickXDisplayImage returns an image when the +user chooses 'Open Image' from the command menu or picks a tile +from the image directory. Otherwise a null image is returned.
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    resource_info:
    +
    Specifies a pointer to a X11 MagickXResourceInfo structure.
    +
    argv:
    +
    Specifies the application's argument list.
    +
    argc:
    +
    Specifies the number of arguments.
    +
    image:
    +
    Specifies an address to an address of an Image structure; +returned from ReadImage.
    +
    +
    +
    +
    + + diff --git a/www/api/draw.html b/www/api/draw.html index 6eaffc7..3bc739e 100644 --- a/www/api/draw.html +++ b/www/api/draw.html @@ -3,7 +3,7 @@ - + draw @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -3219,5 +3219,10 @@ void DrawSetViewbox( +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/draw.html.orig b/www/api/draw.html.orig new file mode 100644 index 0000000..a8caca5 --- /dev/null +++ b/www/api/draw.html.orig @@ -0,0 +1,3223 @@ + + + + + + +draw + + + + + + + +
    +

    draw

    +

    User-friendly methods to draw on an image

    + +
    +

    Contents

    + +
    +
    +

    DrawAnnotation

    +
    +

    Synopsis

    +
    +void DrawAnnotation( DrawContext context, const double x, const double y,
    +                     const unsigned char *text );
    +
    +
    +
    +

    Description

    +

    DrawAnnotation() draws text on the image.

    +

    The format of the DrawAnnotation method is:

    +
    +void DrawAnnotation( DrawContext context, const double x, const double y,
    +                     const unsigned char *text );
    +
    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    x ordinate to left of text
    +
    y:
    +
    y ordinate to text baseline
    +
    text:
    +
    text to draw
    +
    +
    +
    +
    +

    DrawAffine

    +
    +

    Synopsis

    +
    +void DrawAffine( DrawContext context, const AffineMatrix *affine );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawAffine method is:

    +
    +void DrawAffine( DrawContext context, const AffineMatrix *affine );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    Drawing context
    +
    affine:
    +
    Affine matrix parameters
    +
    +
    +
    +
    +

    DrawAllocateContext

    +
    +

    Synopsis

    +
    +DrawContext DrawAllocateContext( const DrawInfo *draw_info, Image *image );
    +
    +
    +
    +

    Description

    +

    DrawAllocateContext() allocates an initial drawing context which is an +opaque handle required by the remaining drawing methods.

    +

    The format of the DrawAllocateContext method is:

    +
    +DrawContext DrawAllocateContext( const DrawInfo *draw_info, Image *image );
    +
    +
    +
    draw_info:
    +
    Initial drawing defaults. Set to NULL to use +GraphicsMagick defaults.
    +
    image:
    +
    The image to draw on.
    +
    +
    +
    +
    +

    DrawArc

    +
    +

    Synopsis

    +
    +void DrawArc( DrawContext context, const double sx, const double sy, const double ex,
    +              const double ey, const double sd, const double ed );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawArc method is:

    +
    +void DrawArc( DrawContext context, const double sx, const double sy, const double ex,
    +              const double ey, const double sd, const double ed );
    +
    +
    +
    context:
    +
    drawing context
    +
    sx:
    +
    starting x ordinate of bounding rectangle
    +
    sy:
    +
    starting y ordinate of bounding rectangle
    +
    ex:
    +
    ending x ordinate of bounding rectangle
    +
    ey:
    +
    ending y ordinate of bounding rectangle
    +
    sd:
    +
    starting degrees of rotation
    +
    ed:
    +
    ending degrees of rotation
    +
    +
    +
    +
    +

    DrawBezier

    +
    +

    Synopsis

    +
    +void DrawBezier( DrawContext context, const unsigned long num_coords,
    +                 const PointInfo *coordinates );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawBezier method is:

    +
    +void DrawBezier( DrawContext context, const unsigned long num_coords,
    +                 const PointInfo *coordinates );
    +
    +
    +
    context:
    +
    drawing context
    +
    num_coords:
    +
    number of coordinates
    +
    coordinates:
    +
    coordinates
    +
    +
    +
    +
    +

    DrawCircle

    +
    +

    Synopsis

    +
    +void DrawCircle( DrawContext context, const double ox, const double oy, const double px,
    +                 const double py );
    +
    +
    +
    +

    Description

    +

    DrawCircle() draws a circle on the image.

    +

    The format of the DrawCircle method is:

    +
    +void DrawCircle( DrawContext context, const double ox, const double oy, const double px,
    +                 const double py );
    +
    +
    +
    context:
    +
    drawing context
    +
    ox:
    +
    origin x ordinate
    +
    oy:
    +
    origin y ordinate
    +
    px:
    +
    perimeter x ordinate
    +
    py:
    +
    perimeter y ordinate
    +
    +
    +
    +
    +

    DrawGetClipPath

    +
    +

    Synopsis

    +
    +char *DrawGetClipPath( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetClipPath method is:

    +
    +char *DrawGetClipPath( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetClipPath

    +
    +

    Synopsis

    +
    +void DrawSetClipPath( DrawContext context, const char *clip_path );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetClipPath method is:

    +
    +void DrawSetClipPath( DrawContext context, const char *clip_path );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    clip_path:
    +
    name of clipping path to associate with image
    +
    +
    +
    +
    +

    DrawGetClipRule

    +
    +

    Synopsis

    +
    +FillRule DrawGetClipRule( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetClipRule method is:

    +
    +FillRule DrawGetClipRule( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetClipRule

    +
    +

    Synopsis

    +
    +void DrawSetClipRule( DrawContext context, const FillRule fill_rule );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetClipRule method is:

    +
    +void DrawSetClipRule( DrawContext context, const FillRule fill_rule );
    +
    +
    +
    context:
    +
    drawing context
    +
    fill_rule:
    +
    fill rule (EvenOddRule or NonZeroRule)
    +
    +
    +
    +
    +

    DrawGetClipUnits

    +
    +

    Synopsis

    +
    +ClipPathUnits DrawGetClipUnits( DrawContext context );
    +
    +
    +
    +

    Description

    +

    DrawGetClipUnits() returns the interpretation of clip path units.

    +

    The format of the DrawGetClipUnits method is:

    +
    +ClipPathUnits DrawGetClipUnits( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetClipUnits

    +
    +

    Synopsis

    +
    +void DrawSetClipUnits( DrawContext context, const ClipPathUnits clip_units );
    +
    +
    +
    +

    Description

    +

    DrawSetClipUnits() sets the interpretation of clip path units.

    +

    The format of the DrawSetClipUnits method is:

    +
    +void DrawSetClipUnits( DrawContext context, const ClipPathUnits clip_units );
    +
    +
    +
    context:
    +
    drawing context
    +
    clip_units:
    +
    units to use (UserSpace, UserSpaceOnUse, or ObjectBoundingBox)
    +
    +
    +
    +
    +

    DrawColor

    +
    +

    Synopsis

    +
    +void DrawColor( DrawContext context, const double x, const double y,
    +                const PaintMethod paintMethod );
    +
    +
    +
    +

    Description

    +

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

    +

    PointMethod: Recolors the target pixel +ReplaceMethod: Recolor any pixel that matches the target pixel. +FloodfillMethod: Recolors target pixels and matching neighbors. +FillToBorderMethod: Recolor target pixels and neighbors not matching border color. +ResetMethod: Recolor all pixels.

    +

    The format of the DrawColor method is:

    +
    +void DrawColor( DrawContext context, const double x, const double y,
    +                const PaintMethod paintMethod );
    +
    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    x ordinate
    +
    y:
    +
    y ordinate
    +
    paintMethod:
    +
    paint method
    +
    +
    +
    +
    +

    DrawComment

    +
    +

    Synopsis

    +
    +void DrawComment( DrawContext context, const char *comment );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawComment method is:

    +
    +void DrawComment( DrawContext context, const char *comment );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    comment:
    +
    comment text
    +
    +
    +
    +
    +

    DrawDestroyContext

    +
    +

    Synopsis

    +
    +void DrawDestroyContext( DrawContext context );
    +
    +
    +
    +

    Description

    +

    DrawDestroyContext() frees all resources associated with the drawing +context. Once the drawing context has been freed, it should not be used +any further unless it re-allocated.

    +

    The format of the DrawDestroyContext method is:

    +
    +void DrawDestroyContext( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context to destroy
    +
    +
    +
    +
    +

    DrawEllipse

    +
    +

    Synopsis

    +
    +void DrawEllipse( DrawContext context, const double ox, const double oy, const double rx,
    +                  const double ry, const double start, const double end );
    +
    +
    +
    +

    Description

    +

    DrawEllipse() draws an ellipse on the image.

    +

    The format of the DrawEllipse method is:

    +
    +void DrawEllipse( DrawContext context, const double ox, const double oy, const double rx,
    +                  const double ry, const double start, const double end );
    +
    +
    +
    context:
    +
    drawing context
    +
    ox:
    +
    origin x ordinate
    +
    oy:
    +
    origin y ordinate
    +
    rx:
    +
    radius in x
    +
    ry:
    +
    radius in y
    +
    start:
    +
    starting rotation in degrees
    +
    end:
    +
    ending rotation in degrees
    +
    +
    +
    +
    +

    DrawGetFillColor

    +
    +

    Synopsis

    +
    +PixelPacket DrawGetFillColor( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFillColor method is:

    +
    +PixelPacket DrawGetFillColor( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetFillColor

    +
    +

    Synopsis

    +
    +void DrawSetFillColor( DrawContext context, const PixelPacket *fill_color );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFillColor method is:

    +
    +void DrawSetFillColor( DrawContext context, const PixelPacket *fill_color );
    +
    +
    +
    context:
    +
    drawing context
    +
    fill_color:
    +
    fill color
    +
    +
    +
    +
    +

    DrawSetFillColorString

    +
    +

    Synopsis

    +
    +void DrawSetFillColorString( DrawContext context, const char *fill_color );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFillColorString method is:

    +
    +void DrawSetFillColorString( DrawContext context, const char *fill_color );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    fill_color:
    +
    fill color
    +
    +
    +
    +
    +

    DrawSetFillPatternURL

    +
    +

    Synopsis

    +
    +void DrawSetFillPatternURL( DrawContext context, const char *fill_url );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawSetFillPatternURL method is:

    +
    +void DrawSetFillPatternURL( DrawContext context, const char *fill_url );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    fill_url:
    +
    URL to use to obtain fill pattern.
    +
    +
    +
    +
    +

    DrawGetFillOpacity

    +
    +

    Synopsis

    +
    +double DrawGetFillOpacity( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFillOpacity method is:

    +
    +double DrawGetFillOpacity( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetFillOpacity

    +
    +

    Synopsis

    +
    +void DrawSetFillOpacity( DrawContext context, const double fill_opacity );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFillOpacity method is:

    +
    +void DrawSetFillOpacity( DrawContext context, const double fill_opacity );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    fill_opacity:
    +
    fill opacity
    +
    +
    +
    +
    +

    DrawGetFillRule

    +
    +

    Synopsis

    +
    +FillRule DrawGetFillRule( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFillRule method is:

    +
    +FillRule DrawGetFillRule( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetFillRule

    +
    +

    Synopsis

    +
    +void DrawSetFillRule( DrawContext context, const FillRule fill_rule );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFillRule method is:

    +
    +void DrawSetFillRule( DrawContext context, const FillRule fill_rule );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    fill_rule:
    +
    fill rule (EvenOddRule or NonZeroRule)
    +
    +
    +
    +
    +

    DrawGetFont

    +
    +

    Synopsis

    +
    +char *DrawGetFont( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFont method is:

    +
    +char *DrawGetFont( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetFont

    +
    +

    Synopsis

    +
    +void DrawSetFont( DrawContext context, const char *font_name );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFont method is:

    +
    +void DrawSetFont( DrawContext context, const char *font_name );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    font_name:
    +
    font name
    +
    +
    +
    +
    +

    DrawGetFontFamily

    +
    +

    Synopsis

    +
    +char *DrawGetFontFamily( DrawContext context );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetFontFamily method is:

    +
    +char *DrawGetFontFamily( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetFontFamily

    +
    +

    Synopsis

    +
    +void DrawSetFontFamily( DrawContext context, const char *font_family );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFontFamily method is:

    +
    +void DrawSetFontFamily( DrawContext context, const char *font_family );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    font_family:
    +
    font family
    +
    +
    +
    +
    +

    DrawGetFontSize

    +
    +

    Synopsis

    +
    +double DrawGetFontSize( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFontSize method is:

    +
    +double DrawGetFontSize( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetFontSize

    +
    +

    Synopsis

    +
    +void DrawSetFontSize( DrawContext context, const double pointsize );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFontSize method is:

    +
    +void DrawSetFontSize( DrawContext context, const double pointsize );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    pointsize:
    +
    text pointsize
    +
    +
    +
    +
    +

    DrawGetFontStretch

    +
    +

    Synopsis

    +
    +StretchType DrawGetFontStretch( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFontStretch method is:

    +
    +StretchType DrawGetFontStretch( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetFontStretch

    +
    +

    Synopsis

    +
    +void DrawSetFontStretch( DrawContext context, const StretchType font_stretch );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFontStretch method is:

    +
    +void DrawSetFontStretch( DrawContext context, const StretchType font_stretch );
    +
    +
    +
    context:
    +
    drawing context
    +
    font_stretch:
    +
    font stretch (NormalStretch, UltraCondensedStretch, +CondensedStretch, SemiCondensedStretch, +SemiExpandedStretch, ExpandedStretch, +ExtraExpandedStretch, UltraExpandedStretch, AnyStretch)
    +
    +
    +
    +
    +

    DrawGetFontStyle

    +
    +

    Synopsis

    +
    +StyleType DrawGetFontStyle( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFontStyle method is:

    +
    +StyleType DrawGetFontStyle( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetFontStyle

    +
    +

    Synopsis

    +
    +void DrawSetFontStyle( DrawContext context, const StyleType style );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFontStyle method is:

    +
    +void DrawSetFontStyle( DrawContext context, const StyleType style );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    style:
    +
    font style (NormalStyle, ItalicStyle, ObliqueStyle, AnyStyle)
    +
    +
    +
    +
    +

    DrawGetFontWeight

    +
    +

    Synopsis

    +
    +unsigned long DrawGetFontWeight( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFontWeight method is:

    +
    +unsigned long DrawGetFontWeight( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetFontWeight

    +
    +

    Synopsis

    +
    +void DrawSetFontWeight( DrawContext context, const unsigned long font_weight );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFontWeight method is:

    +
    +void DrawSetFontWeight( DrawContext context, const unsigned long font_weight );
    +
    +
    +
    context:
    +
    drawing context
    +
    font_weight:
    +
    font weight (valid range 100-900)
    +
    +
    +
    +
    +

    DrawGetGravity

    +
    +

    Synopsis

    +
    +GravityType DrawGetGravity( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetGravity method is:

    +
    +GravityType DrawGetGravity( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetGravity

    +
    +

    Synopsis

    +
    +void DrawSetGravity( DrawContext context, const GravityType gravity );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetGravity method is:

    +
    +void DrawSetGravity( DrawContext context, const GravityType gravity );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    gravity:
    +
    positioning gravity (NorthWestGravity, NorthGravity, +NorthEastGravity, WestGravity, CenterGravity, +EastGravity, SouthWestGravity, SouthGravity, +SouthEastGravity)
    +
    +
    +
    +
    +

    DrawComposite

    +
    +

    Synopsis

    +
    +void DrawComposite( DrawContext context, const CompositeOperator composite_operator,
    +                    const double x, const double y, const double width, const double height,
    +                    const Image *image );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawComposite method is:

    +
    +void DrawComposite( DrawContext context, const CompositeOperator composite_operator,
    +                    const double x, const double y, const double width, const double height,
    +                    const Image *image );
    +
    +
    +
    context:
    +
    drawing context
    +
    composite_operator:
    +
    composition operator
    +
    x:
    +
    x ordinate of top left corner
    +
    y:
    +
    y ordinate of top left corner
    +
    width:
    +
    Width to resize image to prior to compositing. Specify zero to +use existing width.
    +
    height:
    +
    Height to resize image to prior to compositing. Specify zero +to use existing height.
    +
    image:
    +
    Image to composite
    +
    +
    +
    +
    +

    DrawLine

    +
    +

    Synopsis

    +
    +void DrawLine( DrawContext context, const double sx, const double sy, const double ex,
    +               const double ey );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawLine method is:

    +
    +void DrawLine( DrawContext context, const double sx, const double sy, const double ex,
    +               const double ey );
    +
    +
    +
    context:
    +
    drawing context
    +
    sx:
    +
    starting x ordinate
    +
    sy:
    +
    starting y ordinate
    +
    ex:
    +
    ending x ordinate
    +
    ey:
    +
    ending y ordinate
    +
    +
    +
    +
    +

    DrawMatte

    +
    +

    Synopsis

    +
    +void DrawMatte( DrawContext context, const double x, const double y,
    +                const PaintMethod paint_method );
    +
    +
    +
    +

    Description

    +

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

    +

    PointMethod: Select the target pixel +ReplaceMethod: Select any pixel that matches the target pixel. +FloodfillMethod: Select the target pixel and matching neighbors. +FillToBorderMethod: Select the target pixel and neighbors not matching +border color. +ResetMethod: Select all pixels.

    +

    The format of the DrawMatte method is:

    +
    +void DrawMatte( DrawContext context, const double x, const double y,
    +                const PaintMethod paint_method );
    +
    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    x ordinate
    +
    y:
    +
    y ordinate
    +
    +

    o paint_method:

    +
    +
    +
    +

    DrawPathClose

    +
    +

    Synopsis

    +
    +void DrawPathClose( DrawContext context );
    +
    +
    +
    +

    Description

    +

    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).

    +

    The format of the DrawPathClose method is:

    +
    +void DrawPathClose( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawPathCurveToAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathCurveToAbsolute( DrawContext context, const double x1, const double y1,
    +                              const double x2, const double y2, const double x,
    +                              const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToAbsolute method is:

    +
    +void DrawPathCurveToAbsolute( DrawContext context, const double x1, const double y1,
    +                              const double x2, const double y2, const double x,
    +                              const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x1:
    +
    x ordinate of control point for curve beginning
    +
    y1:
    +
    y ordinate of control point for curve beginning
    +
    x2:
    +
    x ordinate of control point for curve ending
    +
    y2:
    +
    y ordinate of control point for curve ending
    +
    x:
    +
    x ordinate of the end of the curve
    +
    y:
    +
    y ordinate of the end of the curve
    +
    +
    +
    +
    +

    DrawPathCurveToRelative

    +
    +

    Synopsis

    +
    +void DrawPathCurveToRelative( DrawContext context, const double x1, const double y1,
    +                              const double x2, const double y2, const double x,
    +                              const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToRelative method is:

    +
    +void DrawPathCurveToRelative( DrawContext context, const double x1, const double y1,
    +                              const double x2, const double y2, const double x,
    +                              const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x1:
    +
    x ordinate of control point for curve beginning
    +
    y1:
    +
    y ordinate of control point for curve beginning
    +
    x2:
    +
    x ordinate of control point for curve ending
    +
    y2:
    +
    y ordinate of control point for curve ending
    +
    x:
    +
    x ordinate of the end of the curve
    +
    y:
    +
    y ordinate of the end of the curve
    +
    +
    +
    +
    +

    DrawPathCurveToQuadraticBezierAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathCurveToQuadraticBezierAbsolute( DrawContext context, const double x1,
    +                                             const double y1, const double x,
    +                                             const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToQuadraticBezierAbsolute method is:

    +
    +void DrawPathCurveToQuadraticBezierAbsolute( DrawContext context, const double x1,
    +                                             const double y1, const double x,
    +                                             const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x1:
    +
    x ordinate of the control point
    +
    y1:
    +
    y ordinate of the control point
    +
    x:
    +
    x ordinate of final point
    +
    y:
    +
    y ordinate of final point
    +
    +
    +
    +
    +

    DrawPathCurveToQuadraticBezierRelative

    +
    +

    Synopsis

    +
    +void DrawPathCurveToQuadraticBezierRelative( DrawContext context, const double x1,
    +                                             const double y1, const double x,
    +                                             const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToQuadraticBezierRelative method is:

    +
    +void DrawPathCurveToQuadraticBezierRelative( DrawContext context, const double x1,
    +                                             const double y1, const double x,
    +                                             const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x1:
    +
    x ordinate of the control point
    +
    y1:
    +
    y ordinate of the control point
    +
    x:
    +
    x ordinate of final point
    +
    y:
    +
    y ordinate of final point
    +
    +
    +
    +
    +

    DrawPathCurveToQuadraticBezierSmoothAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathCurveToQuadraticBezierSmoothAbsolute( DrawContext context, const double x,
    +                                                   const double y );
    +
    +
    +
    +

    Description

    +

    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, +DrawPathCurveToQuadraticBezierSmoothAbsolut 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.

    +

    The format of the DrawPathCurveToQuadraticBezierSmoothAbsolute method is:

    +
    +void DrawPathCurveToQuadraticBezierSmoothAbsolute( DrawContext context, const double x,
    +                                                   const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    x ordinate of final point
    +
    y:
    +
    y ordinate of final point
    +
    +
    +
    +
    +

    DrawPathCurveToQuadraticBezierSmoothRelative

    +
    +

    Synopsis

    +
    +void DrawPathCurveToQuadraticBezierSmoothRelative( DrawContext context, const double x,
    +                                                   const double y );
    +
    +
    +
    +

    Description

    +

    DrawPathCurveToQuadraticBezierSmoothAbsolute() 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, +DrawPathCurveToQuadraticBezierSmoothAbsolut 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.

    +

    The format of the DrawPathCurveToQuadraticBezierSmoothRelative method is:

    +
    +void DrawPathCurveToQuadraticBezierSmoothRelative( DrawContext context, const double x,
    +                                                   const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    x ordinate of final point
    +
    y:
    +
    y ordinate of final point
    +
    +
    +
    +
    +

    DrawPathCurveToSmoothAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathCurveToSmoothAbsolute( DrawContext context, const double x2, const double y2,
    +                                    const double x, const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToSmoothAbsolute method is:

    +
    +void DrawPathCurveToSmoothAbsolute( DrawContext context, const double x2, const double y2,
    +                                    const double x, const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x2:
    +
    x ordinate of second control point
    +
    y2:
    +
    y ordinate of second control point
    +
    x:
    +
    x ordinate of termination point
    +
    y:
    +
    y ordinate of termination point
    +
    +
    +
    +
    +

    DrawPathCurveToSmoothRelative

    +
    +

    Synopsis

    +
    +void DrawPathCurveToSmoothRelative( DrawContext context, const double x2, const double y2,
    +                                    const double x, const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToSmoothRelative method is:

    +
    +void DrawPathCurveToSmoothRelative( DrawContext context, const double x2, const double y2,
    +                                    const double x, const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x2:
    +
    x ordinate of second control point
    +
    y2:
    +
    y ordinate of second control point
    +
    x:
    +
    x ordinate of termination point
    +
    y:
    +
    y ordinate of termination point
    +
    +
    +
    +
    +

    DrawPathEllipticArcAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathEllipticArcAbsolute( DrawContext context, const double rx, const double ry,
    +                                  const double x_axis_rotation,
    +                                  unsigned int large_arc_flag, unsigned int sweep_flag,
    +                                  const double x, const double y );
    +
    +
    +
    +

    Description

    +

    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 automatically 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.

    +

    The format of the DrawPathEllipticArcAbsolute method is:

    +
    +void DrawPathEllipticArcAbsolute( DrawContext context, const double rx, const double ry,
    +                                  const double x_axis_rotation,
    +                                  unsigned int large_arc_flag, unsigned int sweep_flag,
    +                                  const double x, const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    rx:
    +
    x radius
    +
    ry:
    +
    y radius
    +
    x_axis_rotation:
    +
    indicates how the ellipse as a whole is rotated +relative to the current coordinate system
    +
    large_arc_flag:
    +
    If non-zero (true) then draw the larger of the +available arcs
    +
    sweep_flag:
    +
    If non-zero (true) then draw the arc matching a +clock-wise rotation
    +
    +
    +
    +
    +

    DrawPathEllipticArcRelative

    +
    +

    Synopsis

    +
    +void DrawPathEllipticArcRelative( DrawContext context, const double rx, const double ry,
    +                                  const double x_axis_rotation,
    +                                  unsigned int large_arc_flag, unsigned int sweep_flag,
    +                                  const double x, const double y );
    +
    +
    +
    +

    Description

    +

    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 automatically 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.

    +

    The format of the DrawPathEllipticArcRelative method is:

    +
    +void DrawPathEllipticArcRelative( DrawContext context, const double rx, const double ry,
    +                                  const double x_axis_rotation,
    +                                  unsigned int large_arc_flag, unsigned int sweep_flag,
    +                                  const double x, const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    rx:
    +
    x radius
    +
    ry:
    +
    y radius
    +
    x_axis_rotation:
    +
    indicates how the ellipse as a whole is rotated +relative to the current coordinate system
    +
    large_arc_flag:
    +
    If non-zero (true) then draw the larger of the +available arcs
    +
    sweep_flag:
    +
    If non-zero (true) then draw the arc matching a +clock-wise rotation
    +
    +
    +
    +
    +

    DrawPathFinish

    +
    +

    Synopsis

    +
    +void DrawPathFinish( DrawContext context );
    +
    +
    +
    +

    Description

    +

    DrawPathFinish() terminates the current path.

    +

    The format of the DrawPathFinish method is:

    +
    +void DrawPathFinish( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawPathLineToAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathLineToAbsolute( DrawContext context, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPathLineToAbsolute method is:

    +
    +void DrawPathLineToAbsolute( DrawContext context, const double x, const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    target x ordinate
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathLineToRelative

    +
    +

    Synopsis

    +
    +void DrawPathLineToRelative( DrawContext context, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPathLineToRelative method is:

    +
    +void DrawPathLineToRelative( DrawContext context, const double x, const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    target x ordinate
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathLineToHorizontalAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathLineToHorizontalAbsolute( DrawContext context, const double x );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathLineToHorizontalAbsolute method is:

    +
    +void DrawPathLineToHorizontalAbsolute( DrawContext context, const double x );
    +
    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    target x ordinate
    +
    +
    +
    +
    +

    DrawPathLineToHorizontalRelative

    +
    +

    Synopsis

    +
    +void DrawPathLineToHorizontalRelative( DrawContext context, const double x );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathLineToHorizontalRelative method is:

    +
    +void DrawPathLineToHorizontalRelative( DrawContext context, const double x );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    target x ordinate
    +
    +
    +
    +
    +

    DrawPathLineToVerticalAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathLineToVerticalAbsolute( DrawContext context, const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathLineToVerticalAbsolute method is:

    +
    +void DrawPathLineToVerticalAbsolute( DrawContext context, const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathLineToVerticalRelative

    +
    +

    Synopsis

    +
    +void DrawPathLineToVerticalRelative( DrawContext context, const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathLineToVerticalRelative method is:

    +
    +void DrawPathLineToVerticalRelative( DrawContext context, const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathMoveToAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathMoveToAbsolute( DrawContext context, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPathMoveToAbsolute method is:

    +
    +void DrawPathMoveToAbsolute( DrawContext context, const double x, const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    target x ordinate
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathMoveToRelative

    +
    +

    Synopsis

    +
    +void DrawPathMoveToRelative( DrawContext context, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPathMoveToRelative method is:

    +
    +void DrawPathMoveToRelative( DrawContext context, const double x, const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    target x ordinate
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathStart

    +
    +

    Synopsis

    +
    +void DrawPathStart( DrawContext context );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathStart method is:

    +
    +void DrawPathStart( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawPeekGraphicContext

    +
    +

    Synopsis

    +
    +DrawInfo *DrawPeekGraphicContext( const DrawContext context );
    +
    +
    +
    +

    Description

    +

    DrawPeekGraphicContext() returns a copy of the the DrawInfo structure at +the head of the drawing context stack. The user is responsible for +deallocating the returned object using DestroyDrawInfo.

    +

    The format of the DrawPeekGraphicContext method is:

    +
    +DrawInfo *DrawPeekGraphicContext( const DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawPoint

    +
    +

    Synopsis

    +
    +void DrawPoint( DrawContext context, const double x, const double y );
    +
    +
    +
    +

    Description

    +

    DrawPoint() draws a point using the current stroke color and stroke +thickness at the specified coordinates.

    +

    The format of the DrawPoint method is:

    +
    +void DrawPoint( DrawContext context, const double x, const double y );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    target x coordinate
    +
    y:
    +
    target y coordinate
    +
    +
    +
    +
    +

    DrawPolygon

    +
    +

    Synopsis

    +
    +void DrawPolygon( DrawContext context, const unsigned long num_coords,
    +                  const PointInfo *coordinates );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPolygon method is:

    +
    +void DrawPolygon( DrawContext context, const unsigned long num_coords,
    +                  const PointInfo *coordinates );
    +
    +
    +
    context:
    +
    drawing context
    +
    num_coords:
    +
    number of coordinates
    +
    coordinates:
    +
    coordinate array
    +
    +
    +
    +
    +

    DrawPolyline

    +
    +

    Synopsis

    +
    +void DrawPolyline( DrawContext context, const unsigned long num_coords,
    +                   const PointInfo *coordinates );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPolyline method is:

    +
    +void DrawPolyline( DrawContext context, const unsigned long num_coords,
    +                   const PointInfo *coordinates );
    +
    +
    +
    context:
    +
    drawing context
    +
    num_coords:
    +
    number of coordinates
    +
    coordinates:
    +
    coordinate array
    +
    +
    +
    +
    +

    DrawPopClipPath

    +
    +

    Synopsis

    +
    +void DrawPopClipPath( DrawContext context );
    +
    +
    +
    +

    Description

    +

    DrawPopClipPath() terminates a clip path definition.

    +

    The format of the DrawPopClipPath method is:

    +
    +void DrawPopClipPath( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawPopDefs

    +
    +

    Synopsis

    +
    +void DrawPopDefs( DrawContext context );
    +
    +
    +
    +

    Description

    +

    DrawPopDefs() terminates a definition list

    +

    The format of the DrawPopDefs method is:

    +
    +void DrawPopDefs( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawPopGraphicContext

    +
    +

    Synopsis

    +
    +void DrawPopGraphicContext( DrawContext context );
    +
    +
    +
    +

    Description

    +

    DrawPopGraphicContext() destroys the current context returning to the +previously pushed context. Multiple contexts may exist. It is an error +to attempt to pop more contexts than have been pushed, and it is proper +form to pop all contexts which have been pushed.

    +

    The format of the DrawPopGraphicContext method is:

    +
    +void DrawPopGraphicContext( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawPopPattern

    +
    +

    Synopsis

    +
    +void DrawPopPattern( DrawContext context );
    +
    +
    +
    +

    Description

    +

    DrawPopPattern() terminates a pattern definition.

    +

    The format of the DrawPopPattern method is:

    +
    +void DrawPopPattern( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawPushClipPath

    +
    +

    Synopsis

    +
    +void DrawPushClipPath( DrawContext context, const char *clip_path_id );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPushClipPath method is:

    +
    +void DrawPushClipPath( DrawContext context, const char *clip_path_id );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    clip_path_id:
    +
    string identifier to associate with the clip path for +later use.
    +
    +
    +
    +
    +

    DrawPushDefs

    +
    +

    Synopsis

    +
    +void DrawPushDefs( DrawContext context );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPushDefs method is:

    +
    +void DrawPushDefs( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawPushGraphicContext

    +
    +

    Synopsis

    +
    +void DrawPushGraphicContext( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPushGraphicContext method is:

    +
    +void DrawPushGraphicContext( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawPushPattern

    +
    +

    Synopsis

    +
    +void DrawPushPattern( DrawContext context, const char *pattern_id, const double x,
    +                      const double y, const double width, const double height );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPushPattern method is:

    +
    +void DrawPushPattern( DrawContext context, const char *pattern_id, const double x,
    +                      const double y, const double width, const double height );
    +
    +
    +
    context:
    +
    drawing context
    +
    pattern_id:
    +
    pattern identification for later reference
    +
    x:
    +
    x ordinate of top left corner
    +
    y:
    +
    y ordinate of top left corner
    +
    width:
    +
    width of pattern space
    +
    height:
    +
    height of pattern space
    +
    +
    +
    +
    +

    DrawRectangle

    +
    +

    Synopsis

    +
    +void DrawRectangle( DrawContext context, const double x1, const double y1, const double x2,
    +                    const double y2 );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawRectangle method is:

    +
    +void DrawRectangle( DrawContext context, const double x1, const double y1, const double x2,
    +                    const double y2 );
    +
    +
    +
    x1:
    +
    x ordinate of first coordinate
    +
    y1:
    +
    y ordinate of first coordinate
    +
    x2:
    +
    x ordinate of second coordinate
    +
    y2:
    +
    y ordinate of second coordinate
    +
    +
    +
    +
    +

    DrawRender

    +
    +

    Synopsis

    +
    +int DrawRender( const DrawContext context );
    +
    +
    +
    +

    Description

    +

    DrawRender() renders all preceding drawing commands onto the image.

    +

    The format of the DrawRender method is:

    +
    +int DrawRender( const DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawRotate

    +
    +

    Synopsis

    +
    +void DrawRotate( DrawContext context, const double degrees );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawRotate method is:

    +
    +void DrawRotate( DrawContext context, const double degrees );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    degrees:
    +
    degrees of rotation
    +
    +
    +
    +
    +

    DrawRoundRectangle

    +
    +

    Synopsis

    +
    +void DrawRoundRectangle( DrawContext context, double x1, double y1, double x2, double y2,
    +                         double rx, double ry );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawRoundRectangle method is:

    +
    +void DrawRoundRectangle( DrawContext context, double x1, double y1, double x2, double y2,
    +                         double rx, double ry );
    +
    +
    +
    context:
    +
    drawing context
    +
    x1:
    +
    x ordinate of first coordinate
    +
    y1:
    +
    y ordinate of first coordinate
    +
    x2:
    +
    x ordinate of second coordinate
    +
    y2:
    +
    y ordinate of second coordinate
    +
    rx:
    +
    radius of corner in horizontal direction
    +
    ry:
    +
    radius of corner in vertical direction
    +
    +
    +
    +
    +

    DrawScale

    +
    +

    Synopsis

    +
    +void DrawScale( DrawContext context, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawScale method is:

    +
    +void DrawScale( DrawContext context, const double x, const double y );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    horizontal scale factor
    +
    y:
    +
    vertical scale factor
    +
    +
    +
    +
    +

    DrawSkewX

    +
    +

    Synopsis

    +
    +void DrawSkewX( DrawContext context, const double degrees );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSkewX method is:

    +
    +void DrawSkewX( DrawContext context, const double degrees );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    degrees:
    +
    number of degrees to skew the coordinates
    +
    +
    +
    +
    +

    DrawSkewY

    +
    +

    Synopsis

    +
    +void DrawSkewY( DrawContext context, const double degrees );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSkewY method is:

    +
    +void DrawSkewY( DrawContext context, const double degrees );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    degrees:
    +
    number of degrees to skew the coordinates
    +
    +
    +
    +
    +

    DrawSetStopColor

    +
    +

    Synopsis

    +
    +void DrawSetStopColor( DrawContext context, const PixelPacket *stop_color,
    +                       const double offset );
    +
    +
    +
    +

    Description

    +

    DrawSetStopColor() sets the stop color and offset for gradients

    +

    The format of the DrawSetStopColor method is:

    +
    +void DrawSetStopColor( DrawContext context, const PixelPacket *stop_color,
    +                       const double offset );
    +
    +
    +
    context:
    +
    drawing context
    +
    +

    o stop_color:

    +

    o offset:

    +
    +
    +
    +

    DrawGetStrokeColor

    +
    +

    Synopsis

    +
    +PixelPacket DrawGetStrokeColor( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetStrokeColor method is:

    +
    +PixelPacket DrawGetStrokeColor( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetStrokeColor

    +
    +

    Synopsis

    +
    +void DrawSetStrokeColor( DrawContext context, const PixelPacket *stroke_color );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetStrokeColor method is:

    +
    +void DrawSetStrokeColor( DrawContext context, const PixelPacket *stroke_color );
    +
    +
    +
    context:
    +
    drawing context
    +
    stroke_color:
    +
    stroke color
    +
    +
    +
    +
    +

    DrawSetStrokeColorString

    +
    +

    Synopsis

    +
    +void DrawSetStrokeColorString( DrawContext context, const char *stroke_color );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetStrokeColorString method is:

    +
    +void DrawSetStrokeColorString( DrawContext context, const char *stroke_color );
    +
    +
    +
    context:
    +
    drawing context
    +
    stroke_color:
    +
    stroke color
    +
    +
    +
    +
    +

    DrawSetStrokePatternURL

    +
    +

    Synopsis

    +
    +void DrawSetStrokePatternURL( DrawContext context, const char *stroke_url );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetStrokePatternURL method is:

    +
    +void DrawSetStrokePatternURL( DrawContext context, const char *stroke_url );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    stroke_url:
    +
    URL specifying pattern ID (e.g. "#pattern_id")
    +
    +
    +
    +
    +

    DrawGetStrokeAntialias

    +
    +

    Synopsis

    +
    +unsigned int DrawGetStrokeAntialias( DrawContext context );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetStrokeAntialias method is:

    +
    +unsigned int DrawGetStrokeAntialias( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetStrokeAntialias

    +
    +

    Synopsis

    +
    +void DrawSetStrokeAntialias( DrawContext context, const unsigned int stroke_antialias );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawSetStrokeAntialias method is:

    +
    +void DrawSetStrokeAntialias( DrawContext context, const unsigned int stroke_antialias );
    +
    +
    +
    context:
    +
    drawing context
    +
    stroke_antialias:
    +
    set to false (zero) to disable antialiasing
    +
    +
    +
    +
    +

    DrawGetStrokeDashArray

    +
    +

    Synopsis

    +
    +double *DrawGetStrokeDashArray( DrawContext context, unsigned long *num_elems );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetStrokeDashArray method is:

    +
    +double *DrawGetStrokeDashArray( DrawContext context, unsigned long *num_elems );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    num_elems:
    +
    address to place number of elements in dash array
    +
    +
    +
    +
    +

    DrawSetStrokeDashArray

    +
    +

    Synopsis

    +
    +void DrawSetStrokeDashArray( DrawContext context, const unsigned long num_elems,
    +                             const double *dasharray );
    +
    +
    +
    +

    Description

    +

    DrawSetStrokeDashArray() specifies the pattern of dashes and gaps used to +stroke paths. The strokeDashArray 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 +num_elems argument and null dasharray. A typical stroke dash array might +contain the members 5 3 2.

    +

    The format of the DrawSetStrokeDashArray method is:

    +
    +void DrawSetStrokeDashArray( DrawContext context, const unsigned long num_elems,
    +                             const double *dasharray );
    +
    +
    +
    context:
    +
    drawing context
    +
    num_elems:
    +
    number of elements in dash array
    +
    dasharray:
    +
    dash array values
    +
    +
    +
    +
    +

    DrawGetStrokeDashOffset

    +
    +

    Synopsis

    +
    +double DrawGetStrokeDashOffset( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetStrokeDashOffset method is:

    +
    +double DrawGetStrokeDashOffset( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetStrokeDashOffset

    +
    +

    Synopsis

    +
    +void DrawSetStrokeDashOffset( DrawContext context, const double dash_offset );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetStrokeDashOffset method is:

    +
    +void DrawSetStrokeDashOffset( DrawContext context, const double dash_offset );
    +
    +
    +
    context:
    +
    drawing context
    +
    dash_offset:
    +
    dash offset
    +
    +
    +
    +
    +

    DrawGetStrokeLineCap

    +
    +

    Synopsis

    +
    +LineCap DrawGetStrokeLineCap( DrawContext context );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetStrokeLineCap method is:

    +
    +LineCap DrawGetStrokeLineCap( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetStrokeLineCap

    +
    +

    Synopsis

    +
    +void DrawSetStrokeLineCap( DrawContext context, const LineCap linecap );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawSetStrokeLineCap method is:

    +
    +void DrawSetStrokeLineCap( DrawContext context, const LineCap linecap );
    +
    +
    +
    context:
    +
    drawing context
    +
    linecap:
    +
    linecap style
    +
    +
    +
    +
    +

    DrawGetStrokeLineJoin

    +
    +

    Synopsis

    +
    +LineJoin DrawGetStrokeLineJoin( DrawContext context );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetStrokeLineJoin method is:

    +
    +LineJoin DrawGetStrokeLineJoin( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetStrokeLineJoin

    +
    +

    Synopsis

    +
    +void DrawSetStrokeLineJoin( DrawContext context, const LineJoin linejoin );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawSetStrokeLineJoin method is:

    +
    +void DrawSetStrokeLineJoin( DrawContext context, const LineJoin linejoin );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    linejoin:
    +
    line join style
    +
    +
    +
    +
    +

    DrawGetStrokeMiterLimit

    +
    +

    Synopsis

    +
    +unsigned long DrawGetStrokeMiterLimit( DrawContext context );
    +
    +
    +
    +

    Description

    +

    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'.

    +

    The format of the DrawGetStrokeMiterLimit method is:

    +
    +unsigned long DrawGetStrokeMiterLimit( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetStrokeMiterLimit

    +
    +

    Synopsis

    +
    +void DrawSetStrokeMiterLimit( DrawContext context, const unsigned long miterlimit );
    +
    +
    +
    +

    Description

    +

    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'.

    +

    The format of the DrawSetStrokeMiterLimit method is:

    +
    +void DrawSetStrokeMiterLimit( DrawContext context, const unsigned long miterlimit );
    +
    +
    +
    context:
    +
    drawing context
    +
    miterlimit:
    +
    miter limit
    +
    +
    +
    +
    +

    DrawGetStrokeOpacity

    +
    +

    Synopsis

    +
    +double DrawGetStrokeOpacity( DrawContext context );
    +
    +
    +
    +

    Description

    +

    DrawGetStrokeOpacity() returns the opacity of stroked object outlines.

    +

    The format of the DrawGetStrokeOpacity method is:

    +
    +double DrawGetStrokeOpacity( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetStrokeOpacity

    +
    +

    Synopsis

    +
    +void DrawSetStrokeOpacity( DrawContext context, const double stroke_opacity );
    +
    +
    +
    +

    Description

    +

    DrawSetStrokeOpacity() specifies the opacity of stroked object outlines.

    +

    The format of the DrawSetStrokeOpacity method is:

    +
    +void DrawSetStrokeOpacity( DrawContext context, const double stroke_opacity );
    +
    +
    +
    context:
    +
    drawing context
    +
    stroke_opacity:
    +
    stroke opacity. The value 1.0 is opaque.
    +
    +
    +
    +
    +

    DrawGetStrokeWidth

    +
    +

    Synopsis

    +
    +double DrawGetStrokeWidth( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetStrokeWidth method is:

    +
    +double DrawGetStrokeWidth( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetStrokeWidth

    +
    +

    Synopsis

    +
    +void DrawSetStrokeWidth( DrawContext context, const double stroke_width );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetStrokeWidth method is:

    +
    +void DrawSetStrokeWidth( DrawContext context, const double stroke_width );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    stroke_width:
    +
    stroke width
    +
    +
    +
    +
    +

    DrawGetTextAntialias

    +
    +

    Synopsis

    +
    +unsigned int DrawGetTextAntialias( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetTextAntialias method is:

    +
    +unsigned int DrawGetTextAntialias( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetTextAntialias

    +
    +

    Synopsis

    +
    +void DrawSetTextAntialias( DrawContext context, const unsigned int text_antialias );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetTextAntialias method is:

    +
    +void DrawSetTextAntialias( DrawContext context, const unsigned int text_antialias );
    +
    +
    +
    context:
    +
    drawing context
    +
    text_antialias:
    +
    antialias boolean. Set to false (0) to disable +antialiasing.
    +
    +
    +
    +
    +

    DrawGetTextDecoration

    +
    +

    Synopsis

    +
    +DecorationType DrawGetTextDecoration( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetTextDecoration method is:

    +
    +DecorationType DrawGetTextDecoration( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetTextDecoration

    +
    +

    Synopsis

    +
    +void DrawSetTextDecoration( DrawContext context, const DecorationType decoration );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetTextDecoration method is:

    +
    +void DrawSetTextDecoration( DrawContext context, const DecorationType decoration );
    +
    +
    +
    context:
    +
    drawing context
    +
    decoration:
    +
    text decoration. One of NoDecoration, UnderlineDecoration, +OverlineDecoration, or LineThroughDecoration
    +
    +
    +
    +
    +

    DrawGetTextEncoding

    +
    +

    Synopsis

    +
    +char *DrawGetTextEncoding( DrawContext context );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetTextEncoding method is:

    +
    +char *DrawGetTextEncoding( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetTextEncoding

    +
    +

    Synopsis

    +
    +void DrawSetTextEncoding( DrawContext context, const char *encoding );
    +
    +
    +
    +

    Description

    +

    DrawSetTextEncoding() specifies 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.

    +

    The format of the DrawSetTextEncoding method is:

    +
    +void DrawSetTextEncoding( DrawContext context, const char *encoding );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    encoding:
    +
    character string specifying text encoding
    +
    +
    +
    +
    +

    DrawGetTextUnderColor

    +
    +

    Synopsis

    +
    +PixelPacket DrawGetTextUnderColor( DrawContext context );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetTextUnderColor method is:

    +
    +PixelPacket DrawGetTextUnderColor( DrawContext context );
    +
    +

    A description of each parameter follows:

    +
    +
    context:
    +
    drawing context
    +
    +
    +
    +
    +

    DrawSetTextUnderColor

    +
    +

    Synopsis

    +
    +void DrawSetTextUnderColor( DrawContext context, const PixelPacket *under_color );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetTextUnderColor method is:

    +
    +void DrawSetTextUnderColor( DrawContext context, const PixelPacket *under_color );
    +
    +
    +
    context:
    +
    drawing context
    +
    under_color:
    +
    text under color
    +
    +
    +
    +
    +

    DrawSetTextUnderColorString

    +
    +

    Synopsis

    +
    +void DrawSetTextUnderColorString( DrawContext context, const char *under_color );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetTextUnderColorString method is:

    +
    +void DrawSetTextUnderColorString( DrawContext context, const char *under_color );
    +
    +
    +
    context:
    +
    drawing context
    +
    under_color:
    +
    text under color
    +
    +
    +
    +
    +

    DrawTranslate

    +
    +

    Synopsis

    +
    +void DrawTranslate( DrawContext context, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawTranslate method is:

    +
    +void DrawTranslate( DrawContext context, const double x, const double y );
    +
    +
    +
    context:
    +
    drawing context
    +
    x:
    +
    new x ordinate for coordinate system origin
    +
    y:
    +
    new y ordinate for coordinate system origin
    +
    +
    +
    +
    +

    DrawSetViewbox

    +
    +

    Synopsis

    +
    +void DrawSetViewbox( DrawContext context, unsigned long x1, unsigned long y1,
    +                     unsigned long x2, unsigned long y2 );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawSetViewbox method is:

    +
    +void DrawSetViewbox( DrawContext context, unsigned long x1, unsigned long y1,
    +                     unsigned long x2, unsigned long y2 );
    +
    +
    +
    context:
    +
    drawing context
    +
    x1:
    +
    left x ordinate
    +
    y1:
    +
    top y ordinate
    +
    x2:
    +
    right x ordinate
    +
    y2:
    +
    bottom y ordinate
    +
    +
    +
    +
    + + diff --git a/www/api/effect.html b/www/api/effect.html index 8e925ae..17a724f 100644 --- a/www/api/effect.html +++ b/www/api/effect.html @@ -3,7 +3,7 @@ - + effect @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Image effects methods

    -

    Contents

    +

    Contents

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/effect.html.orig b/www/api/effect.html.orig new file mode 100644 index 0000000..6d3c634 --- /dev/null +++ b/www/api/effect.html.orig @@ -0,0 +1,920 @@ + + + + + + +effect + + + + + + + +
    +

    effect

    +

    Image effects methods

    + + +
    +

    AdaptiveThresholdImage

    +
    +

    Synopsis

    +
    +Image *AdaptiveThresholdImage( Image *image, const unsigned long width,
    +                               const unsigned long height, const unsigned long unsigned long,
    +                               ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    AdaptiveThresholdImage() selects an individual threshold for each pixel +based on the range of intensity values in its local neighborhood. This +allows for thresholding of an image whose global intensity histogram +doesn't contain distinctive peaks.

    +

    The format of the AdaptiveThresholdImage method is:

    +
    +Image *AdaptiveThresholdImage( Image *image, const unsigned long width,
    +                               const unsigned long height, const unsigned long unsigned long,
    +                               ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    width:
    +
    The width of the local neighborhood.
    +
    height:
    +
    The height of the local neighborhood.
    +
    offset:
    +
    The mean offset.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    AddNoiseImage

    +
    +

    Synopsis

    +
    +Image *AddNoiseImage( const Image *image, const NoiseType noise_type,
    +                      ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    AddNoiseImage() adds random noise to the image.

    +

    The format of the AddNoiseImage method is:

    +
    +Image *AddNoiseImage( const Image *image, const NoiseType noise_type,
    +                      ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    noise_type:
    +
    The type of noise: Uniform, Gaussian, Multiplicative, +Impulse, Laplacian, Poisson, or Random.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    AddNoiseImageChannel

    +
    +

    Synopsis

    +
    +Image *AddNoiseImageChannel( const Image *image, const ChannelType channel,
    +                             const NoiseType noise_type, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    AddNoiseImageChannel() adds random noise to one image channel.

    +

    The format of the AddNoiseImageChannel method is:

    +
    +Image *AddNoiseImageChannel( const Image *image, const ChannelType channel,
    +                             const NoiseType noise_type, ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    channel:
    +
    The image channel to apply noise to.
    +
    noise_type:
    +
    The type of noise: Uniform, Gaussian, Multiplicative, +Impulse, Laplacian, Poisson, or Random.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    BlackThresholdImage

    +
    +

    Synopsis

    +
    +MagickPassFail BlackThresholdImage( Image *image, const char *thresholds );
    +
    +
    +
    +

    Description

    +

    BlackThresholdImage() adjusts the levels of image channels such that +values below a specified threshold are set to the minimum value (black) +while the remaining pixels are unchanged.

    +

    The format of the BlackThresholdImage method is:

    +
    +MagickPassFail BlackThresholdImage( Image *image, const char *thresholds );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    thresholds:
    +
    Channel thresholds which are specified as a comma delimited +list containing the thresholds for red, green, blue, and opacity. If +the list contains a percent symbol (%) then all values are treated as +a percentage of MaxRGB.
    +
    +
    +
    +
    +

    BlurImage

    +
    +

    Synopsis

    +
    +Image *BlurImage( const Image *image, const double radius, const double sigma,
    +                  ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the BlurImage method is:

    +
    +Image *BlurImage( const Image *image, const double radius, const double sigma,
    +                  ExceptionInfo *exception );
    +
    +
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    BlurImageChannel

    +
    +

    Synopsis

    +
    +Image *BlurImageChannel( const Image *image, const ChannelType channel,
    +                         const double radius, const double sigma,
    +                         ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    BlurImageChannel() blurs the specified image channel. We convolve the +image channel 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 BlurImageChannel() selects a suitable +radius for you.

    +

    The format of the BlurImageChannel method is:

    +
    +Image *BlurImageChannel( const Image *image, const ChannelType channel,
    +                         const double radius, const double sigma,
    +                         ExceptionInfo *exception );
    +
    +
    +
    channel:
    +
    The channel to blur.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ChannelThresholdImage

    +
    +

    Synopsis

    +
    +MagickPassFail ChannelThresholdImage( Image *image, const char *threshold );
    +
    +
    +
    +

    Description

    +

    ChannelThresholdImage() changes the value of individual pixels based on +the level of each pixel channel. The result sets the affected channels +to the minimum or maximum channel value. A negative threshold value +disables thresholding for that channel. Append a percent symbol to +have threshold values automatically scaled from a percentage to MaxRGB.

    +

    Invoked by the '-threshold' option.

    +

    The format of the ChannelThresholdImage method is:

    +
    +MagickPassFail ChannelThresholdImage( Image *image, const char *threshold );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    threshold:
    +
    define the threshold values, <red>{<green>,<blue>,<opacity>}{%}.
    +
    +
    +
    +
    +

    ConvolveImage

    +
    +

    Synopsis

    +
    +Image *ConvolveImage( const Image *image, const unsigned int order,
    +                      const double *kernel, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the ConvolveImage method is:

    +
    +Image *ConvolveImage( const Image *image, const unsigned int order,
    +                      const double *kernel, ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    order:
    +
    The number of columns and rows in the filter kernel.
    +
    kernel:
    +
    An array of double representing the convolution kernel.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    DespeckleImage

    +
    +

    Synopsis

    +
    +Image *DespeckleImage( const Image *image, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    Despeckle() reduces the speckle noise in an image while preserving the +edges of the original image.

    +

    The format of the DespeckleImage method is:

    +
    +Image *DespeckleImage( const Image *image, ExceptionInfo *exception );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    EdgeImage

    +
    +

    Synopsis

    +
    +Image *EdgeImage( const Image *image, const double radius,
    +                  ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the EdgeImage method is:

    +
    +Image *EdgeImage( const Image *image, const double radius,
    +                  ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    radius:
    +
    the radius of the pixel neighborhood.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    EmbossImage

    +
    +

    Synopsis

    +
    +Image *EmbossImage( const Image *image, const double radius, const double sigma,
    +                    ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the EmbossImage method is:

    +
    +Image *EmbossImage( const Image *image, const double radius, const double sigma,
    +                    ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    radius:
    +
    the radius of the pixel neighborhood.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    EnhanceImage

    +
    +

    Synopsis

    +
    +Image *EnhanceImage( const Image *image, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    EnhanceImage() applies a digital filter to the image color channels that +improves the quality of a noisy image. The opacity channel is preserved +but is otherwise ignored.

    +

    The format of the EnhanceImage method is:

    +
    +Image *EnhanceImage( const Image *image, ExceptionInfo *exception );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    GaussianBlurImage

    +
    +

    Synopsis

    +
    +Image *GaussianBlurImage( const Image *image, const double radius, const double sigma,
    +                          ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    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

    +

    The format of the GaussianBlurImage method is:

    +
    +Image *GaussianBlurImage( const Image *image, const double radius, const double sigma,
    +                          ExceptionInfo *exception );
    +
    +
    +
    blur_image:
    +
    Method GaussianBlurImage returns a pointer to the image +after it is blur. A null image is returned if there is a memory +shortage.
    +
    image:
    +
    Image to blur.
    +
    radius:
    +
    the radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    the standard deviation of the Gaussian, in pixels.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    GaussianBlurImageChannel

    +
    +

    Synopsis

    +
    +Image *GaussianBlurImageChannel( const Image *image, const ChannelType channel,
    +                                 const double radius, const double sigma,
    +                                 ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    GaussianBlurImageChannel() blurs an image channel. 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.

    +

    The format of the GaussianBlurImageChannel method is:

    +
    +Image *GaussianBlurImageChannel( const Image *image, const ChannelType channel,
    +                                 const double radius, const double sigma,
    +                                 ExceptionInfo *exception );
    +
    +
    +
    blur_image:
    +
    Method GaussianBlurImage returns a pointer to the image +after it is blur. A null image is returned if there is a memory +shortage.
    +
    image:
    +
    Image to blur.
    +
    channel:
    +
    Channel to blur in image.
    +
    radius:
    +
    the radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    the standard deviation of the Gaussian, in pixels.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    MedianFilterImage

    +
    +

    Synopsis

    +
    +Image *MedianFilterImage( const Image *image, const double radius,
    +                          ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    MedianFilterImage() 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 algorithm was contributed by Mike Edmonds and implements an insertion +sort for selecting median color-channel values. For more on this algorithm +see "Skip Lists: A probabilistic Alternative to Balanced Trees" by William +Pugh in the June 1990 of Communications of the ACM.

    +

    The format of the MedianFilterImage method is:

    +
    +Image *MedianFilterImage( const Image *image, const double radius,
    +                          ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    radius:
    +
    The radius of the pixel neighborhood.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    MotionBlurImage

    +
    +

    Synopsis

    +
    +Image *MotionBlurImage( const Image *image, const double radius, const double sigma,
    +                        const double angle, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    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 (direction object appears +to be coming from).

    +

    Andrew Protano contributed this effect.

    +

    The format of the MotionBlurImage method is:

    +
    +Image *MotionBlurImage( const Image *image, const double radius, const double sigma,
    +                        const double angle, ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting +the center pixel.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    angle:
    +
    Apply the effect along this angle.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    RandomChannelThresholdImage

    +
    +

    Synopsis

    +
    +unsigned int RandomChannelThresholdImage( Image *image, const char *channel,
    +                                          const char *thresholds,
    +                                          ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    RandomChannelThresholdImage() changes the value of individual pixels based +on the intensity of each pixel compared to a random threshold. The result +is a low-contrast, two color image.

    +

    The format of the RandomChannelThresholdImage method is:

    +
    +unsigned int RandomChannelThresholdImage( Image *image, const char *channel,
    +                                          const char *thresholds,
    +                                          ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    channel:
    +
    The channel or channels to be thresholded.
    +
    thresholds:
    +
    a geometry string containing LOWxHIGH thresholds. +If the string contains 2x2, 3x3, 4x4, 5x5, 6x6, or 7x7, then +an ordered dither of order 2, 3, 4, 5, 6, or 7 will be performed +instead.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ReduceNoiseImage

    +
    +

    Synopsis

    +
    +Image *ReduceNoiseImage( const Image *image, const double radius,
    +                         ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    ReduceNoiseImage() 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 ReduceNoiseImage method is:

    +
    +Image *ReduceNoiseImage( const Image *image, const double radius,
    +                         ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    radius:
    +
    The radius of the pixel neighborhood.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ShadeImage

    +
    +

    Synopsis

    +
    +Image *ShadeImage( const Image *image, const unsigned int gray, double azimuth,
    +                   double elevation, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the ShadeImage method is:

    +
    +Image *ShadeImage( const Image *image, const unsigned int gray, double azimuth,
    +                   double elevation, ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    gray:
    +
    A value other than zero shades the intensity of each pixel.
    +
    azimuth, elevation:
    +
    Define the light source direction.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    SharpenImage

    +
    +

    Synopsis

    +
    +Image *SharpenImage( const Image *image, const double radius, const double sigma,
    +                     ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    SharpenImage() sharpens an 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.

    +

    The format of the SharpenImage method is:

    +
    +Image *SharpenImage( const Image *image, const double radius, const double sigma,
    +                     ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    The standard deviation of the Laplacian, in pixels.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    SharpenImageChannel

    +
    +

    Synopsis

    +
    +Image *SharpenImageChannel( const Image *image, const ChannelType channel,
    +                            const double radius, const double sigma,
    +                            ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    SharpenImageChannel() sharpens an image channel. We convolve the image +channel 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 SharpenImageChannel() selects a suitable +radius for you.

    +

    The format of the SharpenImageChannel method is:

    +
    +Image *SharpenImageChannel( const Image *image, const ChannelType channel,
    +                            const double radius, const double sigma,
    +                            ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    channel:
    +
    The channel to sharpen.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    The standard deviation of the Laplacian, in pixels.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    SpreadImage

    +
    +

    Synopsis

    +
    +Image *SpreadImage( const Image *image, const unsigned int radius,
    +                    ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the SpreadImage method is:

    +
    +Image *SpreadImage( const Image *image, const unsigned int radius,
    +                    ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    radius:
    +
    Choose a random pixel in a neighborhood of this extent.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ThresholdImage

    +
    +

    Synopsis

    +
    +MagickPassFail ThresholdImage( Image *image, const double threshold );
    +
    +
    +
    +

    Description

    +

    ThresholdImage() changes the value of individual pixels based on +the intensity of each pixel compared to a specified threshold. Values +greater than the threshold are set to the maximum quantum value, and +values equal to or below the threshold are set to the minimum quantum +value. The result is a high-contrast, two color image.

    +

    The format of the ThresholdImage method is:

    +
    +MagickPassFail ThresholdImage( Image *image, const double threshold );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    threshold:
    +
    Define the threshold value
    +
    +
    +
    +
    +

    UnsharpMaskImage

    +
    +

    Synopsis

    +
    +Image *UnsharpMaskImage( const Image *image, const double radius, const double sigma,
    +                         const double amount, const double threshold,
    +                         ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    UnsharpMaskImage() sharpens an 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 UnsharpMaskImage() selects a suitable radius for you.

    +

    The format of the UnsharpMaskImage method is:

    +
    +Image *UnsharpMaskImage( const Image *image, const double radius, const double sigma,
    +                         const double amount, const double threshold,
    +                         ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    amount:
    +
    The percentage of the difference between the original and the +blur image that is added back into the original.
    +
    threshold:
    +
    The threshold in pixels needed to apply the diffence amount.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    UnsharpMaskImageChannel

    +
    +

    Synopsis

    +
    +Image *UnsharpMaskImageChannel( const Image *image, const ChannelType channel,
    +                                const double radius, const double sigma, const double amount,
    +                                const double threshold, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    UnsharpMaskImageChannel() sharpens an image channel. We convolve the +image channel 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.

    +

    The format of the UnsharpMaskImageChannel method is:

    +
    +Image *UnsharpMaskImageChannel( const Image *image, const ChannelType channel,
    +                                const double radius, const double sigma, const double amount,
    +                                const double threshold, ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    channel:
    +
    The channel to sharpen.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    amount:
    +
    The percentage of the difference between the original and the +blur image that is added back into the original.
    +
    threshold:
    +
    The threshold in pixels needed to apply the diffence amount.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    WhiteThresholdImage

    +
    +

    Synopsis

    +
    +MagickPassFail WhiteThresholdImage( Image *image, const char *thresholds );
    +
    +
    +
    +

    Description

    +

    WhiteThresholdImage() adjusts the levels of image channels such that +values above a specified threshold are set to the maximum value (white) +while the remaining pixels are unchanged.

    +

    The format of the WhiteThresholdImage method is:

    +
    +MagickPassFail WhiteThresholdImage( Image *image, const char *thresholds );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    thresholds:
    +
    Channel thresholds which are specified as a comma delimited +list containing the thresholds for red, green, blue, and opacity. If +the list contains a percent symbol (%) then all values are treated as +a percentage of MaxRGB.
    +
    +
    +
    +
    + + diff --git a/www/api/enhance.html b/www/api/enhance.html index 3654626..d4d4996 100644 --- a/www/api/enhance.html +++ b/www/api/enhance.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -274,5 +274,10 @@ unsigned int NormalizeImage( +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/enhance.html.orig b/www/api/enhance.html.orig new file mode 100644 index 0000000..4229325 --- /dev/null +++ b/www/api/enhance.html.orig @@ -0,0 +1,278 @@ + + + + + + +enhance + + + + + + + +
    +

    enhance

    +

    Methods to enhance or adjust an image

    + + +
    +

    ContrastImage

    +
    +

    Synopsis

    +
    +unsigned int ContrastImage( Image *image, const unsigned int sharpen );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the ContrastImage method is:

    +
    +unsigned int ContrastImage( Image *image, const unsigned int sharpen );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    sharpen:
    +
    Increase or decrease image contrast.
    +
    +
    +
    +
    +

    EqualizeImage

    +
    +

    Synopsis

    +
    +unsigned int EqualizeImage( Image *image );
    +
    +
    +
    +

    Description

    +

    EqualizeImage() applies a histogram equalization to the image.

    +

    The format of the EqualizeImage method is:

    +
    +unsigned int EqualizeImage( Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    +
    +
    +
    +

    GammaImage

    +
    +

    Synopsis

    +
    +MagickPassFail GammaImage( Image *image, const char *level );
    +
    +
    +
    +

    Description

    +

    Use GammaImage() to gamma-correct an image. 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 (e.g. "1.0,2.2,0.45"), +or adjust all three with a single gamma parameter. Values typically range +from 0.45 to 2.6.

    +

    You can also reduce the influence of a particular channel with a gamma +value of 0.

    +

    The format of the GammaImage method is:

    +
    +MagickPassFail GammaImage( Image *image, const char *level );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    level:
    +
    Define the level of gamma correction.
    +
    +
    +
    +
    +

    LevelImage

    +
    +

    Synopsis

    +
    +unsigned int LevelImage( Image *image, const char *level );
    +
    +
    +
    +

    Description

    +

    LevelImage() adjusts the levels of an image by scaling the colors falling +between specified white and black points to the full available quantum +range. The parameters provided represent the black, mid (gamma), and white +points. The black point specifies the darkest color in the image. Colors +darker than the black point are set to zero. Mid point specifies a gamma +correction to apply to the image. White point specifies the lightest color +in the image. Colors brighter than the white point are set to the maximum +quantum value.

    +

    The format of the LevelImage method is:

    +
    +unsigned int LevelImage( Image *image, const char *level );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    levels:
    +
    Specify the levels as a string of the form "black/mid/white" +(e.g. "10,1.0,65000) where black and white have the range of 0-MaxRGB, +and mid has the range 0-10.
    +
    +
    +
    +
    +

    LevelImageChannel

    +
    +

    Synopsis

    +
    +MagickPassFail LevelImageChannel( Image *image, const ChannelType channel,
    +                                  const double black_point, const double mid_point,
    +                                  const double white_point );
    +
    +
    +
    +

    Description

    +

    LevelImageChannel() adjusts the levels of one or more channels by +scaling the colors falling between specified white and black points to +the full available quantum range. The parameters provided represent the +black, mid (gamma), and white points. The black point specifies the +darkest color in the image. Colors darker than the black point are set to +zero. Mid point specifies a gamma correction to apply to the image. +White point specifies the lightest color in the image. Colors brighter +than the white point are set to the maximum quantum value.

    +

    The format of the LevelImage method is:

    +
    +MagickPassFail LevelImageChannel( Image *image, const ChannelType channel,
    +                                  const double black_point, const double mid_point,
    +                                  const double white_point );
    +
    +
    +
    image:
    +
    The image.
    +
    channel:
    +
    Identify which channel to level: Red, Cyan, Green, Magenta, +Blue, Yellow, Opacity, or All.
    +
    black_point, mid_point, white_point:
    +
    Specify the levels where the black +and white points have the range of 0-MaxRGB, and mid has the range 0-10.
    +
    +
    +
    +
    +

    ModulateImage

    +
    +

    Synopsis

    +
    +unsigned int ModulateImage( Image *image, const char *modulate );
    +
    +
    +
    +

    Description

    +

    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).

    +

    The format of the ModulateImage method is:

    +
    +unsigned int ModulateImage( Image *image, const char *modulate );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    modulate:
    +
    Define the percent change in brightness, saturation, and +hue.
    +
    +
    +
    +
    +

    NegateImage

    +
    +

    Synopsis

    +
    +unsigned int NegateImage( Image *image, const unsigned int grayscale );
    +
    +
    +
    +

    Description

    +

    Method NegateImage negates the colors in the reference image. The +Grayscale option means that only grayscale values within the image are +negated.

    +

    The format of the NegateImage method is:

    +
    +unsigned int NegateImage( Image *image, const unsigned int grayscale );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    +
    +
    +
    +

    NormalizeImage

    +
    +

    Synopsis

    +
    +unsigned int NormalizeImage( Image *image );
    +
    +
    +
    +

    Description

    +

    The NormalizeImage() method enhances the contrast of a color image by +adjusting the pixels color to span the entire range of colors available.

    +

    The format of the NormalizeImage method is:

    +
    +unsigned int NormalizeImage( Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    +
    +
    +
    + + diff --git a/www/api/error.html b/www/api/error.html index 630ef50..42f7c63 100644 --- a/www/api/error.html +++ b/www/api/error.html @@ -3,7 +3,7 @@ - + error @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -210,7 +210,7 @@ void MagickFatalError( const void MagickFatalError( const ExceptionType error, const char *reason, const char *description ); @@ -419,5 +419,10 @@ void ThrowLoggedException( +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/error.html.orig b/www/api/error.html.orig new file mode 100644 index 0000000..c2b8a08 --- /dev/null +++ b/www/api/error.html.orig @@ -0,0 +1,423 @@ + + + + + + +error + + + + + + + +
    +

    error

    +

    Error reporting methods

    + + +
    +

    CatchException

    +
    +

    Synopsis

    +
    +CatchException( const ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the CatchException method is:

    +
    +CatchException( const ExceptionInfo *exception );
    +
    +

    A description of each parameter follows:

    +
    +
    exception:
    +
    The exception info.
    +
    +
    +
    +
    +

    CopyException

    +
    +

    Synopsis

    +
    +void CopyException( ExceptionInfo *copy, const ExceptionInfo *original );
    +
    +
    +
    +

    Description

    +

    CopyException() copies exception data from one ExceptionInfo structure +to another.

    +

    The format of the CopyException method is:

    +
    +void CopyException( ExceptionInfo *copy, const ExceptionInfo *original );
    +
    +

    A description of each parameter follows:

    +
    +
    copy:
    +
    The exception to copy to.
    +
    original:
    +
    The exception to copy from.
    +
    +
    +
    +
    +

    DestroyExceptionInfo

    +
    +

    Synopsis

    +
    +void DestroyExceptionInfo( ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    DestroyExceptionInfo() deallocates memory associated with exception.

    +

    The format of the DestroyExceptionInfo method is:

    +
    +void DestroyExceptionInfo( ExceptionInfo *exception );
    +
    +

    A description of each parameter follows:

    +
    +
    exception:
    +
    The exception info.
    +
    +
    +
    +
    +

    GetExceptionInfo

    +
    +

    Synopsis

    +
    +GetExceptionInfo( ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    GetExceptionInfo() initializes an exception to default values.

    +

    The format of the GetExceptionInfo method is:

    +
    +GetExceptionInfo( ExceptionInfo *exception );
    +
    +

    A description of each parameter follows:

    +
    +
    exception:
    +
    The exception info.
    +
    +
    +
    +
    +

    GetLocaleExceptionMessage

    +
    +

    Synopsis

    +
    +const char *GetLocaleExceptionMessage( const ExceptionType severity, const char *tag );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the GetLocaleExceptionMessage method is:

    +
    +const char *GetLocaleExceptionMessage( const ExceptionType severity, const char *tag );
    +
    +
    +
    severity:
    +
    the severity of the exception.
    +
    tag:
    +
    the message tag.
    +
    +
    +
    +
    +

    MagickError

    +
    +

    Synopsis

    +
    +void MagickError( const ExceptionType error, const char *reason, const char *description );
    +
    +
    +
    +

    Description

    +

    Method MagickError calls the error handler methods with an error reason.

    +

    The format of the MagickError method is:

    +
    +void MagickError( const ExceptionType error, const char *reason, const char *description );
    +
    +
    +
    exception:
    +
    Specifies the numeric error category.
    +
    reason:
    +
    Specifies the reason to display before terminating the +program.
    +
    description:
    +
    Specifies any description to the reason.
    +
    +
    +
    +
    +

    MagickFatalError

    +
    +

    Synopsis

    +
    +void MagickFatalError( const ExceptionType error, const char *reason,
    +                       const char *description );
    +
    +
    +
    +

    Description

    +

    MagickFatalError() calls the fatal error handler methods with an error +reason. The fatal error handler is not expected to return!

    +

    The format of the MagickError method is:

    +
    +void MagickFatalError( const ExceptionType error, const char *reason,
    +                       const char *description );
    +
    +
    +
    exception:
    +
    Specifies the numeric error category.
    +
    reason:
    +
    Specifies the reason to display before terminating the +program.
    +
    description:
    +
    Specifies any description to the reason.
    +
    +
    +
    +
    +

    MagickWarning

    +
    +

    Synopsis

    +
    +void MagickWarning( const ExceptionType warning, const char *reason,
    +                    const char *description );
    +
    +
    +
    +

    Description

    +

    Method MagickWarning calls the warning handler methods with a warning +reason.

    +

    The format of the MagickWarning method is:

    +
    +void MagickWarning( const ExceptionType warning, const char *reason,
    +                    const char *description );
    +
    +
    +
    warning:
    +
    The warning severity.
    +
    reason:
    +
    Define the reason for the warning.
    +
    description:
    +
    Describe the warning.
    +
    +
    +
    +
    +

    SetErrorHandler

    +
    +

    Synopsis

    +
    +ErrorHandler SetErrorHandler( ErrorHandler handler );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the SetErrorHandler method is:

    +
    +ErrorHandler SetErrorHandler( ErrorHandler handler );
    +
    +

    A description of each parameter follows:

    +
    +
    handler:
    +
    The method to handle errors.
    +
    +
    +
    +
    +

    SetExceptionInfo

    +
    +

    Synopsis

    +
    +SetExceptionInfo( ExceptionInfo *exception, ExceptionType severity );
    +
    +
    +
    +

    Description

    +

    SetExceptionInfo() set the exception severity.

    +

    The format of the SetExceptionInfo method is:

    +
    +SetExceptionInfo( ExceptionInfo *exception, ExceptionType severity );
    +
    +

    A description of each parameter follows:

    +
    +
    exception:
    +
    The exception info.
    +
    severity:
    +
    The exception severity.
    +
    +
    +
    +
    +

    SetFatalErrorHandler

    +
    +

    Synopsis

    +
    +FatalErrorHandler SetFatalErrorHandler( FatalErrorHandler handler );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the SetFatalErrorHandler method is:

    +
    +FatalErrorHandler SetFatalErrorHandler( FatalErrorHandler handler );
    +
    +

    A description of each parameter follows:

    +
    +
    handler:
    +
    The method to handle errors.
    +
    +
    +
    +
    +

    SetWarningHandler

    +
    +

    Synopsis

    +
    +ErrorHandler SetWarningHandler( ErrorHandler handler );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the SetWarningHandler method is:

    +
    +ErrorHandler SetWarningHandler( ErrorHandler handler );
    +
    +

    A description of each parameter follows:

    +
    +
    handler:
    +
    The method to handle warnings.
    +
    +
    +
    +
    +

    ThrowException

    +
    +

    Synopsis

    +
    +void ThrowException( ExceptionInfo *exception, const ExceptionType severity,
    +                     const char *reason, const char *description );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the ThrowException method is:

    +
    +void ThrowException( ExceptionInfo *exception, const ExceptionType severity,
    +                     const char *reason, const char *description );
    +
    +
    +
    exception:
    +
    The exception.
    +
    severity:
    +
    The severity of the exception.
    +
    reason:
    +
    The reason of the exception.
    +
    description:
    +
    The exception description.
    +
    +
    +
    +
    +

    ThrowLoggedException

    +
    +

    Synopsis

    +
    +void ThrowLoggedException( ExceptionInfo *exception, const ExceptionType severity,
    +                           const char *reason, const char *description, const char *module,
    +                           const char *function, const unsigned long line ;
    +
    +
    +
    +

    Description

    +

    ThrowLoggedException() throws an exception with the specified severity code, +reason, optional description, source filename, function name, and line +number. If logging is enabled, the exception is also logged.

    +

    If the exception already contains an ErrorException (or greater) or the +existing exception is more severe, then it is ignored.

    +

    The format of the ThrowLoggedException method is:

    +
    +void ThrowLoggedException( ExceptionInfo *exception, const ExceptionType severity,
    +                           const char *reason, const char *description, const char *module,
    +                           const char *function, const unsigned long line ;
    +
    +
    +
    exception:
    +
    The exception.
    +
    severity:
    +
    The severity of the exception.
    +
    reason:
    +
    The reason of the exception.
    +
    description:
    +
    The exception description.
    +
    filename:
    +
    The source module filename.
    +
    function:
    +
    The function name.
    +
    line:
    +
    The line number of the source module.
    +
    +
    +
    +
    + + diff --git a/www/api/export.html b/www/api/export.html index 9bfa8f1..4019ad1 100644 --- a/www/api/export.html +++ b/www/api/export.html @@ -3,7 +3,7 @@ - + export @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Export image pixels into common representations

    -

    Contents

    +

    Contents

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/export.html.orig b/www/api/export.html.orig new file mode 100644 index 0000000..386b4f0 --- /dev/null +++ b/www/api/export.html.orig @@ -0,0 +1,184 @@ + + + + + + +export + + + + + + + +
    +

    export

    +

    Export image pixels into common representations

    + + +
    +

    ExportImagePixelArea

    +
    +

    Synopsis

    +
    +MagickPassFail ExportImagePixelArea( const Image *image, const QuantumType quantum_type,
    +                                     unsigned int quantum_size, unsigned char *destination,
    +                                     const ExportPixelAreaOptions *options,
    +                                     ExportPixelAreaInfo *export_info );
    +
    +
    +
    +

    Description

    +

    ExportImagePixelArea() transfers one or more pixel components from the +default image pixel cache view to a user supplied buffer. By default, +values are written in network (big-endian) byte/bit order. By setting +the 'endian' member of ExportPixelAreaOptions, 16, 32 and 64-bit values +may be output as little (LSBEndian), big (MSBEndian), or host native +(NativeEndian) endian values. This function is quite powerful in that +besides common native CPU type sizes, it can support any integer bit +depth from 1 to 32 (e.g. 13), 64-bits as well as 32 and 64-bit float.

    +

    MagickPass is returned if the pixels are successfully transferred, +otherwise MagickFail.

    +

    The format of the ExportImagePixelArea method is:

    +
    +MagickPassFail ExportImagePixelArea( const Image *image, const QuantumType quantum_type,
    +                                     unsigned int quantum_size, unsigned char *destination,
    +                                     const ExportPixelAreaOptions *options,
    +                                     ExportPixelAreaInfo *export_info );
    +
    +
    +
    status:
    +
    Returns MagickPass if the pixels are successfully transferred, +otherwise MagickFail.
    +
    image:
    +
    The image.
    +
    quantum_type:
    +
    Declare which pixel components to transfer (AlphaQuantum, +BlackQuantum, BlueQuantum, CMYKAQuantum, CMYKQuantum, CyanQuantum, +GrayAlphaQuantum, GrayQuantum, GreenQuantum, IndexAlphaQuantum, +IndexQuantum, MagentaQuantum, RGBAQuantum, RGBQuantum, +RedQuantum, YellowQuantum)
    +
    quantum_size:
    +
    Bits per quantum sample (range 1-32, and 64).
    +
    destination:
    +
    The components are transferred to this buffer. The user +is responsible for ensuring that the destination buffer is large +enough.
    +
    options:
    +
    Additional options specific to quantum_type (may be NULL).
    +
    export_info :
    +
    Populated with information regarding the pixels +exported (may be NULL)
    +
    +
    +
    +
    +

    ExportViewPixelArea

    +
    +

    Synopsis

    +
    +MagickPassFail ExportViewPixelArea( const ViewInfo *view, const QuantumType quantum_type,
    +                                    unsigned int quantum_size, unsigned char *destination,
    +                                    const ExportPixelAreaOptions *options,
    +                                    ExportPixelAreaInfo *export_info );
    +
    +
    +
    +

    Description

    +

    ExportViewPixelArea() transfers one or more pixel components from the +specified image pixel cache view to a user supplied buffer. By default, +values are written in network (big-endian) byte/bit order. By setting the +'endian' member of ExportPixelAreaOptions, 16, 32 and 64-bit values may be +output as little (LSBEndian), big (MSBEndian), or host native +(NativeEndian) endian values. This function is quite powerful in that +besides common native CPU type sizes, it can support any integer bit depth +from 1 to 32 (e.g. 13), 64-bits as well as 32 and 64-bit float.

    +

    MagickPass is returned if the pixels are successfully transferred, +otherwise MagickFail.

    +

    The format of the ExportViewPixelArea method is:

    +
    +MagickPassFail ExportViewPixelArea( const ViewInfo *view, const QuantumType quantum_type,
    +                                    unsigned int quantum_size, unsigned char *destination,
    +                                    const ExportPixelAreaOptions *options,
    +                                    ExportPixelAreaInfo *export_info );
    +
    +
    +
    status:
    +
    Returns MagickPass if the pixels are successfully transferred, +otherwise MagickFail.
    +
    view:
    +
    The image pixel cache view.
    +
    quantum_type:
    +
    Declare which pixel components to transfer (AlphaQuantum, +BlackQuantum, BlueQuantum, CMYKAQuantum, CMYKQuantum, CyanQuantum, +GrayAlphaQuantum, GrayQuantum, GreenQuantum, IndexAlphaQuantum, +IndexQuantum, MagentaQuantum, RGBAQuantum, RGBQuantum, +RedQuantum, YellowQuantum)
    +
    quantum_size:
    +
    Bits per quantum sample (range 1-32, and 64).
    +
    destination:
    +
    The components are transferred to this buffer. The user +is responsible for ensuring that the destination buffer is large +enough.
    +
    options:
    +
    Additional options specific to quantum_type (may be NULL).
    +
    export_info :
    +
    Populated with information regarding the pixels +exported (may be NULL)
    +
    +
    +
    +
    +

    ExportPixelAreaOptionsInit

    +
    +

    Synopsis

    +
    +void ExportPixelAreaOptionsInit( ExportPixelAreaOptions *options );
    +
    +
    +
    +

    Description

    +

    ExportPixelAreaOptionsInit() initializes the options structure which is +optionally passed to ExportPixelArea()

    +

    The format of the ExportPixelAreaOptionsInit method is:

    +
    +void ExportPixelAreaOptionsInit( ExportPixelAreaOptions *options );
    +
    +

    A description of each parameter follows:

    +
    +
    options:
    +
    Options structure to initialize.
    +
    +
    +
    +
    + + diff --git a/www/api/fx.html b/www/api/fx.html index 292f788..93973f2 100644 --- a/www/api/fx.html +++ b/www/api/fx.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -406,5 +406,10 @@ sine wave.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/fx.html.orig b/www/api/fx.html.orig new file mode 100644 index 0000000..bee0aba --- /dev/null +++ b/www/api/fx.html.orig @@ -0,0 +1,410 @@ + + + + + + +fx + + + + + + + +
    +

    fx

    +

    Image special effects methods

    + + +
    +

    CharcoalImage

    +
    +

    Synopsis

    +
    +Image *CharcoalImage( const Image *image, const double radius, const double sigma,
    +                      ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    Method CharcoalImage creates a new image that is a copy of an existing +one with the edge highlighted. It allocates the memory necessary for the +new Image structure and returns a pointer to the new image.

    +

    The format of the CharcoalImage method is:

    +
    +Image *CharcoalImage( const Image *image, const double radius, const double sigma,
    +                      ExceptionInfo *exception );
    +
    +
    +
    charcoal_image:
    +
    Method CharcoalImage returns a pointer to the image +after it is embossed. A null image is returned if there is a memory +shortage.
    +
    image:
    +
    The image.
    +
    radius:
    +
    the radius of the pixel neighborhood.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ColorizeImage

    +
    +

    Synopsis

    +
    +Image *ColorizeImage( const Image *image, const char *opacity,
    +                      const PixelPacket target, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    ColorizeImage() blends the fill color with each pixel in the image. +A percentage blend is specified with opacity. Control the application +of different color components by specifying a different percentage for +each component (e.g. 90/100/10 is 90% red, 100% green, and 10% blue).

    +

    The format of the ColorizeImage method is:

    +
    +Image *ColorizeImage( const Image *image, const char *opacity,
    +                      const PixelPacket target, ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    opacity:
    +
    A character string indicating the level of opacity as a +percentage.
    +
    target:
    +
    A color value.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ColorMatrixImage

    +
    +

    Synopsis

    +
    +MagickPassFail ColorMatrixImage( Image *image, const unsigned int order,
    +                                 const double *color_matrix );
    +
    +
    +
    +

    Description

    +

    ColorMatrixImage() applies a color matrix to the image channels. The +user supplied matrix may be of order 1 to 5 (1x1 through 5x5) and is +used to update the default identity matrix:

    +

    1 0 0 0 0 +0 1 0 0 0 +0 0 1 0 0 +0 0 0 1 0 +0 0 0 0 1

    +

    where the first four columns represent the ratio of the color (red, +green, blue) and opacity components incorporated in the output summation. +The first four rows represent the summations for red, green, blue, and +opacity. The last row is a dummy row and is not used. The last column +represents a constant value (expressed as a ratio of MaxRGB) to be +added to the row summation. The following is a summary of how the +matrix is applied:

    +

    r' = r*m[0,0] + g*m[1,0] + b*m[2,0] + o*m[3,0] + MaxRGB*m[4,0] +g' = r*m[0,1] + g*m[1,1] + b*m[2,1] + o*m[3,1] + MaxRGB*m[4,1] +b' = r*m[0,2] + g*m[1,2] + b*m[2,2] + o*m[3,2] + MaxRGB*m[4,2] +o' = r*m[0,3] + g*m[1,3] + b*m[2,3] + o*m[3,3] + MaxRGB*m[4,3]

    +

    The format of the ColorMatrixImage method is:

    +
    +MagickPassFail ColorMatrixImage( Image *image, const unsigned int order,
    +                                 const double *color_matrix );
    +
    +
    +
    image:
    +
    The image.
    +
    order:
    +
    The number of columns and rows in the filter kernel.
    +
    matrix:
    +
    An array of double representing the matrix
    +
    +
    +
    +
    +

    ImplodeImage

    +
    +

    Synopsis

    +
    +Image *ImplodeImage( const Image *image, const double amount,
    +                     ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    Method ImplodeImage creates a new image that is a copy of an existing +one with the image pixels "implode" by the specified percentage. It +allocates the memory necessary for the new Image structure and returns a +pointer to the new image.

    +

    The format of the ImplodeImage method is:

    +
    +Image *ImplodeImage( const Image *image, const double amount,
    +                     ExceptionInfo *exception );
    +
    +
    +
    implode_image:
    +
    Method ImplodeImage returns a pointer to the image +after it is implode. A null image is returned if there is a memory +shortage.
    +
    image:
    +
    The image.
    +
    amount:
    +
    Define the extent of the implosion.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    MorphImages

    +
    +

    Synopsis

    +
    +Image *MorphImages( const Image *image, const unsigned long number_frames,
    +                    ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    The MorphImages() method requires a minimum of two images. The first +image is transformed into the second by a number of intervening images +as specified by frames.

    +

    The format of the MorphImage method is:

    +
    +Image *MorphImages( const Image *image, const unsigned long number_frames,
    +                    ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    number_frames:
    +
    Define the number of in-between image to generate. +The more in-between frames, the smoother the morph.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    OilPaintImage

    +
    +

    Synopsis

    +
    +Image *OilPaintImage( const Image *image, const double radius,
    +                      ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    OilPaintImage() applies a special effect filter that simulates an oil +painting. Each pixel is replaced by the most frequent color occurring +in a circular region defined by radius.

    +

    The format of the OilPaintImage method is:

    +
    +Image *OilPaintImage( const Image *image, const double radius,
    +                      ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    radius:
    +
    The radius of the circular neighborhood.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    SolarizeImage

    +
    +

    Synopsis

    +
    +unsigned int SolarizeImage( Image *image, const double threshold );
    +
    +
    +
    +

    Description

    +

    SolarizeImage() applies a special effect to the image, similar to the effect +achieved in a photo darkroom by selectively exposing areas of photo +sensitive paper to light. Threshold ranges from 0 to MaxRGB and is a +measure of the extent of the solarization. False is returned if an error +is encountered.

    +

    The format of the SolarizeImage method is:

    +
    +unsigned int SolarizeImage( Image *image, const double threshold );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    threshold:
    +
    Define the extent of the solarization.
    +
    +
    +
    +
    +

    SteganoImage

    +
    +

    Synopsis

    +
    +Image *SteganoImage( const Image *image, Image *watermark,
    +                     ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    Use SteganoImage() to hide a digital watermark within the image. +Recover the hidden watermark later to prove that the authenticity of +an image. Offset defines the start position within the image to hide +the watermark.

    +

    The format of the SteganoImage method is:

    +
    +Image *SteganoImage( const Image *image, Image *watermark,
    +                     ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    watermark:
    +
    The watermark image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    StereoImage

    +
    +

    Synopsis

    +
    +Image *StereoImage( const Image *image, const Image *offset_image,
    +                    ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    StereoImage() combines two images and produces a single image that is the +composite of a left and right image of a stereo pair. Special red-green +stereo glasses are required to view this effect.

    +

    The format of the StereoImage method is:

    +
    +Image *StereoImage( const Image *image, const Image *offset_image,
    +                    ExceptionInfo *exception );
    +
    +
    +
    stereo_image:
    +
    Method StereoImage returns a pointer to the stereo +image. A null image is returned if there is a memory shortage.
    +
    image:
    +
    The image.
    +
    offset_image:
    +
    Another image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    SwirlImage

    +
    +

    Synopsis

    +
    +Image *SwirlImage( const Image *image, double degrees, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    SwirlImage() swirls the pixels about the center of the image, where +degrees indicates the sweep of the arc through which each pixel is moved. +You get a more dramatic effect as the degrees move from 1 to 360.

    +

    The format of the SwirlImage method is:

    +
    +Image *SwirlImage( const Image *image, double degrees, ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    degrees:
    +
    Define the tightness of the swirling effect.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    WaveImage

    +
    +

    Synopsis

    +
    +Image *WaveImage( const Image *image, const double amplitude, const double wave_length,
    +                  ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    The WaveImage() filter creates a "ripple" effect in the image by shifting +the pixels vertically along a sine wave whose amplitude and wavelength +is specified by the given parameters.

    +

    The format of the WaveImage method is:

    +
    +Image *WaveImage( const Image *image, const double amplitude, const double wave_length,
    +                  ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    amplitude, frequency:
    +
    Define the amplitude and wave_length of the +sine wave.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    + + diff --git a/www/api/hclut.html b/www/api/hclut.html index 1cc9ae9..9dc6b1a 100644 --- a/www/api/hclut.html +++ b/www/api/hclut.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -84,5 +84,10 @@ MagickPassFail HaldClutImage( +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/hclut.html.orig b/www/api/hclut.html.orig new file mode 100644 index 0000000..54ad0dd --- /dev/null +++ b/www/api/hclut.html.orig @@ -0,0 +1,88 @@ + + + + + + +hclut + + + + + + + +
    +

    hclut

    +

    Apply Hald CLUT to image

    + +
    +

    Contents

    + +
    +
    +

    HaldClutImage

    +
    +

    Synopsis

    +
    +MagickPassFail HaldClutImage( Image *image, const Image *clut );
    +
    +
    +
    +

    Description

    +

    The HaldClutImage() method apply a color lookup table (Hald CLUT) to the +image. The fundamental principle of the Hald CLUT algorithm is that +application of an identity CLUT causes no change to the input image, +but an identity CLUT image which has had its colors transformed in +some way (e.g. in Adobe Photoshop) may be used to implement an identical +transform on any other image.

    +

    The minimum CLUT level is 2, and the maximum depends on available memory +(largest successfully tested is 24). A CLUT image is required to have equal +width and height. A CLUT of level 8 is an image of dimension 512x512, a CLUT +of level 16 is an image of dimension 4096x4096. Interpolation is used so +extremely large CLUT images are not required.

    +

    GraphicsMagick provides an 'identity' coder which may be used to generate +identity HLUTs. For example, reading from "identity:8" creates an identity +CLUT of order 8.

    +

    The Hald CLUT algorithm has been developed by Eskil Steenberg as described +at http://www.quelsolaar.com/technology/clut.html, and was adapted for +GraphicsMagick by Clément Follet with support from Cédric Lejeune of +Workflowers.

    +

    The format of the HaldClutImage method is:

    +
    +MagickPassFail HaldClutImage( Image *image, const Image *clut );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    clut:
    +
    The color lookup table image
    +
    +
    +
    +
    + + diff --git a/www/api/image.html b/www/api/image.html index e9ad14f..857d0c6 100644 --- a/www/api/image.html +++ b/www/api/image.html @@ -3,7 +3,7 @@ - + image @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Miscellaneous image methods

    -

    Contents

    +

    Contents

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/import.html.orig b/www/api/import.html.orig new file mode 100644 index 0000000..efaf8f7 --- /dev/null +++ b/www/api/import.html.orig @@ -0,0 +1,184 @@ + + + + + + +import + + + + + + + +
    +

    import

    +

    Import image pixels from common representations

    + + +
    +

    ImportImagePixelArea

    +
    +

    Synopsis

    +
    +MagickPassFail ImportImagePixelArea( Image *image, const QuantumType quantum_type,
    +                                     const unsigned int quantum_size,
    +                                     const unsigned char *source,
    +                                     const ImportPixelAreaOptions *options,
    +                                     ImportPixelAreaInfo *import_info );
    +
    +
    +
    +

    Description

    +

    ImportImagePixelArea() transfers one or more pixel components from a user +supplied buffer into the default image pixel cache view. By default, +values are read in network (big-endian) byte/bit order. By setting the +'endian' member of ExportPixelAreaOptions, 16, 32 and 64-bit values may +be output as little (LSBEndian), big (MSBEndian), or host native +(NativeEndian) endian values. This function is quite powerful in that +besides common native CPU type sizes, it can support any integer bit +depth from 1 to 32 (e.g. 13), 64-bits, as well as 32 and 64-bit float.

    +

    MagickPass is returned if the pixels are successfully transferred, +otherwise MagickFail.

    +

    The format of the ImportImagePixelArea method is:

    +
    +MagickPassFail ImportImagePixelArea( Image *image, const QuantumType quantum_type,
    +                                     const unsigned int quantum_size,
    +                                     const unsigned char *source,
    +                                     const ImportPixelAreaOptions *options,
    +                                     ImportPixelAreaInfo *import_info );
    +
    +
    +
    status:
    +
    Method PushImagePixels returns MagickPass if the pixels are +successfully transferred, otherwise MagickFail.
    +
    image:
    +
    The image.
    +
    quantum_type:
    +
    Declare which pixel components to transfer (AlphaQuantum, +BlackQuantum, BlueQuantum, CMYKAQuantum, CMYKQuantum, CyanQuantum, +GrayAlphaQuantum, GrayQuantum, GreenQuantum, IndexAlphaQuantum, +IndexQuantum, MagentaQuantum, RGBAQuantum, RGBQuantum, +RedQuantum, YellowQuantum)
    +
    quantum_size:
    +
    Bits per quantum sample (range 1-32, and 64).
    +
    source:
    +
    The pixel components are transferred from this buffer.
    +
    options:
    +
    Additional options specific to quantum_type (may be NULL).
    +
    import_info :
    +
    Populated with information regarding the pixels +imported (may be NULL)
    +
    +
    +
    +
    +

    ImportViewPixelArea

    +
    +

    Synopsis

    +
    +MagickPassFail ImportViewPixelArea( ViewInfo *view, const QuantumType quantum_type,
    +                                    const unsigned int quantum_size,
    +                                    const unsigned char *source,
    +                                    const ImportPixelAreaOptions *options,
    +                                    ImportPixelAreaInfo *import_info );
    +
    +
    +
    +

    Description

    +

    ImportViewPixelArea() transfers one or more pixel components from a user +supplied buffer into the specified image pixel cache view of an image. By +default, values are read in network (big-endian) byte/bit order. By +setting the 'endian' member of ExportPixelAreaOptions, 16, 32 and 64-bit +values may be output as little (LSBEndian), big (MSBEndian), or host +native (NativeEndian) endian values. This function is quite powerful in +that besides common native CPU type sizes, it can support any integer bit +depth from 1 to 32 (e.g. 13), 64-bits, as well as 32 and 64-bit float.

    +

    MagickPass is returned if the pixels are successfully transferred, +otherwise MagickFail.

    +

    The format of the ImportViewPixelArea method is:

    +
    +MagickPassFail ImportViewPixelArea( ViewInfo *view, const QuantumType quantum_type,
    +                                    const unsigned int quantum_size,
    +                                    const unsigned char *source,
    +                                    const ImportPixelAreaOptions *options,
    +                                    ImportPixelAreaInfo *import_info );
    +
    +
    +
    status:
    +
    Method PushImagePixels returns MagickPass if the pixels are +successfully transferred, otherwise MagickFail.
    +
    view:
    +
    The pixel view to import pixels into.
    +
    quantum_type:
    +
    Declare which pixel components to transfer (AlphaQuantum, +BlackQuantum, BlueQuantum, CMYKAQuantum, CMYKQuantum, CyanQuantum, +GrayAlphaQuantum, GrayQuantum, GreenQuantum, IndexAlphaQuantum, +IndexQuantum, MagentaQuantum, RGBAQuantum, RGBQuantum, +RedQuantum, YellowQuantum)
    +
    quantum_size:
    +
    Bits per quantum sample (range 1-32, and 64).
    +
    source:
    +
    The pixel components are transferred from this buffer.
    +
    options:
    +
    Additional options specific to quantum_type (may be NULL).
    +
    import_info :
    +
    Populated with information regarding the pixels +imported (may be NULL)
    +
    +
    +
    +
    +

    ImportPixelAreaOptionsInit

    +
    +

    Synopsis

    +
    +void ImportPixelAreaOptionsInit( ImportPixelAreaOptions *options );
    +
    +
    +
    +

    Description

    +

    ImportPixelAreaOptionsInit() initializes the options structure which is +optionally passed to ImportPixelArea()

    +

    The format of the ImportPixelAreaOptionsInit method is:

    +
    +void ImportPixelAreaOptionsInit( ImportPixelAreaOptions *options );
    +
    +

    A description of each parameter follows:

    +
    +
    options:
    +
    Options structure to initialize.
    +
    +
    +
    +
    + + diff --git a/www/api/list.html b/www/api/list.html index 67f7643..a879a4a 100644 --- a/www/api/list.html +++ b/www/api/list.html @@ -3,7 +3,7 @@ - + list @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Image list support

    -

    Contents

    +

    Contents

    • AppendImageToList
    • CloneImageList
    • @@ -544,5 +544,10 @@ SpliceImageIntoList( +
      +

      Copyright © GraphicsMagick Group 2002 - 2020

      +
      diff --git a/www/api/list.html.orig b/www/api/list.html.orig new file mode 100644 index 0000000..993abe4 --- /dev/null +++ b/www/api/list.html.orig @@ -0,0 +1,548 @@ + + + + + + +list + + + + + + + +
      +

      list

      +

      Image list support

      + + +
      +

      AppendImageToList

      +
      +

      Synopsis

      +
      +AppendImageToList( Image ** images, Image *image );
      +
      +
      +
      +

      Description

      +

      AppendImageToList() appends an image to the end of the list.

      +

      The format of the AppendImageToList method is:

      +
      +AppendImageToList( Image ** images, Image *image );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      image:
      +
      The image.
      +
      +
      +
      +
      +

      CloneImageList

      +
      +

      Synopsis

      +
      +Image *CloneImageList( const Image *images, ExceptionInfo *exception );
      +
      +
      +
      +

      Description

      +

      CloneImageList() returns a duplicate of the image list.

      +

      The format of the CloneImageList method is:

      +
      +Image *CloneImageList( const Image *images, ExceptionInfo *exception );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      exception:
      +
      Return any errors or warnings in this structure.
      +
      +
      +
      +
      +

      DeleteImageFromList

      +
      +

      Synopsis

      +
      +DeleteImageFromList( Image ** images );
      +
      +
      +
      +

      Description

      +

      DeleteImageFromList() deletes an image from the list.

      +

      The format of the DeleteImageFromList method is:

      +
      +DeleteImageFromList( Image ** images );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      +
      +
      +
      +

      DestroyImageList

      +
      +

      Synopsis

      +
      +void DestroyImageList( Image *image );
      +
      +
      +
      +

      Description

      +

      DestroyImageList() destroys an image list. There is no effect if the +image pointer is null.

      +

      The format of the DestroyImageList method is:

      +
      +void DestroyImageList( Image *image );
      +
      +

      A description of each parameter follows:

      +
      +
      image:
      +
      The image sequence.
      +
      +
      +
      +
      +

      GetFirstImageInList

      +
      +

      Synopsis

      +
      +Image *GetFirstImageInList( const Image *images );
      +
      +
      +
      +

      Description

      +

      GetFirstImageInList() returns a pointer to the first image in the list

      +

      The format of the GetFirstImageInList method is:

      +
      +Image *GetFirstImageInList( const Image *images );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      +
      +
      +
      +

      GetImageFromList

      +
      +

      Synopsis

      +
      +Image *GetImageFromList( const Image *images, const long offset );
      +
      +
      +
      +

      Description

      +

      GetImageFromList() returns an image at the specified offset from the list.

      +

      The format of the GetImageFromList method is:

      +
      +Image *GetImageFromList( const Image *images, const long offset );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      offset:
      +
      The position within the list.
      +
      +
      +
      +
      +

      GetImageIndexInList

      +
      +

      Synopsis

      +
      +long GetImageIndexInList( const Image *images );
      +
      +
      +
      +

      Description

      +

      GetImageIndexInList() returns the offset in the list of the specified image.

      +

      The format of the GetImageIndexInList method is:

      +
      +long GetImageIndexInList( const Image *images );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      +
      +
      +
      +

      GetImageListLength

      +
      +

      Synopsis

      +
      +unsigned long GetImageListLength( const Image *images );
      +
      +
      +
      +

      Description

      +

      GetImageListLength() returns the length of the list (the number of images in +the list).

      +

      The format of the GetImageListLength method is:

      +
      +unsigned long GetImageListLength( const Image *images );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      +
      +
      +
      +

      GetLastImageInList

      +
      +

      Synopsis

      +
      +Image *GetLastImageInList( const Image *images );
      +
      +
      +
      +

      Description

      +

      GetLastImageInList() returns a pointer to the last image in the list

      +

      The format of the GetLastImageInList method is:

      +
      +Image *GetLastImageInList( const Image *images );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      +
      +
      +
      +

      GetNextImageInList

      +
      +

      Synopsis

      +
      +Image *GetNextImageInList( const Image *images );
      +
      +
      +
      +

      Description

      +

      GetNextImageInList() returns the next image in the list.

      +

      The format of the GetNextImageInList method is:

      +
      +Image *GetNextImageInList( const Image *images );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      +
      +
      +
      +

      GetPreviousImageInList

      +
      +

      Synopsis

      +
      +Image *GetPreviousImageInList( const Image *images );
      +
      +
      +
      +

      Description

      +

      GetPreviousImageInList() returns the previous image in the list.

      +

      The format of the GetPreviousImageInList method is:

      +
      +Image *GetPreviousImageInList( const Image *images );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      +
      +
      +
      +

      ImageListToArray

      +
      +

      Synopsis

      +
      +Image ** ImageListToArray( const Image *images, ExceptionInfo *exception );
      +
      +
      +
      +

      Description

      +

      ImageListToArray() is a convenience method that converts an image list to +a sequential array. For example,

      +

      group = ImageListToArray(images, exception); +for (i = 0; i < n; i++) +puts(group[i]->filename);

      +

      The format of the ImageListToArray method is:

      +
      +Image ** ImageListToArray( const Image *images, ExceptionInfo *exception );
      +
      +

      A description of each parameter follows:

      +
      +
      image:
      +
      The image list.
      +
      exception:
      +
      Return any errors or warnings in this structure.
      +
      +
      +
      +
      +

      InsertImageInList

      +
      +

      Synopsis

      +
      +InsertImageInList( Image ** images, Image *image );
      +
      +
      +
      +

      Description

      +

      InsertImageInList() inserts an image in the list.

      +

      The format of the InsertImageInList method is:

      +
      +InsertImageInList( Image ** images, Image *image );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      image:
      +
      The image.
      +
      +
      +
      +
      +

      NewImageList

      +
      +

      Synopsis

      +
      +Image *NewImageList( void );
      +
      +
      +
      +

      Description

      +

      NewImageList() creates an empty image list.

      +

      The format of the NewImageList method is:

      +
      +Image *NewImageList( void );
      +
      +
      +
      +
      +

      PrependImageToList

      +
      +

      Synopsis

      +
      +PrependImageToList( Image *images, Image *image );
      +
      +
      +
      +

      Description

      +

      PrependImageToList() prepends the image to the beginning of the list.

      +

      The format of the PrependImageToList method is:

      +
      +PrependImageToList( Image *images, Image *image );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      image:
      +
      The image.
      +
      +
      +
      +
      +

      RemoveFirstImageFromList

      +
      +

      Synopsis

      +
      +Image *RemoveFirstImageFromList( Image ** images );
      +
      +
      +
      +

      Description

      +

      RemoveFirstImageFromList() removes an image from the beginning of the list.

      +

      The format of the RemoveFirstImageFromList method is:

      +
      +Image *RemoveFirstImageFromList( Image ** images );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      +
      +
      +
      +

      RemoveLastImageFromList

      +
      +

      Synopsis

      +
      +Image *RemoveLastImageFromList( Image ** images );
      +
      +
      +
      +

      Description

      +

      RemoveLastImageFromList() removes the last image from the list.

      +

      The format of the RemoveLastImageFromList method is:

      +
      +Image *RemoveLastImageFromList( Image ** images );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      +
      +
      +
      +

      ReplaceImageInList

      +
      +

      Synopsis

      +
      +ReplaceImageInList( Image ** images, Image *image );
      +
      +
      +
      +

      Description

      +

      ReplaceImageInList() replaces an image in the list.

      +

      The format of the ReplaceImageInList method is:

      +
      +ReplaceImageInList( Image ** images, Image *image );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      image:
      +
      The image.
      +
      +
      +
      +
      +

      ReverseImageList

      +
      +

      Synopsis

      +
      +ReverseImageList( const Image ** images );
      +
      +
      +
      +

      Description

      +

      ReverseImageList() reverses the image list.

      +

      The format of the ReverseImageList method is:

      +
      +ReverseImageList( const Image ** images );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      +
      +
      +
      +

      SpliceImageIntoList

      +
      +

      Synopsis

      +
      +SpliceImageIntoList( Image ** images, const unsigned long length, Image *splice );
      +
      +
      +
      +

      Description

      +

      SpliceImageIntoList() removes 'length' images from the list and replaces +them with the specified splice.

      +

      The format of the SpliceImageIntoList method is:

      +
      +SpliceImageIntoList( Image ** images, const unsigned long length, Image *splice );
      +
      +
      +
      images:
      +
      The image list.
      +
      length:
      +
      The length of the image list to remove.
      +
      splice:
      +
      Replace the removed image list with this list.
      +
      +
      +
      +
      +

      SplitImageList

      +
      +

      Synopsis

      +
      +Image *SplitImageList( Image *images );
      +
      +
      +
      +

      Description

      +

      SplitImageList() splits an image into two lists.

      +

      The format of the SplitImageList method is:

      +
      +Image *SplitImageList( Image *images );
      +
      +

      A description of each parameter follows:

      +
      +
      images:
      +
      The image list.
      +
      +
      +
      +
      + + diff --git a/www/api/log.html b/www/api/log.html new file mode 100644 index 0000000..409623a --- /dev/null +++ b/www/api/log.html @@ -0,0 +1,368 @@ + + + + + + +log + + + + + + + +
      +

      log

      +

      Event logging support

      + + +
      +

      IsEventLogging

      +
      +

      Synopsis

      +
      +MagickBool IsEventLogging( void );
      +
      +
      +
      +

      Description

      +

      IsEventLogging() returns MagickTrue if logging of events is enabled otherwise +MagickFalse. This can be used to enable logging code which is otherwise +not needed.

      +

      The format of the IsEventLogging method is:

      +
      +MagickBool IsEventLogging( void );
      +
      +
      +
      +
      +

      LogMagickEvent

      +
      +

      Synopsis

      +
      +MagickPassFail LogMagickEvent( const LogEventType type, const char *module,
      +                               const char *function, const unsigned long line,
      +                               const char *format, ... );
      +
      +
      +
      +

      Description

      +

      LogMagickEvent() logs an event as determined by the current logging +configuration. If an error occurs, MagickFail is returned otherwise +MagickPass.

      +

      The format of the LogMagickEvent method is:

      +
      +MagickPassFail LogMagickEvent( const LogEventType type, const char *module,
      +                               const char *function, const unsigned long line,
      +                               const char *format, ... );
      +
      +
      +
      type:
      +
      The event type.
      +
      filename:
      +
      The source module filename.
      +
      function:
      +
      The function name.
      +
      line:
      +
      The line number of the source module.
      +
      format:
      +
      The output format.
      +
      +
      +
      +
      +

      SetLogDefaultEventType

      +
      +

      Synopsis

      +
      +void SetLogDefaultEventType( const char *events );
      +
      +
      +
      +

      Description

      +

      SetLogDefaultEventType() accepts a comma-delimited list (Annotate, Blob, +Cache, Coder, Configure, Deprecate, Error, Exception, FatalError, +Information, Locale, Option, Render, Resource, TemporaryFile, Transform, +User, Warning, or X11) that determines the default set of events to log. +All other events are ignored. By default, no logging is enabled.

      +

      This function should be called prior to InitializeMagick() since it +provides defaults used by InitializeMagick() while the logging system +is initialized. The events may be modified later after +InitializeMagick() has been called using the SetLogEventMask() function.

      +

      The format of SetLogDefaultEventType method is:

      +
      +void SetLogDefaultEventType( const char *events );
      +
      +

      A description of each parameter follows:

      +
      +
      events:
      +
      Comma-separated list of events to report.
      +
      +
      +
      +
      +

      SetLogDefaultGenerations

      +
      +

      Synopsis

      +
      +void SetLogDefaultGenerations( const unsigned long generations );
      +
      +
      +
      +

      Description

      +

      SetLogDefaultGenerations() specifies the maximum number of log files +to maintain before circulating back to overwrite the first name.

      +

      This function should be called prior to InitializeMagick() since it +provides defaults used by InitializeMagick() while the logging system +is initialized.

      +

      The format of SetLogDefaultGenerations method is:

      +
      +void SetLogDefaultGenerations( const unsigned long generations );
      +
      +

      A description of each parameter follows:

      +
      +
      generations:
      +
      Number of log files to maintain before circulating back to +the first name.
      +
      +
      +
      +
      +

      SetLogDefaultLimit

      +
      +

      Synopsis

      +
      +void SetLogDefaultLimit( const unsigned long limit );
      +
      +
      +
      +

      Description

      +

      SetLogDefaultLimit() specifies the maximum number of logging events which +may occur before creating a new log file.

      +

      This function should be called prior to InitializeMagick() since it +provides defaults used by InitializeMagick() while the logging system +is initialized.

      +

      The format of SetLogDefaultLimit method is:

      +
      +void SetLogDefaultLimit( const unsigned long limit );
      +
      +

      A description of each parameter follows:

      +
      +
      limit:
      +
      Maximum number of logging events before creating a new log file.
      +
      +
      +
      +
      +

      SetLogDefaultLogMethod

      +
      +

      Synopsis

      +
      +void SetLogDefaultLogMethod( const LogMethod method );
      +
      +
      +
      +

      Description

      +

      SetLogDefaultLogMethod() provides a call-back function to be invoked +for each log event when the logging method type is MethodOutput. +This call-back function is supported when MethodOutput is enabled +in the log output type. MethodOutput is automatically enabled if +a call-back function is provided, and disabled if the call-back +function is NULL.

      +

      This function should be called prior to InitializeMagick() since it +provides defaults used by InitializeMagick() while the logging system +is initialized.

      +

      The format of SetLogDefaultLogMethod method is:

      +
      +void SetLogDefaultLogMethod( const LogMethod method );
      +
      +

      A description of each parameter follows:

      +
      +
      method:
      +
      Call-back function to be invoked for each log event.
      +
      +
      +
      +
      +

      SetLogDefaultOutputType

      +
      +

      Synopsis

      +
      +void SetLogDefaultOutputType( const LogOutputType output_type );
      +
      +
      +
      +

      Description

      +

      SetLogDefaultOutputType() sets the logging output destination.

      +

      This function should be called prior to InitializeMagick() since it +provides defaults used by InitializeMagick() while the logging system +is initialized.

      +

      The format of SetLogDefaultOutputType method is:

      +
      +void SetLogDefaultOutputType( const LogOutputType output_type );
      +
      +

      A description of each parameter follows:

      +
      +
      output_type:
      +
      The logging output destination. One of the enumerated +values of LogOutputType.
      +
      +
      +
      +
      +

      SetLogDefaultFileName

      +
      +

      Synopsis

      +
      +void SetLogDefaultFileName( const char *filename );
      +
      +
      +
      +

      Description

      +

      SetLogDefaultFileName() provides the file name, or file path, to be +written to for each log event. Place a %d in the file name in order to +support multiple log generations. This setting is only used when the +log output type uses an output file.

      +

      This function should be called prior to InitializeMagick() since it +provides defaults used by InitializeMagick() while the logging system +is initialized.

      +

      The format of SetLogDefaultFileName method is:

      +
      +void SetLogDefaultFileName( const char *filename );
      +
      +

      A description of each parameter follows:

      +
      +
      filename:
      +
      File name, or file path to write log output to.
      +
      +
      +
      +
      +

      SetLogEventMask

      +
      +

      Synopsis

      +
      +unsigned long SetLogEventMask( const char *events );
      +
      +
      +
      +

      Description

      +

      SetLogEventMask() accepts a comma-delimited list (Annotate, Blob, Cache, +Coder, Configure, Deprecate, Error, Exception, FatalError, Information, +Locale, Option, Render, Resource, TemporaryFile, Transform, User, +Warning, or X11) that determines which events to log. All other events +are ignored. By default, no logging is enabled. This method returns +the updated log event mask.

      +

      The format of the SetLogEventMask method is:

      +
      +unsigned long SetLogEventMask( const char *events );
      +
      +

      A description of each parameter follows:

      +
      +
      events:
      +
      log these events.
      +
      +
      +
      +
      +

      SetLogFormat

      +
      +

      Synopsis

      +
      +void SetLogFormat( const char *format );
      +
      +
      +
      +

      Description

      +

      SetLogFormat() sets the format for the "human readable" log record. +The format specification supports these special format characters:

      +

      %d domain, +%e event, +%f function, +%l line, +%m module, +%p process ID, +%r real CPU time, +%t wall clock time, +%u user CPU time, +%% percent sign, +n newline, +r carriage return

      +

      The format of the LogMagickFormat method is:

      +
      +void SetLogFormat( const char *format );
      +
      +

      A description of each parameter follows:

      +
      +
      format:
      +
      The log record format.
      +
      +
      +
      +
      +

      SetLogMethod

      +
      +

      Synopsis

      +
      +void SetLogMethod( LogMethod method );
      +
      +
      +
      +

      Description

      +

      SetLogMethod() sets the method to be called when logging.

      +

      The format of the SetLogMethod method is:

      +
      +void SetLogMethod( LogMethod method );
      +
      +

      A description of each parameter follows:

      +
      +
      method:
      +
      pointer to a method of type LogMethod that will be called when LogMagickEvent +is called. Pass a null pointer to remove a registered method.
      +
      +
      +
      +
      + +
      +
      +

      Copyright © GraphicsMagick Group 2002 - 2020

      +
      + + diff --git a/www/api/magick.html b/www/api/magick.html index ef4fbb3..8eee5cc 100644 --- a/www/api/magick.html +++ b/www/api/magick.html @@ -3,7 +3,7 @@ - + magick @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
      - - -   + + + 
    @@ -474,5 +474,10 @@ looking for.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/memory.html b/www/api/memory.html index b5dc095..472c232 100644 --- a/www/api/memory.html +++ b/www/api/memory.html @@ -3,7 +3,7 @@ - + memory @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Memory allocation/deallocation functions

    -

    Contents

    +

    Contents

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/memory.html.orig b/www/api/memory.html.orig new file mode 100644 index 0000000..c5e53cb --- /dev/null +++ b/www/api/memory.html.orig @@ -0,0 +1,275 @@ + + + + + + +memory + + + + + + + +
    +

    memory

    +

    Memory allocation/deallocation functions

    + + +
    +

    MagickAllocFunctions

    +
    +

    Synopsis

    +
    +void MagickAllocFunctions( MagickFreeFunc free_func, MagickMallocFunc malloc_func,
    +                           MagickReallocFunc realloc_func );
    +
    +
    +
    +

    Description

    +

    MagickAllocFunctions() provides a way for the user to supply a preferred +free(), malloc(), and realloc() functions. Otherwise the default system +versions are used. If an alternative allocator is to be used, this +function should be invoked prior to invoking InitializeMagick().

    +

    The format of the MagickAllocFunctions method is:

    +
    +void MagickAllocFunctions( MagickFreeFunc free_func, MagickMallocFunc malloc_func,
    +                           MagickReallocFunc realloc_func );
    +
    +
    +
    free_func:
    +
    Function to free memory.
    +
    malloc_func:
    +
    Function to allocate memory.
    +
    realloc_func:
    +
    Function to reallocate memory.
    +
    +
    +
    +
    +

    MagickMalloc

    +
    +

    Synopsis

    +
    +void *MagickMalloc( const size_t size );
    +
    +
    +
    +

    Description

    +

    MagickMalloc() returns a pointer to a block of memory of at least size +bytes suitably aligned for any use. NULL is returned if insufficient +memory is available or the requested size is zero.

    +

    The format of the MagickMalloc method is:

    +
    +void *MagickMalloc( const size_t size );
    +
    +

    A description of each parameter follows:

    +
    +
    size:
    +
    The size of the memory in bytes to allocate.
    +
    +
    +
    +
    +

    MagickMallocAligned

    +
    +

    Synopsis

    +
    +void *MagickMallocAligned( size_t alignment, const size_t size );
    +
    +
    +
    +

    Description

    +

    MagickMallocAligned() allocates memory and returns a pointer to a +block of memory capable of storing at least size bytes with the +allocation's base address being an even multiple of alignment. +The size of the buffer allocation is rounded up as required in +order to consume a block of memory starting at least at the requested +alignment and ending at at least the requested alignment.

    +

    The requested alignment should be a power of 2 at least as large as +sizeof a void pointer.

    +

    NULL is returned if insufficient memory is available, the requested +size is zero, or integer overflow was detected.

    +

    This function is intended for allocating special-purpose buffers +which benefit from specific alignment.

    +

    The allocated memory should only be freed using MagickFreeAligned() +and may not be reallocated.

    +

    The format of the MagickMallocAligned method is:

    +
    +void *MagickMallocAligned( size_t alignment, const size_t size );
    +
    +

    A description of each parameter follows:

    +
    +
    alignment:
    +
    The alignment of the base and size of the allocated +memory.
    +
    size:
    +
    The size of the memory in bytes to allocate.
    +
    +
    +
    +
    +

    MagickMallocCleared

    +
    +

    Synopsis

    +
    +void *MagickMallocCleared( const size_t size );
    +
    +
    +
    +

    Description

    +

    MagickMallocCleared() returns a pointer to a block of memory of at least +size bytes suitably aligned for any use. NULL is returned if insufficient +memory is available or the requested size is zero. This version differs +from MagickMalloc in that the allocated bytes are cleared to zero.

    +

    The format of the MagickMallocCleared method is:

    +
    +void *MagickMallocCleared( const size_t size );
    +
    +

    A description of each parameter follows:

    +
    +
    size:
    +
    The size of the memory in bytes to allocate.
    +
    +
    +
    +
    +

    MagickCloneMemory

    +
    +

    Synopsis

    +
    +void *MagickCloneMemory( void *destination, const void *source, const size_t size );
    +
    +
    +
    +

    Description

    +

    MagickCloneMemory() copies size bytes from memory area source to the +destination. Copying between objects that overlap will take place +correctly. It returns destination.

    +

    The format of the MagickCloneMemory method is:

    +
    +void *MagickCloneMemory( void *destination, const void *source, const size_t size );
    +
    +
    +
    size:
    +
    The size of the memory in bytes to allocate.
    +
    +
    +
    +
    +

    MagickRealloc

    +
    +

    Synopsis

    +
    +void *MagickRealloc( void *memory, const size_t size );
    +
    +
    +
    +

    Description

    +

    MagickRealloc() changes the size of the memory and returns a pointer to +the (possibly moved) block. The contents will be unchanged up to the +lesser of the new and old sizes. If size is zero, then the memory is +freed and a NULL value is returned. If the memory allocation fails, then +the existing memory is freed, and a NULL value is returned.

    +

    Note that the behavior of this function is similar to BSD reallocf(3), +see https://www.freebsd.org/cgi/man.cgi?query=reallocf

    +

    The format of the MagickRealloc method is:

    +
    +void *MagickRealloc( void *memory, const size_t size );
    +
    +

    A description of each parameter follows:

    +
    +
    memory:
    +
    A pointer to a memory allocation.
    +
    size:
    +
    The new size of the allocated memory.
    +
    +
    +
    +
    +

    MagickFree

    +
    +

    Synopsis

    +
    +void MagickFree( void *memory );
    +
    +
    +
    +

    Description

    +

    MagickFree() frees memory that has already been allocated by +MagickMalloc() or other other other allocators directly compatible +with the currently defined memory allocator (which defaults to the +system malloc()). For convenience, a NULL argument is ignored.

    +

    The format of the MagickFree method is:

    +
    +void MagickFree( void *memory );
    +
    +

    A description of each parameter follows:

    +
    +
    memory:
    +
    A pointer to a block of memory to free for reuse.
    +
    +
    +
    +
    +

    MagickFreeAligned

    +
    +

    Synopsis

    +
    +void MagickFreeAligned( void *memory );
    +
    +
    +
    +

    Description

    +

    MagickFreeAligned() frees aligned memory that has previously been +allocated via MagickMallocAligned(). For convenience, a NULL argument is +ignored.

    +

    This function exists in case the pointer allocated by +MagickMallocAligned() can not be used directly with MagickFree().

    +

    The format of the MagickFreeAligned method is:

    +
    +void MagickFreeAligned( void *memory );
    +
    +

    A description of each parameter follows:

    +
    +
    memory:
    +
    A pointer to a block of memory to free for reuse.
    +
    +
    +
    +
    + + diff --git a/www/api/monitor.html b/www/api/monitor.html index 93a9f23..ccd36ad 100644 --- a/www/api/monitor.html +++ b/www/api/monitor.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -148,5 +148,10 @@ and returns the previous monitor handler.

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/monitor.html.orig b/www/api/monitor.html.orig new file mode 100644 index 0000000..984de83 --- /dev/null +++ b/www/api/monitor.html.orig @@ -0,0 +1,152 @@ + + + + + + +monitor + + + + + + + +
    +

    monitor

    +

    Progress monitor support

    + + +
    +

    MagickMonitor

    +
    +

    Synopsis

    +
    +MagickPassFail MagickMonitor( const char *text, const magick_int64_t quantum,
    +                              const magick_uint64_t span, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    MagickMonitor() calls the monitor handler method with a text string that +describes the task and a measure of completion. The method returns True +on success otherwise False if an error is encountered, e.g. if there was a +user interrupt.

    +

    This function is deprecated. Please use MagickMonitorFormatted() instead.

    +

    The format of the MagickMonitor method is:

    +
    +MagickPassFail MagickMonitor( const char *text, const magick_int64_t quantum,
    +                              const magick_uint64_t span, ExceptionInfo *exception );
    +
    +
    +
    text:
    +
    Description of the task being performed.
    +
    quantum:
    +
    The position relative to the span parameter which represents +how much progress has been made toward completing a task.
    +
    span:
    +
    The span relative to completing a task.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    MagickMonitorFormatted

    +
    +

    Synopsis

    +
    +MagickPassFail MagickMonitorFormatted( const magick_int64_t quantum,
    +                                       const magick_uint64_t span,
    +                                       ExceptionInfo *exception, const char *format,
    +                                       ... );
    +
    +
    +
    +

    Description

    +

    MagickMonitorFormatted() calls the monitor handler method with a +printf type format specification and variable argument list. Also +passed are quantum and span values which provide a measure of +completion. The method returns MagickPass on success otherwise +MagickFail if an error is encountered, e.g. if there was a user +interrupt. If MagickFail is returned, the calling code is expected +to terminate whatever is being monitored as soon as possible.

    +

    Most callers of this function will use the QuantumTick() macro to +decide when it should be called. The QuantumTick() macro is designed +to deliver no more than 100 events in a span (representing 1-100%) +and to distribute events as evenly as possible over the span so that +events are reported for every 1% of progress when possible.

    +

    The format of the MagickMonitorFormatted method is:

    +
    +MagickPassFail MagickMonitorFormatted( const magick_int64_t quantum,
    +                                       const magick_uint64_t span,
    +                                       ExceptionInfo *exception, const char *format,
    +                                       ... );
    +
    +
    +
    quantum:
    +
    The position relative to the span parameter which represents +how much progress has been made toward completing a task.
    +
    span:
    +
    The span relative to completing a task.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    format:
    +
    A string describing the format to use to write the remaining +arguments.
    +
    +
    +
    +
    +

    SetMonitorHandler

    +
    +

    Synopsis

    +
    +MonitorHandler SetMonitorHandler( MonitorHandler handler );
    +
    +
    +
    +

    Description

    +

    SetMonitorHandler() sets the monitor handler to the specified method +and returns the previous monitor handler.

    +

    The format of the SetMonitorHandler method is:

    +
    +MonitorHandler SetMonitorHandler( MonitorHandler handler );
    +
    +

    A description of each parameter follows:

    +
    +
    handler:
    +
    Specifies a pointer to a method to handle monitors.
    +
    +
    +
    +
    + + diff --git a/www/api/montage.html b/www/api/montage.html index d912d07..36c61f3 100644 --- a/www/api/montage.html +++ b/www/api/montage.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -146,5 +146,10 @@ thumbnails across an image canvas.

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/montage.html.orig b/www/api/montage.html.orig new file mode 100644 index 0000000..5ba6e8f --- /dev/null +++ b/www/api/montage.html.orig @@ -0,0 +1,150 @@ + + + + + + +montage + + + + + + + +
    +

    montage

    +

    Create a thumbnail image mosaic

    + + +
    +

    CloneMontageInfo

    +
    +

    Synopsis

    +
    +MontageInfo *CloneMontageInfo( const ImageInfo *image_info,
    +                               const MontageInfo *montage_info );
    +
    +
    +
    +

    Description

    +

    CloneMontageInfo() makes a copy of the given montage info structure. If +NULL is specified, a new image info structure is created initialized to +default values.

    +

    The format of the CloneMontageInfo method is:

    +
    +MontageInfo *CloneMontageInfo( const ImageInfo *image_info,
    +                               const MontageInfo *montage_info );
    +
    +
    +
    image_info:
    +
    The image info.
    +
    montage_info:
    +
    The montage info.
    +
    +
    +
    +
    +

    DestroyMontageInfo

    +
    +

    Synopsis

    +
    +void DestroyMontageInfo( MontageInfo *montage_info );
    +
    +
    +
    +

    Description

    +

    DestroyMontageInfo() deallocates memory associated with montage_info.

    +

    The format of the DestroyMontageInfo method is:

    +
    +void DestroyMontageInfo( MontageInfo *montage_info );
    +
    +

    A description of each parameter follows:

    +
    +
    montage_info:
    +
    Specifies a pointer to an MontageInfo structure.
    +
    +
    +
    +
    +

    GetMontageInfo

    +
    +

    Synopsis

    +
    +void GetMontageInfo( const ImageInfo *image_info, MontageInfo *montage_info );
    +
    +
    +
    +

    Description

    +

    GetMontageInfo() initializes montage_info to default values.

    +

    The format of the GetMontageInfo method is:

    +
    +void GetMontageInfo( const ImageInfo *image_info, MontageInfo *montage_info );
    +
    +
    +
    image_info:
    +
    a structure of type ImageInfo.
    +
    montage_info:
    +
    Specifies a pointer to a MontageInfo structure.
    +
    +
    +
    +
    +

    MontageImages

    +
    +

    Synopsis

    +
    +Image *MontageImages( const Image *images, const MontageInfo *montage_info,
    +                      ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    Montageimages() is a layout manager that lets you tile one or more +thumbnails across an image canvas.

    +

    The format of the MontageImages method is:

    +
    +Image *MontageImages( const Image *images, const MontageInfo *montage_info,
    +                      ExceptionInfo *exception );
    +
    +
    +
    images:
    +
    Specifies a pointer to an array of Image structures.
    +
    montage_info:
    +
    Specifies a pointer to a MontageInfo structure.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    + + diff --git a/www/api/operator.html b/www/api/operator.html index 7dca3c4..d330bcb 100644 --- a/www/api/operator.html +++ b/www/api/operator.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -157,5 +157,10 @@ XorQuantumOp).
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/operator.html.orig b/www/api/operator.html.orig new file mode 100644 index 0000000..9212b54 --- /dev/null +++ b/www/api/operator.html.orig @@ -0,0 +1,161 @@ + + + + + + +operator + + + + + + + +
    +

    operator

    +

    Methods to apply mathematic or boolean operators to pixels.

    + + +
    +

    QuantumOperatorImage

    +
    +

    Synopsis

    +
    +MagickPassFail QuantumOperatorImage( Image *image, ChannelType channel,
    +                                     QuantumOperator operator, double rvalue );
    +
    +
    +
    +

    Description

    +

    QuantumOperatorImage() performs the requested arithmetic, +bitwise-logical, or value operation on the selected channels of +the entire image. The AllChannels channel option operates on all +color channels whereas the GrayChannel channel option treats the +color channels as a grayscale intensity.

    +

    These operations are on the DirectClass pixels of the image and do not +update pixel indexes or colormap.

    +

    The format of the QuantumOperatorImage method is:

    +
    +MagickPassFail QuantumOperatorImage( Image *image, ChannelType channel,
    +                                     QuantumOperator operator, double rvalue );
    +
    +
    +
    image:
    +
    The image.
    +
    channel:
    +
    Channel to operate on (RedChannel, CyanChannel, +GreenChannel, MagentaChannel, BlueChannel, YellowChannel, +OpacityChannel, BlackChannel, MatteChannel, AllChannels, +GrayChannel). The AllChannels type only updates color +channels. The GrayChannel type treats the color channels +as if they represent an intensity.
    +
    quantum_operator:
    +
    Operator to use (AddQuantumOp, AndQuantumOp, +AssignQuantumOp, DepthQuantumOp, DivideQuantumOp, GammaQuantumOp, +LShiftQuantumOp, MultiplyQuantumOp, NegateQuantumOp, +NoiseGaussianQuantumOp, NoiseImpulseQuantumOp, +NoiseLaplacianQuantumOp, NoiseMultiplicativeQuantumOp, +NoisePoissonQuantumOp, NoiseRandomQuantumOp, NoiseUniformQuantumOp, +OrQuantumOp, RShiftQuantumOp, SubtractQuantumOp, +ThresholdBlackQuantumOp, ThresholdQuantumOp, ThresholdWhiteQuantumOp, +ThresholdBlackNegateQuantumOp, ThresholdWhiteNegateQuantumOp, +XorQuantumOp).
    +
    rvalue:
    +
    Operator argument.
    +
    exception:
    +
    Updated with error description.
    +
    +
    +
    +
    +

    QuantumOperatorRegionImage

    +
    +

    Synopsis

    +
    +MagickPassFail QuantumOperatorRegionImage( Image *image, long x, long y,
    +                                           unsigned long columns, unsigned long rows,
    +                                           ChannelType channel,
    +                                           QuantumOperator quantum_operator, double rvalue );
    +
    +
    +
    +

    Description

    +

    QuantumOperatorRegionImage() performs the requested arithmetic, +bitwise-logical, or value operation on the selected channels of +the image over the specified region. The AllChannels channel option +operates on all color channels whereas the GrayChannel channel option +treats the color channels as a grayscale intensity.

    +

    These operations are on the DirectClass pixels of the image and do not +update pixel indexes or colormap.

    +

    The format of the QuantumOperatorRegionImage method is:

    +
    +MagickPassFail QuantumOperatorRegionImage( Image *image, long x, long y,
    +                                           unsigned long columns, unsigned long rows,
    +                                           ChannelType channel,
    +                                           QuantumOperator quantum_operator, double rvalue );
    +
    +
    +
    image:
    +
    The image.
    +
    channel:
    +
    Channel to operate on (RedChannel, CyanChannel, +GreenChannel, MagentaChannel, BlueChannel, YellowChannel, +OpacityChannel, BlackChannel, MatteChannel, AllChannels, +GrayChannel). The AllChannels type only updates color +channels. The GrayChannel type treats the color channels +as if they represent an intensity.
    +
    x:
    +
    Ordinate of left row of region.
    +
    y:
    +
    Orginate of top column of region.
    +
    columns:
    +
    Width of region.
    +
    rows:
    +
    Height of region.
    +
    quantum_operator:
    +
    Operator to use (AddQuantumOp,AndQuantumOp, +AssignQuantumOp, DepthQuantumOp, DivideQuantumOp, GammaQuantumOp, +LShiftQuantumOp, MultiplyQuantumOp, NegateQuantumOp, +NoiseGaussianQuantumOp, NoiseImpulseQuantumOp, +NoiseLaplacianQuantumOp, NoiseMultiplicativeQuantumOp, +NoisePoissonQuantumOp, NoiseRandomQuantumOp, NoiseUniformQuantumOp, +OrQuantumOp, RShiftQuantumOp, SubtractQuantumOp, +ThresholdBlackQuantumOp, ThresholdQuantumOp, ThresholdWhiteQuantumOp, +XorQuantumOp).
    +
    rvalue:
    +
    Operator argument.
    +
    exception:
    +
    Updated with error description.
    +
    +
    +
    +
    + + diff --git a/www/api/paint.html b/www/api/paint.html index 7a16765..b8dd4dc 100644 --- a/www/api/paint.html +++ b/www/api/paint.html @@ -3,7 +3,7 @@ - + paint @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Methods to fill image pixel regions

    -

    Contents

    +

    Contents

    • ColorFloodfillImage
    • MatteFloodfillImage
    • @@ -197,5 +197,10 @@ unsigned int TransparentImage( +
      +

      Copyright © GraphicsMagick Group 2002 - 2020

      +
      diff --git a/www/api/paint.html.orig b/www/api/paint.html.orig new file mode 100644 index 0000000..acc0101 --- /dev/null +++ b/www/api/paint.html.orig @@ -0,0 +1,201 @@ + + + + + + +paint + + + + + + + +
      +

      paint

      +

      Methods to fill image pixel regions

      + + +
      +

      ColorFloodfillImage

      +
      +

      Synopsis

      +
      +unsigned int ColorFloodfillImage( Image *image, const DrawInfo *draw_info,
      +                                  const PixelPacket target, const long x_offset,
      +                                  const long y_offset, const PaintMethod method );
      +
      +
      +
      +

      Description

      +

      ColorFloodfill() 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.

      +

      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.

      +

      The format of the ColorFloodfillImage method is:

      +
      +unsigned int ColorFloodfillImage( Image *image, const DrawInfo *draw_info,
      +                                  const PixelPacket target, const long x_offset,
      +                                  const long y_offset, const PaintMethod method );
      +
      +
      +
      image:
      +
      The image.
      +
      draw_info:
      +
      The draw info.
      +
      target:
      +
      The RGB value of the target color.
      +
      x,y:
      +
      The starting location of the operation.
      +
      method:
      +
      Choose either FloodfillMethod or FillToBorderMethod.
      +
      +
      +
      +
      +

      MatteFloodfillImage

      +
      +

      Synopsis

      +
      +unsigned int MatteFloodfillImage( Image *image, const PixelPacket target,
      +                                  const unsigned int opacity, const long x_offset,
      +                                  const long y_offset, const PaintMethod method );
      +
      +
      +
      +

      Description

      +

      MatteFloodfill() 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.

      +

      By default target must match a particular pixel transparency exactly. +However, in many cases two transparency values may differ by a +small amount. The fuzz member of image defines how much tolerance is +acceptable to consider two transparency values as the same. For example, +set fuzz to 10 and the opacity values of 100 and 102 respectively are +now interpreted as the same value for the purposes of the floodfill.

      +

      The format of the MatteFloodfillImage method is:

      +
      +unsigned int MatteFloodfillImage( Image *image, const PixelPacket target,
      +                                  const unsigned int opacity, const long x_offset,
      +                                  const long y_offset, const PaintMethod method );
      +
      +
      +
      image:
      +
      The image.
      +
      target:
      +
      The RGB value of the target color.
      +
      opacity:
      +
      The level of transparency: 0 is fully opaque and MaxRGB is +fully transparent.
      +
      x,y:
      +
      The starting location of the operation.
      +
      method:
      +
      Choose either FloodfillMethod or FillToBorderMethod.
      +
      +
      +
      +
      +

      OpaqueImage

      +
      +

      Synopsis

      +
      +unsigned int OpaqueImage( Image *image, const PixelPacket target,
      +                          const PixelPacket fill );
      +
      +
      +
      +

      Description

      +

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

      +

      By default color must match a particular pixel color exactly. However, +in many cases two colors may differ by a small amount. Fuzz 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.

      +

      The format of the OpaqueImage method is:

      +
      +unsigned int OpaqueImage( Image *image, const PixelPacket target,
      +                          const PixelPacket fill );
      +
      +
      +
      image:
      +
      The image.
      +
      target:
      +
      The RGB value of the target color.
      +
      fill:
      +
      The replacement color.
      +
      +
      +
      +
      +

      TransparentImage

      +
      +

      Synopsis

      +
      +unsigned int TransparentImage( Image *image, const PixelPacket target,
      +                               const unsigned int opacity );
      +
      +
      +
      +

      Description

      +

      TransparentImage() changes the opacity value associated with any pixel +that matches color to the value defined by opacity.

      +

      By default color must match a particular pixel color exactly. However, +in many cases two colors may differ by a small amount. Fuzz 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.

      +

      The format of the TransparentImage method is:

      +
      +unsigned int TransparentImage( Image *image, const PixelPacket target,
      +                               const unsigned int opacity );
      +
      +
      +
      image:
      +
      The image.
      +
      target:
      +
      The RGB value of the target color.
      +
      opacity:
      +
      The replacement opacity value.
      +
      +
      +
      +
      + + diff --git a/www/api/pixel_cache.html b/www/api/pixel_cache.html index fc53979..7824f38 100644 --- a/www/api/pixel_cache.html +++ b/www/api/pixel_cache.html @@ -3,7 +3,7 @@ - + pixel_cache @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
      - - -   + + + 
    @@ -37,7 +37,7 @@

    Image pixel cache (working pixels).

    -

    Contents

    +

    Contents

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/pixel_iterator.html b/www/api/pixel_iterator.html index 00014cd..7cdbfdb 100644 --- a/www/api/pixel_iterator.html +++ b/www/api/pixel_iterator.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -596,5 +596,10 @@ a region of source pixels and initializes a region of destination pixels.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/pixel_iterator.html.orig b/www/api/pixel_iterator.html.orig new file mode 100644 index 0000000..3b1c7dc --- /dev/null +++ b/www/api/pixel_iterator.html.orig @@ -0,0 +1,600 @@ + + + + + + +pixel_iterator + + + + + + + +
    +

    pixel_iterator

    +

    Pixel iterator pattern support functions

    + + +
    +

    InitializePixelIteratorOptions

    +
    +

    Synopsis

    +
    +void InitializePixelIteratorOptions( PixelIteratorOptions *options,
    +                                     ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    InitializePixelIteratorOptions() assigns default options to a user-provided +PixelIteratorOptions structure. This function should always be used +to initialize the PixelIteratorOptions structure prior to making any +changes to it.

    +

    The format of the InitializePixelIteratorOptions method is:

    +
    +void InitializePixelIteratorOptions( PixelIteratorOptions *options,
    +                                     ExceptionInfo *exception );
    +
    +
    +
    options:
    +
    pointer to PixelIteratorOptions structure to initialize.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    PixelIterateMonoRead

    +
    +

    Synopsis

    +
    +MagickPassFail PixelIterateMonoRead( PixelIteratorMonoReadCallback call_back,
    +                                     const PixelIteratorOptions *options,
    +                                     const char *description, void *mutable_data,
    +                                     const void *immutable_data, const long x, const long y,
    +                                     const unsigned long columns, const unsigned long rows,
    +                                     const Image *image, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    PixelIterateMonoRead() iterates through a region of an image and invokes a +user-provided callback function (of type PixelRowIteratorMonoReadCallback) +for a row of pixels. This is useful to support simple operations such as +statistics computation.

    +

    The format of the PixelIterateMonoRead method is:

    +
    +MagickPassFail PixelIterateMonoRead( PixelIteratorMonoReadCallback call_back,
    +                                     const PixelIteratorOptions *options,
    +                                     const char *description, void *mutable_data,
    +                                     const void *immutable_data, const long x, const long y,
    +                                     const unsigned long columns, const unsigned long rows,
    +                                     const Image *image, ExceptionInfo *exception );
    +
    +
    +
    call_back:
    +
    A user-provided C callback function which is passed the +address of pixels from the image.
    +
    options:
    +
    Pixel iterator execution options (may be NULL).
    +
    description:
    +
    textual description of operation being performed.
    +
    mutable_data:
    +
    User-provided mutable context data.
    +
    immutable_data:
    +
    User-provided immutable context data.
    +
    x:
    +
    The horizontal ordinate of the top left corner of the region.
    +
    y:
    +
    The vertical ordinate of the top left corner of the region.
    +
    columns:
    +
    Width of pixel region
    +
    rows:
    +
    Height of pixel region
    +
    image:
    +
    The address of the Image.
    +
    exception:
    +
    If an error is reported, this argument is updated with the reason.
    +
    +
    +
    +
    +

    PixelIterateMonoSet

    +
    +

    Synopsis

    +
    +MagickPassFail PixelIterateMonoSet( PixelIteratorMonoModifyback call_back,
    +                                    const PixelIteratorOptions *options,
    +                                    const char *description, void *mutable_data,
    +                                    const void *immutable_data, const long x, const long y,
    +                                    const unsigned long columns, const unsigned long rows,
    +                                    Image *image, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    PixelIterateMonoSet() iterates through a region of an image and invokes +a user-provided callback function (of type PixelIteratorMonoModifyCallback) +to initialize a region of pixels from scratch. The difference from +PixelIterateMonoModify() is that the output pixels are not initialized +from the underlying store so it is more efficient when outputting a new +image or when the existing pixels are intentionally discarded. This is +useful for operations such as setting the pixel color.

    +

    The format of the PixelIterateMonoSet method is:

    +
    +MagickPassFail PixelIterateMonoSet( PixelIteratorMonoModifyback call_back,
    +                                    const PixelIteratorOptions *options,
    +                                    const char *description, void *mutable_data,
    +                                    const void *immutable_data, const long x, const long y,
    +                                    const unsigned long columns, const unsigned long rows,
    +                                    Image *image, ExceptionInfo *exception );
    +
    +
    +
    call_back:
    +
    A user-provided C callback function which is passed the +address of pixels to be initialized in the image.
    +
    options:
    +
    Pixel iterator execution options (may be NULL).
    +
    description:
    +
    textual description of operation being performed.
    +
    mutable_data:
    +
    User-provided mutable context data.
    +
    immutable_data:
    +
    User-provided immutable context data.
    +
    x:
    +
    The horizontal ordinate of the top left corner of the region.
    +
    y:
    +
    The vertical ordinate of the top left corner of the region.
    +
    columns:
    +
    Width of pixel region
    +
    rows:
    +
    Height of pixel region
    +
    image:
    +
    The address of the Image.
    +
    exception:
    +
    If an error is reported, this argument is updated with the reason.
    +
    +
    +
    +
    +

    PixelIterateMonoModify

    +
    +

    Synopsis

    +
    +MagickPassFail PixelIterateMonoModify( PixelIteratorMonoModifyCallback call_back,
    +                                       const PixelIteratorOptions *options,
    +                                       const char *description, void *mutable_data,
    +                                       const void *immutable_data, const long x,
    +                                       const long y, const unsigned long columns,
    +                                       const unsigned long rows, Image *image,
    +                                       ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    PixelIterateMonoModify() iterates through a region of an image and invokes +a user-provided callback function (of type PixelIteratorMonoModifyCallback) +to modify a region of pixels. This is useful to support simple operations +such as level shifting, colorspace translation, or thresholding.

    +

    The format of the PixelIterateMonoModify method is:

    +
    +MagickPassFail PixelIterateMonoModify( PixelIteratorMonoModifyCallback call_back,
    +                                       const PixelIteratorOptions *options,
    +                                       const char *description, void *mutable_data,
    +                                       const void *immutable_data, const long x,
    +                                       const long y, const unsigned long columns,
    +                                       const unsigned long rows, Image *image,
    +                                       ExceptionInfo *exception );
    +
    +
    +
    call_back:
    +
    A user-provided C callback function which is passed the +address of pixels from the image.
    +
    options:
    +
    Pixel iterator execution options (may be NULL).
    +
    description:
    +
    textual description of operation being performed.
    +
    mutable_data:
    +
    User-provided mutable context data.
    +
    immutable_data:
    +
    User-provided immutable context data.
    +
    x:
    +
    The horizontal ordinate of the top left corner of the region.
    +
    y:
    +
    The vertical ordinate of the top left corner of the region.
    +
    columns:
    +
    Width of pixel region
    +
    rows:
    +
    Height of pixel region
    +
    image:
    +
    The address of the Image.
    +
    exception:
    +
    If an error is reported, this argument is updated with the reason.
    +
    +
    +
    +
    +

    PixelIterateDualRead

    +
    +

    Synopsis

    +
    +MagickPassFail PixelIterateDualRead( PixelIteratorDualReadCallback call_back,
    +                                     const PixelIteratorOptions *options,
    +                                     const char *description, void *mutable_data,
    +                                     const void *immutable_data, const unsigned long columns,
    +                                     const unsigned long rows, const Image *first_image,
    +                                     const long first_x, const long first_y,
    +                                     const Image *second_image, const long second_x,
    +                                     const long second_y, ExceptionInfo *exception ); ;
    +
    +
    +
    +

    Description

    +

    PixelIterateDualRead() iterates through pixel regions of two images and +invokes a user-provided callback function (of type +PixelIteratorDualReadCallback) for each row of pixels. This is useful to +support operations such as image comparison.

    +

    The format of the PixelIterateDualRead method is:

    +
    +MagickPassFail PixelIterateDualRead( PixelIteratorDualReadCallback call_back,
    +                                     const PixelIteratorOptions *options,
    +                                     const char *description, void *mutable_data,
    +                                     const void *immutable_data, const unsigned long columns,
    +                                     const unsigned long rows, const Image *first_image,
    +                                     const long first_x, const long first_y,
    +                                     const Image *second_image, const long second_x,
    +                                     const long second_y, ExceptionInfo *exception ); ;
    +
    +
    +
    call_back:
    +
    A user-provided C callback function which is passed the +address of pixels from each image.
    +
    options:
    +
    Pixel iterator execution options (may be NULL).
    +
    description:
    +
    textual description of operation being performed.
    +
    mutable_data:
    +
    User-provided mutable context data.
    +
    immutable_data:
    +
    User-provided immutable context data.
    +
    columns:
    +
    Width of pixel region
    +
    rows:
    +
    Height of pixel region
    +
    first_image:
    +
    The address of the first Image.
    +
    first_x:
    +
    The horizontal ordinate of the top left corner of the first region.
    +
    first_y:
    +
    The vertical ordinate of the top left corner of the first region.
    +
    second_image:
    +
    The address of the second Image.
    +
    second_x:
    +
    The horizontal ordinate of the top left corner of the second region.
    +
    second_y:
    +
    The vertical ordinate of the top left corner of the second region.
    +
    exception:
    +
    If an error is reported, this argument is updated with the reason.
    +
    +
    +
    +
    +

    PixelIterateDualModify

    +
    +

    Synopsis

    +
    +MagickPassFail PixelIterateDualModify( PixelIteratorDualModifyCallback call_back,
    +                                       const PixelIteratorOptions *options,
    +                                       const char *description, void *mutable_data,
    +                                       const void *immutable_data,
    +                                       const unsigned long columns, const unsigned long rows,
    +                                       const Image *source_image, const long source_x,
    +                                       const long source_y, Image *update_image,
    +                                       const long update_x, const long update_y,
    +                                       ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    PixelIterateDualModify() iterates through pixel regions of two images and +invokes a user-provided callback function (of type +PixelIteratorDualModifyCallback) for each row of pixels. This is useful to +support operations such as composition.

    +

    The format of the PixelIterateDualModify method is:

    +
    +MagickPassFail PixelIterateDualModify( PixelIteratorDualModifyCallback call_back,
    +                                       const PixelIteratorOptions *options,
    +                                       const char *description, void *mutable_data,
    +                                       const void *immutable_data,
    +                                       const unsigned long columns, const unsigned long rows,
    +                                       const Image *source_image, const long source_x,
    +                                       const long source_y, Image *update_image,
    +                                       const long update_x, const long update_y,
    +                                       ExceptionInfo *exception );
    +
    +
    +
    call_back:
    +
    A user-provided C callback function which reads from +a region of source pixels and updates a region of destination pixels.
    +
    options:
    +
    Pixel iterator execution options (may be NULL).
    +
    description:
    +
    textual description of operation being performed.
    +
    mutable_data:
    +
    User-provided mutable context data.
    +
    immutable_data:
    +
    User-provided immutable context data.
    +
    columns:
    +
    Width of pixel region
    +
    rows:
    +
    Height of pixel region
    +
    source_image:
    +
    The address of the constant source Image.
    +
    source_x:
    +
    The horizontal ordinate of the top left corner of the source region.
    +
    source_y:
    +
    The vertical ordinate of the top left corner of the source region.
    +
    update_image:
    +
    The address of the update Image.
    +
    update_x:
    +
    The horizontal ordinate of the top left corner of the update region.
    +
    update_y:
    +
    The vertical ordinate of the top left corner of the update region.
    +
    exception:
    +
    If an error is reported, this argument is updated with the reason.
    +
    +
    +
    +
    +

    PixelIterateDualNew

    +
    +

    Synopsis

    +
    +MagickPassFail PixelIterateDualNew( PixelIteratorDualNewCallback call_back,
    +                                    const PixelIteratorOptions *options,
    +                                    const char *description, void *mutable_data,
    +                                    const void *immutable_data, const unsigned long columns,
    +                                    const unsigned long rows, const Image *source_image,
    +                                    const long source_x, const long source_y,
    +                                    Image *new_image, const long new_x,
    +                                    const long new_y, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    PixelIterateDualNew() iterates through pixel regions of two images and +invokes a user-provided callback function (of type +PixelIteratorDualNewCallback) for each row of pixels. This is used if a +new output image is created based on an input image. The difference from +PixelIterateDualModify() is that the output pixels are not initialized so +it is more efficient when outputting a new image.

    +

    The format of the PixelIterateDualNew method is:

    +
    +MagickPassFail PixelIterateDualNew( PixelIteratorDualNewCallback call_back,
    +                                    const PixelIteratorOptions *options,
    +                                    const char *description, void *mutable_data,
    +                                    const void *immutable_data, const unsigned long columns,
    +                                    const unsigned long rows, const Image *source_image,
    +                                    const long source_x, const long source_y,
    +                                    Image *new_image, const long new_x,
    +                                    const long new_y, ExceptionInfo *exception );
    +
    +
    +
    call_back:
    +
    A user-provided C callback function which reads from +a region of source pixels and initializes a region of destination pixels.
    +
    options:
    +
    Pixel iterator execution options (may be NULL).
    +
    description:
    +
    textual description of operation being performed.
    +
    mutable_data:
    +
    User-provided mutable context data.
    +
    immutable_data:
    +
    User-provided immutable context data.
    +
    columns:
    +
    Width of pixel region
    +
    rows:
    +
    Height of pixel region
    +
    source_image:
    +
    The address of the constant source Image.
    +
    source_x:
    +
    The horizontal ordinate of the top left corner of the source region.
    +
    source_y:
    +
    The vertical ordinate of the top left corner of the source region.
    +
    new_image:
    +
    The address of the new Image.
    +
    new_x:
    +
    The horizontal ordinate of the top left corner of the new region.
    +
    new_y:
    +
    The vertical ordinate of the top left corner of the new region.
    +
    exception:
    +
    If an error is reported, this argument is updated with the reason.
    +
    +
    +
    +
    +

    PixelIterateTripleModify

    +
    +

    Synopsis

    +
    +MagickPassFail PixelIterateTripleModify( PixelIteratorTripleModifyCallback call_back,
    +                                         const PixelIteratorOptions *options,
    +                                         const char *description, void *mutable_data,
    +                                         const void *immutable_data,
    +                                         const unsigned long columns, const unsigned long rows,
    +                                         const Image *source1_image,
    +                                         const Image *source2_image, const long source_x,
    +                                         const long source_y, Image *update_image,
    +                                         const long update_x, const long update_y,
    +                                         ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    PixelIterateTripleModify() iterates through pixel regions of three images +and invokes a user-provided callback function (of type +PixelIteratorTripleModifyCallback) for each row of pixels. The first two +images are read-only, while the third image is read-write for update. +Access of the first two images is done lock-step using the same coordinates. +This is useful to support operations such as image differencing.

    +

    The format of the PixelIterateTripleModify method is:

    +
    +MagickPassFail PixelIterateTripleModify( PixelIteratorTripleModifyCallback call_back,
    +                                         const PixelIteratorOptions *options,
    +                                         const char *description, void *mutable_data,
    +                                         const void *immutable_data,
    +                                         const unsigned long columns, const unsigned long rows,
    +                                         const Image *source1_image,
    +                                         const Image *source2_image, const long source_x,
    +                                         const long source_y, Image *update_image,
    +                                         const long update_x, const long update_y,
    +                                         ExceptionInfo *exception );
    +
    +
    +
    call_back:
    +
    A user-provided C callback function which reads from +a region of source pixels and updates a region of destination pixels.
    +
    options:
    +
    Pixel iterator execution options (may be NULL).
    +
    description:
    +
    textual description of operation being performed.
    +
    mutable_data:
    +
    User-provided mutable context data.
    +
    immutable_data:
    +
    User-provided immutable context data.
    +
    columns:
    +
    Width of pixel region
    +
    rows:
    +
    Height of pixel region
    +
    source1_image:
    +
    The address of the constant source 1 Image.
    +
    source2_image:
    +
    The address of the constant source 2 Image.
    +
    source_x:
    +
    The horizontal ordinate of the top left corner of the source regions.
    +
    source_y:
    +
    The vertical ordinate of the top left corner of the source regions.
    +
    update_image:
    +
    The address of the update Image.
    +
    update_x:
    +
    The horizontal ordinate of the top left corner of the update region.
    +
    update_y:
    +
    The vertical ordinate of the top left corner of the update region.
    +
    exception:
    +
    If an error is reported, this argument is updated with the reason.
    +
    +
    +
    +
    +

    PixelIterateTripleNew

    +
    +

    Synopsis

    +
    +MagickPassFail PixelIterateTripleNew( PixelIteratorTripleNewCallback call_back,
    +                                      const PixelIteratorOptions *options,
    +                                      const char *description, void *mutable_data,
    +                                      const void *immutable_data,
    +                                      const unsigned long columns, const unsigned long rows,
    +                                      const Image *source1_image,
    +                                      const Image *source2_image, const long source_x,
    +                                      const long source_y, Image *new_image,
    +                                      const long new_x, const long new_y,
    +                                      ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    PixelIterateTripleNew() iterates through pixel regions of three images +and invokes a user-provided callback function (of type +PixelIteratorTripleNewCallback) for each row of pixels. The first two +images are read-only, while the third image is read-write for update. +Access of the first two images is done lock-step using the same coordinates. +This is used if a new output image is created based on two input images. +The difference from PixelIterateTripleModify() is that the output pixels +are not initialized so it is more efficient when outputting a new image.

    +

    The format of the PixelIterateTripleNew method is:

    +
    +MagickPassFail PixelIterateTripleNew( PixelIteratorTripleNewCallback call_back,
    +                                      const PixelIteratorOptions *options,
    +                                      const char *description, void *mutable_data,
    +                                      const void *immutable_data,
    +                                      const unsigned long columns, const unsigned long rows,
    +                                      const Image *source1_image,
    +                                      const Image *source2_image, const long source_x,
    +                                      const long source_y, Image *new_image,
    +                                      const long new_x, const long new_y,
    +                                      ExceptionInfo *exception );
    +
    +
    +
    call_back:
    +
    A user-provided C callback function which reads from +a region of source pixels and initializes a region of destination pixels.
    +
    options:
    +
    Pixel iterator execution options (may be NULL).
    +
    description:
    +
    textual description of operation being performed.
    +
    mutable_data:
    +
    User-provided mutable context data.
    +
    immutable_data:
    +
    User-provided immutable context data.
    +
    columns:
    +
    Width of pixel region
    +
    rows:
    +
    Height of pixel region
    +
    source1_image:
    +
    The address of the constant source 1 Image.
    +
    source2_image:
    +
    The address of the constant source 2 Image.
    +
    source_x:
    +
    The horizontal ordinate of the top left corner of the source regions.
    +
    source_y:
    +
    The vertical ordinate of the top left corner of the source regions.
    +
    new_image:
    +
    The address of the new Image.
    +
    new_x:
    +
    The horizontal ordinate of the top left corner of the new region.
    +
    new_y:
    +
    The vertical ordinate of the top left corner of the new region.
    +
    exception:
    +
    If an error is reported, this argument is updated with the reason.
    +
    +
    +
    +
    + + diff --git a/www/api/plasma.html b/www/api/plasma.html index 79a9d69..9c78b9a 100644 --- a/www/api/plasma.html +++ b/www/api/plasma.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -74,5 +74,10 @@ MagickPassFail PlasmaImage( +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/plasma.html.orig b/www/api/plasma.html.orig new file mode 100644 index 0000000..0f58031 --- /dev/null +++ b/www/api/plasma.html.orig @@ -0,0 +1,78 @@ + + + + + + +plasma + + + + + + + +
    +

    plasma

    +

    Create a Plasma fractal image.

    + +
    +

    Contents

    + +
    +
    +

    PlasmaImage

    +
    +

    Synopsis

    +
    +MagickPassFail PlasmaImage( Image *image, const SegmentInfo *segment,
    +                            unsigned long attenuate, unsigned long depth );
    +
    +
    +
    +

    Description

    +

    PlasmaImage() initializes an image with plasma fractal values. The image +must be initialized with a base color and the random number generator +seeded before this method is called.

    +

    The format of the PlasmaImage method is:

    +
    +MagickPassFail PlasmaImage( Image *image, const SegmentInfo *segment,
    +                            unsigned long attenuate, unsigned long depth );
    +
    +
    +
    image:
    +
    The image.
    +
    segment:
    +
    Define the region to apply plasma fractals values.
    +
    attenuate:
    +
    Define the plasma attenuation factor.
    +
    depth:
    +
    Limit the plasma recursion depth.
    +
    +
    +
    +
    + + diff --git a/www/api/profile.html b/www/api/profile.html index 35d7c0f..c3889b8 100644 --- a/www/api/profile.html +++ b/www/api/profile.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -316,5 +316,10 @@ profile.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/profile.html.orig b/www/api/profile.html.orig new file mode 100644 index 0000000..2701cb5 --- /dev/null +++ b/www/api/profile.html.orig @@ -0,0 +1,320 @@ + + + + + + +profile + + + + + + + +
    +

    profile

    +

    Manipulate embedded profiles

    + + +
    +

    AllocateImageProfileIterator

    +
    +

    Synopsis

    +
    +ImageProfileIterator AllocateImageProfileIterator( const Image *image );
    +
    +
    +
    +

    Description

    +

    AllocateImageProfileIterator allocates an iterator to traverse the +image profile list. It is an error (i.e. will surely crash) to invoke +DeleteImageProfile() on the profile that the iterator is currently +referencing. However, it is safe to delete a profile that the iterator +is not currently referencing. Inserting additional profiles does not +invalidate the current iterator.

    +

    The format of the AllocateImageProfileIterator method is:

    +
    +ImageProfileIterator AllocateImageProfileIterator( const Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    +
    +
    +
    +

    AppendImageProfile

    +
    +

    Synopsis

    +
    +MaickPassFail AppendImageProfile( Image *image, const char *name,
    +                                  const unsigned char *profile_chunk,
    +                                  const size_t chunk_length );
    +
    +
    +
    +

    Description

    +

    AppendImageProfile adds a named profile to the image. If a profile with the +same name already exists, then the new profile data is appended to the +existing profile. If a null profile address is supplied, then an existing +profile is removed. The profile is copied into the image. Note that this +function does not execute CMS color profiles. Any existing CMS color +profile is simply added/updated. Use the ProfileImage() function in order +to execute a CMS color profile.

    +

    The format of the AppendImageProfile method is:

    +
    +MaickPassFail AppendImageProfile( Image *image, const char *name,
    +                                  const unsigned char *profile_chunk,
    +                                  const size_t chunk_length );
    +
    +
    +
    image:
    +
    The image.
    +
    name:
    +
    Profile name. Valid names are "8BIM", "ICM", "IPTC", XMP, or any +unique text string.
    +
    profile_chunk:
    +
    Address of profile chunk to add or append. Pass zero +to remove an existing profile.
    +
    length:
    +
    The length of the profile chunk to add or append.
    +
    +
    +
    +
    +

    DeallocateImageProfileIterator

    +
    +

    Synopsis

    +
    +void DeallocateImageProfileIterator( ImageProfileIterator profile_iterator );
    +
    +
    +
    +

    Description

    +

    DeallocateImageProfileIterator deallocates an image profile iterator.

    +

    The format of the DeallocateImageProfileIterator method is:

    +
    +void DeallocateImageProfileIterator( ImageProfileIterator profile_iterator );
    +
    +

    A description of each parameter follows:

    +
    +
    profile_iterator:
    +
    Profile iterator to deallocate.
    +
    +
    +
    +
    +

    DeleteImageProfile

    +
    +

    Synopsis

    +
    +unsigned int DeleteImageProfile( Image *image, const char *name );
    +
    +
    +
    +

    Description

    +

    DeleteImageProfile removes a named profile from the image.

    +

    The format of the DeleteImageProfile method is:

    +
    +unsigned int DeleteImageProfile( Image *image, const char *name );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    name:
    +
    Profile name. Valid names are "8BIM", "ICM", & "IPTC" or a +generic profile name.
    +
    +
    +
    +
    +

    GetImageProfile

    +
    +

    Synopsis

    +
    +const unsigned char *GetImageProfile( const Image *image, const char *name,
    +                                      size_t *length );
    +
    +
    +
    +

    Description

    +

    GetImageProfile returns a pointer to the named image profile if it is +present. A null pointer is returned if the named profile is not present.

    +

    Older versions of this function stored profiles named "8BIM" and "IPTC" +in the same storage location. This is no longer the case. However, +GetImageProfile() will try the alternate name if the specifically +requested profile name is not available.

    +

    The format of the GetImageProfile method is:

    +
    +const unsigned char *GetImageProfile( const Image *image, const char *name,
    +                                      size_t *length );
    +
    +
    +
    image:
    +
    The image.
    +
    name:
    +
    Profile name. Valid names are "8BIM", "ICM", "IPTC", "XMP" or any +unique text string.
    +
    length:
    +
    Updated with profile length if profile is present. Set to NULL +if length is not needed.
    +
    +
    +
    +
    +

    NextImageProfile

    +
    +

    Synopsis

    +
    +MagickPassFail NextImageProfile( ImageProfileIterator profile_iterator, const char ** name,
    +                                 const unsigned char ** profile, size_t *length );
    +
    +
    +
    +

    Description

    +

    NextImageProfile iterates forward to the next image profile. The profile +name is returned along with the profile data, and length. If there are +no more entries in the list, then MagickFail is returned.

    +

    The format of the AllocateImageProfileIterator method is:

    +
    +MagickPassFail NextImageProfile( ImageProfileIterator profile_iterator, const char ** name,
    +                                 const unsigned char ** profile, size_t *length );
    +
    +
    +
    profile_iterator:
    +
    Profile iterator.
    +
    name:
    +
    Address of pointer to update with address of name.
    +
    profile:
    +
    Address of pointer to update with location of profile data.
    +
    length:
    +
    Address of parameter to update with profile length.
    +
    +
    +
    +
    +

    ProfileImage

    +
    +

    Synopsis

    +
    +unsigned int ProfileImage( Image *image, const char *name, unsigned char *profile,
    +                           const size_t length, unsigned int clone );
    +
    +
    +
    +

    Description

    +

    ProfileImage() adds, applies, or removes a ICM, IPTC, or generic profile +from an image. If the profile is NULL, it is removed from the image +otherwise added (or applied). Use a name of '*' and a profile of NULL to +remove all profiles from the image. Ownership of the profile is +transferred to GraphicsMagick (it should not be altered or deallocated) +unless the clone option is set to True.

    +

    ICC ICM profiles are a special case and are handled as follows:

    +

    If there is no ICM profile currently associated with the image, then +the profile is simply associated with the image and the image pixels +are not altered.

    +

    If there is already a ICM profile associated with the image, then +the colorspace transform described by the existing and new profiles +is applied to the image pixels, and the new profile is associated +with the image.

    +

    The format of the ProfileImage method is:

    +
    +unsigned int ProfileImage( Image *image, const char *name, unsigned char *profile,
    +                           const size_t length, unsigned int clone );
    +
    +
    +
    image:
    +
    The image.
    +
    name:
    +
    Name of profile to add or remove: ICM, IPTC, or generic profile.
    +
    profile:
    +
    The profile. Can not be 'const' due to 'clone' option but +is treated as 'const' if 'clone' is set to MagickTrue.
    +
    length:
    +
    The length of the profile.
    +
    clone:
    +
    If set True, then copy the profile rather than taking +ownership of it.
    +
    +
    +
    +
    +

    SetImageProfile

    +
    +

    Synopsis

    +
    +unsigned int SetImageProfile( Image *image, const char *name, const unsigned char *profile,
    +                              const size_t length );
    +
    +
    +
    +

    Description

    +

    SetImageProfile adds a named profile to the image. If a profile with the +same name already exists, then it is replaced. If a null profile address +is supplied, then an existing profile is removed. The profile is copied +into the image. Note that this function does not execute CMS color +profiles. Any existing CMS color profile is simply replaced. Use the +ProfileImage() function in order to execute a CMS color profile.

    +

    Older versions of this function stored profiles named "8BIM" and "IPTC" +in the same storage location. This is no longer the case. However, +GetImageProfile() will try the alternate name if the specifically +requested profile name is not available. Note that when trying to remove +a profile, it may be necessary to remove both names in order for an +"IPTC" profile to no longer be included in output file formats.

    +

    The format of the SetImageProfile method is:

    +
    +unsigned int SetImageProfile( Image *image, const char *name, const unsigned char *profile,
    +                              const size_t length );
    +
    +
    +
    image:
    +
    The image.
    +
    name:
    +
    Profile name. Valid names are "8BIM", "ICM", "IPTC", XMP, or any +unique text string.
    +
    profile:
    +
    Address of profile to add. Pass zero to remove an existing +profile.
    +
    length:
    +
    The length of the profile.
    +
    +
    +
    +
    + + diff --git a/www/api/quantize.html b/www/api/quantize.html index ce03f4c..70dcffd 100644 --- a/www/api/quantize.html +++ b/www/api/quantize.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -350,5 +350,10 @@ unsigned int QuantizeImages( const +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/quantize.html.orig b/www/api/quantize.html.orig new file mode 100644 index 0000000..3af2262 --- /dev/null +++ b/www/api/quantize.html.orig @@ -0,0 +1,354 @@ + + + + + + +quantize + + + + + + + +
    +

    quantize

    +

    Reduce the number of colors in an image

    + + +
    +

    CloneQuantizeInfo

    +
    +

    Synopsis

    +
    +QuantizeInfo *CloneQuantizeInfo( const QuantizeInfo *quantize_info );
    +
    +
    +
    +

    Description

    +

    CloneQuantizeInfo() makes a duplicate of the given quantize info structure, +or if quantize info is NULL, a new one.

    +

    The format of the CloneQuantizeInfo method is:

    +
    +QuantizeInfo *CloneQuantizeInfo( const QuantizeInfo *quantize_info );
    +
    +

    A description of each parameter follows:

    +
    +
    clone_info:
    +
    Method CloneQuantizeInfo returns a duplicate of the given +quantize info, or if image info is NULL a new one.
    +
    quantize_info:
    +
    a structure of type info.
    +
    +
    +
    +
    +

    CompressImageColormap

    +
    +

    Synopsis

    +
    +void CompressImageColormap( Image *image );
    +
    +
    +
    +

    Description

    +

    CompressImageColormap() compresses an image colormap by removing any +duplicate or unused color entries.

    +

    The format of the CompressImageColormap method is:

    +
    +void CompressImageColormap( Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    +
    +
    +
    +

    DestroyQuantizeInfo

    +
    +

    Synopsis

    +
    +DestroyQuantizeInfo( QuantizeInfo *quantize_info );
    +
    +
    +
    +

    Description

    +

    DestroyQuantizeInfo() deallocates memory associated with an QuantizeInfo +structure.

    +

    The format of the DestroyQuantizeInfo method is:

    +
    +DestroyQuantizeInfo( QuantizeInfo *quantize_info );
    +
    +

    A description of each parameter follows:

    +
    +
    quantize_info:
    +
    Specifies a pointer to an QuantizeInfo structure.
    +
    +
    +
    +
    +

    GetImageQuantizeError

    +
    +

    Synopsis

    +
    +unsigned int GetImageQuantizeError( Image *image );
    +
    +
    +
    +

    Description

    +

    GetImageQuantizeError() measures the difference between the original +and quantized images. This difference is the total quantization error. +The error is computed by summing over all pixels in an image the distance +squared in RGB space between each reference pixel value and its quantized +value. These values are computed:

    +

    o mean_error_per_pixel: This value is the mean error for any single +pixel in the image.

    +

    o normalized_mean_square_error: This value is the normalized mean +quantization error for any single pixel in the image. This distance +measure is normalized to a range between 0 and 1. It is independent +of the range of red, green, and blue values in the image.

    +

    o normalized_maximum_square_error: This value is the normalized +maximum quantization error for any single pixel in the image. This +distance measure is normalized to a range between 0 and 1. It is +independent of the range of red, green, and blue values in your image.

    +

    The format of the GetImageQuantizeError method is:

    +
    +unsigned int GetImageQuantizeError( Image *image );
    +
    +

    A description of each parameter follows.

    +
    +
    image:
    +
    Specifies a pointer to an Image structure; returned from +ReadImage.
    +
    +
    +
    +
    +

    GetQuantizeInfo

    +
    +

    Synopsis

    +
    +GetQuantizeInfo( QuantizeInfo *quantize_info );
    +
    +
    +
    +

    Description

    +

    GetQuantizeInfo() initializes the QuantizeInfo structure.

    +

    The format of the GetQuantizeInfo method is:

    +
    +GetQuantizeInfo( QuantizeInfo *quantize_info );
    +
    +

    A description of each parameter follows:

    +
    +
    quantize_info:
    +
    Specifies a pointer to a QuantizeInfo structure.
    +
    +
    +
    +
    +

    GrayscalePseudoClassImage

    +
    +

    Synopsis

    +
    +void GrayscalePseudoClassImage( Image *image );
    +
    +
    +
    +

    Description

    +

    GrayscalePseudoClassImage converts an image to a PseudoClass +grayscale representation with an (optionally) compressed and sorted +colormap. Colormap is ordered by increasing intensity.

    +

    The format of the GrayscalePseudoClassImage method is:

    +
    +void GrayscalePseudoClassImage( Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    optimize_colormap:
    +
    If true, produce an optimimal (compact) colormap.
    +
    +
    +
    +
    +

    MapImage

    +
    +

    Synopsis

    +
    +unsigned int MapImage( Image *image, const Image *map_image,
    +                       const unsigned int dither );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the MapImage method is:

    +
    +unsigned int MapImage( Image *image, const Image *map_image,
    +                       const unsigned int dither );
    +
    +
    +
    image:
    +
    Specifies a pointer to an Image structure.
    +
    map_image:
    +
    Specifies a pointer to an Image structure. Reduce +image to a set of colors represented by this image.
    +
    dither:
    +
    Set this integer value to something other than zero to +dither the quantized image.
    +
    +
    +
    +
    +

    MapImages

    +
    +

    Synopsis

    +
    +unsigned int MapImages( Image *images, Image *map_image, const unsigned int dither );
    +
    +
    +
    +

    Description

    +

    MapImages() replaces the colors of a sequence of images with the closest +color from a reference image. If the reference image does not contain a +colormap, then a colormap will be created based on existing colors in the +reference image. The order and number of colormap entries does not match +the reference image. If the order and number of colormap entries needs to +match the reference image, then the ReplaceImageColormap() function may be +used after invoking MapImages() in order to apply the reference colormap.

    +

    The format of the MapImage method is:

    +
    +unsigned int MapImages( Image *images, Image *map_image, const unsigned int dither );
    +
    +
    +
    image:
    +
    Specifies a pointer to a set of Image structures.
    +
    map_image:
    +
    Specifies a pointer to an Image structure. Reduce +image to a set of colors represented by this image.
    +
    dither:
    +
    Set this integer value to something other than zero to +dither the quantized image.
    +
    +
    +
    +
    +

    OrderedDitherImage

    +
    +

    Synopsis

    +
    +unsigned int OrderedDitherImage( Image *image );
    +
    +
    +
    +

    Description

    +

    OrderedDitherImage() uses the ordered dithering technique of reducing color +images to monochrome using positional information to retain as much +information as possible.

    +

    The format of the OrderedDitherImage method is:

    +
    +unsigned int OrderedDitherImage( Image *image );
    +
    +

    A description of each parameter follows.

    +
    +
    image:
    +
    Specifies a pointer to an Image structure; returned from +ReadImage.
    +
    +
    +
    +
    +

    QuantizeImage

    +
    +

    Synopsis

    +
    +unsigned int QuantizeImage( const QuantizeInfo *quantize_info, Image *image );
    +
    +
    +
    +

    Description

    +

    QuantizeImage() analyzes the colors within a reference image and chooses a +fixed number of colors to represent the image. The goal of the algorithm +is to minimize the color difference between the input and output image while +minimizing the processing time.

    +

    The format of the QuantizeImage method is:

    +
    +unsigned int QuantizeImage( const QuantizeInfo *quantize_info, Image *image );
    +
    +
    +
    quantize_info:
    +
    Specifies a pointer to an QuantizeInfo structure.
    +
    image:
    +
    Specifies a pointer to an Image structure.
    +
    +
    +
    +
    +

    QuantizeImages

    +
    +

    Synopsis

    +
    +unsigned int QuantizeImages( const QuantizeInfo *quantize_info, Image *images );
    +
    +
    +
    +

    Description

    +

    QuantizeImages() analyzes the colors within a set of reference images and +chooses a fixed number of colors to represent the set. The goal of the +algorithm is to minimize the color difference between the input and output +images while minimizing the processing time.

    +

    The format of the QuantizeImages method is:

    +
    +unsigned int QuantizeImages( const QuantizeInfo *quantize_info, Image *images );
    +
    +
    +
    quantize_info:
    +
    Specifies a pointer to an QuantizeInfo structure.
    +
    images:
    +
    Specifies a pointer to a list of Image structures.
    +
    +
    +
    +
    + + diff --git a/www/api/registry.html b/www/api/registry.html index b509fef..ce80b71 100644 --- a/www/api/registry.html +++ b/www/api/registry.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -159,5 +159,10 @@ otherise the blob length in number of bytes.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/registry.html.orig b/www/api/registry.html.orig new file mode 100644 index 0000000..4e75ade --- /dev/null +++ b/www/api/registry.html.orig @@ -0,0 +1,163 @@ + + + + + + +registry + + + + + + + +
    +

    registry

    +

    In-memory image registration interface

    + + +
    +

    DeleteMagickRegistry

    +
    +

    Synopsis

    +
    +MagickPassFail DeleteMagickRegistry( const long id );
    +
    +
    +
    +

    Description

    +

    DeleteMagickRegistry() deletes an entry in the registry as defined by the +id. It returns MagickPass if the entry is deleted otherwise MagickFail if +no entry is found in the registry that matches the id.

    +

    The format of the DeleteMagickRegistry method is:

    +
    +MagickPassFail DeleteMagickRegistry( const long id );
    +
    +

    A description of each parameter follows:

    +
    +
    id:
    +
    The registry id.
    +
    +
    +
    +
    +

    GetImageFromMagickRegistry

    +
    +

    Synopsis

    +
    +Image *GetImageFromMagickRegistry( const char *name, long *id,
    +                                   ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    GetImageFromMagickRegistry() gets an image from the registry as defined by +its name. If the blob that matches the name is not found, NULL is returned.

    +

    The format of the GetImageFromMagickRegistry method is:

    +
    +Image *GetImageFromMagickRegistry( const char *name, long *id,
    +                                   ExceptionInfo *exception );
    +
    +
    +
    name:
    +
    The name of the image to retrieve from the registry.
    +
    id:
    +
    The registry id.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    GetMagickRegistry

    +
    +

    Synopsis

    +
    +const void *GetMagickRegistry( const long id, RegistryType *type, size_t *length,
    +                               ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    GetMagickRegistry() gets a blob from the registry as defined by the id. If +the blob that matches the id is not found, NULL is returned.

    +

    The format of the GetMagickRegistry method is:

    +
    +const void *GetMagickRegistry( const long id, RegistryType *type, size_t *length,
    +                               ExceptionInfo *exception );
    +
    +
    +
    id:
    +
    The registry id.
    +
    type:
    +
    The registry type.
    +
    length:
    +
    The blob length in number of bytes.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    SetMagickRegistry

    +
    +

    Synopsis

    +
    +long SetMagickRegistry( const RegistryType type, const void *blob, const size_t length,
    +                        ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    SetMagickRegistry() sets a blob into the registry and returns a unique ID. +If an error occurs, -1 is returned.

    +

    The format of the SetMagickRegistry method is:

    +
    +long SetMagickRegistry( const RegistryType type, const void *blob, const size_t length,
    +                        ExceptionInfo *exception );
    +
    +
    +
    type:
    +
    The registry type.
    +
    blob:
    +
    The address of a Binary Large OBject.
    +
    length:
    +
    For a registry type of ImageRegistryType use sizeof(Image) +otherise the blob length in number of bytes.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    + + diff --git a/www/api/render.html b/www/api/render.html index 976eaec..a8d45a5 100644 --- a/www/api/render.html +++ b/www/api/render.html @@ -3,7 +3,7 @@ - + render @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Low-level methods to draw on an image

    -

    Contents

    +

    Contents

    @@ -37,7 +37,7 @@

    Resize an image

    -

    Contents

    +

    Contents

    • MagnifyImage
    • MinifyImage
    • @@ -155,7 +155,8 @@ are windowed (brought down to zero) with the Blackman filter.

      Description

      SampleImage() scales an image to the desired dimensions with pixel sampling. Unlike other scaling methods, this method does not introduce -any additional color into the scaled image.

      +any additional color into the scaled image. SampleImage() is extremely +fast and may be used where speed is most important.

      The format of the SampleImage method is:

       Image *SampleImage( const Image *image, const unsigned long columns,
      @@ -184,7 +185,10 @@ any additional color into the scaled image.

    Description

    -

    ScaleImage() changes the size of an image to the given dimensions.

    +

    ScaleImage() changes the size of an image to the specified dimensions. +This method is reasonably fast but it is not currently multi-threaded +and does not support image filters. The quality of the resized image +is sufficient for most purposes.

    The format of the ScaleImage method is:

     Image *ScaleImage( const Image *image, const unsigned long columns,
    @@ -214,8 +218,10 @@ any additional color into the scaled image.

    Description

    ThumbnailImage() changes the size of an image to the given dimensions. -This method was designed by Bob Friesenhahn as a low cost thumbnail -generator.

    +This method was designed as a low cost thumbnail generator. +ThumbnailImage() is typically very fast but an attempt is made to improve +quality by first using a simple sampling algorithm for part of the +reduction, and then a filtering algorithm to produce the final image.

    The format of the ThumbnailImage method is:

     Image *ThumbnailImage( const Image *image, const unsigned long columns,
    @@ -234,5 +240,10 @@ generator.

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/resize.html.orig b/www/api/resize.html.orig new file mode 100644 index 0000000..78259f1 --- /dev/null +++ b/www/api/resize.html.orig @@ -0,0 +1,238 @@ + + + + + + +resize + + + + + + + +
    +

    resize

    +

    Resize an image

    + + +
    +

    MagnifyImage

    +
    +

    Synopsis

    +
    +Image *MagnifyImage( const Image *image, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    MagnifyImage() is a convenience method that scales an image proportionally +to twice its size.

    +

    The format of the MagnifyImage method is:

    +
    +Image *MagnifyImage( const Image *image, ExceptionInfo *exception );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    MinifyImage

    +
    +

    Synopsis

    +
    +Image *MinifyImage( const Image *image, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    MinifyImage() is a convenience method that scales an image proportionally +to half its size.

    +

    The format of the MinifyImage method is:

    +
    +Image *MinifyImage( const Image *image, ExceptionInfo *exception );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ResizeImage

    +
    +

    Synopsis

    +
    +Image *ResizeImage( Image *image, const unsigned long columns, const unsigned long rows,
    +                    const FilterTypes filter, const double blur,
    +                    ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    ResizeImage() scales an image to the desired dimensions with one of these +filters:

    +

    Bessel Blackman Box +Catrom Cubic Gaussian +Hanning Hermite Lanczos +Mitchell Point Quandratic +Sinc Triangle

    +

    Most of the filters are FIR (finite impulse response), however, Bessel, +Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc +are windowed (brought down to zero) with the Blackman filter.

    +

    ResizeImage() was inspired by Paul Heckbert's zoom program.

    +

    The format of the ResizeImage method is:

    +
    +Image *ResizeImage( Image *image, const unsigned long columns, const unsigned long rows,
    +                    const FilterTypes filter, const double blur,
    +                    ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    columns:
    +
    The number of columns in the scaled image.
    +
    rows:
    +
    The number of rows in the scaled image.
    +
    filter:
    +
    Image filter to use.
    +
    blur:
    +
    The blur factor where > 1 is blurry, < 1 is sharp.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    SampleImage

    +
    +

    Synopsis

    +
    +Image *SampleImage( const Image *image, const unsigned long columns,
    +                    const unsigned long rows, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    SampleImage() scales an image to the desired dimensions with pixel +sampling. Unlike other scaling methods, this method does not introduce +any additional color into the scaled image.

    +

    The format of the SampleImage method is:

    +
    +Image *SampleImage( const Image *image, const unsigned long columns,
    +                    const unsigned long rows, ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    columns:
    +
    The number of columns in the sampled image.
    +
    rows:
    +
    The number of rows in the sampled image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ScaleImage

    +
    +

    Synopsis

    +
    +Image *ScaleImage( const Image *image, const unsigned long columns,
    +                   const unsigned long rows, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    ScaleImage() changes the size of an image to the given dimensions.

    +

    The format of the ScaleImage method is:

    +
    +Image *ScaleImage( const Image *image, const unsigned long columns,
    +                   const unsigned long rows, ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    columns:
    +
    The number of columns in the scaled image.
    +
    rows:
    +
    The number of rows in the scaled image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ThumbnailImage

    +
    +

    Synopsis

    +
    +Image *ThumbnailImage( const Image *image, const unsigned long columns,
    +                       const unsigned long rows, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    ThumbnailImage() changes the size of an image to the given dimensions. +This method was designed by Bob Friesenhahn as a low cost thumbnail +generator.

    +

    The format of the ThumbnailImage method is:

    +
    +Image *ThumbnailImage( const Image *image, const unsigned long columns,
    +                       const unsigned long rows, ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    columns:
    +
    The number of columns in the scaled image.
    +
    rows:
    +
    The number of rows in the scaled image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    + + diff --git a/www/api/resource.html b/www/api/resource.html index ad5cff2..6d1c1bd 100644 --- a/www/api/resource.html +++ b/www/api/resource.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -198,5 +198,10 @@ void SetMagickResourceLimit( const +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/segment.html b/www/api/segment.html index 3dba385..eab5fa7 100644 --- a/www/api/segment.html +++ b/www/api/segment.html @@ -3,7 +3,7 @@ - + segment @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -37,7 +37,7 @@

    Segment and image with thresholding using the fuzzy c-means method

    -

    Contents

    +

    Contents

    @@ -95,5 +95,10 @@ causes small variations (could be noise) to be ignored.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/segment.html.orig b/www/api/segment.html.orig new file mode 100644 index 0000000..4ca77ec --- /dev/null +++ b/www/api/segment.html.orig @@ -0,0 +1,99 @@ + + + + + + +segment + + + + + + + +
    +

    segment

    +

    Segment and image with thresholding using the fuzzy c-means method

    + +
    +

    Contents

    + +
    +
    +

    SegmentImage

    +
    +

    Synopsis

    +
    +MagickPassFail SegmentImage( Image *image, const ColorspaceType colorspace,
    +                             const unsigned int verbose, const double cluster_threshold,
    +                             const double smoothing_threshold );
    +
    +
    +
    +

    Description

    +

    Method SegmentImage segment an image by analyzing the histograms of the +color components and identifying units that are homogeneous with the fuzzy +c-means technique.

    +

    Specify cluster threshold as the number of pixels in each cluster must +exceed the the cluster threshold to be considered valid. Smoothing +threshold eliminates noise in the second derivative of the histogram. +As the value is increased, you can expect a smoother second derivative. +The default is 1.5.

    +

    The format of the SegmentImage method is:

    +
    +MagickPassFail SegmentImage( Image *image, const ColorspaceType colorspace,
    +                             const unsigned int verbose, const double cluster_threshold,
    +                             const double smoothing_threshold );
    +
    +
    +
    image:
    +
    Specifies a pointer to an Image structure; returned from +ReadImage.
    +
    colorspace:
    +
    An unsigned integer value that indicates the colorspace. +Empirical evidence suggests that distances in YUV or YIQ correspond to +perceptual color differences more closely than do distances in RGB +space. The image is then returned to RGB colorspace after color +reduction.
    +
    verbose:
    +
    A value greater than zero prints detailed information about +the identified classes.
    +
    cluster_threshold:
    +
    The minimum number of total pixels contained +in a hexahedra before it can be considered valid (expressed as a +percentage of total pixels). This is used to eliminate seldom +used colors.
    +
    smoothing_threshold:
    +
    If the absolute value of a second derivative +point is less than smoothing_threshold then that derivative point +is ignored (i.e. set to 0) while evaluating zero crossings. This +causes small variations (could be noise) to be ignored.
    +
    +
    +
    +
    + + diff --git a/www/api/shear.html b/www/api/shear.html index ca329e9..1ef8fdd 100644 --- a/www/api/shear.html +++ b/www/api/shear.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -189,5 +189,10 @@ ReadImage.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/shear.html.orig b/www/api/shear.html.orig new file mode 100644 index 0000000..0bca62a --- /dev/null +++ b/www/api/shear.html.orig @@ -0,0 +1,193 @@ + + + + + + +shear + + + + + + + +
    +

    shear

    +

    Rotate image, shear image, or apply a 2D affine transformation

    + + +
    +

    AffineTransformImage

    +
    +

    Synopsis

    +
    +Image *AffineTransformImage( const Image *image, AffineMatrix *affine,
    +                             ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the AffineTransformImage method is:

    +
    +Image *AffineTransformImage( const Image *image, AffineMatrix *affine,
    +                             ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    affine:
    +
    The affine transform.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    AutoOrientImage

    +
    +

    Synopsis

    +
    +Image *AutoOrientImage( const Image *image, const OrientationType current_orientation,
    +                        ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    AutoOrientImage() returns an image adjusted so that its orientation is +suitable for viewing (i.e. top-left orientation).

    +

    The format of the AutoOrientImage method is:

    +
    +Image *AutoOrientImage( const Image *image, const OrientationType current_orientation,
    +                        ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    current_orientation:
    +
    Current image orientation (normally same as +image->orientation).
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    RotateImage

    +
    +

    Synopsis

    +
    +Image *RotateImage( const Image *image, const double degrees,
    +                    ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    Method 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 color +specified by the image background_color. RotateImage allocates the memory +necessary for the new Image structure and returns a pointer to the new +image.

    +

    Method RotateImage is based on the paper "A Fast Algorithm for General +Raster Rotatation" by Alan W. Paeth. RotateImage is adapted from a similar +method based on the Paeth paper written by Michael Halle of the Spatial +Imaging Group, MIT Media Lab.

    +

    The format of the RotateImage method is:

    +
    +Image *RotateImage( const Image *image, const double degrees,
    +                    ExceptionInfo *exception );
    +
    +
    +
    status:
    +
    Method RotateImage returns a pointer to the image after +rotating. A null image is returned if there is a memory shortage.
    +
    image:
    +
    The image; returned from +ReadImage.
    +
    degrees:
    +
    Specifies the number of degrees to rotate the image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    +

    ShearImage

    +
    +

    Synopsis

    +
    +Image *ShearImage( const Image *image, const double x_shear, const double y_shear,
    +                   ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    Method ShearImage creates a new image that is a shear_image copy of an +existing one. Shearing slides one edge of an image along the X or Y +axis, creating a parallelogram. An X direction shear slides an edge +along the X axis, while a Y direction shear slides an edge along the Y +axis. The amount of the shear is controlled by a shear angle. For X +direction shears, x_shear is measured relative to the Y axis, and +similarly, for Y direction shears y_shear is measured relative to the +X axis. Empty triangles left over from shearing the image are filled +with the color defined by the pixel at location (0,0). ShearImage +allocates the memory necessary for the new Image structure and returns +a pointer to the new image.

    +

    Method ShearImage is based on the paper "A Fast Algorithm for General +Raster Rotatation" by Alan W. Paeth.

    +

    The format of the ShearImage method is:

    +
    +Image *ShearImage( const Image *image, const double x_shear, const double y_shear,
    +                   ExceptionInfo *exception );
    +
    +
    +
    status:
    +
    Method ShearImage returns a pointer to the image after +rotating. A null image is returned if there is a memory shortage.
    +
    image:
    +
    The image; returned from +ReadImage.
    +
    x_shear, y_shear:
    +
    Specifies the number of degrees to shear the image.
    +
    exception:
    +
    Return any errors or warnings in this structure.
    +
    +
    +
    +
    + + diff --git a/www/api/signature.html b/www/api/signature.html index f573d2d..d73b3a3 100644 --- a/www/api/signature.html +++ b/www/api/signature.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -165,5 +165,10 @@ UpdateSignature( +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/signature.html.orig b/www/api/signature.html.orig new file mode 100644 index 0000000..8fc7c40 --- /dev/null +++ b/www/api/signature.html.orig @@ -0,0 +1,169 @@ + + + + + + +signature + + + + + + + +
    +

    signature

    +

    Add a digital signature to the image

    + + +
    +

    FinalizeSignature

    +
    +

    Synopsis

    +
    +FinalizeSignature( SignatureInfo *signature_info );
    +
    +
    +
    +

    Description

    +

    Method FinalizeSignature finalizes the SHA message digest computation.

    +

    The format of the FinalizeSignature method is:

    +
    +FinalizeSignature( SignatureInfo *signature_info );
    +
    +

    A description of each parameter follows:

    +
    +
    signature_info:
    +
    The address of a structure of type SignatureInfo.
    +
    +
    +
    +
    +

    GetSignatureInfo

    +
    +

    Synopsis

    +
    +GetSignatureInfo( SignatureInfo *signature_info );
    +
    +
    +
    +

    Description

    +

    Method GetSignatureInfo initializes the SHA message digest structure.

    +

    The format of the GetSignatureInfo method is:

    +
    +GetSignatureInfo( SignatureInfo *signature_info );
    +
    +

    A description of each parameter follows:

    +
    +
    signature_info:
    +
    The address of a structure of type SignatureInfo.
    +
    +
    +
    +
    +

    SignatureImage

    +
    +

    Synopsis

    +
    +unsigned int SignatureImage( Image *image );
    +
    +
    +
    +

    Description

    +

    SignatureImage() computes a message digest from an image pixel stream with +an implementation of the NIST SHA-256 Message Digest algorithm. This +signature uniquely identifies the image and is convenient for determining +if an image has been modified or whether two images are identical.

    +

    The format of the SignatureImage method is:

    +
    +unsigned int SignatureImage( Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    +
    +
    +
    +

    TransformSignature

    +
    +

    Synopsis

    +
    +TransformSignature( SignatureInfo *signature_info );
    +
    +
    +
    +

    Description

    +

    TransformSignature() transforms the SHA message digest.

    +

    The format of the TransformSignature method is:

    +
    +TransformSignature( SignatureInfo *signature_info );
    +
    +

    A description of each parameter follows:

    +
    +
    signature_info:
    +
    The address of a structure of type SignatureInfo.
    +
    +
    +
    +
    +

    UpdateSignature

    +
    +

    Synopsis

    +
    +UpdateSignature( SignatureInfo *signature_info, const unsigned char *message,
    +                 const size_t length );
    +
    +
    +
    +

    Description

    +

    UpdateSignature() updates the SHA message digest.

    +

    The format of the UpdateSignature method is:

    +
    +UpdateSignature( SignatureInfo *signature_info, const unsigned char *message,
    +                 const size_t length );
    +
    +
    +
    signature_info:
    +
    The address of a structure of type SignatureInfo.
    +
    message:
    +
    the message
    +
    length:
    +
    The length of the message.
    +
    +
    +
    +
    + + diff --git a/www/api/statistics.html b/www/api/statistics.html index 9b41735..d40e59c 100644 --- a/www/api/statistics.html +++ b/www/api/statistics.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -47,8 +47,8 @@

    Synopsis

    -MagickPassFail GetImageStatistics( const Image *image,
    -                                   ImageStatistics *statistics ExceptionInfo *exception );
    +MagickPassFail GetImageStatistics( const Image *image, ImageStatistics *statistics,
    +                                   ExceptionInfo *exception );
     
    @@ -61,8 +61,8 @@ the statistics in quantum units. Statistics for non-existent channels are set to zero.

    The format of the GetImageStatistics method is:

    -MagickPassFail GetImageStatistics( const Image *image,
    -                                   ImageStatistics *statistics ExceptionInfo *exception );
    +MagickPassFail GetImageStatistics( const Image *image, ImageStatistics *statistics,
    +                                   ExceptionInfo *exception );
     
    image:
    @@ -75,5 +75,10 @@ MagickPassFail GetImageStatistics( const +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/statistics.html.orig b/www/api/statistics.html.orig new file mode 100644 index 0000000..d89ca35 --- /dev/null +++ b/www/api/statistics.html.orig @@ -0,0 +1,79 @@ + + + + + + +statistics + + + + + + + +
    +

    statistics

    +

    Compute image statistics

    + +
    +

    Contents

    + +
    +
    +

    GetImageStatistics

    +
    +

    Synopsis

    +
    +MagickPassFail GetImageStatistics( const Image *image,
    +                                   ImageStatistics *statistics ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    GetImageStatistics computes common statistics (currently maximum, minimum, +mean and standard deviation) for the available image channels. The +per-channel values are returned in an ImageStatistics structure. Statistics +are normalized to the range 0.0 to 1.0. Multiply values by MaxRGB to obtain +the statistics in quantum units. Statistics for non-existent channels are +set to zero.

    +

    The format of the GetImageStatistics method is:

    +
    +MagickPassFail GetImageStatistics( const Image *image,
    +                                   ImageStatistics *statistics ExceptionInfo *exception );
    +
    +
    +
    image:
    +
    The image.
    +
    statistics:
    +
    An ImageStatistics structure to update with statistics.
    +
    exception:
    +
    Any errors are reported here.
    +
    +
    +
    +
    + + diff --git a/www/api/texture.html b/www/api/texture.html index 9640590..760111e 100644 --- a/www/api/texture.html +++ b/www/api/texture.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -102,5 +102,10 @@ MagickPassFail TextureImage( +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/texture.html.orig b/www/api/texture.html.orig new file mode 100644 index 0000000..9202069 --- /dev/null +++ b/www/api/texture.html.orig @@ -0,0 +1,106 @@ + + + + + + +texture + + + + + + + +
    +

    texture

    +

    Image texture functions

    + + +
    +

    ConstituteTextureImage

    +
    +

    Synopsis

    +
    +Image *ConstituteTextureImage( unsigned long columns, unsigned long rows,
    +                               const Image *texture, ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    ConstituteTextureImage() returns a new image canvas based on repeatedly +tiling the texture image across and down the new image canvas. The +returned image properties are similar to the texture image properties.

    +

    The format of the TextureImage method is:

    +
    +Image *ConstituteTextureImage( unsigned long columns, unsigned long rows,
    +                               const Image *texture, ExceptionInfo *exception );
    +
    +
    +
    columns:
    +
    The number of columns in the new image.
    +
    rows:
    +
    The number of rows in the new image.
    +
    texture:
    +
    The texture image to layer on the background.
    +
    exceptions:
    +
    Any errors are reported here.
    +
    +
    +
    +
    +

    TextureImage

    +
    +

    Synopsis

    +
    +MagickPassFail TextureImage( Image *image, const Image *texture );
    +
    +
    +
    +

    Description

    +

    TextureImage() repeatedly tiles the texture image across and down the image +canvas. If the image canvas includes a matte channel, then the tile is +alpha-composited "under" the image and the matte channel is removed. +MagickFail is returned if an error is encountered.

    +

    The format of the TextureImage method is:

    +
    +MagickPassFail TextureImage( Image *image, const Image *texture );
    +
    +

    A description of each parameter follows:

    +
    +
    image:
    +
    The image.
    +
    texture:
    +
    This image is the texture to layer on the background.
    +
    +
    +
    +
    + + diff --git a/www/api/transform.html b/www/api/transform.html index bc9ed7b..bdc3b7b 100644 --- a/www/api/transform.html +++ b/www/api/transform.html @@ -3,7 +3,7 @@ - + transform @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/types.html b/www/api/types.html index ac7104b..432fb07 100644 --- a/www/api/types.html +++ b/www/api/types.html @@ -3,7 +3,7 @@ - + GraphicsMagick Types @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -501,7 +504,7 @@ layer in composite image. The other layers are copied untouched. encoding an image. Be aware that most image types only support a sub-set of the available compression types. If the compression type specified is incompatable with the image, GraphicsMagick selects a compression type -compatable with the image type.

    +compatable with the image type, which might be no compression at all.

    @@ -543,6 +546,24 @@ Huffman coding) as used by bzip2 utilities + + + + + + + + + + + + + + + + + +
    CompressionType
    ZipCompression Lempel-Ziv compression (LZ77) as used in PKZIP and GNU gzip.
    LZMACompressionLZMA - Lempel-Ziv-Markov chain algorithm
    JPEG2000CompressionJPEG 2000 - ISO/IEC std 15444-1
    JBIG1CompressionJBIG v1 - ISO/IEC std 11544 / ITU-T rec T.82
    JBIG2CompressionJBIG v2 - ISO/IEC std 14492 / ITU-T rec T.88
    ZSTDCompressionFacebook's Zstandard/Zstd
    WebPCompressionGoogle's WebP
    @@ -1119,8 +1140,144 @@ position an object. A common default for gravity is NorthWestGravity.

    +
    +

    LogEventType

    +

    LogEventType specifies the log event type to match one or more log +areas. Although defined as an enum type, the values are based on +unsigned integer flags value with one mask bit set, more than one mask +bit set, or all of the assigned mask bits set. Values are boolean +ORed together to represent multiple event types.

    + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    LogEventType
    EnumerationDescription
    UndefinedEventMaskNo events specified
    NoEventsMaskNo events specified
    ConfigureEventMaskConfiguration event (related to initialization or shutdown)
    AnnotateEventMaskAnnotation event (text drawing)
    RenderEventMaskRendering event (vector drawing)
    TransformEventMaskImage transformation event (e.g. cropping)
    LocaleEventMaskLocale event (internationalization)
    CoderEventMaskCoder event (file decode or encode)
    X11EventMaskX11 event (event related to use of X11)
    CacheEventMaskPixel cache event (pixel storage in memory or on disk)
    BlobEventMaskBlob event (I/O to/from memory or a file)
    DeprecateEventMaskDeprecation event (use of a function which will be removed)
    UserEventMaskUser event (event allowed for the user, not otherwise used)
    ResourceEventMaskResource event (resource limit assignment, allocation/deallocation)
    TemporaryFileEventMaskTemporary file event (temporary file created or removed)
    ExceptionEventMaskException event (a warning or error was reported into ExceptionInfo)
    OptionEventMaskOption event (something related to a user provided option)
    InformationEventMaskInformation event
    WarningEventMaskWarning event (a warning was reported into ExceptionInfo)
    ErrorEventMaskError event (an error was reported into ExceptionInfo)
    FatalErrorEventMaskFatal error event (a fatal error was reported into ExceptionInfo)
    AllEventsMaskAll events (matches any/all events)
    +
    +
    +

    LogMethod

    +

    LogMethod is a call-back function type in the form:

    +
    +typedef void (*LogMethod)(const ExceptionType type,const char *text)
    +
    +
    +
    +

    LogOutputType

    +

    LogOutputType specifies how/where logging ("tracing") output is to be directed.

    + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    LogOutputType
    EnumerationDescription
    DisabledOutputReporting disabled
    UndefinedOutputReporting disabled
    StdoutOutputLog to stdout in "human readable" format
    StderrOutputLog to stderr in "human readable" format
    XMLFileOutputLog to a file in an XML format
    TXTFileOutputLog to a file in a text format
    Win32DebugOutputWindows, Output events to the application/system debugger.
    Win32EventlogOutputWindows, Output events to the Application event log.
    MethodOutputLog by calling registered C-language callback function
    +
    -

    Image

    +

    Image

    The Image structure represents an GraphicsMagick image. It is initially allocated by AllocateImage() and deallocated by DestroyImage(). The functions ReadImage(), ReadImages(), BlobToImage() and CreateImage() @@ -1415,7 +1572,7 @@ by GetNumberColors().

    -

    ImageInfo

    +

    ImageInfo

    The ImageInfo structure is used to supply option information to the functions AllocateImage(), AnimateImages(), BlobToImage(), CloneAnnotateInfo(), DisplayImages(), GetAnnotateInfo(), ImageToBlob(), @@ -1636,7 +1793,7 @@ JBIG, or JPEG.

    -

    ImageType

    +

    ImageType

    ImageType indicates the type classification of the image.

    @@ -1676,7 +1833,7 @@ JBIG, or JPEG.
    ImageType
    -

    IndexPacket

    +

    IndexPacket

    IndexPacket is the type used for a colormap index. An array of type IndexPacket is used to represent an image in PseudoClass type. Currently supported IndexPacket underlying types are 'unsigned char' and 'unsigned @@ -1684,7 +1841,7 @@ short'. The type is selected at build time according to the QuantumDepth setting.

    -

    InterlaceType

    +

    InterlaceType

    InterlaceType specifies the ordering of the red, green, and blue pixel information in the image. Interlacing is usually used to make image information available to the user faster by taking advantage of the space @@ -1723,7 +1880,7 @@ individual files (e.g. image.R, image.G, and image.B)

    -

    LayerType

    +

    LayerType

    LayerType is used as an argument when doing color separations. Use LayerType when extracting a layer from an image. MatteLayer is useful for extracting the opacity values from an image.

    @@ -1756,7 +1913,7 @@ extracting the opacity values from an image.

    -

    MagickInfo

    +

    MagickInfo

    The MagickInfo structure is used by GraphicsMagick to register support for an image format. The MagickInfo structure is allocated with default parameters by calling SetMagickInfo(). Image formats are registered by @@ -1929,7 +2086,7 @@ ImageInfo).

    -

    MonitorHandler

    +

    MonitorHandler

    MonitorHandler is the function type to be used for the progress monitor callback. Its definition is as follows:

    @@ -1985,7 +2142,7 @@ the user.
     
     
    -

    MontageInfo

    +

    MontageInfo

     typedef struct _MontageInfo
     {
    @@ -2025,7 +2182,7 @@ typedef struct _MontageInfo
     
    -

    NoiseType

    +

    NoiseType

    NoiseType is used as an argument to select the type of noise to be added to the image.

    @@ -2060,7 +2217,7 @@ to the image.

    -

    OrientationType

    +

    OrientationType

    OrientationType specifies the orientation of the image. Useful for when the image is produced via a different ordinate system, the camera was turned on its side, or the page was scanned sideways.

    @@ -2116,7 +2273,7 @@ turned on its side, or the page was scanned sideways.

    -

    PaintMethod

    +

    PaintMethod

    PaintMethod specifies how pixel colors are to be replaced in the image. It is used to select the pixel-filling algorithm employed.

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

    PixelPacket

    +

    PixelPacket

    The PixelPacket structure is used to represent DirectClass color pixels in GraphicsMagick. If the image is indicated as a PseudoClass image, its DirectClass representation is only valid immediately after calling @@ -2217,7 +2374,7 @@ RGBColorspace except for CMYKColorspace.

    -

    PointInfo

    +

    PointInfo

    The PointInfo structure is used by the ChromaticityInfo structure to specify chromaticity point values. This defines the boundaries and gammut (range of included color) of the colorspace.

    @@ -2250,7 +2407,7 @@ specify chromaticity point values. This defines the boundaries and gammut
    -

    ProfileInfo

    +

    ProfileInfo

    The ProfileInfo structure is used to represent ICC or IPCT profiles in GraphicsMagick (stored as an opaque BLOB).

    The members of the ProfileInfo structure are shown in the following table:

    @@ -2278,7 +2435,7 @@ GraphicsMagick (stored as an opaque BLOB).

    -

    QuantizeInfo

    +

    QuantizeInfo

    The QuantizeInfo structure is used to support passing parameters to GraphicsMagick's color quantization (reduction) functions. Color quantization is the process of analyzing one or more images, and @@ -2371,13 +2528,13 @@ determined through experimentation.

    -

    Quantum

    +

    Quantum

    Quantum is the base type ('unsigned char', 'unsigned short', 'unsigned int') used to store a pixel component (e.g. 'R' is one pixel component of an RGB pixel).

    -

    QuantumType

    +

    QuantumType

    QuantumType is used to indicate the source or destination format of entire pixels, or components of pixels ("Quantums") while they are being read, or written to, a pixel cache. The validity of these format @@ -2476,7 +2633,7 @@ Image depth (eight or sixteen bits).

    -

    RectangleInfo

    +

    RectangleInfo

    The RectangleInfo structure is used to represent positioning information in GraphicsMagick.

    The members of the RectangleInfo structure are shown in the following @@ -2513,7 +2670,7 @@ table:

    -

    RegistryType

    +

    RegistryType

     typedef enum
     {
    @@ -2524,7 +2681,7 @@ typedef enum
     
    -

    RenderingIntent

    +

    RenderingIntent

    Rendering intent is a concept defined by ICC Spec ICC.1:1998-09, "File Format for Color Profiles". GraphicsMagick uses RenderingIntent in order to support ICC Color Profiles.

    @@ -2566,7 +2723,7 @@ but colorimetric accuracy might not be preserved.
    -

    ResolutionType

    +

    ResolutionType

    By default, GraphicsMagick defines resolutions in pixels per inch. ResolutionType provides a means to adjust this.

    @@ -2594,7 +2751,7 @@ centimeter (metric units).
    -

    ResourceType

    +

    ResourceType

     typedef enum
     {
    @@ -2607,7 +2764,7 @@ typedef enum
     
    -

    SegmentInfo

    +

    SegmentInfo

     typedef struct _SegmentInfo
     {
    @@ -2620,7 +2777,7 @@ typedef struct _SegmentInfo
     
    -

    SignatureInfo

    +

    SignatureInfo

     typedef struct _SignatureInfo
     {
    @@ -2638,7 +2795,7 @@ typedef struct _SignatureInfo
     
    -

    StorageType

    +

    StorageType

     typedef enum
     {
    @@ -2652,14 +2809,14 @@ typedef enum
     
    -

    StreamHandler

    +

    StreamHandler

     typedef unsigned int
       (*StreamHandler)(const Image *,const void *,const size_t);
     
    -

    StretchType

    +

    StretchType

     typedef enum
     {
    @@ -2677,7 +2834,7 @@ typedef enum
     
    -

    StyleType

    +

    StyleType

     typedef enum
     {
    @@ -2689,7 +2846,7 @@ typedef enum
     
    -

    TypeMetric

    +

    TypeMetric

     typedef struct _TypeMetric
     {
    @@ -2713,7 +2870,7 @@ typedef struct _TypeMetric
     
    -

    ViewInfo

    +

    ViewInfo

    ViewInfo represents a handle to a pixel view, which represents a uniquely selectable rectangular region of pixels. The only limit on the number of views is the amount of available memory. Each Image contains a collection @@ -2724,7 +2881,7 @@ typedef void *ViewInfo;

    -

    VirtualPixelMethod

    +

    VirtualPixelMethod

     typedef enum
     {
    @@ -2737,7 +2894,7 @@ typedef enum
     
    -

    MagickXResourceInfo

    +

    MagickXResourceInfo

     typedef struct _XResourceInfo
     {
    @@ -2836,9 +2993,12 @@ typedef struct _XResourceInfo
         home_directory[MaxTextExtent];
     } XResourceInfo;
     
    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/types.html.orig b/www/api/types.html.orig new file mode 100644 index 0000000..6b63ac9 --- /dev/null +++ b/www/api/types.html.orig @@ -0,0 +1,2844 @@ + + + + + + +GraphicsMagick Types + + + + + + + +
    +

    GraphicsMagick Types

    + + + + + +
    +

    AffineMatrix

    +

    AffineMatrix defines a 2D affine matrix transform.

    +
    +typedef struct _AffineMatrix
    +{
    +  double
    +    sx,
    +    rx,
    +    ry,
    +    sy,
    +    tx,
    +    ty;
    +} AffineMatrix;
    +
    +
    +
    +

    BlobInfo

    +

    BlobInfo is an opaque pointer reference to the internal structure of an +I/O blob handle.

    +
    +
    +

    Cache

    +
    +typedef void
    +  *Cache;
    +
    +
    +
    +

    ChannelType

    +
    +typedef enum
    +{
    +  UndefinedChannel,
    +  RedChannel,     /* RGB Red channel */
    +  CyanChannel,    /* CMYK Cyan channel */
    +  GreenChannel,   /* RGB Green channel */
    +  MagentaChannel, /* CMYK Magenta channel */
    +  BlueChannel,    /* RGB Blue channel */
    +  YellowChannel,  /* CMYK Yellow channel */
    +  OpacityChannel, /* Opacity channel */
    +  BlackChannel,   /* CMYK Black (K) channel */
    +  MatteChannel,   /* Same as Opacity channel (deprecated) */
    +  AllChannels,    /* Color channels */
    +  GrayChannel     /* Color channels represent an intensity. */
    +} ChannelType;
    +
    +
    +
    +

    ChromaticityInfo

    +

    The ChromaticityInfo structure is used to represent chromaticity +(colorspace primary coordinates in xy space) values for images in +GraphicsMagick.

    +

    The members of the ChromaticityInfo structure are shown in the following +table:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + +
    ChromaticityInfo Structure Members
    MemberTypeDescription
    red_primaryPointInfoChromaticity red primary point (e.g. x=0.64, y=0.33)
    green_primaryPointInfoChromaticity green primary point (e.g. x=0.3, y=0.6)
    blue_primaryPointInfoChromaticity blue primary point (e.g. x=0.15, y=0.06)
    white_pointPointInfoChromaticity white point (e.g. x=0.3127, y=0.329)
    +
    +
    +

    ClassType

    +

    ClassType enumeration specifies the image storage class.

    + + ++++ + + + + + + + + + + + + + + +
    ClassType
    EnumerationDescription
    UndefinedClassUnset value.
    DirectClassImage is composed of pixels which represent literal color values.
    PseudoClassImage is composed of pixels which specify an index in a color palette.
    +
    +
    +

    ClipPathUnits

    +
    +typedef enum
    +{
    +  UserSpace,
    +  UserSpaceOnUse,
    +  ObjectBoundingBox
    +} ClipPathUnits;
    +
    +
    +
    +

    ColorPacket

    +
    +typedef struct _ColorPacket
    +{
    +  PixelPacket
    +    pixel;
    +
    +  unsigned short
    +    index;
    +
    +  unsigned long
    +    count;
    +} ColorPacket;
    +
    +
    +
    +

    ColorspaceType

    +

    The ColorspaceType enumeration is used to specify the colorspace that +quantization (color reduction and mapping) is done under or to specify +the colorspace when encoding an output image. Colorspaces are ways of +describing colors to fit the requirements of a particular application +(e.g. Television, offset printing, color monitors). Color reduction, by +default, takes place in the RGBColorspace. Empirical evidence suggests +that distances in color spaces such as YUVColorspace or YIQColorspace +correspond to perceptual color differences more closely han do distances +in RGB space. These color spaces may give better results when color +reducing an image. Refer to quantize for more details.

    +

    When encoding an output image, the colorspaces RGBColorspace, +CMYKColorspace, and GRAYColorspace may be specified. The CMYKColorspace +option is only applicable when writing TIFF, JPEG, and Adobe Photoshop +bitmap (PSD) files.

    + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ColorspaceType
    EnumerationDescription
    UndefinedColorspaceUnset value.
    RGBColorspaceRed, Green, Blue colorspace.
    GRAYColorspaceSimilar to Luma (Y) according to ITU-R 601
    TransparentColorspaceRGB which preserves the matte while quantizing colors.
    OHTAColorspace 
    XYZColorspaceCIE XYZ
    YCCColorspaceKodak PhotoCD PhotoYCC
    YIQColorspace 
    YPbPrColorspace 
    YUVColorspaceYUV colorspace as used for computer video.
    CMYKColorspaceCyan, Magenta, Yellow, Black colorspace.
    sRGBColorspaceKodak PhotoCD sRGB
    HSLColorspaceHue, saturation, luminosity
    HWBColorspaceHue, whiteness, blackness
    LABColorspaceITU LAB
    CineonLogRGBColorspaceRGB data with Cineon Log scaling, 2.048 density range
    Rec601LumaColorspaceLuma (Y) according to ITU-R 601
    Rec601YCbCrColorspaceYCbCr according to ITU-R 601
    Rec709LumaColorspaceLuma (Y) according to ITU-R 709
    Rec709YCbCrColorspaceYCbCr according to ITU-R 709
    +
    +
    +

    ComplianceType

    +
    +typedef enum
    +{
    +  UndefinedCompliance = 0x0000,
    +  NoCompliance = 0x0000,
    +  SVGCompliance = 0x0001,
    +  X11Compliance = 0x0002,
    +  XPMCompliance = 0x0004,
    +  AllCompliance = 0xffff
    +} ComplianceType;
    +
    +
    +
    +

    CompositeOperator

    +

    CompositeOperator is used to select the image composition algorithm used +to compose a composite image with an image. By default, each of the +composite image pixels are replaced by the corresponding image tile +pixel. Specify CompositeOperator to select a different algorithm.

    +

    The image compositor requires a matte, or alpha channel in the image for +some operations. This extra channel usually defines a mask which +represents a sort of a cookie-cutter for the image. This is the case when +matte is 255 (full coverage) for pixels inside the shape, zero outside, +and between zero and 255 on the boundary. For certain operations, if +image does not have a matte channel, it is initialized with 0 for any +pixel matching in color to pixel location (0,0), otherwise 255 (to work +properly borderWidth must be 0).

    + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CompositeOperator
    EnumerationDescription
    UndefinedCompositeOpUnset value.
    OverCompositeOpThe result is the union of the the two image shapes with the composite +image obscuring image in the region of overlap.
    InCompositeOpThe result is a simply composite image cut by the shape of image. None of +the image data of image is included in the result.
    OutCompositeOpThe resulting image is composite image with the shape of image cut out.
    AtopCompositeOpThe result is the same shape as image image, with composite image +obscuring image there the image shapes overlap. Note that this differs +from OverCompositeOp because the portion of composite image outside of +image's shape does not appear in the result.
    XorCompositeOpThe result is the image data from both composite image and image that is +outside the overlap region. The overlap region will be blank.
    PlusCompositeOpThe result is just the sum of the image data. Output values are cropped +to 255 (no overflow). This operation is independent of the matte channels.
    MinusCompositeOpThe result of composite image - image, with overflow cropped to zero. The +matte chanel is ignored (set to 255, full coverage).
    AddCompositeOpThe result of composite image + image, with overflow wrapping around (mod +256).
    SubtractCompositeOpThe result of composite image - image, with underflow wrapping around (mod +256). The add and subtract operators can be used to perform reversible +transformations.
    DifferenceCompositeOpThe result of abs(composite image - image). This is useful for comparing +two very similar images.
    BumpmapCompositeOpThe result image shaded by composite image.
    CopyCompositeOpThe resulting image is image replaced with composite image. Here the matte +information is ignored.
    CopyRedCompositeOpThe resulting image is the red layer in image replaced with the red layer +in composite image. The other layers are copied untouched.
    CopyGreenCompositeOpThe resulting image is the green layer in image replaced with the green +layer in composite image. The other layers are copied untouched.
    CopyBlueCompositeOpThe resulting image is the blue layer in image replaced with the blue +layer in composite image. The other layers are copied untouched.
    CopyOpacityCompositeOpThe resulting image is the matte layer in image replaced with the matte +layer in composite image. The other layers are copied untouched.
    ClearCompositeOpPixels in the region are set to Transparent.
    DissolveCompositeOp 
    DisplaceCompositeOp 
    ModulateCompositeOpModulate brightness in HSL space.
    ThresholdCompositeOp 
    NoCompositeOpDo nothing at all.
    DarkenCompositeOp 
    LightenCompositeOp 
    HueCompositeOpCopy Hue channel (from HSL colorspace).
    SaturateCompositeOpCopy Saturation channel (from HSL colorspace).
    ColorizeCompositeOpCopy Hue and Saturation channels (from HSL colorspace).
    LuminizeCompositeOpCopy Brightness channel (from HSL colorspace).
    ScreenCompositeOp[Not yet implemented]
    OverlayCompositeOp[Not yet implemented]
    CopyCyanCompositeOpCopy the Cyan channel.
    CopyMagentaCompositeOpCopy the Magenta channel.
    CopyYellowCompositeOpCopy the Yellow channel.
    CopyBlackCompositeOpCopy the Black channel.
    DivideCompositeOp 
    +
    +
    +

    CompressionType

    +

    CompressionType is used to express the desired compression type when +encoding an image. Be aware that most image types only support a sub-set +of the available compression types. If the compression type specified is +incompatable with the image, GraphicsMagick selects a compression type +compatable with the image type.

    + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CompressionType
    EnumerationDescription
    UndefinedCompressionUnset value.
    NoCompressionNo compression
    BZipCompressionBZip (Burrows-Wheeler block-sorting text compression algorithm and +Huffman coding) as used by bzip2 utilities
    FaxCompressionCCITT Group 3 FAX compression
    Group4CompressionCCITT Group 4 FAX compression (used only for TIFF)
    JPEGCompressionJPEG compression
    LosslessJPEGCompressionLossless JPEG compression
    LZWCompressionLempel-Ziv-Welch (LZW) compression (caution, patented by Unisys)
    RLECompressionRun-Length encoded (RLE) compression
    ZipCompressionLempel-Ziv compression (LZ77) as used in PKZIP and GNU gzip.
    +
    +
    +

    DecorationType

    +
    +typedef enum
    +{
    +  NoDecoration,
    +  UnderlineDecoration,
    +  OverlineDecoration,
    +  LineThroughDecoration
    +} DecorationType;
    +
    +
    +
    +

    DrawContext

    +
    +typedef struct _DrawContext *DrawContext;
    +
    +
    +
    +

    DrawInfo

    +

    The DrawInfo structure is used to support annotating an image using +drawing commands.

    + + ++++ + + + + + + + + + + + + + + + + + +
    Methods Supporting DrawInfo
    MethodDescription
    GetDrawInfo()Allocate new structure with defaults set.
    CloneDrawInfo()Copy existing structure, allocating new structure in the process.
    DestroyDrawInfo()Deallocate structure, including any members.
    DrawImage()Render primitives to image.
    +

    The members of the DrawInfo structure are shown in the following table. +The structure is initialized to reasonable defaults by first initializing +the equivalent members of ImageInfo, and then initializing the entire +structure using GetDrawInfo().

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DrawInfo Structure Members Supporting DrawImage()
    MemberTypeDescription
    affineAffineInfoCoordinate transformation (rotation, scaling, and translation).
    border_colorPixelPacketBorder color
    boxPixelPacketText solid background color.
    decorateDecorationTypeText decoration type.
    densitychar *Text rendering density in DPI (effects scaling font according to +pointsize). E.g. "72x72"
    fillPixelPacketObject internal fill (within outline) color.
    fontchar *Font to use when rendering text.
    gravityGravityTypeText placement preference (e.g. NorthWestGravity).
    linewidthdoubleStroke (outline) drawing width in pixels.
    pointsizedoubleFont size (also see density).
    primitivechar *Space or new-line delimited list of text drawing primitives (e.g +"text 100,100 Cockatoo"). See the table Drawing Primitives for the +available drawing primitives.
    strokePixelPacketObject stroke (outline) color.
    stroke_antialiasunsigned intSet to True (non-zero) to obtain anti-aliased stroke rendering.
    text_antialiasunsigned intSet to True (non-zero) to obtain anti-aliased text rendering.
    tileImage *Image texture to draw with. Use an image containing a single color +(e.g. a 1x1 image) to draw in a solid color.
    +

    Drawing Primitives

    +

    The drawing primitives shown in the following table may be supplied as a +space or new-line delimited list to the primitive member. Primitives +which set drawing options effect the results from subsequent drawing +operations. See the 'push graphic-context' and 'pop graphic-context' +primitives for a way to control the propagation of drawing options.

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Drawing Primitives
    PrimitiveArgumentsPurpose
    affinesx,rx,ry,sy,tx,tyApply coordinate transformations to support scaling +(s), rotation (r), and translation (t). Angles are +specified in radians. Equivalent to SVG matrix command +which supplies a transformation matrix.
    angleangleSpecify object drawing angle.
    arcstartX,startY endX,endY +startDegrees,endDegreesDraw an arc.
    Bezierx1,y1, x2,y2, x3,y3, ..., +xN,yNDraw a Bezier curve.
    circleoriginX,originY +perimX,perimYDraw a circle.
    colorx,y (point|replace| +floodfill|filltoborder| +reset)Set color in image according to specified colorization +rule.
    decorate(none|underline|overline| +line-through)Specify text decoration.
    ellipseoriginX,originY +width,height +arcStart,arcEndDraw an ellipse.
    fillcolorspecSpecifiy object filling color.
    fill-opacityopacitySpecify object fill opacity.
    fontfontnameSpecify text drawing font.
    gravity(NorthWest,North,NorthEast, +West,Center,East, +SouthWest,South,SouthEast)Specify text positioning gravity.
    imagex,y width,height filenameComposite image at position, scaled to specified width +and height, and specified filename. If width or height +is zero, scaling is not performed.
    linestartX,startY endX,endYDraw a line.
    mattex,y (point|replace| +floodfill|filltoborder| +reset)Set matte in image according to specified colorization +rule.
    opacityfillOpacity strokeOpacitySpecify drawing fill and stroke opacities.
    path'SVG-compatible path +arguments'Draw using SVG-compatible path drawing commands.
    pointx,ySet point to fill color.
    pointsizepointsizeSpecify text drawing pointsize (scaled to density).
    polygonx1,y1, x2,y2, x3,y3, ..., +xN,yNDraw a polygon.
    polylinex1,y1, x2,y2, x3,y3, ..., +xN,yNDraw a polyline.
    popgraphic-contextRemove options set since previous "push +graphic-context" command. Options revert to those in +effect prior to pushing the graphic context.
    pushgraphic-contextSpecify new graphic context.
    rectupperLeftX,upperLeftY +lowerRightX,lowerRightYDraw a rectangle.
    rotateangleSpecify coordiante space rotation. Subsequent objects +are drawn with coordate space rotated by specified +angle.
    roundrectanglecenterX,centerY +width,hight +cornerWidth,cornerHeightDraw a rectangle with rounded corners.
    strokecolorspecSpecify object stroke (outline) color.
    stroke-antialiasstroke_antialias (0 or 1)Specify if stroke should be antialiased or not.
    stroke-dashvalueSpecify pattern to be used when drawing stroke.
    stroke-opacityopacitySpecify opacity of stroke drawing color.
    stroke-widthlinewidthSpecify stroke (outline) width in pixels.
    textx,y "some text"Draw text at position.
    text-antialiastext_antialias (0 or 1)Specify if rendered text is to be antialiased (blend +edges).
    scalex,ySpecify scaling to be applied to coordintate space for +subsequent drawing commands.
    translatex,ySpecify center of coordinate space to use for +subsequent drawing commands.
    +
    +
    +

    EndianType

    +
    +typedef enum
    +{
    +  UndefinedEndian,
    +  LSBEndian,            /* "little" endian */
    +  MSBEndian,            /* "big" endian */
    +  NativeEndian          /* native endian */
    +} EndianType;
    +
    +
    +
    +

    ErrorHandler

    +
    +typedef void
    +  (*ErrorHandler)(const ExceptionType,const char *,const char *);
    +
    +
    +
    +

    ExceptionInfo

    +
    +typedef struct _ExceptionInfo
    +{
    +  char
    +    *reason,
    +    *description;
    +
    +  ExceptionType
    +    severity;
    +
    +  unsigned long
    +    signature;
    +} ExceptionInfo;
    +
    +
    +
    +

    ExceptionType

    +
    +typedef enum
    +{
    +  UndefinedException,
    +  WarningException = 300,
    +  ResourceLimitWarning = 300,
    +  TypeWarning = 305,
    +  OptionWarning = 310,
    +  DelegateWarning = 315,
    +  MissingDelegateWarning = 320,
    +  CorruptImageWarning = 325,
    +  FileOpenWarning = 330,
    +  BlobWarning = 335,
    +  StreamWarning = 340,
    +  CacheWarning = 345,
    +  CoderWarning = 350,
    +  ModuleWarning = 355,
    +  DrawWarning = 360,
    +  ImageWarning = 365,
    +  XServerWarning = 380,
    +  MonitorWarning = 385,
    +  RegistryWarning = 390,
    +  ConfigureWarning = 395,
    +  ErrorException = 400,
    +  ResourceLimitError = 400,
    +  TypeError = 405,
    +  OptionError = 410,
    +  DelegateError = 415,
    +  MissingDelegateError = 420,
    +  CorruptImageError = 425,
    +  FileOpenError = 430,
    +  BlobError = 435,
    +  StreamError = 440,
    +  CacheError = 445,
    +  CoderError = 450,
    +  ModuleError = 455,
    +  DrawError = 460,
    +  ImageError = 465,
    +  XServerError = 480,
    +  MonitorError = 485,
    +  RegistryError = 490,
    +  ConfigureError = 495,
    +  FatalErrorException = 700,
    +  ResourceLimitFatalError = 700,
    +  TypeFatalError = 705,
    +  OptionFatalError = 710,
    +  DelegateFatalError = 715,
    +  MissingDelegateFatalError = 720,
    +  CorruptImageFatalError = 725,
    +  FileOpenFatalError = 730,
    +  BlobFatalError = 735,
    +  StreamFatalError = 740,
    +  CacheFatalError = 745,
    +  CoderFatalError = 750,
    +  ModuleFatalError = 755,
    +  DrawFatalError = 760,
    +  ImageFatalError = 765,
    +  XServerFatalError = 780,
    +  MonitorFatalError = 785,
    +  RegistryFatalError = 790,
    +  ConfigureFatalError = 795
    +} ExceptionType;
    +
    +
    +
    +

    FillRule

    +
    +typedef enum
    +{
    +  UndefinedRule,
    +  EvenOddRule,
    +  NonZeroRule
    +} FillRule;
    +
    +
    +
    +

    FilterTypes

    +

    FilterTypes is used to adjust the filter algorithm used when resizing +images. Different filters experience varying degrees of success with +various images and can take significantly different amounts of processing +time. GraphicsMagick uses the LanczosFilter by default since this filter +has been shown to provide the best results for most images in a +reasonable amount of time. Other filter types (e.g. TriangleFilter) may +execute much faster but may show artifacts when the image is re-sized or +around diagonal lines. The only way to be sure is to test the filter with +sample images.

    + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FilterTypes
    EnumerationDescription
    UndefinedFilterUnset value.
    PointFilterPoint Filter
    BoxFilterBox Filter
    TriangleFilterTriangle Filter
    HermiteFilterHermite Filter
    HanningFilterHanning Filter
    HammingFilterHamming Filter
    BlackmanFilterBlackman Filter
    GaussianFilterGaussian Filter
    QuadraticFilterQuadratic Filter
    CubicFilterCubic Filter
    CatromFilterCatrom Filter
    MitchellFilterMitchell Filter
    LanczosFilterLanczos Filter
    BesselFilterBessel Filter
    SincFilterSinc Filter
    +
    +
    +

    FrameInfo

    +
    +typedef struct _FrameInfo
    +{
    +  unsigned long
    +    width,
    +    height;
    +
    +  long
    +    x,
    +    y,
    +    inner_bevel,
    +    outer_bevel;
    +} FrameInfo;
    +
    +
    +
    +

    GravityType

    +

    GravityType specifies positioning of an object (e.g. text, image) within +a bounding region (e.g. an image). Gravity provides a convenient way to +locate objects irrespective of the size of the bounding region, in other +words, you don't need to provide absolute coordinates in order to +position an object. A common default for gravity is NorthWestGravity.

    + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    GravityType
    EnumerationDescription
    ForgetGravityDon't use gravity.
    NorthWestGravityPosition object at top-left of region.
    NorthGravityPostiion object at top-center of region
    NorthEastGravityPosition object at top-right of region
    WestGravityPosition object at left-center of region
    CenterGravityPosition object at center of region
    EastGravityPosition object at right-center of region
    SouthWestGravityPosition object at left-bottom of region
    SouthGravityPosition object at bottom-center of region
    SouthEastGravityPosition object at bottom-right of region
    +
    +
    +

    Image

    +

    The Image structure represents an GraphicsMagick image. It is initially +allocated by AllocateImage() and deallocated by DestroyImage(). The +functions ReadImage(), ReadImages(), BlobToImage() and CreateImage() +return a new image. Use CloneImage() to copy an image. An image consists +of a structure containing image attributes as well as the image pixels.

    +

    The image pixels are represented by the structure PixelPacket and are +cached in-memory, or on disk, depending on the cache threshold setting. +This cache is known as the "pixel cache". Pixels in the cache may not be +edited directly. They must first be made visible from the cache via a +pixel view. A pixel view is a rectangular view of the pixels as defined +by a starting coordinate, and a number of rows and columns. When +considering the varying abilities of multiple platforms, the most +reliably efficient pixel view is comprized of part, or all, of one image +row.

    +

    There are two means of accessing pixel views. When using the default +view, the pixels are made visible and accessable by using the +GetImagePixels() method which provides access to a specified region of +the image. After the view has been updated, the pixels may be saved back +to the cache in their original positions via SyncImagePixels(). In order +to create an image with new contents, or to blindly overwrite existing +contents, the method SetImagePixels() is used to reserve a pixel view +corresponding to a region in the pixel cache. Once the pixel view has +been updated, it may be written to the cache via SyncImagePixels(). The +function GetIndexes() provides access to the image colormap, represented +as an array of type IndexPacket.

    +

    A more flexible interface to the image pixels is via the Cache View +interface. This interface supports multiple pixel cache views (limited by +the amount of available memory), each of which are identified by a handle +(of type ViewInfo). Use OpenCacheView() to obtain a new cache view, +CloseCacheView() to discard a cache view, GetCacheViewPixels() to access +an existing pixel region, SetCacheView() to define a new pixel region, +and SyncCacheViewPixels() to save the updated pixel region. The function +GetCacheViewIndexes() provides access to the colormap indexes associated +with the pixel view.

    +

    When writing encoders and decoders for new image formats, it is +convenient to have a high-level interface available which supports +converting between external pixel representations and GraphicsMagick's +own representation. Pixel components (red, green, blue, opacity, RGB, or +RGBA) may be transferred from a user-supplied buffer into the default +view by using ImportImagePixelArea(), or from an allocated view via +ImportViewPixelArea(). Pixel components may be transferred from the +default view into a user-supplied buffer by using ExportImagePixelArea(), +or from an allocated view via ExportViewPixelArea(). Use of this +high-level interface helps protect image coders from changes to +GraphicsMagick's pixel representation and simplifies the implementation.

    +

    The members of the Image structure are shown in the following table:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Image Structure Members
    MemberTypeDescription
    background_colorPixelPacketImage background color
    blurdoubleBlur factor to apply to the image when zooming
    border_colorPixelPacketImage border color
    chromaticityChromaticityInfoRed, green, blue, and white-point chromaticity +values.
    colormapPixelPacket *PseudoColor palette array.
    colorsunsigned intThe desired number of colors. Used by +QuantizeImage().
    colorspaceColorspaceTypeImage pixel interpretation.If the colorspace is +RGB the pixels are red, green, blue. If matte is +true, then red, green, blue, and index. If it is +CMYK, the pixels are cyan, yellow, magenta, black. +Otherwise the colorspace is ignored.
    columnsunsigned intImage width
    compressionCompressionTypeImage compresion type. The default is the +compression type of the specified image file.
    delayunsigned intTime in 1/100ths of a second (0 to 65535) which +must expire before displaying the next image in an +animated sequence. This option is useful for +regulating the animation of a sequence of GIF +images within Netscape.
    depthunsigned intImage depth. Number of encoding bits per sample. +Usually 8 or 16, but sometimes 10 or 12.
    directorychar *Tile names from within an image montage. Only +valid after calling MontageImages() or reading a +MIFF file which contains a directory.
    disposeunsigned intGIF disposal method. This option is used to +control how successive frames are rendered (how +the preceding frame is disposed of) when creating +a GIF animation.
    exceptionExceptionInfoRecord of any error which occurred when updating +image.
    filenamechar +[MaxTextExtent]Image file name to read or write.
    filterFilterTypesFilter to use when resizing image. The reduction +filter employed has a significant effect on the +time required to resize an image and the resulting +quality. The default filter is Lanczos which has +been shown to produce high quality results when +reducing most images.
    fuzzintColors within this distance are considered equal. +A number of algorithms search for a target color. +By default the color must be exact. Use this +option to match colors that are close to the +target color in RGB space.
    gammadoubleGamma level of the image. The same color image +displayed on two different workstations may look +different due to differences in the display +monitor. Use gamma correction to adjust for this +color difference.
    geometrychar *Preferred size of the image when encoding.
    interlaceInterlaceTypeThe type of interlacing scheme (default +NoInterlace). This option is used to specify the +type of interlacing scheme for raw image formats +such as RGB or YUV. NoInterlace means do not +interlace, LineInterlace uses scanline +interlacing, and PlaneInterlace uses plane +interlacing. PartitionInterlace is like +PlaneInterlace except the different planes are +saved to individual files (e.g. image.R, image.G, +and image.B). Use LineInterlace or PlaneInterlace +to create an interlaced GIF or progressive JPEG +image.
    iterationsunsigned intNumber of iterations to loop an animation (e.g. +Netscape loop extension) for.
    magickchar +[MaxTextExtent]Image encoding format (e.g. "GIF").
    magick_columnsunsigned intBase image width (before transformations)
    magick_filenamechar +[MaxTextExtent]Base image filename (before transformations)
    magick_rowsunsigned intBase image height (before transformations)
    matteunsigned intIf non-zero, then the index member of pixels +represents the alpha channel.
    matte_colorPixelPacketImage matte (transparent) color
    montagechar *Tile size and offset within an image montage. Only +valid for montage images.
    nextstruct _Image *Next image frame in sequence
    offsetintNumber of initial bytes to skip over when reading +raw image.
    orientationOrientationTypeOrientation of the image. Specifies scanline +orientation and starting coordinate of image.
    pageRectangleInfoEquivalent size of Postscript page.
    previousstruct _Image *Previous image frame in sequence.
    rendering_intentRenderingIntentThe type of rendering intent.
    rowsunsigned intImage height
    sceneunsigned intImage frame scene number.
    storage_classClassTypeImage storage class. If DirectClass then the image +packets contain valid RGB or CMYK colors. If +PseudoClass then the image has a colormap +referenced by pixel's index member.
    tile_infoRectangleInfoDescribes a tile within an image. For example, if +your images is 640x480 you may only want 320x256 +with an offset of +128+64. It is used for raw +formats such as RGB and CMYK as well as for TIFF.
    timerTimerInfoSupport for measuring actual (user + system) and +elapsed execution time.
    total_colorsunsigned longThe number of colors in the image after +QuantizeImage(), or QuantizeImages() if the +verbose flag was set before the call. Calculated +by GetNumberColors().
    unitsResolutionTypeUnits of image resolution
    x_resolutiondoubleHorizontal resolution of the image
    y_resolutiondoubleVertical resolution of the image
    +
    +
    +

    ImageInfo

    +

    The ImageInfo structure is used to supply option information to the +functions AllocateImage(), AnimateImages(), BlobToImage(), +CloneAnnotateInfo(), DisplayImages(), GetAnnotateInfo(), ImageToBlob(), +PingImage(), ReadImage(), ReadImages(), and, WriteImage(). These +functions update information in ImageInfo to reflect attributes of the +current image.

    +

    Use CloneImageInfo() to duplicate an existing ImageInfo structure or +allocate a new one. Use DestroyImageInfo() to deallocate memory +associated with an ImageInfo structure. Use GetImageInfo() to initialize +an existing ImageInfo structure. Use SetImageInfo() to set image type +information in the ImageInfo structure based on an existing image.

    +

    The members of the ImageInfo structure are shown in the following table:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ImageInfo Structure Members
    MemberTypeDescription
    adjoinunsigned intJoin images into a single multi-image file.
    antialiasunsigned intControl antialiasing of rendered Postscript and Postscript or +TrueType fonts. Enabled by default.
    background_colorPixelPacketImage background color.
    border_colorPixelPacketImage border color.
    colorspaceColorspaceTypeImage pixel interpretation.If the colorspace is RGB the pixels are +red, green, blue. If matte is true, then red, green, blue, and +index. If it is CMYK, the pixels are cyan, yellow, magenta, black. +Otherwise the colorspace is ignored.
    compressionCompressionTypeImage compresion type. The default is the compression type of the +specified image file.
    delaychar *Time in 1/100ths of a second (0 to 65535) which must expire before +displaying the next image in an animated sequence. This option is +useful for regulating the animation of a sequence of GIF images +within Netscape.
    densitychar *Vertical and horizontal resolution in pixels of the image. This +option specifies an image density when decoding a Postscript or +Portable Document page. Often used with page.
    depthunsigned intImage depth (8 or 16). QuantumLeap must be defined before a depth +of 16 is valid.
    disposechar *GIF disposal method. This option is used to control how successive +frames are rendered (how the preceding frame is disposed of) when +creating a GIF animation.
    ditherunsigned intApply Floyd/Steinberg error diffusion to the image. The basic +strategy of dithering is to trade intensity resolution for spatial +resolution by averaging the intensities of several neighboring +pixels. Images which suffer from severe contouring when reducing +colors can be improved with this option. The colors or monochrome +option must be set for this option to take effect.
    fileFILE *Stdio stream to read image from or write image to. If set, +ImageMagick will read from or write to the stream rather than +opening a file. Used by ReadImage() and WriteImage(). The stream is +closed when the operation completes.
    filenamechar +[MaxTextExtent]Image file name to read or write.
    fillPixelPacketDrawing object fill color.
    fontchar *Text rendering font. If the font is a fully qualified X server font +name, the font is obtained from an X server. To use a TrueType +font, precede the TrueType filename with an @. Otherwise, specify a +Postscript font name (e.g. "helvetica").
    fuzzintColors within this distance are considered equal. A number of +algorithms search for a target color. By default the color must be +exact. Use this option to match colors that are close to the target +color in RGB space.
    interlaceInterlaceTypeThe type of interlacing scheme (default NoInterlace). This option +is used to specify the type of interlacing scheme for raw image +formats such as RGB or YUV. NoInterlace means do not interlace, +LineInterlace uses scanline interlacing, and PlaneInterlace uses +plane interlacing. PartitionInterlace is like PlaneInterlace except +the different planes are saved to individual files (e.g. image.R, +image.G, and image.B). Use LineInterlace or PlaneInterlace to +create an interlaced GIF or progressive JPEG image.
    iterationschar *Number of iterations to loop an animation (e.g. Netscape loop +extension) for.
    linewidthunsigned intLine width for drawing lines, circles, ellipses, etc.
    magickchar +[MaxTextExtent]Image encoding format (e.g. "GIF").
    matte_colorPixelPacketImage matte (transparent) color.
    monochromeunsigned intTransform the image to black and white.
    pagechar *Equivalent size of Postscript page.
    pingunsigned intSet to True to read enough of the image to determine the image +columns, rows, and filesize. The columns, rows, and size attributes +are valid after invoking ReadImage() while ping is set. The image +data is not valid after calling ReadImage() if ping is set.
    pointsizedoubleText rendering font point size.
    preview_typePreviewTypeImage manipulation preview option. Used by 'display'.
    qualityunsigned intJPEG/MIFF/PNG compression level (default 75).
    server_namechar *X11 display to display to obtain fonts from, or to capture image +from.
    sizechar *Width and height of a raw image (an image which does not support +width and height information). Size may also be used to affect the +image size read from a multi-resolution format (e.g. Photo CD, +JBIG, or JPEG.
    strokePixelPacketDrawing object outline color.
    subimageunsigned intSubimage of an image sequence.
    subrangeunsigned intNumber of images relative to the base image.
    texturechar *Image filename to use as background texture.
    tilechar *Tile name.
    unitsResolutionTypeUnits of image resolution.
    verboseunsigned intPrint detailed information about the image if True.
    viewchar *FlashPix viewing parameters.
    +
    +
    +

    ImageType

    +

    ImageType indicates the type classification of the image.

    + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ImageType
    EnumerationDescription
    UndefinedTypeUnset value.
    BilevelTypeMonochrome image
    GrayscaleTypeGrayscale image
    PaletteTypeIndexed color (palette) image
    PaletteMatteTypeIndexed color (palette) image with opacity
    TrueColorTypeTruecolor image
    TrueColorMatteTypeTruecolor image with opacity
    ColorSeparationTypeCyan/Yellow/Magenta/Black (CYMK) image
    +
    +
    +

    IndexPacket

    +

    IndexPacket is the type used for a colormap index. An array of type +IndexPacket is used to represent an image in PseudoClass type. Currently +supported IndexPacket underlying types are 'unsigned char' and 'unsigned +short'. The type is selected at build time according to the QuantumDepth +setting.

    +
    +
    +

    InterlaceType

    +

    InterlaceType specifies the ordering of the red, green, and blue pixel +information in the image. Interlacing is usually used to make image +information available to the user faster by taking advantage of the space +vs time tradeoff. For example, interlacing allows images on the Web to be +recognizable sooner and satellite images to accumulate/render with image +resolution increasing over time.

    +

    Use LineInterlace or PlaneInterlace to create an interlaced GIF or +progressive JPEG image.

    + + ++++ + + + + + + + + + + + + + + + + + + + + +
    InterlaceType
    EnumerationDescription
    UndefinedInterlaceUnset value.
    NoInterlaceDon't interlace image (RGBRGBRGBRGBRGBRGB...)
    LineInterlaceUse scanline interlacing (RRR...GGG...BBB...RRR...GGG...BBB...)
    PlaneInterlaceUse plane interlacing (RRRRRR...GGGGGG...BBBBBB...)
    PartitionInterlaceSimilar to plane interlaing except that the different planes are saved to +individual files (e.g. image.R, image.G, and image.B)
    +
    +
    +

    LayerType

    +

    LayerType is used as an argument when doing color separations. Use +LayerType when extracting a layer from an image. MatteLayer is useful for +extracting the opacity values from an image.

    + + ++++ + + + + + + + + + + + + + + + + + + + + +
    LayerType
    EnumerationDescription
    UndefinedLayerUnset value.
    RedLayerSelect red layer
    GreenLayerSelect green layer
    BlueLayerSelect blue layer
    MatteLayerSelect matte (opacity values) layer
    +
    +
    +

    MagickInfo

    +

    The MagickInfo structure is used by GraphicsMagick to register support +for an image format. The MagickInfo structure is allocated with default +parameters by calling SetMagickInfo(). Image formats are registered by +calling RegisterMagickInfo() which adds the initial structure to a linked +list (at which point it is owned by the list). A pointer to the structure +describing a format may be obtained by calling GetMagickInfo(). Pass the +argument NULL to obtain the first member of this list. A human-readable +list of registered image formats may be printed to a file descriptor by +calling ListMagickInfo().

    +

    Support for formats may be provided as a module which is part of the +GraphicsMagick library, provided by a module which is loaded dynamically +at run-time, or directly by the linked program. Users of GraphicsMagick +will normally want to create a loadable-module, or support encode/decode +of an image format directly from within their program.

    +

    Sample Module:

    +

    The following shows sample code for a module called "GIF" (gif.c). Note +that the names of the Register and Unregister call-back routines are +calculated at run-time, and therefore must follow the rigid naming scheme +RegisterFORMATImage and UnregisterFORMATImage, respectively, where FORMAT +is the upper-cased name of the module file:

    +
    +/* Read image */
    +Image *ReadGIFImage(const ImageInfo *image_info)
    +{
    +  [ decode the image ... ]
    +}
    +
    +/* Write image */
    +unsigned int WriteGIFImage(const ImageInfo *image_info,Image *image)
    +{
    +  [ encode the image ... ]
    +}
    +
    +/* Module call-back to register support for formats */
    +void RegisterGIFImage(void)
    +{
    +  MagickInfo *entry;
    +  entry=SetMagickInfo("GIF");
    +  entry->decoder=ReadGIFImage;
    +  entry->encoder=WriteGIFImage;
    +  entry->description="CompuServe graphics interchange format";
    +  entry->module="GIF";
    +  RegisterMagickInfo(entry);
    +
    +  entry=SetMagickInfo("GIF87");
    +  entry->decoder=ReadGIFImage;
    +  entry->encoder=WriteGIFImage;
    +  entry->adjoin=False;
    +  entry->description="CompuServe graphics interchange format (version 87a)";
    +  entry->module="GIF";
    +  RegisterMagickInfo(entry);
    +}
    +
    +/* Module call-back to unregister support for formats */
    +Export void UnregisterGIFImage(void)
    +{
    +  UnregisterMagickInfo("GIF");
    +  UnregisterMagickInfo("GIF87");
    +}
    +
    +

    Sample Application Code

    +

    Image format support provided within the user's application does not need +to implement the RegisterFORMATImage and UnregisterFORMATImage call-back +routines. Instead, the application takes responsibility for the +registration itself. An example follows:

    +
    +/* Read image */
    +Image *ReadGIFImage(const ImageInfo *image_info)
    +{
    +  [ decode the image ... ]
    +}
    +/* Write image */
    +unsigned int WriteGIFImage(const ImageInfo *image_info,Image *image)
    +{
    +  [ encode the image ... ]
    +}
    +#include <stdio.h>
    +int main( void )
    +{
    +  struct MagickInfo* info;
    +  info = SetMagickInfo("GIF");
    +  if ( info == (MagickInfo*)NULL )
    +  exit(1);
    +  info->decoder = ReadGIFImage;
    +  info->encoder = WriteGIFImage;
    +  info->adjoin = False;
    +  info->description = "CompuServe graphics interchange format";
    +  /* Add MagickInfo structure to list */
    +  RegisterMagickInfo(info);
    +  info = GetMagickInfo("GIF");
    +  [ do something with info ... ]
    +  ListMagickInfo( stdout );
    +  return;
    +}
    +
    +

    MagickInfo Structure Definition

    +

    The members of the MagickInfo structure are shown in the following table:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    MagickInfo Structure Members
    MemberTypeDescription
    adjoinunsigned intSet to non-zero (True) if this file format supports multi-frame +images.
    blob_supportunsigned intSet to non-zero (True) if the encoder and decoder for this format +supports operating on arbitrary BLOBs (rather than only disk +files).
    datavoid *User specified data. A way to pass any sort of data structure to +the endoder/decoder. To set this, GetMagickInfo() must be called +to first obtain a pointer to the registered structure since it can +not be set via a RegisterMagickInfo() parameter.
    decoderImage *(*decoder) +(const ImageInfo +*)Function to decode image data and return GraphicsMagick Image.
    descriptionchar *Long form image format description (e.g. "CompuServe graphics +interchange format").
    encoderunsigned int +(*encoder)(const +ImageInfo *, Image +*)Function to encode image data with options passed via ImageInfo +and image represented by Image.
    modulechar *Name of module (e.g. "GIF") which registered this format. Set to +NULL if format is not registered by a module.
    nameconst char *Magick string (e.g. "GIF") which identifies this format.
    nextMagickInfoNext MagickInfo struct in linked-list. NULL if none.
    previousMagickInfoPrevious MagickInfo struct in linked-list. NULL if none.
    rawunsigned intImage format does not contain size (must be specified in +ImageInfo).
    +
    +
    +

    MonitorHandler

    +

    MonitorHandler is the function type to be used for the progress monitor +callback. Its definition is as follows:

    +
    +typedef unsigned int
    +  (*MonitorHandler)(const char *text, const magick_int64_t quantum,
    +    const magick_uint64_t span, ExceptionInfo *exception);
    +
    +

    The operation of the monitor handler is described in the following table:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
    MonitorHandler Parameters
    ParameterTypeDescription
    return statusunsigned intThe progress monitor should normally return +True (a non-zero value) if the operation is +to continue. If the progress monitor returns +false, then the operation is will be aborted. +This mechanism allows a user to terminate a +process which is taking too long to complete.
    textconst char *A description of the current operation being +performed.
    quantumconst magick_int64_tA value within the range of 0 to span which +indicates the degree of progress.
    spanconst magick_uint64_tThe total range that quantum will span.
    exceptionexceptionInfo *If the progress monitor returns False (abort +operation), it should also update the +structure passed via the exception parameter +so that an error message may be reported to +the user.
    +
    +
    +

    MontageInfo

    +
    +typedef struct _MontageInfo
    +{
    +  char
    +    *geometry,
    +    *tile,
    +    *title,
    +    *frame,
    +    *texture,
    +    *font;
    +
    +  double
    +    pointsize;
    +
    +  unsigned long
    +    border_width;
    +
    +  unsigned int
    +    shadow;
    +
    +  PixelPacket
    +    fill,
    +    stroke,
    +    background_color,
    +    border_color,
    +    matte_color;
    +
    +  GravityType
    +    gravity;
    +
    +  char
    +    filename[MaxTextExtent];
    +
    +  unsigned long
    +    signature;
    +} MontageInfo;
    +
    +
    +
    +

    NoiseType

    +

    NoiseType is used as an argument to select the type of noise to be added +to the image.

    + + ++++ + + + + + + + + + + + + + + + + + + + + + + + +
    NoiseType
    EnumerationDescription
    UniformNoiseUniform noise
    GaussianNoiseGaussian noise
    MultiplicativeGaussianNoiseMultiplicative Gaussian noise
    ImpulseNoiseImpulse noise
    LaplacianNoiseLaplacian noise
    PoissonNoisePoisson noise
    +
    +
    +

    OrientationType

    +

    OrientationType specifies the orientation of the image. Useful for when +the image is produced via a different ordinate system, the camera was +turned on its side, or the page was scanned sideways.

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OrientationType
    EnumerationScanline DirectionFrame Direction
    UndefinedOrientationUnknownUnknown
    TopLeftOrientationLeft to rightTop to bottom
    TopRightOrientationRight to leftTop to bottom
    BottomRightOrientationRight to leftBottom to top
    BottomLeftOrientationLeft to rightBottom to top
    LeftTopOrientationTop to bottomLeft to right
    RightTopOrientationTop to bottomRight to left
    RightBottomOrientationBottom to topRight to left
    LeftBottomOrientationBottom to topLeft to right
    +
    +
    +

    PaintMethod

    +

    PaintMethod specifies how pixel colors are to be replaced in the image. +It is used to select the pixel-filling algorithm employed.

    + + ++++ + + + + + + + + + + + + + + + + + + + + +
    PaintMethod
    EnumerationDescription
    PointMethodReplace pixel color at point.
    ReplaceMethodReplace color for all image pixels matching color at point.
    FloodfillMethodReplace color for pixels surrounding point until encountering pixel that fails +to match color at point.
    FillToBorderMethodReplace color for pixels surrounding point until encountering pixels matching +border color.
    ResetMethodReplace colors for all pixels in image with pen color.
    +
    +
    +

    PixelPacket

    +

    The PixelPacket structure is used to represent DirectClass color pixels +in GraphicsMagick. If the image is indicated as a PseudoClass image, its +DirectClass representation is only valid immediately after calling +SyncImage(). If an image is set as PseudoClass and the DirectClass +representation is modified, the image should then be set as DirectClass. +Use QuantizeImage() to restore the PseudoClass colormap if the +DirectClass representation is modified.

    +

    The members of the PixelPacket structure are shown in the following table:

    + + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PixelPacket Structure Members
    MemberTypeInterpretation
    RGBColorspace (3)RGBColorspace + matte(3)CMYKColorspace
    redQuantumRedRedCyan
    greenQuantumGreenGreenMagenta
    blueQuantumBlueBlueYellow
    opacityQuantumIgnoredOpacityBlack
    +

    Notes:

    +
    +
      +
    1. Quantum is an unsigned short (MaxRGB=65535) if GraphicsMagick is +built using -DQuantumDepth=16 Otherwise it is an unsigned char +(MaxRGB=255).
    2. +
    3. SyncImage() may be used to synchronize the DirectClass color pixels +to the current PseudoClass colormap.
    4. +
    5. For pixel representation purposes, all colorspaces are treated like +RGBColorspace except for CMYKColorspace.
    6. +
    +
    +
    +
    +

    PointInfo

    +

    The PointInfo structure is used by the ChromaticityInfo structure to +specify chromaticity point values. This defines the boundaries and gammut +(range of included color) of the colorspace.

    +

    The members of the PointInfo structure are shown in the following table:

    + + +++++ + + + + + + + + + + + + + + + + + + +
    PointInfo Structure Members
    MemberTypeDescription
    xdoubleX ordinate
    ydoubleY ordinate
    zdoubleZ ordinate
    +
    +
    +

    ProfileInfo

    +

    The ProfileInfo structure is used to represent ICC or IPCT profiles in +GraphicsMagick (stored as an opaque BLOB).

    +

    The members of the ProfileInfo structure are shown in the following table:

    + + +++++ + + + + + + + + + + + + + + +
    ProfileInfo Structure Members
    MemberTypeDescription
    lengthunsigned intProfile length
    infounsigned char *Profile data
    +
    +
    +

    QuantizeInfo

    +

    The QuantizeInfo structure is used to support passing parameters to +GraphicsMagick's color quantization (reduction) functions. Color +quantization is the process of analyzing one or more images, and +calculating a color palette which best approximates the image within a +specified colorspace, and then adjusting the image pixels to use the +calculated color palette. The maximum number of colors allowed in the +color palette may be specified.

    + + ++++ + + + + + + + + + + + + + + + + + + + + +
    Methods Supporting QuantizeInfo
    MethodDescription
    GetQuantizeInfo()Allocate new structure with defaults set.
    CloneQuantizeInfo()Copy existing structure, allocating new structure in the process.
    DestroyQuantizeInfo +()Deallocate structure, including any members.
    QuantizeImageAnalyzes the colors within a reference image and chooses a fixed number of +colors to represent the image.
    QuantizeImagesAnalyzes the colors within a set of reference images and chooses a fixed +number of colors to represent the set.
    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    QuantizeInfo Structure Members
    MemberTypeDescription
    colorspaceColorspaceTypeThe colorspace to quantize in. Color reduction, by default, takes +place in the RGB color space. Empirical evidence suggests that +distances in color spaces such as YUV or YIQ correspond to +perceptual color differences more closely than do distances in RGB +space. The Transparent color space behaves uniquely in that it +preserves the matte channel of the image if it exists.
    ditherunsigned intSet to True (non-zero) to apply Floyd/Steinberg error diffusion to the +image. When the size of the color palette is less than the image +colors, this trades off spacial resolution for color resolution by +dithering to achieve a similar looking image.
    measure_errorunsigned intSet to True (non-zero) to calculate quantization errors when +quantizing the image.
    number_colorsunsigned intSpecify the maximum number of colors in the output image. Must be +equal to, or less than MaxRGB, which is determined by the value of +QuantumLeap when GraphicsMagick was compiled.
    signatureunsigned long???
    tree_depthunsigned intSpecify the tree depth to use while quantizing. The values zero and +one support automatic tree depth determination. The tree depth may be +forced via values ranging from two to eight. The ideal tree depth +depends on the characteristics of the input image, and may be +determined through experimentation.
    +
    +
    +

    Quantum

    +

    Quantum is the base type ('unsigned char', 'unsigned short', 'unsigned +int') used to store a pixel component (e.g. 'R' is one pixel component of +an RGB pixel).

    +
    +
    +

    QuantumType

    +

    QuantumType is used to indicate the source or destination format of +entire pixels, or components of pixels ("Quantums") while they are being +read, or written to, a pixel cache. The validity of these format +specifications depends on whether the Image pixels are in RGB format, +RGBA format, or CMYK format. The pixel Quantum size is determined by the +Image depth (eight or sixteen bits).

    + + ++++ + + + + + + + + + + + + + + + + + + + + +
    RGB(A) Image Quantums
    EnumerationDescription
    IndexQuantumPseudoColor colormap indices (valid only for image with colormap)
    RedQuantumRed pixel Quantum
    GreenQuantumGreen pixel Quantum
    BlueQuantumBlue pixel Quantum
    OpacityQuantumOpacity (Alpha) Quantum
    + + ++++ + + + + + + + + + + + + + + + + + +
    CMY(K) Image Quantum
    EnumerationDescription
    CyanQuantumCyan pixel Quantum
    MagentaQuantumMagenta pixel Quantum
    YellowQuantumYellow pixel Quantum
    BlackQuantumBlack pixel Quantum
    + + ++++ + + + + + + + + + + + +
    Grayscale Image Quantums
    EnumerationDescription
    GrayQuantumGray pixel
    GrayOpacityQuantumPixel opacity
    + + ++++ + + + + + + + + + + + + + + +
    Entire Pixels (Expressed in Byte Order)
    EnumerationDescription
    RGBQuantumRGB pixel (24 or 48 octets)
    RGBAQuantumRGBA pixel (32 or 64 octets)
    CMYKQuantumCMYK pixel (32 or 64 octets)
    +
    +
    +

    RectangleInfo

    +

    The RectangleInfo structure is used to represent positioning information +in GraphicsMagick.

    +

    The members of the RectangleInfo structure are shown in the following +table:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + +
    RectangleInfo Structure Members
    MemberTypeDescription
    widthunsigned intRectangle width
    heightunsigned intRectangle height
    xintRectangle horizontal offset
    yintRectangle vertical offset
    +
    +
    +

    RegistryType

    +
    +typedef enum
    +{
    +  UndefinedRegistryType,
    +  ImageRegistryType,
    +  ImageInfoRegistryType
    +} RegistryType;
    +
    +
    +
    +

    RenderingIntent

    +

    Rendering intent is a concept defined by ICC Spec ICC.1:1998-09, "File +Format for Color Profiles". GraphicsMagick uses RenderingIntent in order +to support ICC Color Profiles.

    +

    From the specification: "Rendering intent specifies the style of +reproduction to be used during the evaluation of this profile in a +sequence of profiles. It applies specifically to that profile in the +sequence and not to the entire sequence. Typically, the user or +application will set the rendering intent dynamically at runtime or +embedding time."

    + + ++++ + + + + + + + + + + + + + + + + + + + + +
    RenderingIntent
    EnumerationDescription
    UndefinedIntentUnset value.
    SaturationIntentA rendering intent that specifies the saturation of the pixels in the image is +preserved perhaps at the expense of accuracy in hue and lightness.
    PerceptualIntentA rendering intent that specifies the full gamut of the image is compressed or +expanded to fill the gamut of the destination device. Gray balance is preserved +but colorimetric accuracy might not be preserved.
    AbsoluteIntentAbsolute colorimetric
    RelativeIntentRelative colorimetric
    +
    +
    +

    ResolutionType

    +

    By default, GraphicsMagick defines resolutions in pixels per inch. +ResolutionType provides a means to adjust this.

    + + ++++ + + + + + + + + + + + + + + +
    ResolutionType
    EnumerationDescription
    UndefinedResolutionUnset value.
    PixelsPerInchResolutionDensity specifications are specified in units of pixels per inch +(english units).
    PixelsPerCentimeterResolutionDensity specifications are specified in units of pixels per +centimeter (metric units).
    +
    +
    +

    ResourceType

    +
    +typedef enum
    +{
    +  UndefinedResource,
    +  FileResource,
    +  MemoryResource,
    +  MapResource,
    +  DiskResource
    +} ResourceType;
    +
    +
    +
    +

    SegmentInfo

    +
    +typedef struct _SegmentInfo
    +{
    +  double
    +    x1,
    +    y1,
    +    x2,
    +    y2;
    +} SegmentInfo;
    +
    +
    +
    +

    SignatureInfo

    +
    +typedef struct _SignatureInfo
    +{
    +  unsigned long
    +    digest[8],
    +    low_order,
    +    high_order;
    +
    +  long
    +    offset;
    +
    +  unsigned char
    +    message[SignatureSize];
    +} SignatureInfo;
    +
    +
    +
    +

    StorageType

    +
    +typedef enum
    +{
    +  CharPixel,
    +  ShortPixel,
    +  IntegerPixel,
    +  LongPixel,
    +  FloatPixel,
    +  DoublePixel
    +} StorageType;
    +
    +
    +
    +

    StreamHandler

    +
    +typedef unsigned int
    +  (*StreamHandler)(const Image *,const void *,const size_t);
    +
    +
    +
    +

    StretchType

    +
    +typedef enum
    +{
    +  NormalStretch,
    +  UltraCondensedStretch,
    +  ExtraCondensedStretch,
    +  CondensedStretch,
    +  SemiCondensedStretch,
    +  SemiExpandedStretch,
    +  ExpandedStretch,
    +  ExtraExpandedStretch,
    +  UltraExpandedStretch,
    +  AnyStretch
    +} StretchType;
    +
    +
    +
    +

    StyleType

    +
    +typedef enum
    +{
    +  NormalStyle,
    +  ItalicStyle,
    +  ObliqueStyle,
    +  AnyStyle
    +} StyleType;
    +
    +
    +
    +

    TypeMetric

    +
    +typedef struct _TypeMetric
    +{
    +  PointInfo
    +    pixels_per_em;
    +
    +  double
    +    ascent,
    +    descent,
    +    width,
    +    height,
    +    max_advance;
    +
    +  SegmentInfo
    +    bounds;
    +
    +  double
    +    underline_position,
    +    underline_thickness;
    +} TypeMetric;
    +
    +
    +
    +

    ViewInfo

    +

    ViewInfo represents a handle to a pixel view, which represents a uniquely +selectable rectangular region of pixels. The only limit on the number of +views is the amount of available memory. Each Image contains a collection +of default views (one view per thread) so that the image may be usefully +accessed without needing to explicitly allocate pixel views.

    +
    +typedef void *ViewInfo;
    +
    +
    +
    +

    VirtualPixelMethod

    +
    +typedef enum
    +{
    +  UndefinedVirtualPixelMethod,
    +  ConstantVirtualPixelMethod,
    +  EdgeVirtualPixelMethod,
    +  MirrorVirtualPixelMethod,
    +  TileVirtualPixelMethod
    +} VirtualPixelMethod;
    +
    +
    +
    +

    MagickXResourceInfo

    +
    +typedef struct _XResourceInfo
    +{
    +  XrmDatabase
    +    resource_database;
    +
    +  ImageInfo
    +    *image_info;
    +
    +  QuantizeInfo
    +    *quantize_info;
    +
    +  unsigned long
    +    colors;
    +
    +  unsigned int
    +    close_server,
    +    backdrop;
    +
    +  char
    +    *background_color,
    +    *border_color;
    +
    +  char
    +    *client_name;
    +
    +  XColormapType
    +    colormap;
    +
    +  unsigned int
    +    border_width,
    +    color_recovery,
    +    confirm_exit,
    +    delay;
    +
    +  char
    +    *display_gamma;
    +
    +  char
    +    *font,
    +    *font_name[MaxNumberFonts],
    +    *foreground_color;
    +
    +  unsigned int
    +    display_warnings,
    +    gamma_correct;
    +
    +  char
    +    *icon_geometry;
    +
    +  unsigned int
    +    iconic,
    +    immutable;
    +
    +  char
    +    *image_geometry;
    +
    +  char
    +    *map_type,
    +    *matte_color,
    +    *name;
    +
    +  unsigned int
    +    magnify,
    +    pause;  char
    +    *pen_colors[MaxNumberPens];
    +
    +  char
    +    *text_font,
    +    *title;
    +
    +  int
    +    quantum;
    +
    +  unsigned int
    +    update,
    +    use_pixmap,
    +    use_shared_memory;
    +
    +  unsigned long
    +    undo_cache;
    +
    +  char
    +    *visual_type,
    +    *window_group,
    +    *window_id,
    +    *write_filename;
    +
    +  Image
    +    *copy_image;
    +
    +  int
    +    gravity;
    +
    +  char
    +    home_directory[MaxTextExtent];
    +} XResourceInfo;
    +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    + + diff --git a/www/api/types.rst b/www/api/types.rst index 013253a..03d55e4 100644 --- a/www/api/types.rst +++ b/www/api/types.rst @@ -284,7 +284,7 @@ CompressionType is used to express the desired compression type when encoding an image. Be aware that most image types only support a sub-set of the available compression types. If the compression type specified is incompatable with the image, GraphicsMagick selects a compression type -compatable with the image type. +compatable with the image type, which might be no compression at all. .. table:: CompressionType @@ -313,6 +313,19 @@ compatable with the image type. +---------------------------+---------------------------------------------------------------------+ |ZipCompression |Lempel-Ziv compression (LZ77) as used in PKZIP and GNU gzip. | +---------------------------+---------------------------------------------------------------------+ + |LZMACompression |LZMA - Lempel-Ziv-Markov chain algorithm | + +---------------------------+---------------------------------------------------------------------+ + |JPEG2000Compression |JPEG 2000 - ISO/IEC std 15444-1 | + +---------------------------+---------------------------------------------------------------------+ + |JBIG1Compression |JBIG v1 - ISO/IEC std 11544 / ITU-T rec T.82 | + +---------------------------+---------------------------------------------------------------------+ + |JBIG2Compression |JBIG v2 - ISO/IEC std 14492 / ITU-T rec T.88 | + +---------------------------+---------------------------------------------------------------------+ + |ZSTDCompression |Facebook's Zstandard/Zstd | + +---------------------------+---------------------------------------------------------------------+ + |WebPCompression |Google's WebP | + +---------------------------+---------------------------------------------------------------------+ + DecorationType ============== @@ -748,6 +761,103 @@ position an object. A common default for gravity is NorthWestGravity. |SouthEastGravity |Position object at bottom-right of region | +--------------------------+----------------------------------------------------------------------+ +LogEventType +============ + +LogEventType specifies the log event type to match one or more log +areas. Although defined as an enum type, the values are based on +unsigned integer flags value with one mask bit set, more than one mask +bit set, or all of the assigned mask bits set. Values are boolean +ORed together to represent multiple event types. + +.. table:: LogEventType + + +--------------------------+----------------------------------------------------------------------+ + | Enumeration | Description | + +--------------------------+----------------------------------------------------------------------+ + |UndefinedEventMask | No events specified | + +--------------------------+----------------------------------------------------------------------+ + |NoEventsMask | No events specified | + +--------------------------+----------------------------------------------------------------------+ + |ConfigureEventMask | Configuration event (related to initialization or shutdown) | + +--------------------------+----------------------------------------------------------------------+ + |AnnotateEventMask | Annotation event (text drawing) | + +--------------------------+----------------------------------------------------------------------+ + |RenderEventMask | Rendering event (vector drawing) | + +--------------------------+----------------------------------------------------------------------+ + |TransformEventMask | Image transformation event (e.g. cropping) | + +--------------------------+----------------------------------------------------------------------+ + |LocaleEventMask | Locale event (internationalization) | + +--------------------------+----------------------------------------------------------------------+ + |CoderEventMask | Coder event (file decode or encode) | + +--------------------------+----------------------------------------------------------------------+ + |X11EventMask | X11 event (event related to use of X11) | + +--------------------------+----------------------------------------------------------------------+ + |CacheEventMask | Pixel cache event (pixel storage in memory or on disk) | + +--------------------------+----------------------------------------------------------------------+ + |BlobEventMask | Blob event (I/O to/from memory or a file) | + +--------------------------+----------------------------------------------------------------------+ + |DeprecateEventMask | Deprecation event (use of a function which will be removed) | + +--------------------------+----------------------------------------------------------------------+ + |UserEventMask | User event (event allowed for the user, not otherwise used) | + +--------------------------+----------------------------------------------------------------------+ + |ResourceEventMask | Resource event (resource limit assignment, allocation/deallocation) | + +--------------------------+----------------------------------------------------------------------+ + |TemporaryFileEventMask | Temporary file event (temporary file created or removed) | + +--------------------------+----------------------------------------------------------------------+ + |ExceptionEventMask | Exception event (a warning or error was reported into ExceptionInfo) | + +--------------------------+----------------------------------------------------------------------+ + |OptionEventMask | Option event (something related to a user provided option) | + +--------------------------+----------------------------------------------------------------------+ + |InformationEventMask | Information event | + +--------------------------+----------------------------------------------------------------------+ + |WarningEventMask | Warning event (a warning was reported into ExceptionInfo) | + +--------------------------+----------------------------------------------------------------------+ + |ErrorEventMask | Error event (an error was reported into ExceptionInfo) | + +--------------------------+----------------------------------------------------------------------+ + |FatalErrorEventMask | Fatal error event (a fatal error was reported into ExceptionInfo) | + +--------------------------+----------------------------------------------------------------------+ + |AllEventsMask | All events (matches any/all events) | + +--------------------------+----------------------------------------------------------------------+ + + +LogMethod +========= + +LogMethod is a call-back function type in the form:: + + typedef void (*LogMethod)(const ExceptionType type,const char *text) + +LogOutputType +============= + +LogOutputType specifies how/where logging ("tracing") output is to be directed. + +.. table:: LogOutputType + + +--------------------------+----------------------------------------------------------------------+ + | Enumeration | Description | + +--------------------------+----------------------------------------------------------------------+ + |DisabledOutput |Reporting disabled | + +--------------------------+----------------------------------------------------------------------+ + |UndefinedOutput |Reporting disabled | + +--------------------------+----------------------------------------------------------------------+ + |StdoutOutput |Log to stdout in "human readable" format | + +--------------------------+----------------------------------------------------------------------+ + |StderrOutput |Log to stderr in "human readable" format | + +--------------------------+----------------------------------------------------------------------+ + |XMLFileOutput |Log to a file in an XML format | + +--------------------------+----------------------------------------------------------------------+ + |TXTFileOutput |Log to a file in a text format | + +--------------------------+----------------------------------------------------------------------+ + |Win32DebugOutput |Windows, Output events to the application/system debugger. | + +--------------------------+----------------------------------------------------------------------+ + |Win32EventlogOutput |Windows, Output events to the Application event log. | + +--------------------------+----------------------------------------------------------------------+ + |MethodOutput |Log by calling registered C-language callback function | + +--------------------------+----------------------------------------------------------------------+ + + Image ===== @@ -2065,9 +2175,3 @@ MagickXResourceInfo char home_directory[MaxTextExtent]; } XResourceInfo; - -------------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/api/widget.html b/www/api/widget.html index 0c9f7d3..280c7aa 100644 --- a/www/api/widget.html +++ b/www/api/widget.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -500,5 +500,10 @@ window.
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/api/widget.html.orig b/www/api/widget.html.orig new file mode 100644 index 0000000..4f26808 --- /dev/null +++ b/www/api/widget.html.orig @@ -0,0 +1,504 @@ + + + + + + +widget + + + + + + + +
    +

    widget

    +

    X11 Widgets

    + + +
    +

    XColorBrowserWidget

    +
    +

    Synopsis

    +
    +void MagickXColorBrowserWidget( Display *display, MagickXWindows *windows, const char *action,
    +                                char *reply );
    +
    +
    +
    +

    Description

    +

    Method MagickXColorBrowserWidget displays a Color Browser widget with a color +query to the user. The user keys a reply and presses the Action or Cancel +button to exit. The typed text is returned as the reply function parameter.

    +

    The format of the MagickXColorBrowserWidget method is:

    +
    +void MagickXColorBrowserWidget( Display *display, MagickXWindows *windows, const char *action,
    +                                char *reply );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    action:
    +
    Specifies a pointer to the action of this widget.
    +
    reply:
    +
    The response from the user is returned in this parameter.
    +
    +
    +
    +
    +

    XCommandWidget

    +
    +

    Synopsis

    +
    +int MagickXCommandWidget( Display *display, MagickXWindows *windows,
    +                          const char ** selections, XEvent *event );
    +
    +
    +
    +

    Description

    +

    Method MagickXCommandWidget maps a menu and returns the command pointed to by +the user when the button is released.

    +

    The format of the MagickXCommandWidget method is:

    +
    +int MagickXCommandWidget( Display *display, MagickXWindows *windows,
    +                          const char ** selections, XEvent *event );
    +
    +
    +
    selection_number:
    +
    Specifies the number of the selection that the +user choose.
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    selections:
    +
    Specifies a pointer to one or more strings that comprise +the choices in the menu.
    +
    event:
    +
    Specifies a pointer to a X11 XEvent structure.
    +
    +
    +
    +
    +

    XConfirmWidget

    +
    +

    Synopsis

    +
    +int MagickXConfirmWidget( Display *display, MagickXWindows *windows, const char *reason,
    +                          const char *description );
    +
    +
    +
    +

    Description

    +

    Method MagickXConfirmWidget displays a Confirm widget with a notice to the user. +The function returns -1 if Dismiss is pressed, 0 for Cancel, and 1 for +Yes.

    +

    The format of the MagickXConfirmWidget method is:

    +
    +int MagickXConfirmWidget( Display *display, MagickXWindows *windows, const char *reason,
    +                          const char *description );
    +
    +
    +
    status:
    +
    Method MagickXConfirmWidget returns True if the user presses Yes +otherwise False is returned.
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    reason:
    +
    Specifies the message to display before terminating the +program.
    +
    description:
    +
    Specifies any description to the message.
    +
    +
    +
    +
    +

    XDialogWidget

    +
    +

    Synopsis

    +
    +int MagickXDialogWidget( Display *display, MagickXWindows *windows, const char *action,
    +                         const char *query, char *reply );
    +
    +
    +
    +

    Description

    +

    Method MagickXDialogWidget displays a Dialog widget with a query to the user. +The user keys a reply and presses the Ok or Cancel button to exit. The +typed text is returned as the reply function parameter.

    +

    The format of the MagickXDialogWidget method is:

    +
    +int MagickXDialogWidget( Display *display, MagickXWindows *windows, const char *action,
    +                         const char *query, char *reply );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    action:
    +
    Specifies a pointer to the action of this widget.
    +
    query:
    +
    Specifies a pointer to the query to present to the user.
    +
    reply:
    +
    The response from the user is returned in this parameter.
    +
    +
    +
    +
    +

    XFileBrowserWidget

    +
    +

    Synopsis

    +
    +void MagickXFileBrowserWidget( Display *display, MagickXWindows *windows, const char *action,
    +                               char *reply );
    +
    +
    +
    +

    Description

    +

    Method MagickXFileBrowserWidget displays a File Browser widget with a file query +to the user. The user keys a reply and presses the Action or Cancel button +to exit. The typed text is returned as the reply function parameter.

    +

    The format of the MagickXFileBrowserWidget method is:

    +
    +void MagickXFileBrowserWidget( Display *display, MagickXWindows *windows, const char *action,
    +                               char *reply );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    action:
    +
    Specifies a pointer to the action of this widget.
    +
    reply:
    +
    The response from the user is returned in this parameter.
    +
    +
    +
    +
    +

    XFontBrowserWidget

    +
    +

    Synopsis

    +
    +void MagickXFontBrowserWidget( Display *display, MagickXWindows *windows, const char *action,
    +                               char *reply );
    +
    +
    +
    +

    Description

    +

    Method MagickXFontBrowserWidget displays a Font Browser widget with a font query +to the user. The user keys a reply and presses the Action or Cancel button +to exit. The typed text is returned as the reply function parameter.

    +

    The format of the MagickXFontBrowserWidget method is:

    +
    +void MagickXFontBrowserWidget( Display *display, MagickXWindows *windows, const char *action,
    +                               char *reply );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    action:
    +
    Specifies a pointer to the action of this widget.
    +
    reply:
    +
    The response from the user is returned in this parameter.
    +
    +
    +
    +
    +

    XInfoWidget

    +
    +

    Synopsis

    +
    +void MagickXInfoWidget( Display *display, MagickXWindows *windows, const char *activity );
    +
    +
    +
    +

    Description

    +

    Method MagickXInfoWidget displays text in the Info widget. The purpose is to +inform the user that what activity is currently being performed (e.g. +reading an image, rotating an image, etc.).

    +

    The format of the MagickXInfoWidget method is:

    +
    +void MagickXInfoWidget( Display *display, MagickXWindows *windows, const char *activity );
    +
    +

    A description of each parameter follows:

    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    activity:
    +
    This character string reflects the current activity and is +displayed in the Info widget.
    +
    +
    +
    +
    +

    XListBrowserWidget

    +
    +

    Synopsis

    +
    +void MagickXListBrowserWidget( Display *display, MagickXWindows *windows,
    +                               MagickXWindowInfo *window_info, const char ** list,
    +                               const char *action, const char *query, char *reply );
    +
    +
    +
    +

    Description

    +

    Method MagickXListBrowserWidget displays a List Browser widget with a query to +the user. The user keys a reply or select a reply from the list. Finally, +the user presses the Action or Cancel button to exit. The typed text is +returned as the reply function parameter.

    +

    The format of the MagickXListBrowserWidget method is:

    +
    +void MagickXListBrowserWidget( Display *display, MagickXWindows *windows,
    +                               MagickXWindowInfo *window_info, const char ** list,
    +                               const char *action, const char *query, char *reply );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    list:
    +
    Specifies a pointer to an array of strings. The user can +select from these strings as a possible reply value.
    +
    action:
    +
    Specifies a pointer to the action of this widget.
    +
    query:
    +
    Specifies a pointer to the query to present to the user.
    +
    reply:
    +
    The response from the user is returned in this parameter.
    +
    +
    +
    +
    +

    XMenuWidget

    +
    +

    Synopsis

    +
    +int MagickXMenuWidget( Display *display, MagickXWindows *windows, const char *title,
    +                       const char ** selections, char *item );
    +
    +
    +
    +

    Description

    +

    Method MagickXMenuWidget maps a menu and returns the command pointed to by the +user when the button is released.

    +

    The format of the MagickXMenuWidget method is:

    +
    +int MagickXMenuWidget( Display *display, MagickXWindows *windows, const char *title,
    +                       const char ** selections, char *item );
    +
    +
    +
    selection_number:
    +
    Specifies the number of the selection that the +user choose.
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    title:
    +
    Specifies a character string that describes the menu selections.
    +
    selections:
    +
    Specifies a pointer to one or more strings that comprise +the choices in the menu.
    +
    item:
    +
    Specifies a character array. The item selected from the menu +is returned here.
    +
    +
    +
    +
    +

    XMonitorWidget

    +
    +

    Synopsis

    +
    +void MagickXMonitorWidget( Display *display, MagickXWindows *windows, const char *task,
    +                           const magick_int64_t quantum, const magick_uint64_t span );
    +
    +
    +
    +

    Description

    +

    Method MagickXMonitorWidget displays the progress a task is making in +completing a task. A span of zero toggles the active status. An inactive +state disables the progress monitor.

    +

    The format of the MagickXMonitorWidget method is:

    +
    +void MagickXMonitorWidget( Display *display, MagickXWindows *windows, const char *task,
    +                           const magick_int64_t quantum, const magick_uint64_t span );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    task:
    +
    Identifies the task in progress.
    +
    quantum:
    +
    Specifies the quantum position within the span which represents +how much progress has been made in completing a task.
    +
    span:
    +
    Specifies the span relative to completing a task.
    +
    +
    +
    +
    +

    XNoticeWidget

    +
    +

    Synopsis

    +
    +void MagickXNoticeWidget( Display *display, MagickXWindows *windows, const char *reason,
    +                          const char *description );
    +
    +
    +
    +

    Description

    +

    Method MagickXNoticeWidget displays a Notice widget with a notice to the user. +The function returns when the user presses the "Dismiss" button.

    +

    The format of the MagickXNoticeWidget method is:

    +
    +void MagickXNoticeWidget( Display *display, MagickXWindows *windows, const char *reason,
    +                          const char *description );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    reason:
    +
    Specifies the message to display before terminating the +program.
    +
    description:
    +
    Specifies any description to the message.
    +
    +
    +
    +
    +

    XPreferencesWidget

    +
    +

    Synopsis

    +
    +unsigned int MagickXPreferencesWidget( Display *display,
    +                                       MagickXResourceInfo *resource_info,
    +                                       MagickXWindows *windows );
    +
    +
    +
    +

    Description

    +

    Method MagickXPreferencesWidget displays a Preferences widget with program +preferences. If the user presses the Apply button, the preferences are +stored in a configuration file in the users' home directory.

    +

    The format of the MagickXPreferencesWidget method is:

    +
    +unsigned int MagickXPreferencesWidget( Display *display,
    +                                       MagickXResourceInfo *resource_info,
    +                                       MagickXWindows *windows );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    resource_info:
    +
    Specifies a pointer to a X11 MagickXResourceInfo structure.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    +
    +
    +
    +

    XTextViewWidget

    +
    +

    Synopsis

    +
    +void MagickXTextViewWidget( Display *display, const MagickXResourceInfo *resource_info,
    +                            MagickXWindows *windows, const unsigned int mono,
    +                            const char *title, const char ** textlist );
    +
    +
    +
    +

    Description

    +

    Method MagickXTextViewWidget displays text in a Text View widget.

    +

    The format of the MagickXTextViewWidget method is:

    +
    +void MagickXTextViewWidget( Display *display, const MagickXResourceInfo *resource_info,
    +                            MagickXWindows *windows, const unsigned int mono,
    +                            const char *title, const char ** textlist );
    +
    +
    +
    display:
    +
    Specifies a connection to an X server; returned from +XOpenDisplay.
    +
    resource_info:
    +
    Specifies a pointer to a X11 MagickXResourceInfo structure.
    +
    window:
    +
    Specifies a pointer to a MagickXWindows structure.
    +
    mono:
    +
    Use mono-spaced font when displaying text.
    +
    title:
    +
    This character string is displayed at the top of the widget +window.
    +
    textlist:
    +
    This string list is displayed within the Text View widget.
    +
    +
    +
    +
    + + diff --git a/www/authors.html b/www/authors.html index 30b5711..4140601 100644 --- a/www/authors.html +++ b/www/authors.html @@ -3,7 +3,7 @@ - + GraphicsMagick Authors @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -197,14 +197,12 @@ Wireless Access Protocol.
    Mike Edmonds
    Contributed the median filter algorithm.
    -
    -
    -
    Copyright © GraphicsMagick Group 2002 - 2020
    -

    This program is covered by multiple licenses, which are described in -Copyright.txt. You should have received a copy of Copyright.txt with this -package; otherwise see http://www.graphicsmagick.org/Copyright.html.

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/authors.html.orig b/www/authors.html.orig new file mode 100644 index 0000000..4eaf517 --- /dev/null +++ b/www/authors.html.orig @@ -0,0 +1,210 @@ + + + + + + +GraphicsMagick Authors + + + + + + + +
    +

    GraphicsMagick Authors

    + + + + +

    The following people have contributed substantially to the development +of GraphicsMagick. Please let us know if an author is missing, or a +significant contribution was made and not recorded.

    + +
    +

    Active GraphicsMagick Contributors

    +
    +
    Bob Friesenhahn
    +
    Principal maintainer of GraphicsMagick. Author of +Magick++ (C++ API to ImageMagick and GraphicsMagick). +Author of module loader facility, automatic file +identification (magic) support, Unix/Cygwin/MinGW +configure/make facility, Windows setup.exe style +installer, WMF renderer, C API documentation formatter, +and the C, C++, and Perl test suites used by ImageMagick +and GraphicsMagick.
    +
    Jaroslav Fojtik
    +
    Authored the ART, CUT, HRZ, JNX, MAC, MATLAB, TOPOL, +and WPG coder modules. Improved the FITS and TXT coder +modules. VisualMagick 'configure' improvements and +build testing/fixes for many versions of Microsoft +Visual Studio.
    +
    Troy Patteson
    +
    Contributed a several significant patches to fix image +rotation bugs and improve image rotation performance, +as well as an improved bi-linear interpolation +implementation.
    +
    +
    +
    +

    Former GraphicsMagick Contributors

    +
    +
    Glenn Randers-Pehrson
    +
    Contributed significantly to the utilities, including +writing the 'gm' utility wrapper. Authored support for +JNG, MNG, and PNG formats. Provided significant +support for the BMP format. Significant improvements +to the documentation, including creating a +documentation authoring environment based on the +<imdoc> format. Maintained the SourceForge mailing +lists. GraphicsMagick would not be what it is today +without Glenn and he will always be remembered.
    +
    Gregory J Wolfe
    +
    Contributed significant improvements to the SVG +parsing and rendering code.
    +
    Kenneth Xu
    +
    Contributed the implementation of 'gm batch', a simple +batch mode for GraphicsMagick.
    +
    Sara Shafaei
    +
    Contributed a number of Wand API functions as well as +fixes for several composition operators.
    +
    Brendan Lane
    +
    Contributed a large number of new Photoshop +composition operators and alpha-channel fixes for +existing ones.
    +
    Dirk Lemstra
    +
    Contributed improvements to the VisualMagick configure +program to support configuring more build options via +the GUI dialogs and to deal with similarly named +files.
    +
    Roman Hiestand
    +
    Contributed WebP coder improvements.
    +
    Mike Chiarappa
    +
    Created and maintains the Borland C++ Builder 6.0 build +environment for GraphicsMagick.
    +
    Daniel Kobras
    +
    Provided many security patches and fixes from the Debian +project.
    +
    William Radcliffe
    +
    Author of the VisualMagick project configure facility for +Visual C++. Author of FlashPix module. Author of the +ImageMagickObject COM object for Windows. Author of the +EMF, XTRN, and META coders. Significant contributions to +the MSL, JPEG, TIFF, SVG, and URL coders. Authored +"process" module support. Wrote the micro-timer facility +used by 'identify'. Ported module loader support to +Windows. Significantly improved polygon rendering +performance.
    +
    Leonard Rosenthol
    +
    Authored the 'conjure' utility and associated MSL +execution environment. Provided MacOS support. Authored +the CLIPBOARD, XCF, and PSD coders. Postscript and PDF +expertise. Significant drawing enhancements including +support for dash patterns, linecap stroking, clipping +masks and a mask image.
    +
    Lars Ruben Skyum
    +
    Contributed the -clippath functionality, added +-define support, improved color profile support, +and re-wrote the PS3 coder.
    +
    Rolf Schroedter
    +
    Principal author of TclMagick.
    +
    David N. Welton
    +
    Co-author of TclMagick, particularly in the Unix environment.
    +
    Mark Mitchell
    +
    Contributed a new design for the web pages, including the +formatting scripts, and converted many pages to the new +format.
    +
    Richard Nolde
    +
    Contributed code for converting between native floating +point types, and short (16/24) bit float types.
    +
    Clément Follet
    +
    Contributed Hald CLUT and ASC-CDL implementations.
    +
    John Sergeant
    +
    Re-wrote the HP PCL writer to work much better, +including support for compression. Implemented +support for CALS type 1 format. Re-wrote the DICOM +reader.
    +
    Roberto de Deus Barbosa Murta
    +
    Contributed the adaptive threshold implementation +(-lat), which executes in linear rather than quadratic +time.
    +
    Samuel Thibault
    +
    Contributed support for the Braille image format.
    +
    +
    +
    +

    Other Contributors (via ImageMagick)

    +
    +
    John Cristy
    +
    Creator, principal author, and principal maintainer of +ImageMagick, from which GraphicsMagick is originally +derived (from ImageMagick 5.5.2). Also the author of +the Wand API to ImageMagick which is incorporated as +a stand-alone library by GraphicsMagick.
    +
    Kelly Bergougnoux
    +
    Authored the initial Cineon coder (which has since been +replaced).
    +
    Christopher R. Hawks
    +
    Authored the PALM coder.
    +
    Francis J. Franklin
    +
    Ported the WMF coder to the libwmf 0.2 API.
    +
    Rick Mabry
    +
    Contributed code to support filling drawn objects using a +pattern image.
    +
    Nathan Brown
    +
    Original author of the JP2 coder.
    +
    Kyle Shorter
    +
    Original author of PerlMagick. Original author of the +LOCALE coder.
    +
    Markus Friedl
    +
    Original author of Base64 encode/decode sources.
    +
    David Harr
    +
    Contributed (with Leonard Rosenthol) dash pattern, +linecap stroking algorithm, and minor rendering +improvements.
    +
    Troy Edwards
    +
    Authored the source RPM spec file for GraphicsMagick.
    +
    Milan Votava
    +
    Contributed support for Wireless BitMap, used in WAP - +Wireless Access Protocol.
    +
    Mike Edmonds
    +
    Contributed the median filter algorithm.
    +
    +
    +
    +
    Copyright © GraphicsMagick Group 2002 - 2020
    +
    +

    This program is covered by multiple licenses, which are described in +Copyright.txt. You should have received a copy of Copyright.txt with this +package; otherwise see http://www.graphicsmagick.org/Copyright.html.

    +
    +
    + + diff --git a/www/authors.rst b/www/authors.rst index 3495af4..296f205 100644 --- a/www/authors.rst +++ b/www/authors.rst @@ -192,14 +192,3 @@ Milan Votava Mike Edmonds Contributed the median filter algorithm. - - ---------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -| Copyright |copy| GraphicsMagick Group 2002 - 2020 - -This program is covered by multiple licenses, which are described in -Copyright.txt. You should have received a copy of Copyright.txt with this -package; otherwise see http://www.graphicsmagick.org/Copyright.html. diff --git a/www/batch.html b/www/batch.html index 9f54cc0..4ccc94b 100644 --- a/www/batch.html +++ b/www/batch.html @@ -135,7 +135,7 @@ as the script to execute: gm batch -echo on -feedback on script.txt -

    +

    Back to Contents  

    @@ -270,7 +270,7 @@ Normally command processing continues if a command encounters an error. Specify -stop-on-error on to cause processing to quit immediately on error.
    -

    +

    Back to Contents  

    diff --git a/www/benchmark.html b/www/benchmark.html index 9254484..05a09ae 100644 --- a/www/benchmark.html +++ b/www/benchmark.html @@ -167,7 +167,7 @@ worry about thermal management. The powertop utility available under Linux and Solaris provides a way to observe CPU core clock rates while a benchmark is running. -

    +

    Back to Contents  

    @@ -253,7 +253,7 @@ threads at each step by the specified value. The maximum number of threads is taken from the standard OMP_NUM_THREADS environment variable.
    -

    +

    Back to Contents  

    diff --git a/www/benchmarks.html b/www/benchmarks.html index 4f130ee..2bc1a18 100644 --- a/www/benchmarks.html +++ b/www/benchmarks.html @@ -3,7 +3,7 @@ - + GraphicsMagick vs ImageMagick Benchmarks @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -168,14 +168,12 @@ do sleep 1 done 2>&1 -
    -
    -
    Copyright (C) 2008 - 2020 GraphicsMagick Group
    -

    This program is covered by multiple licenses, which are described in -Copyright.txt. You should have received a copy of Copyright.txt with this -package; otherwise see http://www.graphicsmagick.org/Copyright.html.

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/benchmarks.html.orig b/www/benchmarks.html.orig new file mode 100644 index 0000000..797619f --- /dev/null +++ b/www/benchmarks.html.orig @@ -0,0 +1,181 @@ + + + + + + +GraphicsMagick vs ImageMagick Benchmarks + + + + + + + +
    +

    GraphicsMagick vs ImageMagick Benchmarks

    + + + + + +
    +

    Foreword

    +

    This page used to document benchmark results which compared +GraphicsMagick 1.3.8 performance to ImageMagick 6.5.8-10 performance. +We found that GraphicsMagick was usually considerably faster at +executing image processing operations from the command line than +ImageMagick 6.5.8-10 was. One ImageMagick algorithm ran as much as 770 +times slower. GraphicsMagick clearly ran much more efficiently under +Microsoft Windows.

    +

    We now find that a simple head to head performance comparison between +GraphicsMagick and recent ImageMagick is no longer possible because +ImageMagick has changed the meanings of the existing arguments. In +particular, we discovered that ImageMagick filter arguments producing +convolution matrices are now producing lower-order convolution +matrices representing perhaps an order of magnitude less work given +the same arguments. The resulting images are visually substantially +less filtered. Using the same command-line filter arguments causes +GraphicsMagick to appear slower when it is actually doing far more +work than ImageMagick.

    +

    Due to it not being feasable to do a head to head performance +measurement between GraphicsMagick and ImageMagick, we have decided to +not post results at the moment. However, the strategy and a simple +benchmark driver script are still provided for those who want to do +their own performance comparisons between GraphicsMagick and +ImageMagick.

    +
    +
    +

    Strategy

    +

    The benchmark focuses on the ability to process many medium sized +HD-resolution (1920x1080 pixels) images. In order to prevent disk I/O +from being a factor, we use a small input image and tile it to create +a larger input image via the "tile:" coder. The processed image is +sent to the "null:" coder so that file writes to a slow disk are also +not a factor. Static executables are used and executed via full paths +in order to minimize variability from the execution environment. In +order to obtain accurate and useful timing, we use the bash shell to +execute the command 40 times and see how long it takes. This is a very +simple benchmark approach which is quite representative of the +performance that the typical user observes.

    +

    This new benchmark reveals the following performance criteria:

    +
    +
      +
    • Basic execution overhead of the software.
    • +
    • Image processing algorithmic efficiency.
    • +
    • Efficacy of OpenMP enhancements.
    • +
    +
    +
    +
    +

    The Benchmark

    +

    The benchmark is quite simple. It reads a list of commands to execute +from a file named "commands.txt" and times how long it takes to +execute each command 40 times using GraphicsMagick and ImageMagick.

    +

    Here is the simple benchmark script:

    +
    +#!/usr/bin/env bash
    +#
    +# Measure the performance between two 'convert' commands by
    +# executing a subcommand through many iterations and seeing
    +# the total time that it takes.
    +#
    +# Written by Bob Friesenhahn, October 2008
    +#
    +
    +# GraphicsMagick
    +convert1='/usr/local/bin/gm convert'
    +#convert1='/c/Program\ Files/GraphicsMagick-1.3.8-Q16/gm.exe convert'
    +
    +# ImageMagick
    +convert2='/usr/local/bin/convert'
    +#convert2='/c/Program\ Files/ImageMagick-6.5.9-Q16/convert.exe'
    +
    +# Input file specification
    +input_image='-size 1920x1080 tile:model.pnm'
    +
    +# Ouput file specification
    +output_image="null:"
    +
    +# Should not need to change any of the rest
    +typeset -i iterations=40
    +echo "Convert-1:   ${convert1}"
    +echo "Version:     `eval "${convert1}" -version | head -1`"
    +echo "Convert-2:   ${convert2}"
    +echo "Version:     `eval "${convert2}" -version | head -1`"
    +echo "Date:        `date`"
    +echo "Host:        `uname -n`"
    +echo "OS:          `uname -s`"
    +echo "Release:     `uname -r`"
    +echo "Arch:        `uname -p`"
    +echo "Input File:  ${input_image}"
    +echo "Output File: ${output_image}"
    +echo "Threads:     ${OMP_NUM_THREADS:-1}"
    +echo "Iterations:  ${iterations}"
    +echo "========================================================================================"
    +echo
    +typeset -i count=0 i=0
    +cat commands.txt | while read subcommand
    +do
    +  echo ${subcommand}
    +
    +  command1="${convert1} ${input_image} ${subcommand} ${output_image}"
    +  i=0
    +  count=$iterations
    +  time while ((i < count))
    +  do
    +    eval "${command1}"
    +    let i=i+1
    +  done
    +  sleep 1
    +
    +  command2="${convert2} ${input_image} ${subcommand} ${output_image}"
    +  i=0
    +  count=$iterations
    +  time while ((i < count))
    +  do
    +    eval "${command2}"
    +    let i=i+1
    +  done
    +
    +  echo
    +  sleep 1
    +done 2>&1
    +
    +
    +
    +
    Copyright (C) 2008 - 2020 GraphicsMagick Group
    +
    +

    This program is covered by multiple licenses, which are described in +Copyright.txt. You should have received a copy of Copyright.txt with this +package; otherwise see http://www.graphicsmagick.org/Copyright.html.

    +
    +
    + + diff --git a/www/benchmarks.rst b/www/benchmarks.rst index dcec20b..2e137d3 100644 --- a/www/benchmarks.rst +++ b/www/benchmarks.rst @@ -137,13 +137,3 @@ Here is the simple benchmark script:: echo sleep 1 done 2>&1 - - --------------------------------------------------------------------------- - -| Copyright (C) 2008 - 2020 GraphicsMagick Group - -This program is covered by multiple licenses, which are described in -Copyright.txt. You should have received a copy of Copyright.txt with this -package; otherwise see http://www.graphicsmagick.org/Copyright.html. - diff --git a/www/bugs.html b/www/bugs.html index 34ba0c6..d746f91 100644 --- a/www/bugs.html +++ b/www/bugs.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -58,5 +58,10 @@ not included in the build by default..
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/bugs.html.orig b/www/bugs.html.orig new file mode 100644 index 0000000..09f4a38 --- /dev/null +++ b/www/bugs.html.orig @@ -0,0 +1,62 @@ + + + + + + +GraphicsMagick Bugs + + + + + + + +
    +

    GraphicsMagick Bugs

    + + + + +

    The following bugs are known to exist in GraphicsMagick. Please report +any additional bugs to the GraphicsMagick bug tracker at SourceForge.

    +
    +
      +
    • BMP reader is not working for some obscure low-color packed files.
    • +
    • DPX reader/writer does not properly handle subformats where row +samples spill over the storage word boundary. This means that +single-channel/grayscale 10-bit DPX files will only work for widths +evenly divisible by three. (SF 1533184)
    • +
    • The PSD reader is disabled by default because it does not work well +enough and several man-years worth of dedicated volunteer time is +required to make it work properly.
    • +
    • Scitex reader is not working for some files.
    • +
    • SVG writer works only if you are particularly luckly and so it is +not included in the build by default..
    • +
    • SVG reader mishandles basic units and many other syntax elements (SF +1231547, 1298606).
    • +
    +
    +
    + + diff --git a/www/color.html b/www/color.html index 0f7bc1a..1dc074a 100644 --- a/www/color.html +++ b/www/color.html @@ -32,24 +32,24 @@ Magick++"> GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -57,7 +57,7 @@ Magick++">

    Here are some example color selections to choose from or define your own. GraphicsMagick understands color names or hex values (.e.g. -white or #ffffff). +white or #ffffff).

    diff --git a/www/compare.html b/www/compare.html index 1d0126e..717d251 100644 --- a/www/compare.html +++ b/www/compare.html @@ -122,7 +122,7 @@ To create an annotated difference image use: compare -highlight-style assign -highlight-color purple -file diff.miff original.miff compare.miff
    -

    +

    Back to Contents  

    @@ -414,6 +414,6 @@ Options, above. GraphicsMagick(1).
     
    -

    +

    Back to Contents  

    diff --git a/www/composite.html b/www/composite.html index e23ec89..d3ec1a5 100644 --- a/www/composite.html +++ b/www/composite.html @@ -147,7 +147,7 @@ try gm composite -compose CopyBlue blue.png red-green.png composite.png -

    +

    Back to Contents  

    @@ -857,6 +857,6 @@ Options, above. GraphicsMagick(1).
     
    -

    +

    Back to Contents  

    diff --git a/www/conjure.html b/www/conjure.html index 1ff6e93..83fb61e 100644 --- a/www/conjure.html +++ b/www/conjure.html @@ -119,7 +119,7 @@ invoked with All operations will closely follow the key/value pairs defined in PerlMagick, unless otherwise noted. -

    +

    Back to Contents  

    @@ -236,7 +236,7 @@ width=15>

    print GraphicsMagick version string
    -

    +

    Back to Contents  

    diff --git a/www/contribute.html b/www/contribute.html index 35610df..8191e0e 100644 --- a/www/contribute.html +++ b/www/contribute.html @@ -3,7 +3,7 @@ - +Contributing to GraphicsMagick @@ -13,23 +13,23 @@ GraphicMagick logoGraphicsMagick - - -   + + + 
    @@ -113,9 +113,12 @@ explore.
  • Complete the port of ralcgm to Windows so that it may be used as a delegate under Windows.
  • -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/contribute.html.orig b/www/contribute.html.orig new file mode 100644 index 0000000..da68ad1 --- /dev/null +++ b/www/contribute.html.orig @@ -0,0 +1,121 @@ + + + + + + +Contributing to GraphicsMagick + + + + + + + +
    +

    Contributing to GraphicsMagick

    + + + + +

    The future and success of GraphicsMagick depends on your contributions. +By contributing to GraphicsMagick you will benefit from the +features/fixes you contribute, can take pride in taking part in the +development of a quality product, and you can tell your friends that you +contribute to the GraphicsMagick project.

    +

    There are a number of ways you can contribute:

    +
      +
    • Submit bug reports to the GraphicsMagick bug tracking system at +SourceForge.
    • +
    • Submit patches to the GraphicsMagick patch submission system at +SourceForge.
    • +
    • Perform test builds on unusual systems and report the results.
    • +
    • Submit ideas and proposed designs to the graphicsmagick-core +mailing list.
    • +
    • Create a new language interface, dependent library, or application.
    • +
    • Join the GraphicsMagick Group as a full-fledged developer with CVS +commit access.
    • +
    +

    Regardless of how you choose to contribute, your contributions will be +treated with the respect and value that they deserve.

    +

    Becoming a member of the GraphicsMagick Group requires a majority vote +from existing members. Your chances of being admitted to the group are +increased significantly if you have a proven track-record of success on +other open source projects, are a recognized expert in the field, or have +already demonstrated your capabilities and commitment by contributing to +the project in other ways. Please contact Bob Friesenhahn +<bfriesen@simple.dallas.tx.us> in order to be considered for group +membership.

    +
    +

    Areas To Contribute

    +

    The following are areas where significant contributions may be made to +the GraphicsMagick project:

    +
      +
    • Support building and distributing GraphicsMagick RPMs for Linux.
    • +
    • Act as formal maintainer for the Gentoo Linux GraphicsMagick ebuild so +that it is added back to Portage. This is not difficult since the +ebuild has been actively maintained via the Gentoo bug tracking system. +At the very least, registering a vote for the Gentoo bug may be helpful. +See http://bugs.gentoo.org/show_bug.cgi?id=190372.
    • +
    • Set up an FTP mirror site for GraphicsMagick.
    • +
    • Create a language interface using SWIG <http://www.swig.org/> to +support scripting in Perl, Python, TCL/TK, Guile, MzScheme, Ruby, +Java, PHP, and CHICKEN, based on a common implementation.
    • +
    • Create a new utility command parser based on a separate LALR or +XML-based syntax definition, and using an approach suitable to +replace the existing error-prone command parsers in magick/command.c
    • +
    • Create a vector encoder for EPS, Postscript, PDF, SVG +<http://www.w3.org/Graphics/SVG/>, Macromedia Flash +(SWF), WebCGM <http://www.w3.org/Graphics/WebCGM/>, or WMF.
    • +
    • Create an OpenEXR coder based on the OpenEXR +<http://www.openexr.com/> library from Industrial Light & Magic.
    • +
    • Create a pstoedit module to import Postscript, EPS, and PDF +files as vector data using pstoedit <http://www.pstoedit.net/> which +already includes a high-quality driver to render Postscript vectors via +GraphicsMagick. This module could also export vector data in many +formats using pstoedit's output drivers.
    • +
    • Work on adding EXIF profile writing support which works for JPEG and +TIFF formats.
    • +
    • Add integrated Adobe XMP +<http://www.adobe.com/products/xmp/index.html> profile support for +TIFF, JPEG, PNG, PDF, EPS, and Postscript.
    • +
    • Port Erik Reinhard's super-cool Parameter Estimation For +Photographic Tone Reproduction +<http://www.cs.ucf.edu/~reinhard/Reinhard02/> algorithm to +GraphicsMagick.
    • +
    • Create a replacement (using a portable Widget set such as FLTK) for the +IMDisplay Windows GUI program and possibly the X11 'display' program.
    • +
    • Create an interface between GraphicsMagick and OpenOffice.org. +<http://www.openoffice.org/> so that OpenOffice may load and save +any format supported by GraphicsMagick. OpenOffice.org offers a +separate SDK so there may be a number of other opportunities to +explore.
    • +
    • Complete the port of ralcgm to Windows so that it may be used as a +delegate under Windows.
    • +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    + + diff --git a/www/contribute.rst b/www/contribute.rst index 37c49f9..36b750a 100644 --- a/www/contribute.rst +++ b/www/contribute.rst @@ -102,9 +102,3 @@ the GraphicsMagick project: * Complete the port of ralcgm to Windows so that it may be used as a delegate under Windows. - --------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/convert.html b/www/convert.html index 2870a15..8940d7b 100644 --- a/www/convert.html +++ b/www/convert.html @@ -101,7 +101,7 @@ process. Convert recognizes the image formats listed in GraphicsMagick(1).
     
    -

    +

    Back to Contents  

    @@ -191,7 +191,7 @@ To create a MNG animation from a DNA molecule sequence, use: gm convert -delay 20 dna.* dna.mng
    -

    +

    Back to Contents  

    @@ -1904,6 +1904,6 @@ Options, above. GraphicsMagick(1).
     
    -

    +

    Back to Contents  

    diff --git a/www/display.html b/www/display.html index 89b5ec9..5b52707 100644 --- a/www/display.html +++ b/www/display.html @@ -208,7 +208,7 @@ With display, you can perform these functions on an image:
    *display images specified by a World Wide Web (WWW) uniform resource locator (URL) -

    +

    Back to Contents  

    @@ -261,7 +261,7 @@ To display histogram of an image, use: gm gm convert file.jpg HISTOGRAM:- | gm display -
    -

    +

    Back to Contents  

    @@ -1179,7 +1179,7 @@ Options, above. GraphicsMagick(1).
     
    -

    +

    Back to Contents  

    @@ -1257,7 +1257,7 @@ all the image tiles with their respective images. See and miff for more details.
    -

    +

    Back to Contents  

    @@ -1412,7 +1412,7 @@ desired sub-menu item, release the button and the command is executed. Move the pointer away from the sub-menu if you decide not to execute a particular command.
    -

    +

    Back to Contents  

    @@ -1557,7 +1557,7 @@ button 2. Press ALT and one of the arrow keys to trim off one pixel from any side of the image.
    -

    +

    Back to Contents  

    @@ -1931,7 +1931,7 @@ For example, to set the Pan window geometry to 256x256, use: gm display.pan.geometry: 256x256
    -

    +

    Back to Contents  

    @@ -1963,7 +1963,7 @@ with .jpg. To select your image from the X server screen instead of from a file, Choose Grab of the Open widget.
    -

    +

    Back to Contents  

    @@ -1995,7 +1995,7 @@ by the thumbnail is displayed at its full size. Choose Next fro the File sub-menu of the Command widget to return to the Visual Image Directory.
    -

    +

    Back to Contents  

    @@ -2044,7 +2044,7 @@ You can make adjustments by moving the pointer to one of the cut rectangle corners, pressing a button, and dragging. Finally, press Cut to commit your copy region. To exit without cutting the image, press Dismiss.
    -

    +

    Back to Contents  

    @@ -2086,7 +2086,7 @@ You can make adjustments by moving the pointer to one of the copy rectangle corners, pressing a button, and dragging. Finally, press Copy to commit your copy region. To exit without copying the image, press Dismiss.
    -

    +

    Back to Contents  

    @@ -2343,7 +2343,7 @@ To force a PseudoClass image to remain PseudoClass, use -colors.
    -

    +

    Back to Contents  

    @@ -2384,7 +2384,7 @@ You can make adjustments by moving the pointer to one of the cropping rectangle corners, pressing a button, and dragging. Finally, press Crop to commit your cropping region. To exit without cropping the image, press Dismiss.
    -

    +

    Back to Contents  

    @@ -2430,7 +2430,7 @@ by which direction you choose from the Command widget. To cancel the image chopping, move the pointer back to the starting point of the line and release the button.
    -

    +

    Back to Contents  

    @@ -2494,7 +2494,7 @@ sub-menu of the Command widget. To cancel the image rotation, move the pointer back to the starting point of the line and release the button.
    -

    +

    Back to Contents  

    @@ -2547,7 +2547,7 @@ Algorithm Based on the Thresholding and the Fuzzy c-Means Techniques", Pattern Recognition, Volume 23, Number 9, pages 935-952, 1990.
     
    -

    +

    Back to Contents  

    @@ -2716,7 +2716,7 @@ to DirectClass (see miff(5)). To force a PseudoClass image to remain PseudoClass, use -colors.
    -

    +

    Back to Contents  

    @@ -3004,7 +3004,7 @@ final image, any PseudoClass image is promoted to DirectClass (see To force a PseudoClass image to remain PseudoClass, use -colors.
    -

    +

    Back to Contents  

    @@ -3148,7 +3148,7 @@ to DirectClass To force a PseudoClass image to remain PseudoClass, use -colors.
    -

    +

    Back to Contents  

    @@ -3272,7 +3272,7 @@ unless you immediately save your image to a file (refer to Write). Correct matte editing behavior may require a TrueColor or DirectColor visual or a Standard Colormap.
    -

    +

    Back to Contents  

    @@ -3415,7 +3415,7 @@ is updated when you press and release the button without moving the pointer. To cancel image drawing, move the pointer back to the starting point of the line and release the button.
    -

    +

    Back to Contents  

    @@ -3578,7 +3578,7 @@ more than one image processing technique to apply to an area. Alternatively, you can move the region of interest before applying another image processing technique. To exit, press Dismiss.
    -

    +

    Back to Contents  

    @@ -3606,7 +3606,7 @@ within the image window. The panning icon is withdrawn if the image becomes smaller than the dimensions of the X server screen.
    -

    +

    Back to Contents  

    @@ -3672,6 +3672,6 @@ image. Panning is much faster with Pixmaps than with a XImage. Pixmaps are considered a precious resource, use them with discretion.
    -

    +

    Back to Contents  

    diff --git a/www/download.html b/www/download.html index c81cf53..a9f744b 100644 --- a/www/download.html +++ b/www/download.html @@ -3,7 +3,7 @@ - + GraphicsMagick Download @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -50,7 +50,7 @@ noted). At the moment, the fastest way to obtain formal releases is from the SourceForge Download page since SourceForge has lots of bandwidth, and many mirror sites. Snapshot packages should usually be retrieved from the GraphicsMagick FTP site or one of its mirrors. -There are mirrors of the ftp site in Czechoslovakia and Poland.

    +There are mirrors of the ftp site in the Czech Republic and Poland.

    Ftp Site Organization

    The organization of the GraphicsMagick directory on ftp sites is as @@ -95,9 +95,12 @@ Visual C++ workspace) may be found here.

    Polish ftp mirror via ftp (ftp protocol)

    Polish ftp mirror via http (http protocol)

    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/download.html.orig b/www/download.html.orig new file mode 100644 index 0000000..73cd17d --- /dev/null +++ b/www/download.html.orig @@ -0,0 +1,103 @@ + + + + + + +GraphicsMagick Download + + + + + + + +
    +

    GraphicsMagick Download

    + + + + + +

    The source distribution of GraphicsMagick as well as pre-compiled +binaries are available at the sites listed here (unless otherwise +noted). At the moment, the fastest way to obtain formal releases is +from the SourceForge Download page since SourceForge has lots of +bandwidth, and many mirror sites. Snapshot packages should usually be +retrieved from the GraphicsMagick FTP site or one of its mirrors. +There are mirrors of the ftp site in Czechoslovakia and Poland.

    +
    +

    Ftp Site Organization

    +

    The organization of the GraphicsMagick directory on ftp sites is as +follows:

    +

    GraphicsMagick FTP

    +
    +Contains the core GraphicsMagick sources in a file named similar to +GraphicsMagick-1.3.tar.bz2, GraphicsMagick-1.3.tar.gz, or +GraphicsMagick-1.3.tar.xz. These core sources are sufficient to +compile a minimal GraphicsMagick on a Unix system (including +MacOS-X), or under the Cygwin and MinGW environments for Windows. +Additional development packages need to be installed in advance to +support formats like JPEG and PNG.
    +

    delegates

    +
    +Add on third-party libraries and applications which extend the +formats supported by GraphicsMagick may be obtained from this +directory. Windows users can usually ignore the contents of this +directory since all common delegates are included in the Windows +source and binaries packages.
    +

    linux

    +
    +Linux source RPM (SRPM) packages for Red Hat Linux, other Linux +systems, or any system with RPM installed, may be found here.
    +

    snapshots

    +
    +Snapshots (between releases) copies of GraphicsMagick may be found +here. New snapshots may be cut every few days as time +permits. Quality may vary (but is usually excellent).
    +

    windows

    +
    +Installable binary packages and the extended source code package for +use with Microsoft Visual C++ (including configured delegates and a +Visual C++ workspace) may be found here.
    +
    +
    +

    Download Sites

    +

    Here are some known download sites for GraphicsMagick:

    +
    +

    SourceForge file download (http protocol)

    +

    Czech ftp mirror (http protocol)

    +

    Polish ftp mirror via ftp (ftp protocol)

    +

    Polish ftp mirror via http (http protocol)

    +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    + + diff --git a/www/download.rst b/www/download.rst index 8217d20..227c037 100644 --- a/www/download.rst +++ b/www/download.rst @@ -26,7 +26,7 @@ noted). At the moment, the fastest way to obtain formal releases is from the `SourceForge Download`_ page since SourceForge has lots of bandwidth, and many mirror sites. Snapshot packages should usually be retrieved from the `GraphicsMagick FTP`_ site or one of its mirrors. -There are mirrors of the ftp site in Czechoslovakia and Poland. +There are mirrors of the ftp site in the Czech Republic and Poland. Ftp Site Organization --------------------- @@ -81,9 +81,3 @@ Here are some known download sites for GraphicsMagick: `Polish ftp mirror via ftp `_ (ftp protocol) `Polish ftp mirror via http `_ (http protocol) - --------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/formats.html b/www/formats.html index fb95da7..a2c8242 100644 --- a/www/formats.html +++ b/www/formats.html @@ -3,7 +3,7 @@ - + GraphicsMagick Supported Formats @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -1285,8 +1285,11 @@ gm convert -list format extensions: .gz for Zip compression, .Z for Unix compression, and .bz2 for block compression. For example, a PNM image called image.pnm.gz is automatically uncompressed while the image is read.

    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/formats.html.orig b/www/formats.html.orig new file mode 100644 index 0000000..cadcb46 --- /dev/null +++ b/www/formats.html.orig @@ -0,0 +1,1292 @@ + + + + + + +GraphicsMagick Supported Formats + + + + + + + +
    +

    GraphicsMagick Supported Formats

    + + + + +

    GraphicsMagick uses an ASCII string known as "magick" (e.g. "GIF") to +identify file formats, algorithms acting as formats, built-in images, and +embedded profile types. After a file has been read or "pinged", the +associated magick string is stored in the "magick" member of the Image +structure, and is reported in the default output of 'gm identify'.

    +

    GraphicsMagick supports reading over 88 major file formats (not including +sub-formats). The following table provides a summary of the supported +image formats.

    + + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Supported Image Formats
    FormatModeDescriptionNotes
    ARTRWPFS: 1st PublisherFormat originally used on the Macintosh +(MacPaint?) and later used for PFS: 1st +Publisher clip art.
    AVSRWAVS X image 
    BMPRWMicrosoft Windows bitmap 
    CALSRContinuous Acquisition +and Life-cycle Support +Type 1 imageSpecified in MIL-R-28002 and MIL-PRF-28002. +Standard blueprint archive format as used by the +US military to replace microfiche.
    CINRKodak CineonKodak Cineon Log format (4.5 draft). +Precursor to SMPTE DPX
    CGMRComputer Graphics +MetafileRequires ralcgm to render CGM files.
    CMYKRWRaw cyan, magenta, +yellow, and black samplesUse -size, -depth, -endian, and -interlace to +specify the image width, height, depth, byte +order, and interlace.
    CURRMicrosoft Cursor Icon 
    CUTRDR Halo 
    DCMRDigital Imaging and +Communications in +Medicine (DICOM) imageUsed by the medical community for images like +X-rays. See the NEMA DICOM web site for more +information. DICOM is the basis for the +DICONDE format.
    DCXRWZSoft IBM PC multi-page +Paintbrush image 
    DIBRWMicrosoft Windows Device +Independent BitmapDIB is a BMP file without the BMP header. Used +to support embedded images in compound formats +like WMF.
    DPXRWDigital Moving Picture +ExchangeRGB and grayscale are fully supported at 1, 8, +10, 12, and 16 bits as per the SMPTE 268M-2003 +(V2.0) specification. This includes support for +images stored in a planar (multi-element) +configuration and Cineon Log RGB. Rec. 601 and +709 YCbCr are fully supported with 4:4:4 and +4:2:2 subsampling. DPX is commonly used to +store image frames in film and HDTV production.
    EMFRMicrosoft Enhanced +Metafile (32-bit)Only available under Microsoft Windows.
    EPDFRWEncapsulated Portable +Document Format 
    EPIRWAdobe Encapsulated +PostScript Interchange +formatRequires Ghostscript to read.
    EPSRWAdobe Encapsulated +PostScriptRequires Ghostscript to read.
    EPS2WAdobe Level II +Encapsulated PostScriptRequires Ghostscript to read.
    EPS3WAdobe Level III +Encapsulated PostScriptRequires Ghostscript to read.
    EPSFRWAdobe Encapsulated +PostScriptRequires Ghostscript to read.
    EPSIRWAdobe Encapsulated +PostScript Interchange +formatRequires Ghostscript to read.
    EPTRWAdobe Encapsulated +PostScript Interchange +format with TIFF previewRequires Ghostscript to read.
    FAXRWGroup 3 FAXNote that FAX machines use non-square pixels +which are 1.5 times wider than they are tall but +computer displays use square pixels, so FAX +images may appear to be narrow unless they are +explicitly resized using a resize specification +of "150x100%". Please note that this is not a +TIFF format.
    FIGRFIG graphics formatRequires TransFig.
    FITSRWFlexible Image Transport +System 
    FPXRWFlashPix FormatRequires FlashPix SDK.
    GIFRWCompuServe Graphics +Interchange Format

    8-bit RGB PseudoColor with up to 256 palette +entires. Specify the format "GIF87" to write the +older version 87a of the format.

    +

    The PNG format provides a superior set of +features to GIF. Consider using PNG format +rather than GIF if clients are able to read PNG.

    +
    GRAYRWRaw gray samplesUse -size, -depth, and -endian to specify the +image width, height, depth, and byte order.
    GRAYARWRaw gray samples + alphaUse -size, -depth, and -endian to specify the +image width, height, depth, and byte order.
    HPGLRHP-GL plotter languageRequires hp2xx 3.2.0 or later
    HTMLRWHypertext Markup Language +with a client-side image +mapAlso known as "HTM". Requires html2ps to read.
    ICORMicrosoft iconAlso known as "ICON".
    JBIGRWJoint Bi-level Image +experts Group file +interchange formatAlso known as "BIE" and "JBG". Requires +jbigkit 1.0 or later
    JNGRWJPEG Network GraphicsJPEG in a PNG-style wrapper with transparency. +Requires libjpeg and libpng-1.0.2 or later, +libpng-1.2.5 or later recommended.
    JP2RWJPEG-2000 JP2 File Format +SyntaxRequires jasper 1.600.0 or later
    JPCRWJPEG-2000 Code Stream +SyntaxRequires jasper 1.600.0 or later
    JPEGRWJoint Photographic +Experts Group JFIF formatRequires jpegsrc.v6b.tar.gz
    MANRUnix reference manual +pagesRequires that GNU groff and Ghostcript are +installed.
    MATRWMATLAB image formatComing from MathWorks for storing matrices. +Currently supported types are 2D matrices: byte, +word, double, complex and 3D matrices containing +RGB [x*y*3] byte, word.
    MIFFRWMagick image file formatImageMagick's lossless image format (with +ASCII header) which ensures that no image +attributes understood by ImageMagick or +GraphicsMagick are lost.
    MONORWBi-level bitmap in +least-significant-byte +first order 
    MNGRWMultiple-image Network +GraphicsRequires libpng-1.0.2 or later, libpng-1.2.5 or +later recommended.
    MPEGRWMotion Picture Experts +Group file interchange +format (version 1)Requires mpeg2vidcodec_v12.tar.gz.
    M2VRWMotion Picture Experts +Group file interchange +format (version 2)Requires mpeg2vidcodec_v12.tar.gz.
    MPCRWMagick Persistent Cache +image file format

    The native "in-memory" GraphicsMagick +uncompressed file format. This file format is +identical to that used by Open ImageMagick to +represent images in memory and is read in "zero +time" via memory mapping. The MPC format is not +portable and is not suitable as an archive +format. It is suitable as an intermediate format +for high-performance image processing.

    +

    The MPC format requires two files to support one +image. When writing the MPC format, a file with +extension ".mpc" is used to store information +about the image, while a file with extension +.cache stores the image pixels. The storage +space required by a MPC image (or an image in +memory) may be calculated by the equation +(QuantumDepth*Rows*Columns*5)/8.

    +
    MSLRWMagick Scripting LanguageMSL is the XML-based scripting language +supported by the conjure utility.
    MTVRWMTV Raytracing image +format 
    MVGRWMagick Vector Graphics.The native GraphicsMagick vector metafile +format. A text file containing vector drawing +commands accepted by convert's -draw option.
    OTBRWOn-the-air Bitmap 
    P7RWXv's Visual Schnauzer +thumbnail format 
    PALMRWPalm pixmap 
    PAMRWPortable Arbitrary Map +formatSuperset of PNM (PPM, PGM, PPM) raw type formats. +Supports bilevel, gray, RGB, CMYK, alpha channel.
    PBMRWPortable bitmap format +(black and white) 
    PCDRWPhoto CDThe maximum resolution written is 768x512 pixels +since larger images require huffman compression +(which is not supported).
    PCDSRWPhoto CDDecode with the sRGB color tables.
    PCLWHP Page Control LanguageFor output to HP laser printers.
    PCXRWZSoft IBM PC Paintbrush +file 
    PDBRWPalm Database ImageViewer +Format 
    PDFRWPortable Document FormatRequires Ghostscript to read.
    PFARPostscript Type 1 font +(ASCII)Opening as file returns a preview image.
    PFBRPostscript Type 1 font +(binary)Opening as file returns a preview image.
    PGMRWPortable graymap format +(gray scale) 
    PICONRWPersonal Icon 
    PICTRWApple Macintosh QuickDraw +/PICT file 
    PIXRAlias/Wavefront RLE image +format 
    PNGRWPortable Network GraphicsRequires libpng-1.0.2 or later, libpng-1.2.5 or +later recommended.
    PNMRWPortable anymap

    PNM is a family of formats supporting portable +bitmaps (PBM) , graymaps (PGM), and pixmaps +(PPM). There is no file format associated with +pnm itself. If PNM is used as the output format +specifier, then GraphicsMagick automatically +selects the most appropriate format to represent +the image.

    +

    The default is to write the binary version of +the formats. Use '-quality 0' to write the +ASCII version of the formats.

    +
    PPMRWPortable pixmap format +(color) 
    PSRWAdobe PostScript fileRequires Ghostscript to read.
    PS2RWAdobe Level II PostScript +fileRequires Ghostscript to read.
    PS3RWAdobe Level III +PostScript fileRequires Ghostscript to read.
    PSDRWAdobe Photoshop bitmap +filePSD format is no longer supported since the +1.3.24 release.
    PTIFRWPyramid encoded TIFFMulti-resolution TIFF containing successively +smaller versions of the image down to the size +of an icon. The desired sub-image size may be +specified when reading via the -size option.
    PWPRSeattle File Works +multi-image file 
    RASRTopoL (GIS) 
    RADRRadiance image fileRequires that ra_ppm from the Radiance software +package be installed.
    RGBRWRaw red, green, and blue +samplesUse -size, -depth, -endian, and -interlace to +specify the image width, height, depth, byte +order, and interlace.
    RGBARWRaw red, green, and blue +and matte samplesUse -size, -depth, -endian, and -interlace to +specify the image width, height, depth, byte +order, and interlace.
    RLARAlias/Wavefront image +file 
    RLERUtah Run length encoded +image file 
    SCTRScitex Continuous Tone +Picture 
    SFWRSeattle File Works image 
    SGIRWIrix RGB image 
    SHTMLWHypertext Markup Language +client-side image mapUsed to write HTML clickable image maps based on +a the output of montage or a format which +supports tiled images such as MIFF.
    SUNRWSUN Rasterfile 
    SVGRWScalable Vector GraphicsRequires libxml2 and freetype2. Note that SVG +is a very complex specification so support is +still not complete.
    TGARWTruevision Targa imageAlso known as formats "ICB", "VDA", and "VST".
    TIFFRWTagged Image File FormatAlso known as "TIF". Requires tiff-v3.5.4.tar.gz +or later. Note that since the Unisys LZW patent +recently expired, libtiff may still require a +separate LZW patch in order to support LZW. LZW +is included in libtiff by default since v3.7.0.
    TIMRPSX TIM file 
    TTFRTrueType font fileRequires freetype2. Opening as file returns a +preview image.
    TXTRWRaw text file 
    UILWX-Motif UIL table 
    UYVYRWInterleaved YUV raw imageUse -size command line option to specify width +and height.
    VICARRWVICAR rasterfile format 
    VIFFRWKhoros Visualization +Image File Format 
    WBMPRWWireless bitmapSupport for uncompressed monochrome only.
    WMF Windows MetafileRequires libwmf. By default, renders WMF files +using the dimensions specified by the metafile +header. Use the -density option to adjust the +output resolution, and thereby adjust the ouput +size. The default output resolution is 72DPI so +"-density 144" results in an image twice as +large as the default. Use -background color to +specify the WMF background color (default white) +or -texture filename to specify a background +texture image.
    WPGRWord Perfect Graphics +File 
    XBMRWX Windows system bitmap, +black and white onlyUsed by the X Windows System to store monochrome +icons.
    XCFRGIMP image 
    XPMRWX Windows system pixmapAlso known as "PM". Used by the X Windows System +to store color icons.
    XWDRWX Windows system window +dumpUsed by the X Windows System to save/display +screen dumps.
    YUVRWCCIR 601 4:1:1Use -size command line option to specify width +and height.
    +

    GraphicsMagick supports a number of image format specifications which +refer to images prepared via an algorithm, or input/output targets. The +following table lists these pseudo image formats:

    + + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Pseudo Image Formats
    TagModeDescriptionNotes
    CAPTIONRImage captionDraws text on a canvas image with size specified by -size +canvas color as specified by -background' (default white), +and text stroke and fill colors as specified by `-stroke +and -fill. Capable of supporting multi-line text.
    CLIPBOARDRWWindows ClipboardOnly available under Microsoft Windows.
    FRACTALRPlasma fractal image 
    GRADIENTRGradual passing from +one shade to another

    Returns a rendered gradient image using the +specified image size. Specify the desired +shading as part of the filename. For example:

    +
    +gradient:red-blue or gradient:#F00-#00F
    +
    HISTOGRAMWHistogram of the image

    Generate an RGB histogram of the input image. +The output format is always ImageMagick MIFF +(regardless of file extension). For example:

    +
    +gm convert file.tiff histogram:file.miff
    +
    IDENTITYRHald CLUT identity +imageGenerate a Hald CLUT identity image of a specified order. +The order is specified as an argument like "IDENTITY:8". +The default order is eight, producing a 512x512 image.
    INFOWImage descriptive +information and +statisticsWrites descriptive information similar to 'identify'
    LABELRText image formatSpecify the desired text as the filename (e.g. +"label:This is a label").
    MAPRWColormap intensities +and indicesSet -depth to set the sample size of the +intensities; indices are 16-bit if colors > +256.
    MATTEWMATTE formatWrite only.
    NULLRWNULL imageUseful for creating blank tiles with montage +(use "NULL:"). Also useful as an output format +when evaluating image read performance.
    PLASMARPlasma fractal image

    Creates an image using the plasma fractal. For +example:

    +
    +gm convert -size 640x480 plasma: file.miff
    +
    PREVIEWWShow a preview an image +enhancement, effect, or +f/x

    Creates a preview montage of images prepared +over a parameteric range in order to assist +with parameter selection. Specify the desired +preview type via the -preview option). The +output file is always written in the +ImageMagick MIFF format.

    +

    For example:

    +
    +gm convert file.tiff -preview gamma preview:file.miff
    +
    PRINTWSend image to your +computer printerUnix users may set the PRINTER (for 'lp') or +LPDEST (for 'lpr') environment variables to +select the desired printer.
    SCANRImport image from a +scanner deviceRequires SANE Specify the device name and path +as the filename (e.g. "scan:mustek:/dev/scanner").
    STEGANORSteganographic imageUse -size command line option to specify width, +height, and offset of the steganographic image
    TILERTiled image

    Create a tiled version of an image at by tiling +a image. Use -size to specify the tiled image +size. The image is specified similar to +"TILE:image.miff". +For example:

    +
    +gm convert -size 800x600 tile:image.jpg out.jpg
    +
    VIDRWVisual Image Directory

    Used to create a thumbnailed directory (tiled +thumbnails) of a set of images which may be +used to select images to view via the display +program, or saved to a MIFF or SHTML file. +For example:

    +
    +gm convert vid:"*.jpg" index.miff
    +
    WINRWSelect image from or +display image to your +computer screen

    Only supported under Microsoft Windows. For example:

    +
    +gm convert file.jpg -rotate 90 win:
    +
    XRWSelect image from or +display image to your X +server screen

    Also see the import and display programs. For example:

    +
    +gm convert file.jpg -rotate 90 x:
    +
    XCRCanvas image of +specified color

    Useful to create solid color "canvas" images. +Use -size and -depth to specify the image +width, height, and depth. Example XC color +specifications include "XC:red" and "XC:# +FF0000". See the color reference for the +numeric values used for named colors. For example:

    +
    +gm convert -size 640x480 xc:red red.jpg
    +
    +

    GraphicsMagick includes a number of built-in (embedded) images which may +be referenced as if they were an image file. The IMAGE: format tag may +be used via the syntax "IMAGE:name" to request an embedded image (e.g. +IMAGE:LOGO). For backwards compatibility, the image specifications +GRANITE:, LOGO:, NETSCAPE:, and ROSE: may also be used to request +images with those names.

    +

    A new canvas image of a specified size may be created using one of these pattern +images using a command similar to:

    +
    +gm convert -size 640x480 PATTERN:BRICKS bricks.miff
    +
    +

    The TILE: virtual image type may also be used similar to:

    +
    +gm convert -size 640x480 TILE:IMAGE:BRICKS bricks.miff
    +
    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Built-In Images And Patterns
    NameDescriptionNotes/Sample
    BRICKS16x16 brick patternbricks
    CHECKERBOARD30x30 checkerboard patterncheckerboard
    CIRCLES16x16 circles patterncircles
    CROSSHATCH8x4 crosshatch patterncrosshatch
    CROSSHATCH308x4 crosshatch pattern with lines +at 30 degrees.crosshatch30
    CROSSHATCH458x4 crosshatch pattern with lines +at 45 degrees.crosshatch45
    FISHSCALES16x8 fish scales patternfishscales
    GRANITE128x128 granite texture patterngranite
    GRAY032x32 0% intensity graygray0
    GRAY532x32 5% intensity graygray5
    GRAY1032x32 10% intensity graygray10
    GRAY1532x32 15% intensity graygray15
    GRAY2032x32 20% intensity graygray20
    GRAY2532x32 25% intensity graygray25
    GRAY3032x32 30% intensity graygray30
    GRAY3532x32 35% intensity graygray35
    GRAY4032x32 40% intensity graygray40
    GRAY4532x32 45% intensity graygray45
    GRAY5032x32 50% intensity graygray50
    GRAY5532x32 55% intensity graygray55
    GRAY6032x32 60% intensity graygray60
    GRAY6532x32 65% intensity graygray65
    GRAY7032x32 70% intensity graygray70
    GRAY7532x32 75% intensity graygray75
    GRAY8032x32 80% intensity graygray80
    GRAY8532x32 85% intensity graygray85
    GRAY9032x32 90% intensity graygray90
    GRAY9532x32 95% intensity graygray95
    GRAY10032x32 100% intensity graygray100
    HEXAGONS30x18 hexagon patternhexagons
    HORIZONTAL8x4 horizontal line patternhorizontal
    HORIZONTALSAW16x8 horizontal saw-tooth patternhorizontalsaw
    HS_BDIAGONAL8x8 backward diagonal line pattern +(45 degrees slope)hs_bdiagonal
    HS_CROSS8x8 cross line patternhs_cross
    HS_DIAGCROSS8x8 diagonal line cross pattern +(45 degrees slope)hs_diagcross
    HS_FDIAGONAL8x8 forward diagonal line pattern +(45 degrees slope)hs_fdiagonal
    HS_HORIZONTAL8x8 horizontal line patternhs_horizontal
    HS_VERTICAL8x8 vertical line patternhs_vertical
    LEFT308x4 forward diagonal pattern (30 +degrees slope)left30
    LEFT458x8 forward diagonal line pattern +(45 degrees slope)left45
    LEFTSHINGLE24x24 left shingle patternleftshingle
    LOGO640x480, GraphicsMagick Logologo
    NETSCAPE216x144 image using colors in +Netscape 216 (6x6x6 ) color cube.Most commonly used with the +convert/mogrify -map option to +create web safe images.
    OCTAGONS16x16 octagons patternoctagons
    RIGHT308x4 backward diagonal line pattern +(30 degrees)right30
    RIGHT458x8 backward diagonal line pattern +(30 degrees)right45
    RIGHTSHINGLE24x24 right shingle patternrightshingle
    ROSE70x46, Picture of a rose.rose
    SMALLFISHSCALES8x8 small fish scales patternsmallfishscales
    VERTICAL8x8 vertical line patternvertical
    VERTICALBRICKS16x16 vertical brick patternverticalbricks
    VERTICALLEFTSHINGLE24x24 vertical left shingle +patternverticalleftshingle
    VERTICALRIGHTSHINGLE24x24 vertical right shingle +patternverticalrightshingle
    VERTICALSAW8x16 vertical saw-tooth patternverticalsaw
    +

    GraphicsMagick provides a number of format identifiers which are used +to add, remove, and save embedded profiles for images which can +support embedded profiles. Image types which may contain embedded +profiles are TIFF, JPEG, PDF, and PNG.

    + + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Supported Embedded Profile Formats
    FormatModeDescriptionNotes
    8BIMRWPhotoshop resource format +(binary) 
    8BIMTEXTRWPhotoshop resource format +(ASCII)An ASCII representation of the 8BIM format.
    APP1RWRaw application +information 
    APP1JPEGRWRaw JPEG binary dataProfile in JPEG wrapper.
    ICCRWInternational Color +Consortium color profileAlso known as "ICM". To read, use -profile with +convert.
    IPTCRWIPTC Newsphoto (binary)To read, use -profile with convert
    IPTCTEXTRWIPTC Newsphoto (ASCII)An ASCII representation of the IPTC format.
    +

    Support for some of the formats are delegated to libraries or external +programs. The README describes where to find these distributions and +any special configuration options required.

    +

    To get a complete listing of the image formats which are supported on +your system, type

    +
    +gm convert -list format
    +
    +

    On some platforms, GraphicsMagick automatically processes these +extensions: .gz for Zip compression, .Z for Unix compression, and .bz2 +for block compression. For example, a PNM image called image.pnm.gz is +automatically uncompressed while the image is read.

    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    + + diff --git a/www/formats.rst b/www/formats.rst index 66ed7cf..6529253 100644 --- a/www/formats.rst +++ b/www/formats.rst @@ -807,9 +807,3 @@ On some platforms, GraphicsMagick automatically processes these extensions: .gz for Zip compression, .Z for Unix compression, and .bz2 for block compression. For example, a PNM image called image.pnm.gz is automatically uncompressed while the image is read. - ------------------------------------------------------------------------------------------------------------------------ - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/gm.html b/www/gm.html index 939709c..4b263e1 100644 --- a/www/gm.html +++ b/www/gm.html @@ -394,7 +394,7 @@ can tell if gm was compiled in 16-bit mode by typing "gm version" without any options, and looking for "Q:16" in the first line of output. -

    +

    Back to Contents  

    @@ -473,7 +473,7 @@ prepend an at sign @ to a filename to read a list of image filenames from that file. This is convenient in the event you have too many image filenames to fit on the command line.
    -

    +

    Back to Contents  

    @@ -1494,12 +1494,17 @@ reading or writing the DPX files. Sometimes this is useful if the file is use different endianness.
    dpx:swap-samples={true|false}
    +
    dpx:swap-samples-read={true|false}
    +
    dpx:swap-samples-write={true|false}
    GraphicsMagick strives to adhere to the DPX standard but certain -aspects of the standard can be quite confusing. As a result, some 10-bit -DPX files have Red and Blue interchanged, or Cb and Cr interchanged due -to an different interpretation of the standard, or getting the wires -crossed. The swap-samples option may be supplied when reading or writing -in order to read or write using the necessary sample order. +aspects of the standard can be quite confusing. As a result, some +10-bit DPX files have Red and Blue interchanged, or Cb and Cr +interchanged due to an different interpretation of the standard, or +getting the wires crossed. The swap-samples option may be supplied +when reading or writing in order to read or write using the necessary +sample order. Use swap-samples-read when swapping should only occur +in the reader, or swap-samples-write when swapping should only occur +in the writer.
    gradient:direction={South|North|West|East|NorthWest|NorthEast|SouthWest|SouthEast}
    By default, the gradient coder produces a gradient from top to @@ -3512,8 +3517,15 @@ width=15>

    If the image does not have a matte channel, create an opaque one.

    -Use +matte to ignore the matte channel and to avoid writing a +Use +matte to ignore the matte channel (treats it as opaque) and to avoid writing a matte channel in the output file.
    +

    +For the compare command, -matte will add an opaque matte +channel to images if they do not already have a matte channel, and +matte will be enabled for both images. Likewise, if +matte is +used, the matte channel is disabled for both images. This makes it +easier to compare images regardless of if they already have a matte +channel.
    @@ -3875,7 +3887,7 @@ result is a gray image.


    Select an operator from Add, And, Assign, Depth, Divide, Gamma, Negate, LShift, Log, Max, Min, Multiply, -Or, Pow RShift, Subtract, +Or, Pow, RShift, Subtract, Threshold, Threshold-White, Threshold-White-Negate, Threshold-Black, Threshold-Black-Negate, Xor, Noise-Gaussian, @@ -5880,7 +5892,7 @@ See "X Resources", below, for details.
    -

    +

    Back to Contents  

    @@ -6269,7 +6281,7 @@ use to the number of processor cores available while others default to just one thread. See the OpenMP specification for other standard adjustments and your compiler's manual for vendor-specific settings.
    -

    +

    Back to Contents  

    @@ -6381,7 +6393,7 @@ width=15>
    -

    +

    Back to Contents  


     
    @@ -6420,7 +6432,7 @@ You can define a Standard Colormap with xstdcmap. See xstdcmap( for details. This method is recommended for colormapped X server because it eliminates the need to compute a global colormap. -

    +

    Back to Contents  

    @@ -6453,7 +6465,7 @@ use: gm animate +borderwidth -backdrop cockatoo.*
    -

    +

    Back to Contents  

    @@ -7056,7 +7068,7 @@ format is MIFF (refer to miff(5) and the is specified in the image. Otherwise the images will display in the order they appear on the command line.
    -

    +

    Back to Contents  

    @@ -7073,7 +7085,7 @@ color="#00B04F"> Press any button to map or unmap the Command widget. See the next section for more information about the Command widget.
    -

    +

    Back to Contents  

    @@ -7119,7 +7131,7 @@ desired sub-menu item, release the button and the command is executed. Move the pointer away from the sub-menu if you decide not to execute a particular command.
    -

    +

    Back to Contents  

    @@ -7154,7 +7166,7 @@ and the total number of unique colors in the image.
    Press to discard all images and exit program.
    -

    +

    Back to Contents  

    @@ -7241,7 +7253,7 @@ information is sometimes used by a window manager to provide some sort of header identifying the window. The default is the image file name.
    -

    +

    Back to Contents  


     
    @@ -7311,7 +7323,7 @@ as the script to execute: gm batch -echo on -feedback on script.txt -

    +

    Back to Contents  

    @@ -7537,7 +7549,7 @@ worry about thermal management. The powertop utility available under Linux and Solaris provides a way to observe CPU core clock rates while a benchmark is running.
    -

    +

    Back to Contents  

    @@ -7667,7 +7679,7 @@ To create an annotated difference image use: -file diff.miff original.miff compare.miff
    -

    +

    Back to Contents  

    @@ -8027,7 +8039,7 @@ try gm composite.png
    -

    +

    Back to Contents  

    @@ -8774,7 +8786,7 @@ invoked with All operations will closely follow the key/value pairs defined in PerlMagick, unless otherwise noted.
    -

    +

    Back to Contents  

    @@ -8890,7 +8902,7 @@ width=15>

    print GraphicsMagick version string
    -

    +

    Back to Contents  

    @@ -9141,7 +9153,7 @@ process. Convert recognizes the image formats listed in GraphicsMagick(1).
     
    -

    +

    Back to Contents  

    @@ -9235,7 +9247,7 @@ To create a MNG animation from a DNA molecule sequence, use: gm convert -delay 20 dna.* dna.mng
    -

    +

    Back to Contents  

    @@ -11033,7 +11045,7 @@ With display, you can perform these functions on an image:
    *display images specified by a World Wide Web (WWW) uniform resource locator (URL)
    -

    +

    Back to Contents  

    @@ -11086,7 +11098,7 @@ To display histogram of an image, use: gm gm convert file.jpg HISTOGRAM:- | gm display -
    -

    +

    Back to Contents  

    @@ -12003,7 +12015,7 @@ For a more detailed description of each option, see Options, above.
     
    -

    +

    Back to Contents  

    @@ -12081,7 +12093,7 @@ all the image tiles with their respective images. See and miff for more details.
    -

    +

    Back to Contents  

    @@ -12236,7 +12248,7 @@ desired sub-menu item, release the button and the command is executed. Move the pointer away from the sub-menu if you decide not to execute a particular command.
    -

    +

    Back to Contents  

    @@ -12381,7 +12393,7 @@ button 2. Press ALT and one of the arrow keys to trim off one pixel from any side of the image.
    -

    +

    Back to Contents  

    @@ -12755,7 +12767,7 @@ For example, to set the Pan window geometry to 256x256, use: gm display.pan.geometry: 256x256
    -

    +

    Back to Contents  

    @@ -12787,7 +12799,7 @@ with .jpg. To select your image from the X server screen instead of from a file, Choose Grab of the Open widget.
    -

    +

    Back to Contents  

    @@ -12819,7 +12831,7 @@ by the thumbnail is displayed at its full size. Choose Next fro the File sub-menu of the Command widget to return to the Visual Image Directory.
    -

    +

    Back to Contents  

    @@ -12868,7 +12880,7 @@ You can make adjustments by moving the pointer to one of the cut rectangle corners, pressing a button, and dragging. Finally, press Cut to commit your copy region. To exit without cutting the image, press Dismiss.
    -

    +

    Back to Contents  

    @@ -12910,7 +12922,7 @@ You can make adjustments by moving the pointer to one of the copy rectangle corners, pressing a button, and dragging. Finally, press Copy to commit your copy region. To exit without copying the image, press Dismiss.
    -

    +

    Back to Contents  

    @@ -13167,7 +13179,7 @@ To force a PseudoClass image to remain PseudoClass, use -colors.
    -

    +

    Back to Contents  

    @@ -13208,7 +13220,7 @@ You can make adjustments by moving the pointer to one of the cropping rectangle corners, pressing a button, and dragging. Finally, press Crop to commit your cropping region. To exit without cropping the image, press Dismiss.
    -

    +

    Back to Contents  

    @@ -13254,7 +13266,7 @@ by which direction you choose from the Command widget. To cancel the image chopping, move the pointer back to the starting point of the line and release the button.
    -

    +

    Back to Contents  

    @@ -13318,10 +13330,10 @@ sub-menu of the Command widget. To cancel the image rotation, move the pointer back to the starting point of the line and release the button.
    -

    +

    Back to Contents  

    -

    +

    Back to Contents  

    @@ -13490,7 +13502,7 @@ to DirectClass (see miff(5)). To force a PseudoClass image to remain PseudoClass, use -colors.
    -

    +

    Back to Contents  

    @@ -13778,7 +13790,7 @@ final image, any PseudoClass image is promoted to DirectClass (see To force a PseudoClass image to remain PseudoClass, use -colors.
    -

    +

    Back to Contents  

    @@ -13922,7 +13934,7 @@ to DirectClass To force a PseudoClass image to remain PseudoClass, use -colors.
    -

    +

    Back to Contents  

    @@ -14046,7 +14058,7 @@ unless you immediately save your image to a file (refer to Write). Correct matte editing behavior may require a TrueColor or DirectColor visual or a Standard Colormap.
    -

    +

    Back to Contents  

    @@ -14189,7 +14201,7 @@ is updated when you press and release the button without moving the pointer. To cancel image drawing, move the pointer back to the starting point of the line and release the button.
    -

    +

    Back to Contents  

    @@ -14352,7 +14364,7 @@ more than one image processing technique to apply to an area. Alternatively, you can move the region of interest before applying another image processing technique. To exit, press Dismiss.
    -

    +

    Back to Contents  

    @@ -14380,7 +14392,7 @@ within the image window. The panning icon is withdrawn if the image becomes smaller than the dimensions of the X server screen.
    -

    +

    Back to Contents  

    @@ -14446,7 +14458,7 @@ image. Panning is much faster with Pixmaps than with a XImage. Pixmaps are considered a precious resource, use them with discretion.
    -

    +

    Back to Contents  


     
    @@ -14498,7 +14510,7 @@ For some formats, additional format-specific information about the file will be written if the -debug coder or -debug all option is used. -

    +

    Back to Contents  

    @@ -14690,7 +14702,7 @@ For a more detailed description of each option, see Options, above.
     
    -

    +

    Back to Contents  


     
    @@ -14719,7 +14731,7 @@ moves. To save the portion of the screen defined by the rectangle, just release the button. The keyboard bell is rung once at the beginning of the screen capture and twice when it completes. -

    +

    Back to Contents  

    @@ -14759,7 +14771,7 @@ without using the mouse, use: corner.png
    -

    +

    Back to Contents  

    @@ -15306,7 +15318,7 @@ filename. The graphics formats supported by mogrify are listed in GraphicsMagick(1).
    -

    +

    Back to Contents  

    @@ -15345,7 +15357,7 @@ pixels in height, use: gm mogrify -resize 640x480! cockatoo.miff
    -

    +

    Back to Contents  

    @@ -16911,7 +16923,7 @@ For a more detailed description of each option, see Options, above.
     
    -

    +

    Back to Contents  


     
    @@ -16986,7 +16998,7 @@ behaves differently than other images. You can think of the composite as a visual image directory. Choose a particular tile of the composite and press a button to display it. See display(1) and miff(5) -

    +

    Back to Contents  

    @@ -17034,7 +17046,7 @@ no label, no shadowing, no surrounding tile frame), use: -geometry 50x50+0+0 *.png joined.png
    -

    +

    Back to Contents  

    @@ -17870,7 +17882,7 @@ For a more detailed description of each option, see Options, above.
     
    -

    +

    Back to Contents  

    @@ -18042,7 +18054,7 @@ convert input.ppm -gaussian 0x2 output.ppm 22.60s user 0.00s system 2354% cpu
  • total - the total elapsed time consumed.
  • -

    +

    Back to Contents  

    @@ -18140,7 +18152,7 @@ color="#00B04F"> LIBS = ...
    -

    +

    Back to Contents  

    diff --git a/www/identify.html b/www/identify.html index 3dd9065..6d2aa9c 100644 --- a/www/identify.html +++ b/www/identify.html @@ -125,7 +125,7 @@ For some formats, additional format-specific information about the file will be written if the -debug coder or -debug all option is used.
    -

    +

    Back to Contents  

    @@ -319,6 +319,6 @@ Options, above. GraphicsMagick(1).
     
    -

    +

    Back to Contents  

    diff --git a/www/import.html b/www/import.html index 559c66f..17c5e8f 100644 --- a/www/import.html +++ b/www/import.html @@ -102,7 +102,7 @@ moves. To save the portion of the screen defined by the rectangle, just release the button. The keyboard bell is rung once at the beginning of the screen capture and twice when it completes. -

    +

    Back to Contents  

    @@ -142,7 +142,7 @@ without using the mouse, use: corner.png
    -

    +

    Back to Contents  

    diff --git a/www/index.html b/www/index.html index 2cf3e53..7cafdc6 100644 --- a/www/index.html +++ b/www/index.html @@ -3,7 +3,7 @@ - +GraphicsMagick Image Processing System @@ -15,23 +15,23 @@ GraphicMagick logoGraphicsMagick - - -   + + + 
    @@ -47,7 +47,7 @@
    - + @@ -142,8 +142,11 @@ image
  • Describe the format and characteristics of an image
  • -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/index.html.orig b/www/index.html.orig new file mode 100644 index 0000000..8a60fce --- /dev/null +++ b/www/index.html.orig @@ -0,0 +1,149 @@ + + + + + + +GraphicsMagick Image Processing System + + + + + + + + + +
    +

    GraphicsMagick Image Processing System

    + + + + +
    Current Release1.3.35 (Released February 23, 2020) download release1.3.36 (Released December 26, 2020) download release
    Development Snapshots (Updated frequently) download development snapshots
    ++++ + + + + + + + + + + + +
    Current Release1.3.35 (Released February 23, 2020) download release
    Development Snapshots(Updated frequently) download development snapshots
    Mercurial Repository(Updated frequently) visit Mercurial repository
    +

    Check http://www.GraphicsMagick.org/ for the latest version of this page.

    +

    GraphicsMagick is the swiss army knife of image processing. Comprised +of 267K physical lines (according to David A. Wheeler's SLOCCount) +of source code in the base package (or 1,225K including 3rd party +libraries) it provides a robust and efficient collection of tools and +libraries which support reading, writing, and manipulating an image in +over 89 major formats including important formats like DPX, GIF, JPEG, +JPEG-2000, PNG, PDF, PNM, TIFF, and WebP.

    +

    Image processing is multi-threaded using OpenMP (read about OpenMP +in GraphicsMagick) so that CPU-bound tasks scale linearly as +processor cores are added. OpenMP support requires compilation with +GCC 4.2 (or later), or use of any C compiler supporting at least the +OpenMP 2.0 specification.

    +

    GraphicsMagick is quite portable, and compiles under almost every general +purpose operating system that runs on 32-bit or 64-bit CPUs. +GraphicsMagick is available for virtually any Unix or Unix-like system, +including Linux. It also runs under Windows +2000 and later (Windows 2000, XP, Vista, 7, 8.X, 10), and MacOS-X.

    +

    GraphicsMagick supports huge images and has been tested with +gigapixel-size images. GraphicsMagick can create new images on the +fly, making it suitable for building dynamic Web +applications. GraphicsMagick may be used to resize, rotate, sharpen, +color reduce, or add special effects to an image and save the result +in the same or different image format. Image processing operations are +available from the command line, as well as through C, C++, Lua, Perl, +PHP, Python, Tcl, Ruby, Windows .NET, or Windows COM programming +interfaces. With some modification, language extensions for +ImageMagick may be used.

    +

    GraphicsMagick is originally derived from ImageMagick 5.5.2 as of +November 2002 but has been completely independent of the ImageMagick +project since then. Since the fork from ImageMagick many improvements +have been made (see NEWS) by many authors using an open +development model but without breaking the API or utilities operation.

    +

    Here are some reasons to prefer GraphicsMagick over ImageMagick or +other popular software:

    +
    +
      +
    • GM is more efficient than ImageMagick so it gets the job done +faster using fewer resources.
    • +
    • GM is much smaller and lighter than ImageMagick (3-5X smaller +installation footprint).
    • +
    • GM is used to process billions of files at the world's largest photo +sites (e.g. Flickr and Etsy).
    • +
    • GM does not conflict with other installed software.
    • +
    • GM suffers from fewer security issues and exploits than ImageMagick.
    • +
    • GM participates in Google's oss-fuzz project (since February, 2018).
    • +
    • GM valgrind's 100% clean (memcheck and helgrind).
    • +
    • GM passes rigorous memory error testing using ASan.
    • +
    • GM passes undefined behavior testing using UBSan.
    • +
    • GM comes with a comprehensive manual page.
    • +
    • GM provides API and ABI stability and managed releases that you can +count on (ImageMagick does not).
    • +
    • GM provides detailed yet comprehensible ChangeLog and NEWS +files (ImageMagick does not).
    • +
    • GM is available for free, and may be used to support both open and +proprietary applications.
    • +
    • GM is distributed under an X11-style license (MIT License), +approved by the Open Source Initiative, recommended for use by +the OSSCC, and compatible with the GNU GPL.
    • +
    • GM source code is managed in Mercurial, a distributed source +control management tool which supports management of local +changes. The repository history goes back to 1998.
    • +
    • GM has 0.00 (zero) defects per 1000 lines of code (293,341 total +lines included) according to Coverity analysis on May 25, 2015.
    • +
    • GM developers contribute to other free projects for the public good.
    • +
    +
    +

    GraphicsMagick is copyrighted by the GraphicsMagick +Group as well as many others.

    +

    Here are just a few examples of what GraphicsMagick can do:

    +
    +
      +
    • Convert an image from one format to another (e.g. TIFF to JPEG)
    • +
    • Resize, rotate, sharpen, color reduce, or add special effects to an +image
    • +
    • Create a montage of image thumbnails
    • +
    • Create a transparent image suitable for use on the Web
    • +
    • Compare two images
    • +
    • Turn a group of images into a GIF animation sequence
    • +
    • Create a composite image by combining several separate images
    • +
    • Draw shapes or text on an image
    • +
    • Decorate an image with a border or frame
    • +
    • Describe the format and characteristics of an image
    • +
    +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    + + + diff --git a/www/index.rst b/www/index.rst index 940b2ad..26ef274 100644 --- a/www/index.rst +++ b/www/index.rst @@ -28,7 +28,7 @@ GraphicsMagick Image Processing System .. _programming : programming.html =========================== ======================================================== -Current Release 1.3.35 (Released February 23, 2020) `download release`__ +Current Release 1.3.36 (Released December 26, 2020) `download release`__ Development Snapshots (Updated frequently) `download development snapshots`__ Mercurial Repository (Updated frequently) `visit Mercurial repository`__ =========================== ======================================================== @@ -173,9 +173,3 @@ Here are just a few examples of what GraphicsMagick can do: * Decorate an image with a border or frame * Describe the format and characteristics of an image - ------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/links.html b/www/links.html index d5a0a25..9404f57 100644 --- a/www/links.html +++ b/www/links.html @@ -3,7 +3,7 @@ - + Related Links @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -457,9 +457,12 @@ individual image (composed of a header and image data) into one file.

    Authors

    John Cristy, magick-users@imagemagick.org ImageMagick Studio LLC.

    Maintained since 2002 by Bob Friesenhahn, GraphicsMagick Group.

    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/miff.html.orig b/www/miff.html.orig new file mode 100644 index 0000000..8127fb9 --- /dev/null +++ b/www/miff.html.orig @@ -0,0 +1,465 @@ + + + + + + +Magick Image File Format (version 1.0) + + + + + + + +
    +

    Magick Image File Format (version 1.0)

    + + + + +

    Magick Image File Format (MIFF) is a platform-independent format for +storing bitmap images. MIFF was originally invented by John Cristy for +ImageMagick, but is also a native format of GraphicsMagick. It is +useful as an efficient lossless working file format which assures that +all of the image attributes used by ImageMagick and GraphicsMagick are +preserved. Several lossless compression algorithms are available in +order to save space.

    +
    +

    Description

    +

    A MIFF image file consist of two sections. The first section is a header +composed of keywords describing the image in text form. The next section +is the binary image data. The header is separated from the image data by +a : character immediately followed by a ctrl-Z.

    +

    The MIFF header is composed entirely of LATIN-1 characters. The fields in +the header are keyword and value combination in the keyword=value format, +with each keyword and value separated by an equal sign (=). Each +keyword=value combination is delimited by at least one control or +whitespace character. Comments may appear in the header section and are +always delimited by braces. The MIFF header always ends with a colon (:) +character, followed by a ctrl-Z character. It is also common to precede +the colon with a formfeed and a newline character. The formfeed prevents +the listing of binary data when using more(1) under Unix where the ctrl-Z +has the same effect with the type command on the Win32 command line.

    +

    It is required that the 'id' keyword be present with the value +'ImageMagick' (id=ImageMagick) and be the first keyword listed in the +MIFF header. Files not starting with this keyword/value may be +rejected. The 'version' keyword must always be emitted for all new +files with the value '1.0' (version=1.0).

    +

    The MIFF header supports arbitrary LATIN-1 keyword strings. Some +keyword strings have special interpretation while others are merely +stored as image attributes. The following is a list of keyword=value +combinations with special interpretation that may be found in a MIFF +file:

    +

    background-color=color

    +

    border-color=color

    +

    matte-color=color

    +
    +these optional keywords reflects the image background, border, and +matte colors respectively. A color can be a name (e.g. white) or a hex +value (e.g. #ccc).
    +

    class=DirectClass

    +

    class=PseudoClass

    +
    +the type of binary image data stored in the MIFF file. If this keyword +is not present, DirectClass image data is assumed.
    +

    colors=value

    +
    +the number of colors in a DirectClass image. For a PseudoClass image, +this keyword specifies the size of the colormap. If this keyword is not +present in the header, and the image is PseudoClass, a linear 256 color +grayscale colormap is used with the image data. The maximum number of +colormap entries is 65535.
    +

    columns=value

    +
    +the width of the image in pixels. This is a required keyword and has no +default.
    +

    colorspace=RGB

    +

    colorspace=CMYK

    +
    +the colorspace of the pixel data. The default is RGB.
    +

    comment={text}

    +
    +comment text. Note that extremely old MIFF files used a different +means to indicate comment text.
    +

    compression=BZip

    +

    compression=None

    +

    compression=RLE

    +

    compression=Zip

    +
    +the type of algorithm used to compress the image data. If this keyword +is not present, the image data is assumed to be uncompressed.
    +

    delay <1/100ths of a second>

    +
    +the interframe delay in an image sequence. The maximum delay is 65535.
    +

    depth=8

    +

    depth=16

    +

    depth=32

    +
    +depth of a single color value representing values from 0 to 255 +(depth 8), 65535 (depth 16), or 4294967295 (depth 32). If this +keyword is absent, a depth of 8 is assumed. Depth values of 1 to 32 +are accepted, with the storage depth being rounded up to 8, 16, +or 32.
    +

    dispose value

    +
    +

    GIF disposal method. Here are the valid methods:

    +
    + ++++ + + + + + + + + + + + + + + + + + +
    DisposalDescription
    0No disposal specified.
    1Do not dispose between frames.
    2Overwrite frame with background color from +header.
    3Overwrite with previous frame.
    +
    +
    +

    gamma=value

    +
    +gamma of the image. If it is not specified, a gamma value of +.45454545 (linear-intensity gamma "2.2" as used by NTSC, sRGB, and +Rec.709) is assumed. A gamma value of 1.0 indicates linear-light.
    +

    id=ImageMagick

    +
    +identify the file as a MIFF-format image file. This keyword is required +and has no default. Although this keyword can appear anywhere in the +header, it should start as the first keyword of the header in column 1. +This will allow programs like file(1) to easily identify the file as +MIFF.
    +

    iterations value

    +
    +the number of times an image sequence loops before stopping.
    +

    label={value}

    +
    +this optional keyword defines a short title or caption for the image. +If any whitespace appears in the label, it must be enclosed within +double quotes.
    +

    matte=True

    +

    matte=False

    +
    +specifies whether a DirectClass image has matte data. Matte data is +generally useful for image compositing. This keyword has no meaning for +pseudocolor images.
    +

    montage=<width>x<height>{+-}<xoffset>{+-}<yoffset>

    +
    +size and location of the individual tiles of a composite image. See +X(1) for details about the geometry specification. Use this keyword +when the image is a composite of a number of different tiles. A tile +consists of an image and optionally a border and a label. < width> is +the size in pixels of each individual tile in the horizontal direction +and <height> is the size in the vertical direction. Each tile must have +an equal number of pixels in width and equal in height. However, the +width can differ from the height. <xoffset> is the offset in number of +pixels from the vertical edge of the composite image where the first +tile of a row begins and <yoffset> is the offset from the horizontal +edge where the first tile of a column begins. If this keyword is +specified, a directory of tile names must follow the image header. The +format of the directory is explained below.
    +

    page=<width>x<height>{+-}<xoffset>{+-}<yoffset>

    +
    +preferred size and location of an image canvas.
    +

    profile-icc=value

    +
    +the number of bytes in the International Color Consortium color +profile. The profile is defined by the ICC profile specification.
    +

    profile-iptc=value

    +
    +the number of bytes in the IPTC Newsphoto profile. The profile is +defined by the IPTC specification.
    +

    profile-name=value

    +
    +the number of bytes in the generic profile name where name identifies +the profile. Name is substituted with any LATIN-1 string to form a +unique generic profile identifier.
    +

    profile:name=value

    +
    +the number of bytes in the generic profile name where name identifies +the profile. Name is substituted with any LATIN-1 string to form a +unique generic profile identifier.
    +

    red-primary=x,y

    +

    green-primary=x,y

    +

    blue-primary=x,y

    +

    white-point=x,y

    +
    +these optional keywords reflect the chromaticity primaries and white point.
    +

    rendering-intent=saturation

    +

    rendering-intent=perceptual

    +

    rendering-intent=absolute

    +

    rendering-intent=relative

    +
    +Rendering intent is the CSS-1 property that has been defined by the +International Color Consortium.
    +

    resolution=<x-resolution>x<y-resolution>

    +
    +vertical and horizontal resolution of the image. See units for the +specific resolution units (e.g. pixels per inch).
    +

    rows=value

    +
    +the height of the image in pixels. This is a required keyword and has +no default.
    +

    orientation=value

    +
    +specifies the orientation of the image as an attribute (does not +effect pixel storage). Supported values are TopLeft, TopRight, +BottomRight, BottomLeft, LeftTop, RightTop, RightBottom, LeftBottom +as specified by the TIFF and EXIF standards.
    +

    scene=value

    +
    +the sequence number for this MIFF image file. This optional keyword is +used when a MIFF image file is one in a sequence of files used in an +animation.
    +

    signature=value

    +
    +this optional keyword contains a string that uniquely identifies the +image pixel contents. NIST's SHA-256 message digest algorithm is +recommended.
    +

    units=pixels-per-inch

    +

    units=pixels-per-centimeter

    +
    +image resolution units.
    +

    version=1.0

    +
    +Identifies the MIFF version used, which is 1.0 for the purpose of +this specification. If version is omitted, then certain MIFF +features (e.g. compressed rows) are assumed to be encoded using a +defunct MIFF format.
    +

    Other key value pairs are permitted. If a value contains whitespace it must be +enclosed with braces as illustrated here:

    +
    +id=ImageMagick  version=1.0
    +class=PseudoClass colors=256
    +compression=RLE
    +columns=1280 rows=1024
    +scene=1
    +signature=d79e1c308aa5bbcdeea8ed63df412da9
    +copyright={Copyright (c) 2000 Mortimer Snerd}
    +<FF>
    +:
    +
    +

    Note that keyword=value combinations may be separated by newlines or +spaces and may occur in any order within the header. Comments (within +braces) may appear anywhere before the colon.

    +

    The elements shown in the following table may appear after the header and +before the image data. These elements appear in the order described in +the following table if the keyword indicates that they exist.

    + +++++ + + + + + + + + + + + + + + + + + + + + + + +
    ElementKeywordDescription
    Image +directorymontageThe directory consists of a name for each +tile of the composite image separated by +a newline character. The list is +terminated with a NULL character.
    ICC Profileprofile-iccBinary color profile.
    IPTC Profileprofile-iptcBinary IPTC Newsphoto profile.
    Generic +Profilesprofile-<name>Binary generic profile. Multiple named +generic profiles may exist.
    +

    Next comes the binary image data itself. How the image data is formatted +depends upon the class of the image as specified (or not specified) by +the value of the class keyword in the header. All numeric values in the +binary section are written with the most significant bytes occuring first +(big-endian ordering).

    +

    DirectClass images (class=DirectClass) are continuous-tone, images stored +as RGB (red, green, blue), RGBA (red, green, blue, alpha), CMYK (cyan, +yellow, magenta, black), and CMYKA (cyan, yellow, magenta, black, alpha) +intensity values as defined by the colorspace and matte keywords. The +size of each intensity value depends on the depth of the image. The +depth, number of bytes, and numeric range of each value are shown in the +following table:

    +
    + +++++ + + + + + + + + + + + + + + + + + + +
    DepthBytes Per +ValueValue Range
    810..255
    1620..65535
    3240..4294967295
    +
    +

    The alpha value (if it occurs) represents the degree of pixel opacity +(zero is totally transparent).

    +

    PseudoClass images (class=PseudoClass) are colormapped RGB images. The +colormap is stored as a series of red, green, and blue pixel values. The +size of each colormap value depends on the image depth, as shown in the +following table:

    +
    + ++++++ + + + + + + + + + + + + + + + + + + + + + + +
    DepthBytes Per +ValueValue RangeBytes Per +Colormap Entry
    810..2553
    1620..655356
    3240..429496729512
    +
    +

    The number of colormap entries is defined by the colors keyword. The +colormap data occurs immediately following the header (or image directory +if the montage keyword is in the header). Immediately following the +colormap data is the PseudoClass image data. PseudoClass image data is an +array of index values into the color map. The number of bytes comprising +the index value depends on the number of colors in the image. The +following table shows the number of bytes in each colormap index as +determined by the colors keyword:

    +
    + +++++ + + + + + + + + + + + + + + + + + + +
    ColorsBytes Per +IndexIndex Range
    <=25610..255
    <=6553520..65535
    <=429496729540..4294967295
    +
    +

    If matte is true, each colormap index is immediately followed by an +equally-sized alpha value. The alpha value represents the degree of pixel +opacity (zero is totally transparent).

    +

    The image data in a MIFF file may be uncompressed, runlength encoded, +Zip compressed, or BZip compressed. The compression keyword in the +header defines how the image data is compressed. Uncompressed pixels +are stored one scanline at a time in row order. Runlength encoded +compression counts runs of identical adjacent pixels and stores the +pixels followed by a length byte (the number of identical pixels minus +1). Zip and BZip compression for version 1.0 compresses each row of an +image and precedes the compressed row with the length of compressed +pixel bytes as a 32-bit unsigned value in most significant byte first +order. If the version tag is not present (indicating a virtually +unused legacy format) then Zip and BZip omit this length value and the +reader must incrementally decode each row and restart compression at +the point where decoding completed for the previous row.

    +

    Note that compression in MIFF is scanline-based without any +specialized pre-processing as is found in the PNG and TIFF file +formats. As a result, available compression levels are likely to be +less than some other file formats given the same compression algorithm.

    +

    MIFF files may contain more than one image. Simply concatenate each +individual image (composed of a header and image data) into one file.

    +
    +
    +

    Authors

    +

    John Cristy, magick-users@imagemagick.org ImageMagick Studio LLC.

    +

    Maintained since 2002 by Bob Friesenhahn, GraphicsMagick Group.

    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    + + diff --git a/www/miff.rst b/www/miff.rst index 88ba973..291fb99 100644 --- a/www/miff.rst +++ b/www/miff.rst @@ -401,9 +401,3 @@ Authors John Cristy, magick-users@imagemagick.org ImageMagick Studio LLC. Maintained since 2002 by Bob Friesenhahn, GraphicsMagick Group. - -------------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/mission.html b/www/mission.html index da2ce1e..4418997 100644 --- a/www/mission.html +++ b/www/mission.html @@ -3,7 +3,7 @@ - + GraphicsMagick Mission Statement @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -63,7 +63,11 @@ GraphicsMagick a stable component in Linux and BSD distributions.
  • Value, and respect the contributions of developers, and observe and respect the copyrights of other projects.
  • -

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/mission.html.orig b/www/mission.html.orig new file mode 100644 index 0000000..00da1e8 --- /dev/null +++ b/www/mission.html.orig @@ -0,0 +1,69 @@ + + + + + + +GraphicsMagick Mission Statement + + + + + + + +
    +

    GraphicsMagick Mission Statement

    + + + + +

    In November, 2002, the GraphicsMagick project was formed as a branch from +ImageMagick 5.5.2. The project was formed in order to develop a more +"stable" form of ImageMagick which is suitable to be use as a base for +other open source (and proprietary) applications. It was perceived that +ImageMagick provided tremendous value, but also proved to be difficult to +rely on as a stable application component since the ImageMagick +interfaces often changed between releases, and there was no concept of +shared library ABI stability. GraphicsMagick intends to resolve these +issues while providing an appealing development environment to attract +the best available developers.

    +

    The objectives of the GraphicsMagick project are to:

    +
      +
    • Use an open development model.
    • +
    • Encourage new developers to join the project.
    • +
    • Avoid unnecessary source code "churn".
    • +
    • Establish and preserve both a stable API, and stable ABI, making +GraphicsMagick a stable component in Linux and BSD distributions.
    • +
    • Use efficient coding practices which result in fast code.
    • +
    • Improve memory efficiency.
    • +
    • Use a release process which assures a working product.
    • +
    • Prioritize bug-fixes over new feature enhancements.
    • +
    • Maintain an accurate change log.
    • +
    • Value, and respect the contributions of developers, and observe and +respect the copyrights of other projects.
    • +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    + + diff --git a/www/mission.rst b/www/mission.rst index c22ac4b..5e37367 100644 --- a/www/mission.rst +++ b/www/mission.rst @@ -40,8 +40,3 @@ The objectives of the GraphicsMagick project are to: * Value, and respect the contributions of developers, and observe and respect the copyrights of other projects. - - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/mogrify.html b/www/mogrify.html index 1bb34a5..caef168 100644 --- a/www/mogrify.html +++ b/www/mogrify.html @@ -101,7 +101,7 @@ filename. The graphics formats supported by mogrify are listed in GraphicsMagick(1). -

    +

    Back to Contents  

    @@ -140,7 +140,7 @@ pixels in height, use: gm mogrify -resize 640x480! cockatoo.miff
    -

    +

    Back to Contents  

    @@ -1708,6 +1708,6 @@ Options, above. GraphicsMagick(1).
     
    -

    +

    Back to Contents  

    diff --git a/www/montage.html b/www/montage.html index 4f0d85b..af1dbd5 100644 --- a/www/montage.html +++ b/www/montage.html @@ -157,7 +157,7 @@ behaves differently than other images. You can think of the composite as a visual image directory. Choose a particular tile of the composite and press a button to display it. See display(1) and miff(5) -

    +

    Back to Contents  

    @@ -202,7 +202,7 @@ no label, no shadowing, no surrounding tile frame), use: gm montage +frame +shadow +label -tile 5x1 -geometry 50x50+0+0 *.png joined.png
    -

    +

    Back to Contents  

    @@ -1040,7 +1040,7 @@ Options, above. GraphicsMagick(1).
     
    -

    +

    Back to Contents  

    @@ -1162,6 +1162,6 @@ This resource specifies the title to be placed at the top of the composite image. The default is not to place a title at the top of the composite image.
    -

    +

    Back to Contents  

    diff --git a/www/motion-picture.html b/www/motion-picture.html index 30fb69e..e2dbf5d 100644 --- a/www/motion-picture.html +++ b/www/motion-picture.html @@ -3,7 +3,7 @@ - + GraphicsMagick Cineon and SMTPE DPX Support @@ -15,23 +15,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -681,6 +681,10 @@ interchanged due to an different interpretation of the standard, or getting the wires crossed. The swap-samples option may be supplied when reading or writing in order to read or write using the necessary sample order.
    +
    -define dpx:swap-samples-read={true|false}
    +
    Similar to dpx:swap-samples but only applied while reading.
    +
    -define dpx:swap-samples-write={true|false}
    +
    Similar to dpx:swap-samples but only applied while writing.
    -interlace plane
    By default, samples are stored contiguously in a single element when possible. Specifying '-interlace plane' causes each sample @@ -782,10 +786,13 @@ gm identify -format '%[DPX:tv.time.code]' foo.dpx gm identify -format '%[dpx:*]' foo.dpx

    to list all DPX header attributes.

    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/motion-picture.html.orig b/www/motion-picture.html.orig new file mode 100644 index 0000000..b5e2b2a --- /dev/null +++ b/www/motion-picture.html.orig @@ -0,0 +1,791 @@ + + + + + + +GraphicsMagick Cineon and SMTPE DPX Support + + + + + + + + + +
    +

    GraphicsMagick Cineon and SMTPE DPX Support

    + + + + + +
    +

    Introduction

    +

    GraphicsMagick supports legacy Legacy 10-bit Kodak Cineon format as +well as high-grade support for SMPTE DPX Version 2.0 (SMPTE +268M-2003). SMPTE DPX RGB and YCbCr colorspaces are supported. The +DPX implementation supports 8, 10, 12, and 16 bits/sample and any +arbitrary image pixel size. The Cineon implementation supports 8 and +10 bits/sample.

    +

    Film images are usually captured at 2K resolution (82 pixels/mm), +4K resolution (164 pixels/mm), or even 8K resolution (328 +pixels/mm), where the actual resolution values approximate the +horizontal dimension of the image. A table of typical pixel +resolutions for various film sizes may be found on the Surreal +Road site (table reproduced here for convenience). File sizes may be +quite large and range in size from 8MB to as much as 180MB. The common +10-bit 2K format consumes 12MB of disk while a 10-bit 4K scan +consumes 50MB of disk.

    + + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Standard data resolutions
    FormatPicture +aspect +ratioStandard +pixel +resolutionPixel +aspect +ratio
    Apple iPod video1.33320×2401.0
    Apple iPhone video1.5480×3201.0
    Sony PlayStationPortable1.76480×2721.0
    SD video (PAL, DV)1.33720×5761.067
    SD video (NTSC, DV)1.33720×4860.9
    SD video (PAL, square pixels)1.33768×5761.0
    SD video (NTSC, square pixels)1.33648×4861.0
    DVD video (NTSC, 4:3)1.33720×4800.9
    DVD video (PAL, 4:3)1.33720×5761.067
    DVD video (NTSC, 16:9)1.78720×4801.185
    DVD video (PAL, 16:9)1.78720×5761.69
    Blu-ray1.781920×10801.0
    HD video @7201.781280×7201.0
    HD video @1080 (certain types)1.781440×10801.33
    HD video @10801.781920×10801.0
    DVC Pro HD @59.94i1.781280×10801.5
    16mm1.371712×12401.00
    Super-161.652048×12401.00
    “Academy” aperture (2k)1.371828×13321.00
    “Academy” aperture (4k)1.373656×26641.00
    Cinemascope (Squeezed, 2k)2.351828×15562.00
    Cinemascope (Squeezed, 4k)2.353656×26642.00
    Cinemascope (Unsqueezed, 2k)2.352048×8721.00
    Cinemascope (Unsqueezed, 4k)2.353656×15561.00
    Full Aperture (2k)1.332048×15561.00
    Full Aperture (4k)1.334096×31121.00
    8-perf “VistaVision” (3k)1.53072×20481.00
    8-perf “VistaVision” (6k)1.56144×40961.00
    Red (16:9, 4k)1.784096×23041.00
    Red (2:1, 4k)2.04096×20481.00
    Digital Cinema (2k)1.92048×10801.00
    Digital Cinema (4k)1.94096×21601.00
    UHDTV ("4k")1.783840×21601.00
    UHDTV ("8k")1.787860×43201.00
    +
    +
    +

    Applications

    +

    The strength of GraphicsMagick versus specialized proprietary software +are its cost (absolutely free!), open source availability (user is +able to fix software flaws or tailor software to meet specific needs), +general purpose image processing capabilities, deep image capabilities +(up to 32-bits per sample), excellent performance, platform +independence, lack of encumbering usage licenses, and robust +implementation. Examples of areas where GraphicsMagick may be used +are:

    +
    +
      +
    • View the image on a display.
    • +
    • Scaling (for example, 4K to 2K or 1920x1080 HD with excellent quality)
    • +
    • Cropping
    • +
    • Rotation
    • +
    • Filtering
    • +
    • ICC ICM profile-based color management and transformations
    • +
    • Gamma adjustment
    • +
    • Color adjustment
    • +
    • Conversion to grayscale
    • +
    • Text annotations
    • +
    • Compositions
    • +
    • Drawing on images (for example drawing markers on image)
    • +
    • Conversion to and from other formats (e.g. Kodak Cineon, TIFF, JPEG, SGI, +Postscript, PNG, and PNM)
    • +
    +
    +

    GraphicsMagick's DPX file format support is very comprehensive. It +goes beyond the DPX format support in other applications by striving +to implement the complete DPX specification rather than just a few +commonly used sub-formats. The capabilities of GraphicsMagick's DPX +support are as follows:

    +
    +
    +

    DPX features

    +
    +

    Basic

    +
    +
      +
    • Anything which can be read, can also be written.
    • +
    • All DPX header information (including the user specific area) are +stored as image attributes and restored when the image is written.
    • +
    • Image source header information is updated appropriately.
    • +
    +
    +
    +
    +

    Colorspaces

    +
    +
      +
    • Linear RGB
    • +
    • Cineon Log RGB (default density range = 2.048)
    • +
    • Grayscale (Luma)
    • +
    • Rec. 601 and Rec. 709 YCbCr (4:4:4 and 4:2:2). Below-black and +above-white values are clipped.
    • +
    +
    +
    +
    +

    Storage

    +
    +
      +
    • Bits per sample of 1, 8, 10, 12, and 16.
    • +
    • Packed, or fill type A or B for 10/12 bits.
    • +
    • All RGB-oriented element types (R, G, B, A, RGB, RGBA, ABGR).
    • +
    • YCbCr
    • +
    • Planar (multi-element) storage fully supported.
    • +
    • Alpha may be stored in a separate element.
    • +
    • Big and little endian storage.
    • +
    +
    +
    +
    +

    Yet to be supported

    +
    +
      +
    • Composite video.
    • +
    • Floating point formats (32 and 64 bits)
    • +
    • Depth channel (not supportable within GraphicsMagick).
    • +
    • Studio (reduced range) YCbCr and RGB.
    • +
    +
    +

    The software is written efficiently so the performance when reading +and writing files is limited by the performance of the file I/O +subsystem. The software is designed to avoid seeking while reading +and writing so that files may be read and written over pipes, or via a +user provided file descriptor.

    +
    +
    +
    +

    Using GraphicsMagick

    +
    +

    Image Resize

    +

    GraphicsMagick is easy to use. The following is an example of scaling +a 4K 16 bit scan to a 2K Academy 10 bit image using the convert +command:

    +
    +gm convert 4k.dpx -resize 1828x1556 -depth 10 2k.dpx
    +
    +

    The above example uses the default resizing filters which are +optimized for quality, but take longer than some other filters. The +box resize filter provides reasonably good scaling in a reasonable +amount of time:

    +
    +gm convert 4k.dpx -filter box -resize 1828x1556 -depth 10 2k.dpx
    +
    +

    The above example command takes about 4 seconds (on an Apple 2.5GHz G5 +PowerMac or Intel 2.4GHz Xeon) to down-convert from a 131MB 5K +(5232x4376) original 16-bit scan from a NorthLight scanner to a 11MB +2K 10-bit working image. Operations on more typical 2K images take +about a quarter of a second.

    +
    +
    +

    Annotate Image

    +

    The following example shows how GraphicsMagick's resize capability may +be combined with its powerful drawing capability to take a full size +source image and produce a smaller (720x576) version which includes +the image filename and timecode at the top of the image, and a logo +bug image in the bottom right corner:

    +
    +gm convert infile.dpx -resize '720x576!' \
    +  -draw 'fill "white";text-undercolor "Blue";font "Helvetica";font-size 18;\
    +     text 10,20 "%f (%[DPX:tv.time.code])";image atop 500,400 0,0 "gm-125x80t.png"' \
    +  outfile.dpx
    +
    +

    As may be seen, the argument to -draw can become extremely long, so to +make things easy, the drawing commands may be placed in a simple text +file and passed by reference to the draw comand:

    +

    First lets check what we edited into our drawing command file:

    +
    +% cat drawcmd.txt
    +fill "white"
    +text-undercolor "Blue"
    +font "Helvetica"
    +font-size 18
    +text 10,20 "%f (%[DPX:tv.time.code])"
    +image atop 500,400 "0,0 "gm-125x80t.png"
    +
    +

    and now we can apply it by passing the filename prefixed with a '@' to the +-draw command:

    +
    +gm convert infile.dpx -resize '720x576!' -draw '@drawcmd.txt' outfile.dpx
    +
    +

    The 0,0 in the image composition command argument says to use the +image as is. If the composited image should be automatically resized, +then simply replace the 0,0 with the desired size.

    +

    There are a number of powerful scripting environments for +GraphicsMagick. One of these is RMagick (Ruby language interface to +GraphicsMagick). In Ruby, the same effect may be obtained via a script +that looks like:

    +
    +#! /usr/local/bin/ruby -w
    +require 'RMagick'
    +include Magick
    +img = Image.read('infile.dpx')[0]
    +frog = Image.read('gm-125x80t.png')[0]
    +gc = Draw.new
    +gc.fill('white')
    +gc.text_undercolor("Blue")
    +gc.font("Helvetica")
    +gc.font_size(18)
    +gc.text(10, 20, "%f (%[DPX:tv.time.code])")
    +gc.composite(500, 400, 0, 0, frog, AtopCompositeOp)
    +gc.draw(img)
    +img.write('outfile.dpx')
    +
    +

    In addition to Ruby, there are scripting interfaces for Perl, Python, +Tcl, and Ch (C-like scripting language).

    +
    +
    +

    Colorspace Transformation

    +

    To convert an RGB file to a 4:2:2 YCbCr file in Rec 709 space:

    +
    +gm convert 2k.dpx -depth 10 -colorspace Rec709YCbCr -sampling-factor 4:2:2 2k-ycbcr.dpx
    +
    +
    +
    +

    Modifying An Image In-Place

    +

    Besides convert, which converts from one file to another, there is +mogrify which transforms the file in place. A temporary file is used +(if necessary) to ensure that the existing image file is not damaged +if something goes wrong (e.g., not enough disk space). Note that +unlike some applications supporting DPX/Cineon, when a file is modifed +in-place , it is completely re-written. While GraphicsMagick makes +every attempt to preserve header information, some previously existing +features of the file (such as the offset to the pixel data) may +change.

    +

    A typical mogrify command is

    +
    +gm mogrify -resize 1828x1556 -depth 10 file-0001.dpx file-0002.dpx
    +
    +

    Multiple files may be specified on the command line so the same +command may process hundreds of files in one invocation.

    +

    Unix users can use the find and xargs programs to perform operations +on any number of files:

    +
    +find /assets/001 -name '*.dpx' -print | \
    +  xargs gm mogrify -resize 1828x1556 -depth 10
    +
    +

    Xargs works by pasting as many file names as possible on the end of +the command provided to it.

    +

    The GNU version of xargs provides an added benefit. It is able to run +several commands in the background. This means that if your system has +multiple CPUs, it can take advantage of all the CPUs while still using +one command:

    +
    +find /assets/001 -name '*.dpx' -print | \
    +  xargs --max-procs 3 --max-args 25 gm mogrify -resize 1828x1556 -depth 10
    +
    +

    The mogrify command supports the -output-directory option to sent +files to a different directory than the input files. This allows +processing a large number of files without overwriting the input +files:

    +
    +mkdir dest
    +cd source
    +gm mogrify -output-directory ../dest -resize 1828x1556 -depth 10 '*.dpx'
    +
    +

    Note that the entire input file path specification is preserved when +composing the output path so that the input file path is simply +appended to the output directory path. Also, unless the +-create-directories option is added, the user is responsible for +creating any necessary destination directories. As an example of the +path composition algorithm, if the input file name is specified as +source/file.dpx and the output directory is specified as dest, then +the output file path will be dest/source/file.dpx.

    +

    Here is an incantation which recursively processes all DPX files under +source and sends the result to a similar directory tree under dest.

    +
    +mkdir dest
    +cd source
    +find . name '*.dpx' -print | xargs gm mogrify -output-directory ../dest \
    +  -create-directories -resize 1828x1556 -depth 10
    +
    +
    +
    +

    Creating A Contact Sheet

    +

    GraphicsMagick may be used to create a contact sheet (grid of +thumbnails with name and size) by using the VID pseudoformat which +accepts a wildcarded argument of files (protected by quotes!) to +read. The output files are buffered while files are being read so +there is a practical limit to the number of files which may be +processed at once. To output to a Postscript file:

    +
    +gm convert "vid:*.dpx" "contact-sheet.ps"
    +
    +

    or to a PDF file:

    +
    +gm convert "vid:*.dpx" "contact-sheet.pdf"
    +
    +

    or to a sequence of JPEG files ranging from contact-sheet-000.jpg to +contact-sheet-999.jpg:

    +
    +gm convert "vid:*.dpx" "contact-sheet-%03d.jpg"
    +
    +

    or to a MIFF file which may be used to interactively browse the +original files using 'gm display':

    +
    +gm convert "vid:*.dpx" "contact-sheet.miff"
    +
    +
    +
    +

    Animating A Sequence

    +

    GraphicsMagick may be used to animate an image sequence on an X11 +display using the animate subcommand. Frames are buffered in memory +(pre-loaded into the X11 server) so the number of frames which may be +animated at once is limited. GraphicsMagick has been used to animate +1080P (1920x1080) images at 24 frames per second with at least 300 +frames in the sequence.More frames may be buffered on 64-bit +systems. Many more frames may be animated by preparing a reduced set +of frames in advance.

    +

    To visualize an animation at 24 frames per second (delay (1/24)*100) use

    +
    +gm animate -delay 4.17 'Frame_*.dpx'
    +
    +

    In order to obtain a preview of a larger sequence, and if the frames +are numbered, a broader span of time may be animated by selecting +every 10^th frame (terminating with zero) to animate at 2.4 frames per +second:

    +
    +gm animate -delay 41.7 'Frame_*0.dpx'
    +
    +
    +
    +

    Displaying One Image Frame

    +

    An image frame may be displayed on an X11 server using the display +subcommand. By default the name of the image file is displayed in the +title bar. By specifying the format of the title, other useful +information such as the time code (see the DPX Attributes section for +more details) may be included in the window title:

    +
    +gm display -title '%f (%[DPX:tv.time.code])' foo.dpx
    +
    +
    +
    +

    Viewing A Sequence

    +

    A sequence of images may be displayed on an X11 server using the +display subcommand. Unlike 'gm animate' there are no arbitrary limits +when displaying a sequence this way. Unlike 'gm animate' the +inter-frame delay can not be set to less than a second (100 ticks is +one second).

    +
    +gm display +progress -delay 100 'Frame_*.dpx'
    +
    +
    +
    +

    Using the Batch capability

    +

    A 'batch' command is provided (starting with the GraphicsMagick 1.3.18 +release) which supports executing an arbitrary number of +GraphicsMagick commands from a file, or provided via standard input, +while executing just one instance of GraphicsMagick. This provides +for more efficiency and for use of GraphicsMagick as a co-process. An +arbitrary script which produces the commands may continue to produce +the commands as GraphicsMagick executes them. For example (Bourne +shell script):

    +
    +outdir=outdir
    +mkdir $outdir
    +find fromdir -name '*.dpx'| sort |
    +while read infile
    +do
    +    outfile=$outdir/`basename $infile`
    +    echo time convert $infile -gaussian 0x1 $outfile
    +done | gm batch -
    +
    +
    +
    +
    +

    Options And Attributes

    +
    +

    Command options

    +

    The following command options are particularly useful when dealing with +DPX files:

    +
    +
    -colorspace {CineonLog|RGB|Gray|Rec601Luma|Rec709Luma|Rec601YCbCr|Rec709YCbCr}
    +
    Specifies the colorspace to be used when saving the DPX +file. CineonLog selects log encoding according to Kodak Cineon +specifications. RGB selects linear RGB encoding. Gray selects +linear gray encoding similar to RGB, but with a single +channel. Rec601Luma requests that RGB is converted to a gray image +using Rec601 Luma. Rec709Luma requests that RGB is converted to a +gray image using Rec709Luma. Rec601YCbCr requests that the image +is saved as YCbCr according to Rec601 (SDTV) +specifications. Rec709CbCr requests that the image is saved as +YCbCr according to Rec709 (HDTV) specifications.
    +
    -endian {lsb|msb}
    +
    Specifies the endian order to use when writing the DPX +file. GraphicsMagick writes big-endian DPX files by default since +they are the most portable. Other implementations may use the +native order of the host CPU (e.g. little-endian when using an +Intel 'x86 CPU).
    +
    -depth <value>
    +
    Specifies the number of bits to preserve in a color sample. By +default the output file is written with the same number of bits as +the input file. For example, if the input file is 16 bits, it may +be reduced to 10 bits via '-depth 10'.
    +
    -define dpx:bits-per-sample=<value>
    +
    If the dpx:bits-per-sample key is defined, GraphicsMagick will +write DPX images with the specified bits per sample, overriding +any existing depth value. If this option is not specified, then +the value is based on the existing image depth value from the +original image file. The DPX standard supports bits per sample +values of 1, 8, 10, 12, and 16. Many DPX readers demand a sample +size of 10 bits with type A padding (see below).
    +
    -define dpx:colorspace={rgb|cineonlog}
    +
    Use the dpx:colorspace option when reading a DPX file to specify +the colorspace the DPX file uses. This overrides the colorspace +type implied by the DPX header (if any). Currently files with the +transfer characteristic Printing Density are assumed to be log +encoded density while files marked as Linear are assumed to be +linear. Hint: use -define dpx:colorspace=rgb in order to avoid +the log to linear transformation for DPX files which use Printing +Density.
    +
    -define dpx:packing-method={packed|a|b|lsbpad|msbpad}
    +
    DPX samples may be output within 32-bit words. They may be tightly +packed end-to-end within the words ("packed"), padded with null +bits to the right of the sample ("a" or "lsbpad"), or padded with +null bits to the left of the sample ("b" or "msbpad"). This option +only has an effect for sample sizes of 10 or 12 bits. If samples +are not packed, the DPX standard recommends type A padding. Many +DPX readers demand a sample size of 10 bits with type A padding.
    +
    -define dpx:pixel-endian={lsb|msb}
    +
    DPX pixels should use the endian order that the DPX header +specifies. Sometimes there is a mis-match and the pixels use a +different endian order than the file header specifies. For +example, the file header may specify little endian, but the pixels +are in big-endian order. To work around that use -define +dpx-pixel-endian=msb when reading the file. Likewise, this option +may be used to intentionally write the pixels using a different +order than the header.
    +
    -define dpx:swap-samples={true|false}
    +
    GraphicsMagick strives to adhere to the DPX standard but certain +aspects of the standard can be quite confusing. As a result, some +10-bit DPX files have Red and Blue interchanged, or Cb and Cr +interchanged due to an different interpretation of the standard, +or getting the wires crossed. The swap-samples option may be +supplied when reading or writing in order to read or write using +the necessary sample order.
    +
    -interlace plane
    +
    By default, samples are stored contiguously in a single element +when possible. Specifying '-interlace plane' causes each sample +type (e.g. 'red') to be stored in its own image element. Planar +storage is fully supported for grayscale (with alpha) and RGB. For +YCbCr, chroma must be 4:2:2 subsampled in order to use planar +storage. While planar storage offers a number of benefits, it +seems that very few DPX-supporting applications support it.
    +
    -sampling-factor 4:2:2
    +
    Select 4:2:2subsampling when saving an image in YCbCr +format. Subsampling is handled via a general-purpose image resize +algorithm (lanczos) rather than a dedicated filter so subsampling +is slow (but good).
    +
    -set reference-white <value>
    +
    Set the 90% white card level (default 685) for Cineon Log.
    +
    -set reference-black <value>
    +
    Set the 1% black card level (default 95) for Cineon Log.
    +
    -set display-gamma <value>
    +
    Set the display gamma (default 1.7) for Cineon Log.
    +
    -set film-gamma <value>
    +
    Set the film gamma (default 0.6) for Cineon Log.
    +
    -set soft-clip-offset <value>
    +
    Set the soft clip offset (default 0) when converting to computer RGB from +Cineon Log.
    +
    +
    +
    +

    DPX Attributes

    +

    GraphicsMagick provides almost full access to DPX header +attributes. DPX header attributes are shown in the output of 'gm +identify -verbose' and may be set using the -define syntax +(e.g. '-define dpx:mp.frame.position=2000') on the command line in +order to add a value, or override an existing value. The attributes in +the list below may be viewed or updated. The names are similar to the +attribute descriptions from the DPX standard.

    +
    +dpx:file.copyright
    +dpx:file.creation.datetime
    +dpx:file.creator
    +dpx:file.encryption.key
    +dpx:file.filename
    +dpx:file.project.name
    +dpx:file.version
    +dpx:image.orientation
    +dpx:mp.count
    +dpx:mp.film.manufacturer.id
    +dpx:mp.film.type
    +dpx:mp.format
    +dpx:mp.frame.id
    +dpx:mp.frame.position
    +dpx:mp.frame.rate
    +dpx:mp.held.count
    +dpx:mp.perfs.offset
    +dpx:mp.prefix
    +dpx:mp.sequence.length
    +dpx:mp.shutter.angle
    +dpx:mp.slate.info
    +dpx:source.aspect.ratio.horizontal
    +dpx:source.aspect.ratio.vertical
    +dpx:source.border.validity.bottom
    +dpx:source.border.validity.left
    +dpx:source.border.validity.right
    +dpx:source.border.validity.top
    +dpx:source.creation.datetime
    +dpx:source.device.name
    +dpx:source.device.serialnumber
    +dpx:source.filename
    +dpx:source.scanned.size.x
    +dpx:source.scanned.size.y
    +dpx:source.x-center
    +dpx:source.x-offset
    +dpx:source.x-original-size
    +dpx:source.y-center
    +dpx:source.y-offset
    +dpx:source.y-original-size
    +dpx:tv.black.gain
    +dpx:tv.black.level
    +dpx:tv.breakpoint
    +dpx:tv.field.number
    +dpx:tv.gama
    +dpx:tv.horizontal.sampling.rate
    +dpx:tv.integration.time
    +dpx:tv.interlace
    +dpx:tv.sync.time
    +dpx:tv.temporal.sampling.rate
    +dpx:tv.time.code
    +dpx:tv.user.bits
    +dpx:tv.video.signal
    +dpx:tv.white.level
    +dpx:user.data.id
    +
    +

    Specific header values from a DPX file may be displayed quickly using a command +similar to:

    +
    +gm identify -format '%[DPX:tv.time.code]' foo.dpx
    +
    +

    Use

    +
    +gm identify -format '%[dpx:*]' foo.dpx
    +
    +

    to list all DPX header attributes.

    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    +
    + + diff --git a/www/motion-picture.rst b/www/motion-picture.rst index 8ea5344..396acac 100644 --- a/www/motion-picture.rst +++ b/www/motion-picture.rst @@ -524,6 +524,12 @@ DPX files: supplied when reading or writing in order to read or write using the necessary sample order. +-define dpx:swap-samples-read={true|false} + Similar to dpx:swap-samples but only applied while reading. + +-define dpx:swap-samples-write={true|false} + Similar to dpx:swap-samples but only applied while writing. + -interlace plane By default, samples are stored contiguously in a single element when possible. Specifying '-interlace plane' causes each sample @@ -635,9 +641,3 @@ Use gm identify -format '%[dpx:*]' foo.dpx to list all DPX header attributes. - -------------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/perl.html b/www/perl.html index 6a92a5c..407230d 100644 --- a/www/perl.html +++ b/www/perl.html @@ -3,7 +3,7 @@ - + GraphicsMagick Perl API -- PerlMagick @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -2035,9 +2035,12 @@ $status = $image->Read('rose.png'); $status =~ /(\d+)/; die "unable to continue" if ($1 == ResourceLimitError); -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/perl.html.orig b/www/perl.html.orig new file mode 100644 index 0000000..179e653 --- /dev/null +++ b/www/perl.html.orig @@ -0,0 +1,2043 @@ + + + + + + +GraphicsMagick Perl API -- PerlMagick + + + + + + + +
    +

    GraphicsMagick Perl API -- PerlMagick

    + + + + + +
    +

    Introduction

    +

    PerlMagick is an objected-oriented Perl interface to GraphicsMagick. Use +the module to read, manipulate, or write an image or image sequence from +within a Perl script. This makes it very suitable for Web CGI scripts. +You must have GraphicsMagick 1.0.0 or above and Perl version 5.005_02 or +greater installed on your system for either of these utilities to work. +There are a number of useful scripts available to show you the value of +PerlMagick. The PerlMagick demo directory provides a number of sample +demos.

    +
    +
    +

    Installation

    +
    +

    UNIX

    +

    PerlMagick is installed by default by installing GraphicsMagick. +Installing PerlMagick as a subordinate package of GraphicsMagick is the +best way to avoid problems.

    +

    For Unix, you typically need to be root to install the software. There +are ways around this. Consult the Perl manual pages for more information.

    +
    +
    +

    Windows XP - Windows 8

    +

    Please note that a nice GUI installer is available for GraphicsMagick. +PerlMagick is included in this installer. If you are using the installer, +then there is no need to compile PerlMagick.

    +

    After GraphicsMagick has been compiled from the GraphicsMagick Windows +source distribution using Microsoft Visual C++, PerlMagick may be +manually built and installed by opening a CLI window and performing the +following steps:

    +
    +cd PerlMagick
    +copy Makefile.nt Makefile.PL
    +perl Makefile.PL
    +nmake
    +nmake install
    +
    +

    See the PerlMagick Windows HowTo page for further installation +instructions.

    +
    +
    +

    Running the Regression Tests

    +

    To verify a correct installation, type:

    +
    +make test
    +
    +

    Use nmake test under Windows. There are a few demonstration scripts +available to exercise many of the functions PerlMagick can perform. Type

    +
    +cd demo
    +make
    +
    +

    You are now ready to utilize the PerlMagick methods from within your Perl +scripts.

    +
    +
    +
    +

    Overview

    +

    Any script that wants to use PerlMagick methods must first define the +methods within its namespace and instantiate an image object. Do this +with

    +
    +use Graphics::Magick;
    +$image=Graphics::Magick->new;
    +
    +

    Note that this differs from the ImageMagick version of PerlMagick which +uses the namespace Image::Magick. Any PerlMagick code written for the +ImageMagick version of PerlMagick requires a global substition of +Image::Magick to Graphics::Magick in order to work with the +GraphicsMagick version.

    +

    The new() method takes the same parameters as SetAttribute . For example:

    +
    +$image=Graphics::Magick->new(size=>'384x256');
    +
    +

    Next you will want to read an image or image sequence, manipulate it, and +then display or write it. The input and output methods for PerlMagick are +defined in Read or Write an Image. See Set an Image Attribute for methods +that affect the way an image is read or written. Refer to Manipulate an +Image for a list of methods to transform an image. Get an Image Attribute +describes how to retrieve an attribute for an image. Refer to Create an +Image Montage for details about tiling your images as thumbnails on a +background. Finally, some methods do not neatly fit into any of the +categories just mentioned. Review Miscellaneous Methods for a list of +these methods.

    +

    Once you are finished with a PerlMagick object you should consider +destroying it. Each image in an image sequence is stored in either +virtual memory or as a file in the system's temporary file directory. +This can potentially add up to megabytes of memory or disk. Upon +destroying a PerlMagick object, the memory is returned for use by other +Perl methods. The recommended way to destroy an object is with undef

    +
    +undef $image;
    +
    +

    To delete all the images but retain the Graphics::Magick object use

    +
    +@$image = ();
    +
    +

    and finally, to delete a single image from a multi-image sequence, use

    +
    +undef $image->[x];
    +
    +

    The next section illustrates how to use various PerlMagick methods to +manipulate an image sequence.

    +

    Some of the PerlMagick methods require external programs such as +Ghostscript. This may require an explicit path in your PATH environment +variable to work properly. For example,

    +
    +$ENV{PATH}='/bin:/usr/bin:/usr/local/bin';
    +
    +
    +
    +

    Example Script

    +

    Here is an example script to get you started:

    +
    +#!/usr/local/bin/perl
    +use Graphics::Magick;
    +my($image, $status);
    +$image = Graphics::Magick->new;
    +$status = $image->Read('girl.png', 'logo.png', 'rose.png');
    +warn "$status" if "$status";
    +$status = $image->Crop(geometry=>'100x100+100+100');
    +warn "$status" if "$status";
    +$status = $image->Write('x.gif');
    +warn "$status" if "$status";
    +
    +

    The script reads three images, crops them, and writes a single image as a +GIF animation sequence. In many cases you may want to access individual +images of a sequence. The next example illustrates how this is done:

    +
    +#!/usr/local/bin/perl
    +use Graphics::Magick;
    +my($image, $p, $q);
    +$image = new Graphics::Magick;
    +$image->Read('x1.png');
    +$image->Read('j*.jpg');
    +$image->Read('k.miff[1, 5, 3]');
    +$image->Contrast();
    +for ($x = 0; $image->[x]; $x++)
    +{
    +  $image->[x]->Frame('100x200') if $image->[x]->Get('magick') eq 'GIF';
    +  undef $image->[x] if $image->[x]->Get('columns') < 100;
    +}
    +$p = $image->[1];
    +$p->Draw(stroke=>'red', primitive=>'rectangle', points=>'20,20 100,100');
    +$q = $p->Montage();
    +undef $image;
    +$q->Write('x.miff');
    +
    +

    Suppose you want to start out with a 100 by 100 pixel white canvas with a +red pixel in the center. Try

    +
    +$image = Graphics::Magick->new;
    +$image->Set(size=>'100x100');
    +$image->ReadImage('xc:white');
    +$image->Set('pixel[49,49]'=>'red');
    +
    +

    Or suppose you want to convert your color image to grayscale:

    +
    +$image->Quantize(colorspace=>'gray');
    +
    +

    Here we annotate an image with a Taipai TrueType font:

    +
    +$text = 'Works like magick!';
    +$image->Annotate(font=>'kai.ttf', pointsize=>40, fill=>'green', text=>$text);
    +
    +

    Other clever things you can do with a PerlMagick objects include

    +
    +$i = $#$p"+1"; # return the number of images associated with object p
    +push(@$q, @$p); # push the images from object p onto object q
    +@$p = (); # delete the images but not the object p
    +$p->Convolve([1, 2, 1, 2, 4, 2, 1, 2, 1]); # 3x3 Gaussian kernel
    +
    +
    +
    +

    Read or Write an Image

    +

    Use the methods listed below to either read, write, or display an image +or image sequence.

    + + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Read or Write Methods
    MethodParametersReturn ValueDescription
    Readone or more +filenamesthe number of +images readread an image or image sequence
    Writefilenamethe number of +images writtenwrite an image or image +sequence
    Displayserver namethe number of +images displayeddisplay the image or image +sequence to an X server
    Animateserver namethe number of +images animatedanimate image sequence to an X +server
    +

    For convenience, methods Write(), Display(), and Animate() can take any +parameter that SetAttribute knows about. For example,

    +
    +$image->Write(filename=>'image.png', compression=>'None');
    +
    +

    Use - as the filename to method Read() to read from standard in or to +method Write() to write to standard out:

    +
    +binmode STDOUT;
    +$image->Write('png:-');
    +
    +
    +
    To read an image from a disk file, use::
    +
    $image = Graphics::Magick->new; +$filename = 'test.gif'; +$status = $image->Read ($filename);
    +
    +

    and to write the image back to the disk file, use:

    +
    +$status = $image->Write($filename);
    +
    +

    To read an image in the GIF format from a PERL filehandle, use:

    +
    +$image = Graphics::Magick->new;
    +open(IMAGE, 'image.gif');
    +$status = $image->Read(file=>\*IMAGE);
    +close(IMAGE);
    +
    +

    To write an image in the PNG format to a PERL filehandle, use:

    +
    +$filename = "image.png";
    +open(IMAGE, ">$filename");
    +$status = $image->Write(file=>\*IMAGE, filename=>$filename);
    +close(IMAGE);
    +
    +

    If %0Nd appears in the filename, it is interpreted as a printf format +specification and the specification is replaced with the specified +decimal encoding of the scene number. For example,

    +
    +image%03d.miff
    +
    +

    converts files image000.miff, image001.miff, etc.

    +

    You can optionally add Image to any method name. For example, ReadImage() +is an alias for method Read().

    +
    +
    +

    Manipulate an Image

    +

    Once you create an image with, for example, method ReadImage() you may want +to operate on it. Below is a list of all the image manipulations methods +available to you with PerlMagick. There are examples of select PerlMagick +methods. Here is an example call to an image manipulation method:

    +
    +$image->Crop(geometry=>'100x100"+1"0+20');
    +$image->[x]->Frame("100x200");
    +
    +

    Image method parameters are often redundant. For example, a 'geometry' +string parameter (e.g. 800x600+10+20) is equivalent to the explicit use of +width, height, x, and y, parameters.

    +

    The following image manipulation methods are available:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Image Manipulation Methods
    MethodParametersDescription
    AdaptiveThresholdgeometry=>geometry, width=> +integer, height=> integer, offset +=>integerLocal adaptive +thresholding. Width +and height specify +the size of the local +region while offset +specifies the amount +to subtract from the +average of the +region.
    AddNoisenoise=>{Uniform, Gaussian, +Multiplicative, Impulse, +Laplacian, Poisson, Random}Add noise to an image +across the red, +green, and blue, +channels. Set the +image colorspace to +GRAY to obtain +intensity noise.
    AffineTransformaffine=>array of float values, +translate=>float, float, scale=> +float, float, rotate=>float, +skewX=>float, skewY=>floatAffine transform +image
    Annotatetext=>string, font=>string, +family=>string, style=>{Normal, +Italic, Oblique, Any}, stretch=> +{Normal, UltraCondensed, +ExtraCondensed, Condensed, +SemiCondensed, SemiExpanded, +Expanded, ExtraExpanded, +UltraExpanded}, weight=>integer, +pointsize=>integer, density=> +geometry, stroke=> color name, +strokewidth=>integer, fill=>color +name, undercolor=>color name, +geometry=>geometry, gravity=> +{NorthWest, North, NorthEast, +West, Center, East, SouthWest, +South, SouthEast}, antialias=> +{true, false}, x=>integer, y=> +integer, affine=>array of float +values, translate=>float, float, +scale=>float, float, rotate=> +float. skewX=>float, skewY=> +float, align=>{Left, Center, +Right}, encoding=>{UTF-8}annotate an image +with text. See +QueryFontMetrics to +get font metrics +without rendering any +text.
    Blurgeometry=>geometry, radius=> +double, sigma=> doubleblur the image with a +Gaussian operator of +the given radius and +standard deviation +(sigma).
    Bordergeometry=>geometry, width=> +integer, height=> integer, fill=> +color namesurround the image +with a border of +color
    Channelchannel=>{Red, Cyan, Green, +Magenta, Blue, Yellow, Opacity, +Black, Matte, All, Gray}extract a channel +from the image
    Charcoalorder=>integersimulate a charcoal +drawing
    Chopgeometry=>geometry, width=> +integer, height=> integer, x=> +integer, y=>integerchop an image
    Coalesce merge a sequence of +images
    Clip apply any clipping +path information as +an image clip mask.
    ColorFloodfillgeometry=>geometry, x=>integer, y +=>integer , fill=>color name, +bordercolor=> color namechanges the color +value of any pixel +that matches the +color of the target +pixel and is a +neighbor. If you +specify a border +color, the color +value is changed for +any neighbor pixel +that is not that +color.
    Colorizefill=>color name, opacity=>stringcolorize the image +with the fill color
    Commentstringadd a comment to your +image
    Compareimage=>image-handlecompare image to a +reference image
    Compositeimage=>image-handle, compose=>{ +Over, In, Out, Atop, Xor, Plus, +Minus, Add, Subtract, +Difference, Multiply, Bumpmap, +Copy, CopyRed, CopyGreen, +CopyBlue, CopyOpacity, +Clear, Dissolve, Displace, +Modulate, Threshold, No, Darken, +Lighten, Hue, Saturate, +Colorize, Luminize, Screen, +Overlay, CopyCyan, CopyMagenta, +CopyYellow, CopyBlack, Divide, +HardLight}, +mask=> +image-handle, geometry=>geometry, +x=>integer, y=>integer, gravity=> +{NorthWest, North, NorthEast, +West, Center, East, SouthWest, +South, SouthEast}, opacity=> +integer, tile=>{True, False}, +rotate=>double, color=>color namecomposite one image +onto another
    Contrastsharpen=>{True, False}enhance or reduce the +image contrast
    Convolvecoefficients=>array of float +valuesapply a convolution +kernel to the image. +Given a kernel order +, you would supply +order*order float +values (e.g. 3x3 +implies 9 values).
    Cropgeometry=>geometry, width=> +integer, height=> integer, x=> +integer, y=>integercrop an image
    CycleColormapamount=>integerdisplace image +colormap by amount
    Deconstruct break down an image +sequence into +constituent parts
    Despeckle reduce the speckles +within an image
    Drawprimitive=>{point, line, +rectangle, roundRectangle, arc, +ellipse, circle, polyline, +polygon, ,bezier, path, color, +matte, text, image, @filename}, +points=>string , method=>{Point, +Replace, Floodfill, FillToBorder, +Reset}, stroke=> color name, fill +=>color name, tile=>image-handle, +strokewidth=>float, antialias=> +{true, false}, bordercolor=>color +name, x=> float, y=>float, affine +=>array of float values, +translate=>float, float, scale=> +float, float, rotate=>float. +skewX=>float, skewY=> floatannotate an image +with one or more +graphic primitives
    Edgeradius=>doubleenhance edges within +the image with a +convolution filter of +the given radius.
    Embossgeometry=>geometry, radius=> +double, sigma=> doubleemboss the image with +a convolution filter +of the given radius +and standard +deviation (sigma).
    Enhance apply a digital +filter to enhance a +noisy image
    Equalize perform histogram +equalization to the +image
    Flatten flatten a sequence of +images
    Flip create a mirror image +by reflecting the +image scanlines in +the vertical +direction
    Flop create a mirror image +by reflecting the +image scanlines in +the horizontal +direction
    Framegeometry=>geometry, width=> +integer, height=> integer, inner +=>integer, outer=>integer, fill=> +color namesurround the image +with an ornamental +border
    Gammagamma=>string, red=>double, green +=>double , blue=>doublegamma correct the +image
    Implodeamount=>doubleimplode image pixels +about the center
    Labelstringassign a label to an +image
    Levellevel=>string, 'black-point'=> +double, 'mid-point'=>double, +'white-point'=>doubleadjust the level of +image contrast
    Magnify double the size of an +image
    Mapimage=>image-handle, dither=> +{True, False}choose a particular +set of colors from +this image
    MatteFloodfillgeometry=>geometry, x=>integer, y +=>integer , matte=>integer, +bordercolor=>color namechanges the matte +value of any pixel +that matches the +color of the target +pixel and is a +neighbor. If you +specify a border +color, the matte +value is changed for +any neighbor pixel +that is not that +color.
    MedianFilterradius=>doublereplace each pixel +with the median +intensity pixel of a +neighborhood.
    Minify half the size of an +image
    Modulatebrightness=>double, saturation=> +double, hue=> doublevary the brightness, +saturation, and hue +of an image by the +specified percentage
    MotionBlurgeometry=>geometry, radius=> +double, sigma=> double, angle=> +doubleblur the image with a +Gaussian operator of +the given radius and +standard deviation +(sigma) at the given +angle to simulate the +effect of motion
    Negategray=>{True, False}replace every pixel +with its +complementary color +(white becomes black, +yellow becomes blue, +etc.)
    Normalize transform image to +span the full range +of color values
    OilPaintradius=>integersimulate an oil +painting
    Opaquecolor=>color name, fill=> color +namechange this color to +the fill color within +the image
    Quantizecolors=>integer, colorspace=> +{RGB, Gray, Transparent, OHTA, +XYZ, YCbCr, YIQ, YPbPr, YUV, +CMYK}, treedepth=> integer, +dither=>{True, False}, +measure_error=>{True, False}, +global_colormap=>{True, False}preferred number of +colors in the image
    Profilename=>{ICM, IPTC}, profile=>blobadd or remove ICC or +IPTC image profile
    Raisegeometry=>geometry, width=> +integer, height=> integer, x=> +integer, y=>integer, raise=> +{True, False}lighten or darken +image edges to create +a 3-D effect
    ReduceNoiseradius=>doublereduce noise in the +image with a noise +peak elimination +filter
    Resizegeometry=>geometry, width=> +integer, height=> integer, filter +=>{Point, Box, Triangle, Hermite, +Hanning, Hamming, Blackman, +Gaussian, Quadratic, Cubic, +Catrom, Mitchell, Lanczos, +Bessel, Sinc}, blur=>doublescale image to +desired size. Specify +blur > 1 for blurry +or < 1 for sharp
    Rollgeometry=>geometry, x=>integer, y +=>integerroll an image +vertically or +horizontally
    Rotatedegrees=>double, color=>color +namerotate an image
    Samplegeometry=>geometry, width=> +integer, height=> integerscale image with +pixel sampling
    Scalegeometry=>geometry, width=> +integer, height=> integerscale image to +desired size
    Segmentcolorspace=>{RGB, Gray, +Transparent, OHTA, XYZ, YCbCr, +YCC, YIQ, YPbPr, YUV, CMYK}, +verbose={True, False}, cluster=> +double, smooth= doublesegment an image by +analyzing the +histograms of the +color components and +identifying units +that are homogeneous
    Shadegeometry=>geometry, azimuth=> +double, elevation=> double, gray +=>{true, false}shade the image using +a distant light +source
    Sharpengeometry=>geometry, radius=> +double, sigma=> doublesharpen the image +with a Gaussian +operator of the given +radius and standard +deviation (sigma).
    Shavegeometry=>geometry, width=> +integer, height=> integershave pixels from the +image edges
    Sheargeometry=>geometry, x=>double, y +=>double color=>color nameshear the image along +the X or Y axis by a +positive or negative +shear angle
    Signature generate an SHA-256 +message digest for +the image pixel +stream
    Solarizethreshold=>integernegate all pixels +above the threshold +level
    Spreadamount=>integerdisplace image pixels +by a random amount
    Stereoimage=>image-handlecomposites two images +and produces a single +image that is the +composite of a left +and right image of a +stereo pair
    Steganoimage=>image-handle, offset=> +integerhide a digital +watermark within the +image
    Swirldegrees=>doubleswirl image pixels +about the center
    Texturetexture=>image-handlename of texture to +tile onto the image +background
    Thresholdthreshold=>stringthreshold the image
    Transparentcolor=>color namemake this color +transparent within +the image
    Trim remove edges that are +the background color +from the image
    UnsharpMaskgeometry=>geometry, radius=> +double, sigma=> double, amount=> +double, threshold=>doublesharpen the image +with the unsharp mask +algorithm.
    Wavegeometry=>geometry, amplitude=> +double, wavelength=> doublealter an image along +a sine wave
    +

    Note, that the geometry parameter is a short cut for the width and height +parameters (e.g. geometry=>'106x80' is equivalent to width=>106, +height=>80).

    +

    You can specify @filename in both Annotate() and Draw(). This reads the +text or graphic primitive instructions from a file on disk. For example,

    +
    +$image->Draw(fill=>'red', primitive=>'rectangle',
    +points=>'20,20 100,100 40,40 200,200 60,60 300,300');
    +
    +

    Is equivalent to

    +
    +$image->Draw(fill=>'red', primitive=>'@draw.txt');
    +
    +

    Where draw.txt is a file on disk that contains this:

    +
    +rectangle 20, 20 100, 100
    +rectangle 40, 40 200, 200
    +rectangle 60, 60 300, 300
    +
    +

    The text parameter for methods, Annotate(), Comment(), Draw(), and +Label() can include the image filename, type, width, height, or other +image attribute by embedding these special format characters:

    +
    +%b file size
    +%d comment
    +%d directory
    +%e filename extension
    +%f filename
    +%h height
    +%m magick
    +%p page number
    +%s scene number
    +%t top of filename
    +%w width
    +%x x resolution
    +%y y resolution
    +\n newline
    +\r carriage return
    +
    +

    For example,

    +
    +text=>"%m:%f %wx%h"
    +
    +

    produces an annotation of MIFF:bird.miff 512x480 for an image titled +bird.miff and whose width is 512 and height is 480.

    +

    You can optionally add Image to any method name. For example, TrimImage() +is an alias for method Trim().

    +

    Most of the attributes listed above have an analog in convert. See the +documentation for a more detailed description of these attributes.

    +
    +
    +

    Set an Image Attribute

    +

    Use method Set() to set an image attribute. For example,

    +
    +$image->Set(dither=>'True');
    +$image->[$x]->Set(delay=>3);
    +
    +

    And here is a list of all the image attributes you can set:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Image Attributes
    AttributeValuesDescription
    adjoin{True, False}join images into a +single multi-image +file
    antialias{True, False}remove pixel +aliasing
    authenticatestringdecrypt image with +this password.
    backgroundcolor nameimage background +color
    blue-primaryx-value, y-valuechromaticity blue +primary point (e.g. +0.15, 0.06)
    bordercolorcolor nameset the image +border color
    clip-maskimageAssociate a clip +mask with the +image.
    colormap[i]color namecolor name (e.g. +red) or hex value +(e.g. #ccc) at +position i
    colorspace{RGB, CMYK}type of colorspace
    commentstringAppend to the image +comment.
    compression{None, BZip, Fax, Group4, JPEG, +LosslessJPEG, LZW, RLE, Zip, LZMA +JPEG2000, JBIG1, JBIG2}type of image +compression
    debug{No, Configure, Annotate, Render, +Transform, Locale, Coder, X11, +Cache, Blob, Deprecate, User, +Resource, TemporaryFile, +Exception,All}log copious +debugging +information for +one or more event +types
    delayintegerthis many 1/100ths +of a second must +expire before +displaying the next +image in a sequence
    densitygeometryvertical and +horizontal +resolution in +pixels of the image
    disk-limitintegerset disk resource +limit in megabytes
    dispose{Undefined, None, Background, +Previous}GIF disposal method
    dither{True, False}apply error +diffusion to the +image
    displaystringspecifies the X +server to contact
    endian{Undefined, LSB, MSB, Native}specifies the +ordering of bytes +in a multi-byte +word. MSB is +big-endian, LSB is +little-endian, and +Native is whatever +the current host +uses by default.
    filefilehandleset the image +filehandle
    filenamestringset the image +filename
    fillcolorThe fill color +paints any areas +inside the outline +of drawn shape.
    fontstringuse this font when +annotating the +image with text
    fuzzintegercolors within this +distance are +considered equal
    gammadoublegamma level of the +image
    Gravity{Forget, NorthWest, North, +NorthEast, West, Center, East, +SouthWest, South, SouthEast}type of image +gravity
    green-primaryx-value, y-valuechromaticity green +primary point (e.g. +0.3, 0.6)
    index[x, y]stringcolormap index at +position (x, y)
    interlace{None, Line, Plane, Partition}the type of +interlacing scheme
    iterationsintegeradd Netscape loop +extension to your +GIF animation
    labelstringAppend to the image +label.
    loopintegeradd Netscape loop +extension to your +GIF animation
    magickstringset the image +format
    matte{True, False}True if the image +has transparency
    mattecolorcolor nameset the image matte +color
    map-limitintegerset map resource +limit in megabytes
    memory-limitintegerset memory resource +limit in megabytes
    monochrome{True, False}transform the image +to black and white
    page{ Letter, Tabloid, Ledger, Legal, +Statement, Executive, A3, A4, A5, +B4, B5, Folio, Quarto, 10x14} or +geometrypreferred size and +location of an +image canvas
    pixel[x, y]stringhex value (e.g. # +ccc) at position (x +, y)
    pointsizeintegerpointsize of the +Postscript or +TrueType font
    preview{ Rotate, Shear, Roll, Hue, +Saturation, Brightness, Gamma, +Spiff, Dull, Grayscale, Quantize, +Despeckle, ReduceNoise, AddNoise, +Sharpen, Blur, Threshold, +EdgeDetect, Spread, Solarize, Shade, +Raise, Segment, Swirl, Implode, +Wave, OilPaint, Charcoal, +JPEG}type of preview for +the Preview image +format
    qualityintegerJPEG/MIFF/PNG +compression level
    red-primaryx-value, y-valuechromaticity red +primary point (e.g. +0.64, 0.33)
    rendering-intent{Undefined, Saturation, Perceptual, +Absolute, Relative}the type of +rendering intent
    sampling-factorgeometryhorizontal and +vertical sampling +factor
    sceneintegerimage scene number
    subimageintegersubimage of an +image sequence
    subrangeintegernumber of images +relative to the +base image
    serverstringspecifies the X +server to contact
    sizestringwidth and height of +a raw image
    strokecolorThe stroke color +paints along the +outline of a shape.
    tilestringtile name
    texturestringname of texture to +tile onto the image +background
    type{Bilevel, Grayscale, GrayscaleMatte, +Palette, PaletteMatte, TrueColor, +TrueColorMatte, ColorSeparation, +ColorSeparationMatte, Optimize }image type
    units{ Undefined, PixelsPerInch, +PixelsPerCentimeters}units of image +resolution
    verbose{True, False}print detailed +information about +the image
    virtual-pixel{Constant, Edge, Mirror, Tile}the virtual pixel +method
    white-pointx-value, y-valuechromaticity white +point (e.g. 0.3127, +0.329)
    +

    Note, that the geometry parameter is a short cut for the width and height +parameters (e.g. geometry=>'106x80' is equivalent to width=>106, height=> +80).

    +

    SetAttribute() is an alias for method Set().

    +

    Most of the attributes listed above have an analog in gm convert. See the +gm documentation for a more detailed description of these attributes.

    +
    +
    +

    Get an Image Attribute

    +

    Use method Get() to get an image attribute. For example,

    +
    +($a, $b, $c) = $image->Get('colorspace', 'magick', 'adjoin');
    +$width = $image->[3]->Get('columns');
    +
    +

    In addition to all the attributes listed in Set an Image Attribute , you +can get these additional attributes:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Image Attributes
    AttributeValuesDescription
    base-columnsintegerbase image width (before transformations)
    base-filenamestringbase image filename (before transformations)
    base-rowsintegerbase image height (before transformations)
    class{Direct, +Pseudo}image class
    colorsintegernumber of unique colors in the image
    commentstringimage comment
    columnsintegerimage width
    depthintegerimage depth
    directorystringtile names from within an image montage
    errordoublethe mean error per pixel computed with methods +Compare() or Quantize()
    filesizeintegernumber of bytes of the image on disk
    formatstringget the descriptive image format
    geometrystringimage geometry
    heightintegerthe number of rows or height of an image
    idintegerGraphicsMagick registry id
    labelstringimage label
    maximum-errordoublethe normalized max error per pixel computed with +methods Compare() or Quantize()
    mean-errordoublethe normalized mean error per pixel computed +with methods Compare() or Quantize()
    montagegeometrytile size and offset within an image montage
    rowsintegerthe number of rows or height of an image
    signaturestringSHA-256 message digest associated with the image +pixel stream
    taint{True, +False}True if the image has been modified
    widthintegerthe number of columns or width of an image
    x-resolutionintegerx resolution of the image
    y-resolutionintegery resolution of the image
    +

    GetAttribute() is an alias for method Get().

    +

    Most of the attributes listed above have an analog in convert. See the +documentation for a more detailed description of these attributes.

    +
    +
    +

    Create an Image Montage

    +

    Use method Montage() to create a composite image by combining several +separate images. The images are tiled on the composite image with the +name of the image optionally appearing just below the individual tile. +For example,

    +
    +$image->Montage(geometry=>'160x160', tile=>'2x2', texture=>'granite:');
    +
    +

    And here is a list of Montage() parameters you can set:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Montage Parameters
    ParameterValuesDescription
    backgroundcolor namebackground color name
    borderwidthintegerimage border width
    compose{Over, In, Out, Atop, Xor, Plus, +Minus, Add, Subtract, Difference, +Bumpmap, Copy, Mask, Dissolve, Clear, +Displace}composite operator
    filenamestringname of montage image
    fillcolor namefill color for +annotations
    fontstringX11 font name
    framegeometrysurround the image with +an ornamental border
    geometrygeometrypreferred tile and +border size of each +tile of the composite +image
    gravity{NorthWest, North, NorthEast, West, +Center, East, SouthWest, South, +SouthEast}direction image +gravitates to within a +tile
    ICMblobcolor information +profile
    IPTCblobnewswire information +profile
    labelstringassign a label to an +image
    mode{Frame, Unframe, Concatenate}thumbnail framing +options
    pointsizeintegerpointsize of the +Postscript or TrueType +font
    shadow{True, False}add a shadow beneath a +tile to simulate depth
    strokecolor namestroke color for +annotations
    texturestringname of texture to tile +onto the image +background
    tilegeometrynumber of tiles per row +and column
    titlestringassign a title to the +image montage
    transparentstringmake this color +transparent within the +image
    +

    Note, that the geometry parameter is a short cut for the width and height +parameters (e.g. geometry=>'106x80' is equivalent to width=>106, height=> +80).

    +

    MontageImage() is an alias for method Montage().

    +

    Most of the attributes listed above have an analog in montage. See the +documentation for a more detailed description of these attributes.

    +
    +
    +

    Working with Blobs

    +

    A blob contains data that directly represent a particular image format in +memory instead of on disk. PerlMagick supports blobs in any of these +image formats and provides methods to convert a blob to or from a +particular image format.

    + + ++++++ + + + + + + + + + + + + + + + + + +
    Blob Methods
    MethodParametersReturn ValueDescription
    ImageToBlobany image +attributean array of image data +in the respective image +formatconvert an image or image +sequence to an array of +blobs
    BlobToImageone or +more blobsthe number of blobs +converted to an imageconvert one or more blobs +to an image
    +

    ImageToBlob() returns the image data in their respective formats. You can +then print it, save it to an ODBC database, write it to a file, or pipe +it to a display program:

    +
    +@blobs = $image->ImageToBlob();
    +open(DISPLAY,"| display -") || die;
    +binmode DISPLAY;
    +print DISPLAY $blobs[0];
    +close DISPLAY;
    +
    +

    Method BlobToImage() returns an image or image sequence converted from +the supplied blob:

    +
    +@blob=$db->GetImage();
    +$image=Graphics::Magick->new(magick=>'jpg');
    +$image->BlobToImage(@blob);
    +
    +
    +
    +

    Miscellaneous Methods

    +

    The Append() method append a set of images. For example,

    +
    +$p = $image->Append(stack=>{true,false});
    +
    +

    appends all the images associated with object $image. By default, images +are stacked left-to-right. Set stack to True to stack them top-to-bottom.

    +

    The Average() method averages a set of images. For example,

    +
    +$p = $image->Average();
    +
    +

    averages all the images associated with object $image.

    +

    The Clone() method copies a set of images. For example,

    +
    +$p = $image->Clone();
    +
    +

    copies all the images from object $q to $p. You can use this method for +single or multi-image sequences.

    +

    The Morph() method morphs a set of images. Both the image pixels and size +are linearly interpolated to give the appearance of a meta-morphosis from +one image to the next:

    +
    +$p = $image->Morph(frames=>integer);
    +
    +

    where frames is the number of in-between images to generate. The default +is 1.

    +

    Mosaic() creates an mosaic from an image sequence.

    +

    Method Mogrify() is a single entry point for the image manipulation +methods (Manipulate an Image). The parameters are the name of a method +followed by any parameters the method may require. For example, these +calls are equivalent:

    +
    +$image->Crop('340x256+0+0');
    +$image->Mogrify('crop', '340x256+0+0');
    +
    +

    Method MogrifyRegion() applies a transform to a region of the image. It +is similar to Mogrify() but begins with the region geometry. For example, +suppose you want to brighten a 100x100 region of your image at location +(40, 50):

    +
    +$image->MogrifyRegion('100x100+40+50', 'modulate', brightness=>50);
    +
    +

    Ping() is a convenience method that returns information about an image +without having to read the image into memory. It returns the width, +height, file size in bytes, and the file format of the image. You can +specify more than one filename but only one filehandle:

    +
    +($width, $height, $size, $format) = $image->Ping('logo.png');
    +($width, $height, $size, $format) = $image->Ping(file=>\*IMAGE);
    +($width, $height, $size, $format) = $image->Ping(blob=>@blob);
    +
    +

    This is a more efficient and less memory intensive way to query if an +image exists and what its characteristics are.

    +

    To have full control over text positioning you need font metric +information. Use

    +
    +($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) =
    +$image->QueryFontMetrics(parameters);
    +
    +Where parameters is any parameter of the Annotate method.  The
    +'text' parameter must be specified since there can be no default for
    +the text to render. The return values are
    +
    +* character width
    +* character height
    +* ascender
    +* descender
    +* text width
    +* text height
    +* maximum horizontal advance
    +
    +

    Call QueryColor() with no parameters to return a list of known colors +names or specify one or more color names to get these attributes: red, +green, blue, and opacity value.

    +
    +@colors = $image->QueryColor();
    +($red, $green, $blue, $opacity) = $image->QueryColor('cyan');
    +($red, $green, $blue, $opacity) = $image->QueryColor('#716bae');
    +
    +

    QueryColorname() accepts a color value and returns its respective name or +hex value;

    +
    +$name = $image->QueryColorname('rgba(80,60,0,0)');
    +
    +

    Call QueryFont() with no parameters to return a list of known fonts or +specify one or more font names to get these attributes: font name, +description, family, style, stretch, weight, encoding, foundry, format, +metrics, and glyphs values.

    +
    +@fonts = $image->QueryFont();
    +$weight = ($image->QueryFont('Helvetica'))[5];
    +
    +

    Call QueryFormat() with no parameters to return a list of known image +formats or specify one or more format names to get these attributes: +adjoin, blob support, raw, decoder, encoder, description, and module.

    +
    +@formats = $image->QueryFormat();
    +($adjoin, $blob_support, $raw, $decoder, $encoder, $description, $module) = $image->QueryFormat('gif');
    +
    +

    Use RemoteCommand() to send a command to an already running display or +animate application. The only parameter is the name of the image file to +display or animate.

    +

    Finally, the Transform() method accepts a fully-qualified geometry +specification for cropping or resizing one or more images. For example,

    +
    +$p = $image->Transform(crop=>'100x100');
    +
    +

    You can optionally add Image to any method name above. For example, +PingImage() is an alias for method Ping().

    +
    +
    +

    Handling Errors

    +

    All PerlMagick methods return an undefined string context upon success. If +any problems occur, the error is returned as a string with an embedded +numeric status code. A status code less than 400 is a warning. This means +that the operation did not complete but was recoverable to some degree. A +numeric code greater or equal to 400 is an error and indicates the +operation failed completely. Here is how errors are returned for the +different methods:

    +
    +
      +
    • Methods which return a number (e.g. Read(), Write()):

      +
      +$status = $image->Read(...);
      +warn "$status" if "$status"; # print the error message
      +$status =~ /(\d+)/;
      +print $1; # print the error number
      +print 0+$status; # print the number of images read
      +
      +
    • +
    • Methods which operate on an image (e.g. Resize(), Crop()):

      +
      +$status = $image->Crop(...);
      +warn "$status" if "$status"; # print the error message
      +$status =~ /(\d+)/;
      +print $1; # print the error number
      +
      +
    • +
    • Methods which return images (Average(), Montage(), Clone()) should be +checked for errors this way:

      +
      +$status = $image->Montage(...);
      +warn "$status" if !ref($status); # print the error message
      +$status =~ /(\d+)/;
      +print $1; # print the error number
      +
      +
    • +
    +
    +

    Here is an example error message:

    +
    +Error 400: Memory allocation failed
    +
    +

    Below is a list of error and warning codes:

    + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Error and Warning Codes
    CodeMnemonicDescription
    0Successmethod completed without an error or warning
    300ResourceLimitWarninga program resource is exhausted (e.g. not +enough memory)
    305TypeWarningA font is unavailable; a substitution may +have occurred
    310OptionWarninga command-line option was malformed
    315DelegateWarningan GraphicsMagick delegate returned a warning
    320MissingDelegateWarningthe image type can not be read or written +because the appropriate Delegate is missing
    325CorruptImageWarningthe image file may be corrupt
    330FileOpenWarningthe image file could not be opened
    335BlobWarninga binary large object could not be allocated
    340StreamWarningthere was a problem reading or writing from a +stream
    345CacheWarningpixels could not be saved to the pixel cache
    350CoderWarningthere was a problem with an image coder
    355ModuleWarningthere was a problem with an image module
    360DrawWarninga drawing operation failed
    365ImageWarningthe operation could not complete due to an +incompatible image
    380XServerWarningan X resource is unavailable
    385MonitorWarningthere was a problem with prgress monitor
    390RegistryWarningthere was a problem getting or setting the +registry
    395ConfigureWarningthere was a problem getting a configuration +file
    400ResourceLimitErrora program resource is exhausted (e.g. not +enough memory)
    405TypeErrorA font is unavailable; a substitution may +have occurred
    410OptionErrora command-line option was malformed
    415DelegateErroran GraphicsMagick delegate returned a warning
    420MissingDelegateErrorthe image type can not be read or written +because the appropriate Delegate is missing
    425CorruptImageErrorthe image file may be corrupt
    430FileOpenErrorthe image file could not be opened
    435BlobErrora binary large object could not be allocated
    440StreamErrorthere was a problem reading or writing from a +stream
    445CacheErrorpixels could not be saved to the pixel cache
    450CoderErrorthere was a problem with an image coder
    455ModuleErrorthere was a problem with an image module
    460DrawErrora drawing operation failed
    465ImageErrorthe operation could not complete due to an +incompatible image
    480XServerErroran X resource is unavailable
    480MonitorErrorthere was a progress monitor error
    490RegistryErrorthere was a problem getting or setting the +registry
    495ConfigureErrorthere was a problem getting a configuration +file
    +

    The following illustrates how you can use a numeric status code:

    +
    +$status = $image->Read('rose.png');
    +$status =~ /(\d+)/;
    +die "unable to continue" if ($1 == ResourceLimitError);
    +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    + + diff --git a/www/perl.rst b/www/perl.rst index f2c3666..5c2fab7 100644 --- a/www/perl.rst +++ b/www/perl.rst @@ -1493,10 +1493,3 @@ The following illustrates how you can use a numeric status code:: $status = $image->Read('rose.png'); $status =~ /(\d+)/; die "unable to continue" if ($1 == ResourceLimitError); - - -------------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/process.html b/www/process.html index 7c6841a..ec7042d 100644 --- a/www/process.html +++ b/www/process.html @@ -3,7 +3,7 @@ - + GraphicsMagick Development Process @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -119,10 +119,13 @@ current beta package is determined to be sufficiently flawless for a final release.

    Exit Criteria: None

    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/process.html.orig b/www/process.html.orig new file mode 100644 index 0000000..d8a70a7 --- /dev/null +++ b/www/process.html.orig @@ -0,0 +1,128 @@ + + + + + + +GraphicsMagick Development Process + + + + + + + +
    +

    GraphicsMagick Development Process

    + + + + +

    In order to ensure an orderly development process, and assure the highest +quality releases, a development process has been established for +GraphicsMagick.

    +
    +

    Phases of Development

    +

    Four major development phases have been identified. These are the +feature development phase, snapshot phase, beta phase, and release +phase. The phases used depend on the nature of preceding development. +The Beta phase is usually skipped. The descriptions of these phases +are as follows:

    +
    +

    Feature Development Phase

    +
    +

    The feature development phase is a time of rapid development and +innovation. Work is normally done on Mercurial 'tip'. During the +feature development phase, Mercurial is the only way to access the +work in progress. Before updates are committed to Mercurial, they +should be proven to compile on at least one architecture and pass +the test suite ('make distcheck').

    +

    Entry Criteria: There is a plan for feature development.

    +

    Exit Criteria: Test suite passes on at least one machine.

    +
    +
    +
    +

    Snapshot Phase

    +
    +

    The snapshot phase is entered when it is decided that the work is +stable enough for non-developers to test. API and user interfaces +should be stable before the snapshot phase begins in order to avoid +confusion. Snapshot development is done on Mercurial 'tip'. Snapshot +packages are identified by the date of the snapshot, and no Mercurial +branching or tagging is performed to support the snapshot.

    +

    Entry Criteria: Interfaces are stable, and code compiles and runs on +multiple architectures.

    +

    Exit Criteria: Code is release quality. The test suite must show +100% completion for Q:8 and Q:16 quantum depths on at least three +operating environments.

    +
    +
    +
    +

    Beta Phase

    +
    +

    The Beta phase (usually only occuring at the beginning of a major +release cycle) is entered when the work is feature complete, the +package passes all tests, and it is considered time for versioned +releases. As the first step of entering the beta phase, a release +branch is created off of the trunk to support change sets for the +release. The purpose of the beta phase is to wring out any remaining +bugs prior to release. When a beta package is prepared, a release +tag is applied to the associated release branch in Mercurial.

    +

    Entry Criteria: Code is release quality.. The test suite must show +100% completion for Q:8 and Q:16 quantum depths on at least three +operating environments.

    +

    Exit Criteria: The test suite must show 100% completion for Q:8, Q:16, +and Q:32 quantum depths on at least three operating environments. The +current beta package is determined to be sufficiently flawless for a +final release.

    +
    +
    +
    +

    Release Phase

    +
    +

    The release phase is entered when the most recent Beta (or snapshot) +is considered to be of acceptable quality for a release or bug-fixes +have been prepared based on a previous release. At this time, a +formal release tag is applied to the release branch, and release +packages are created. Once a release tag has been applied to a +release branch, that release branch is considered to be in release +state and may only be used to prepare additional releases intended +to correct bugs found in preceding releases. The initial release on +a release branch has a two-digit (i.e. X.X) release +designation. Bug-fix releases have a three-digit (i.e. X.X.X) +release designation. A release designation may only be used once. If +a problem is discovered with the release package, a new release +number is assigned to support the corrected release package.

    +

    Entry Criteria: The test suite must show 100% completion for Q:8, Q:16, +and Q:32 quantum depths on at least three operating environments. The +current beta package is determined to be sufficiently flawless for a +final release.

    +

    Exit Criteria: None

    +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    +
    + + diff --git a/www/process.rst b/www/process.rst index 8f46ced..9f696ec 100644 --- a/www/process.rst +++ b/www/process.rst @@ -94,9 +94,3 @@ Release Phase final release. Exit Criteria: None - --------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/programming.html b/www/programming.html index bf4d9fb..12a3ca4 100644 --- a/www/programming.html +++ b/www/programming.html @@ -3,7 +3,7 @@ - + GraphicsMagick Programming Interfaces @@ -15,23 +15,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -103,8 +103,11 @@ a COM+ object.

    Some of these languages and scripting environments are supported by the GraphicsMagick Group while others are developed and supported by third parties.

    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/programming.html.orig b/www/programming.html.orig new file mode 100644 index 0000000..6c0fa44 --- /dev/null +++ b/www/programming.html.orig @@ -0,0 +1,110 @@ + + + + + + +GraphicsMagick Programming Interfaces + + + + + + + + + +
    +

    GraphicsMagick Programming Interfaces

    + + + + +

    GraphicsMagick capabilities may be accessed from many languages and scripting +environments via programming APIs as shown in the following table:

    + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    LanguageDescription
    C CoreC language API for the lowest-level core programming interface.
    C WandC language API for the mid-level Wand API programming interface.
    C++Magick++ provides an abstract object-oriented C++ interface.
    LuaGraphicsMagick for Lua interfaces to GraphicsMagick's Wand API.
    node.jsGraphicsmagick for node.js provides server-side support for +Javascript programming with node.js.
    PHPGmagick provides a small and fast extension for PHP.
    PerlPerlMagick provides an object-oriented Perl interface.
    PythonPgMagick provides the power and ease of the C++ API, but in Python.
    Redis ModuleImage processing via redis APIs
    Ruby (RMagick)RMagick provides a native Ruby language extension
    Ruby (MiniMagick)MiniMagick provides a Ruby language extension via a command line +wrapper.
    Tcl/TkTclMagick provides a scripting environment based on Tcl or Tcl/Tk.
    Windows .NETGraphicsMagick.NET provides a Windows .NET programming interface, +allowing use of GraphicsMagick features via a stand-alone package.
    Windows OLEThe ImageMagickObject OLE control supports utility-style access via +a COM+ object.
    +

    Some of these languages and scripting environments are supported by the +GraphicsMagick Group while others are developed and supported by third parties.

    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    + + diff --git a/www/programming.rst b/www/programming.rst index 741b631..7e7a8c9 100644 --- a/www/programming.rst +++ b/www/programming.rst @@ -65,9 +65,3 @@ Python_ PgMagick provides the power and ease of the C++ API, but i *Some of these languages and scripting environments are supported by the GraphicsMagick Group while others are developed and supported by third parties.* - --------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/project.html b/www/project.html index afb0477..381d866 100644 --- a/www/project.html +++ b/www/project.html @@ -3,7 +3,7 @@ - + GraphicsMagick Project Information @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -54,8 +54,11 @@

    Authors - Read about those who provided source code or algorithms.

    Thanks - Read about those who helped in ways other than contributing code.

    Source Control - Source control is important. We use Mercurial.

    -
    -

    Copyright © GraphicsMagick Group 2012 - 2020

    +
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/project.html.orig b/www/project.html.orig new file mode 100644 index 0000000..a3cb258 --- /dev/null +++ b/www/project.html.orig @@ -0,0 +1,61 @@ + + + + + + +GraphicsMagick Project Information + + + + + + + +
    +

    GraphicsMagick Project Information

    + + + + +

    Security - GraphicsMagick security (and how to report issues).

    +

    Change Logs - Read the detailed change logs to see what changed.

    +

    License - Copyrights and usage terms for GraphicsMagick.

    +

    Contribute - Contribute your work to the project.

    +

    Bugs - Report a bug via the tracker at SourceForge.

    +

    Development Process - Read about the project development process.

    +

    Download - Download the source code or binaries.

    +

    FAQ - Answers for the questions asked the most often.

    +

    Install - Read about how to install the software.

    +

    Links - Some links we find useful.

    +

    Mailing Lists - Participate in discussions on our mailing lists.

    +

    Mission - Every project needs a mission statement.

    +

    News - Read the project news and release notes.

    +

    Authors - Read about those who provided source code or algorithms.

    +

    Thanks - Read about those who helped in ways other than contributing code.

    +

    Source Control - Source control is important. We use Mercurial.

    +
    +

    Copyright © GraphicsMagick Group 2012 - 2020

    +
    + + diff --git a/www/project.rst b/www/project.rst index f6c9e02..8fdf6a2 100644 --- a/www/project.rst +++ b/www/project.rst @@ -54,9 +54,3 @@ GraphicsMagick Project Information `Thanks`_ - Read about those who helped in ways other than contributing code. `Source Control`_ - Source control is important. We use Mercurial. - --------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2012 - 2020 diff --git a/www/quantize.html b/www/quantize.html index 7979c61..95093ec 100644 --- a/www/quantize.html +++ b/www/quantize.html @@ -3,7 +3,7 @@ - + GraphicsMagick Color Quantization @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -243,9 +243,12 @@ values in the image.

    Paul Raveling, USC Information Sciences Institute, for the original idea of using space subdivision for the color reduction algorithm. With Paul's permission, this document is an adaptation from a document he wrote.

    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/quantize.html.orig b/www/quantize.html.orig new file mode 100644 index 0000000..558648a --- /dev/null +++ b/www/quantize.html.orig @@ -0,0 +1,251 @@ + + + + + + +GraphicsMagick Color Quantization + + + + + + + +
    +

    GraphicsMagick Color Quantization

    + + + + +
    +This document describes how GraphicsMagick performs color +reduction on an image. To fully understand this document, +you should have a knowledge of basic imaging techniques and +the tree data structure and terminology.
    +
    +

    Description

    +

    For purposes of color allocation, an image is a set of n pixels, where +each pixel is a point in RGB space. RGB space is a 3-dimensional vector +space, and each pixel, p(i), is defined by an ordered triple of red, +green, and blue coordinates, (r(i),g(i),b(i)).

    +

    Each primary color component (red, green, or blue) represents an +intensity which varies linearly from 0 to a maximum value, Cmax, which +corresponds to full saturation of that color. Color allocation is defined +over a domain consisting of the cube in RGB space with opposite vertices +at (0,0,0) and (Cmax ,Cmax,Cmax). GraphicsMagick requires Cmax= 255.

    +

    The algorithm maps this domain onto a tree in which each node represents +a cube within that domain. In the following discussion, these cubes are +defined by the coordinate of two opposite vertices: The vertex nearest +the origin in RGB space and the vertex farthest from the origin.

    +

    The tree's root node represents the the entire domain, (0,0,0) through +(Cmax, Cmax,Cmax). Each lower level in the tree is generated by +subdividing one node's cube into eight smaller cubes of equal size. This +corresponds to bisecting the parent cube with planes passing through the +midpoints of each edge.

    +

    The basic algorithm operates in three phases:

    +
    +
      +
    • Classification,
    • +
    • Reduction, and
    • +
    • Assignment.
    • +
    +
    +

    Classification builds a color description tree for the image. Reduction +collapses the tree until the number it represents, at most, is the number +of colors desired in the output image. Assignment defines the output +image's color map and sets each pixel's color by reclassification in the +reduced tree. Our goal is to minimize the numerical discrepancies between +the original colors and quantized colors. To learn more about +quantization error, see Measuring Color Reduction Error later in this +document.

    +

    Classification begins by initializing a color description tree of +sufficient depth to represent each possible input color in a leaf. +However, it is impractical to generate a fully-formed color description +tree in the classification phase for realistic values of Cmax. If color +components in the input image are quantized to k-bit precision, so that +Cmax = 2^k-1, the tree would need k levels below the root node to allow +representing each possible input color in a leaf. This becomes +prohibitive because the tree's:

    +
    +total number of nodes = 1+Sum(8^i), i=1,k
    +
    +For k=8,
    +Number of nodes= 1 + (8^1+8^2+....+8^8)
    +8^8 - 1
    += 1 + 8.-----------
    +8 - 1
    += 19,173,961
    +
    +

    Therefore, to avoid building a fully populated tree, GraphicsMagick:

    +
      +
    1. Initializes data structures for nodes only as they are needed;
    2. +
    3. Chooses a maximum depth for the tree as a function of the desired +number of colors in the output image (currently based-two logarithm +of Cmax).
    4. +
    +

    For Cmax=255,

    +
    +Maximum tree depth = log (256)
    +2
    +
    += log (256) / log (2)
    +e e
    +
    += 8
    +
    +

    A tree of this depth generally allows the best representation of the +source image with the fastest computational speed and the least amount of +memory. However, the default depth is inappropriate for some images. +Therefore, the caller can request a specific tree depth.

    +

    For each pixel in the input image, classification scans downward from the +root of the color description tree. At each level of the tree, it +identifies the single node which represents a cube in RGB space +containing the pixel's color. It updates the following data for each such +node:

    +
    +
    +
    n1:
    +
    Number of pixels whose color is contained in the RGB cube which +this node represents;
    +
    n2:
    +
    Number of pixels whose color is not represented in a node at lower +depth in the tree; initially, n2=0 for all nodes except leaves of +the tree.
    +
    Sr,Sg,Sb:
    +
    Sums of the red, green, and blue component values for all pixels +not classified at a lower depth. The combination of these sums and +n2 will ultimately characterize the mean color of a set of pixels +represented by this node.
    +
    E:
    +
    The distance squared in RGB space between each pixel contained +within a node and the nodes' center. This represents the +quantization error for a node.
    +
    +
    +

    Reduction repeatedly prunes the tree until the number of nodes with n2 > +0 is less than or equal to the maximum number of colors allowed in the +output image. On any given iteration over the tree, it selects those +nodes whose E value is minimal for pruning and merges their color +statistics upward. It uses a pruning threshold, Ep, to govern node +selection as follows:

    +
    +Ep = 0
    +while number of nodes with (n2 > 0) > required maximum number of colors
    +prune all nodes such that E <= Ep
    +Set Ep to minimum E in remaining nodes
    +
    +

    This has the effect of minimizing any quantization error when merging two +nodes together.

    +

    When a node to be pruned has offspring, the pruning procedure invokes +itself recursively in order to prune the tree from the leaves upward. The +values of n2 ,Sr, Sg and Sb in a node being pruned are always added to +the corresponding data in that node's parent. This retains the pruned +node's color characteristics for later averaging.

    +

    For each node, n2 pixels exist for which that node represents the +smallest volume in RGB space containing those pixel's colors. When n2 > 0 +the node will uniquely define a color in the output image. At the +beginning of reduction, n2 = 0 for all nodes except the leaves of the +tree which represent colors present in the input image.

    +

    The other pixel count, n1, indicates the total number of colors within +the cubic volume which the node represents. This includes n1 - n2 pixels +whose colors should be defined by nodes at a lower level in the tree.

    +

    Assignment generates the output image from the pruned tree. The output +image consists of two parts:

    +
      +
    1. A color map, which is an array of color descriptions (RGB triples) +for each color present in the output image.
    2. +
    3. A pixel array, which represents each pixel as an index into the +color map array.
    4. +
    +

    First, the assignment phase makes one pass over the pruned color +description tree to establish the image's color map. For each node with +n2 > 0, it divides Sr, Sg, and Sb by n2. This produces the mean color of +all pixels that classify no lower than this node. Each of these colors +becomes an entry in the color map.

    +

    Finally, the assignment phase reclassifies each pixel in the pruned tree +to identify the deepest node containing the pixel's color. The pixel's +value in the pixel array becomes the index of this node's mean color in +the color map.

    +

    Empirical evidence suggests that the distances in color spaces such as +YUV, or YIQ correspond to perceptual color differences more closely than +do distances in RGB space. These color spaces may give better results +when color reducing an image. Here the algorithm is as described except +each pixel is a point in the alternate color space. For convenience, the +color components are normalized to the range 0 to a maximum value, Cmax. +The color reduction can then proceed as described.

    +
    +
    +

    Measuring Color Reduction Error

    +

    Depending on the image, the color reduction error may be obvious or +invisible. Images with high spatial frequencies (such as hair or grass) +will show error much less than pictures with large smoothly shaded areas +(such as faces). This is because the high-frequency contour edges +introduced by the color reduction process are masked by the high +frequencies in the image.

    +

    To measure the difference between the original and color reduced images +(the total color reduction error), GraphicsMagick sums over all pixels in +an image the distance squared in RGB space between each original pixel +value and its color reduced value. GraphicsMagick prints several error +measurements including the mean error per pixel, the normalized mean +error, and the normalized maximum error.

    +

    The normalized error measurement can be used to compare images. In +general, the closer the mean error is to zero the more the quantized +image resembles the source image. Ideally, the error should be +perceptually-based, since the human eye is the final judge of +quantization quality.

    +

    These errors are measured and printed when -verbose and -colorsare +specified on the command line:

    +
    +
    +
    mean error per pixel:
    +
    is the mean error for any single pixel in the image.
    +
    normalized mean square error:
    +
    is the normalized mean square quantization error for any single +pixel in the image. +This distance measure is normalized to a range between 0 and 1. It +is independent of the range of red, green, and blue values in the +image.
    +
    normalized maximum square error:
    +
    is the largest normalized square quantization error for any single +pixel in the image. +This distance measure is normalized to a range between and blue +values in the image.
    +
    +
    +
    +
    +

    Authors

    +

    John Cristy, magick@imagemagick.org, ImageMagick Studio.

    +
    +
    +

    Acknowledgements

    +

    Paul Raveling, USC Information Sciences Institute, for the original idea +of using space subdivision for the color reduction algorithm. With Paul's +permission, this document is an adaptation from a document he wrote.

    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    + + diff --git a/www/quantize.rst b/www/quantize.rst index 855d750..85356e6 100644 --- a/www/quantize.rst +++ b/www/quantize.rst @@ -235,9 +235,3 @@ Acknowledgements Paul Raveling, USC Information Sciences Institute, for the original idea of using space subdivision for the color reduction algorithm. With Paul's permission, this document is an adaptation from a document he wrote. - -------------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/reference.html b/www/reference.html index eaded6e..907b308 100644 --- a/www/reference.html +++ b/www/reference.html @@ -3,7 +3,7 @@ - + GraphicsMagick Reference Information @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -43,8 +43,11 @@

    Formats - File formats supported by GraphicsMagick.

    MIFF - Magick Image File Format.

    Links - Some links we find useful.

    -
    -

    Copyright © GraphicsMagick Group 2012 - 2020

    +
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/reference.html.orig b/www/reference.html.orig new file mode 100644 index 0000000..eac4fdc --- /dev/null +++ b/www/reference.html.orig @@ -0,0 +1,50 @@ + + + + + + +GraphicsMagick Reference Information + + + + + + + +
    +

    GraphicsMagick Reference Information

    + + + + +

    Colors - Reference of colors known by GraphicsMagick.

    +

    FAQ - Answers for the questions asked the most often.

    +

    Formats - File formats supported by GraphicsMagick.

    +

    MIFF - Magick Image File Format.

    +

    Links - Some links we find useful.

    +
    +

    Copyright © GraphicsMagick Group 2012 - 2020

    +
    + + diff --git a/www/reference.rst b/www/reference.rst index 950570b..7d81482 100644 --- a/www/reference.rst +++ b/www/reference.rst @@ -21,9 +21,3 @@ Formats_ - File formats supported by GraphicsMagick. MIFF_ - Magick Image File Format. Links_ - Some links we find useful. - --------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2012 - 2020 diff --git a/www/security.html b/www/security.html index 397b67d..d1cd967 100644 --- a/www/security.html +++ b/www/security.html @@ -3,7 +3,7 @@ - + GraphicsMagick Security @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -322,8 +322,12 @@ akWaTz0WKIOiD9Lm2ylI9J0= =UAq2 -----END PGP PUBLIC KEY BLOCK----- -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/security.html.orig b/www/security.html.orig new file mode 100644 index 0000000..a64dac8 --- /dev/null +++ b/www/security.html.orig @@ -0,0 +1,329 @@ + + + + + + +GraphicsMagick Security + + + + + + + +
    +

    GraphicsMagick Security

    + + + + +
    +

    Background

    +

    Although GraphicsMagick is image processing software, security is a +very important consideration for GraphicsMagick. GraphicsMagick may +be used to open files and URLs produced by an untrusted party. Given +a suitable weakness (which we make every effort to prevent), an +intentionally constructed file might be able to cause the software to +crash, leak memory, request huge amounts of memory, run forever, or in +the worst case execute arbitrary code, including shell code. +GraphicsMagick is very powerful and complex software supporting many +capabilities and so untrusted parties should never be allowed to +submit arbitrary requests into it.

    +

    GraphicsMagick includes the ability to access arbitrary http and ftp +URLs as well as local image, font, and SVG files. The SVG renderer +supports read access to http and ftp URLs as well as local files +according to the SVG specification. Since URLs and local file paths +may be included in SVG files, untrusted SVG files may create a Server +Side Request Forgery (SSRF) vulnerability since URL requests are +done by the computer executing the SVG, which may be in a realm of +trust (e.g. inside the firewall and able to access "localhost" +addresses).

    +

    The -comment, -draw, -format, and -label utility options +support a @filename syntax to incorporate any readable file on the +system as a convenience to the user. If text from an untrusted source +(e.g. a web page) is allowed to supply these options, then they may be +used to read arbitrary files, creating a potential security hazard.

    +

    The GraphicsMagick project is continually striving to eliminate +conditions in the software which might pose a risk for its users while +not constraining what its users may do with the software.

    +
    +
    +

    Reporting Issues

    +

    If you become aware of a serious security issue with GraphicsMagick, +then it may be addressed by email directly to the GraphicsMagick +maintainers or to the GraphicsMagick Security mail address. More +minor issues are best addressed via the GraphicsMagick Bug Tracker +at SourceForge. Please remember to set the bug to 'private' if you +use the bug tracker or else someone may aquire a zero-day exploit from +your report. We will set the bug to 'public' as soon as a remedy has +been made available.

    +

    Reporting an issue will allow us to fix it so that future releases of +the software won't suffer from the problem.

    +

    The current state of free software is that security-sensitive free +software projects have been undergoing automated testing by machines +(and sometimes what might be hundreds of machines). Machines do not +need to work at a day job, take care of families, rest, or eat, but we +do. Any bug report which comes with a patch or changeset to fix the +problem is greatly appreciated and helps to move the project forward.

    +

    The remedy available to us is to submit a changeset to the +GraphicsMagick Mercurial repository, and include the changes in the +next release. Regardless of how an issue becomes known to us, the +issue will become public knowledge as soon as we commit a fix to the +source code repository. Only in exceedingly rare and dire +circumstances (e.g a previously-unknown zero-day shell exploit) might +we do anything different.

    +
    +
    +

    Safe Use Of The Software

    +

    You are the first line of defense when it comes to GraphicsMagick +security!

    +

    If you are operating a server which supports file uploads from +untrusted users, or delivered via a network protocol such as http, +ftp, or email, then you should take steps to assure that a problem +with opening/processing the file does not place the whole server at +risk. These are steps which can be taken:

    +
      +
    1. Subscribe to the graphicsmagick-announce mailing list so that +you are informed about new GraphicsMagick releases or special +security bulletins.

      +
    2. +
    3. Make sure that GraphicsMagick is up to date as reported on the +GraphicsMagick web site. Don't simply trust that packages from +your operating system vendor are kept up to date or are updated to +include security fixes. Keeping GraphicsMagick up to date might +require that you compile GraphicsMagick yourself from source code.

      +
    4. +
    5. Execute the software in a Container, FreeBSD Jail, Solaris +Zone, or chrooted environment such that it can not cause harm +to the system running it.

      +
    6. +
    7. Execute the software as a least-privileged user (e.g. 'nobody').

      +
    8. +
    9. Normalize input file names or any other external inputs so that +they are under your control and not controlled by an untrusted +party. This should include any file name specifications, which may +include arbitrary 'glob' patterns (wildcards) (requiring hours or +days to complete if sufficiently close long file names exist), and +options supporting a @filename syntax.

      +
    10. +
    11. Enforce that uploaded files are passed to the expected reader. For +example, the uploaded file "file.jpg" is forced to be read by the +JPEG reader (rather than a reader selected based on header magic +testing) by using the file name "jpg:file.jpg". If the file is not +really what was indicated, then an error is reported.

      +

      GraphicsMagick supports a great many file types and auto-detects +many file types based on their content rather than file extension. +The file which pretends to be an ordinary PNG or JPEG file might be +something else entirely. Note that even using independent file +header testing may not be sufficient since it is possible to +construct valid files with a header which appears to be several +different types, but the first type which matches while testing the +header will be selected.

      +
    12. +
    13. Apply resource limits via the -limit option or the +MAGICK_LIMIT_* environment variables (e.g. export +MAGICK_LIMIT_PIXELS=30Mp, export MAGICK_LIMIT_MEMORY=500Mb). +Also consider setting resource limits using the ulimit command.

      +
    14. +
    15. Consider using the MAGICK_CODER_STABILITY environment variable to +constrain the supported file formats to the subsets selected by +PRIMARY or STABLE. After setting this environment variable +(e.g. export MAGICK_CODER_STABILITY=PRIMARY), use gm +convert -list format and verify that the format support you need +is enabled. Selecting the PRIMARY or STABLE options blocks +access of http and ftp URLs (SSRF vulnerability), but does not +block SVG renderer access to read local image files.

      +
    16. +
    +
    +
    +

    PGP Public Key

    +

    The following PGP public key (belonging to Bob Friesenhahn) is used to +sign release files on the ftp site and may be used for private +correspondence:

    +
    +-----BEGIN PGP PUBLIC KEY BLOCK-----
    +
    +mQMuBFvWDmMRCACvO+aWyRPlp7jezY8m4t8q+MkLQXczLCoC8sUVQ5qd5T28HsfD
    +rUVzrFYY6pWT1K3AgTTKZnVcBO5lyZtLLS6HQI41FESp1Gp/FtyisYbOlQAeOvfG
    +yJVCQe16QoaHye0UIC8rs2VqH055nSewk7YOpEg9PNdHce0/Mvajkxyj2Eb6C4jp
    +mZuvcPhU4MaEqo9yAlSnRztwqmmDwvO60LPEoS7WRUB3oEqDGGR8wnMARbCwjlVn
    +kMHd5BqgOnFDhqxxGnQzq+dv9C4RKGZtpIFl+jVpx9m5DszF9ZYEDtNMwxAoCIia
    +mZE0DkxTwI5lbwe9Pc3HZSK/wEF7Df1HC/U7AQDoVpk/g33Tllvsd52UYUZM1aca
    +3qaPM6orhVLXysaI+Qf+LoRoQgTlQX4IP19Z2t8MIx7VP08SOsrZdNAwIgHO4fhs
    +dOX6okfwpiYOl1bGqnakprit4HarAhtSM0Xd8JPtXImPqzHN07yz6jhCKZBIFWGC
    +kJSzPFar+P/jCmCWArL7DfBelBw0aHiV7HmSqEQJsyKVZBYjgHmXzjLkp3zsFRaR
    +tAj3TnB+nN4uXCchv63bVmYd3Cv55AZyugJb49Kl5PHqHarcle39Gbhg/UPPiduo
    +zIQKqtsKZcLckxZWi5f3XF/BnIY+uKdbOssTY0u8hyCqj904KdUl50GtYEb274EZ
    +a7ZepmcSp6a3aTtQmmHMf1MP/5U7Z6c6fNha4N3Xwwf+O1Zhc0Y11JSEV8G/2gAC
    +rjwYCIQ17w6/KDUe4nflxZpCsTP7+YOwmaXRSBqBoCz5N3ZH9jTp0xu73l6hK5wY
    +LodkfYHRhIMSyRCrW4T7yalUlpcuJy0NhFUnCDALgkjAhLUi4goJ+nsnOIJWC1dp
    +5DhZtClRTWNIHWK1AmIrWAUBuodpcp6K1NouJFenQB/NtwHS71J+ILli9LTxt6jM
    +CvaOAseRjvOs8JxG3pBm2LPOvZDyvQQFvfrTgqOlcMgqVp4mIqTKeEtXa2AQWrCG
    +QK5Ig3ZxfiQuNYIYNRsbag8Xyo8/udvbMDXVOAWQlmQz2B/Ge23rTGQZPMixoA+e
    +JrQuQm9iIEZyaWVzZW5oYWhuIDxiZnJpZXNlbkBzaW1wbGUuZGFsbGFzLnR4LnVz
    +PoiZBBMRCABBAhsDBQkSzAMABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEE69/b
    +IbAg7o/RUaiN4wEEfeEZiXUFAlvWDvECGQEACgkQ4wEEfeEZiXXLpgEAqPfOR6nD
    +iq8o/5RZ57f8UFNSPBiLTFbi/FTHhn9FV/oA/14uiKfpWhhKib3INfOZweDC0sHX
    +GdULE2Nrbx54Rn/otCxCb2IgRnJpZXNlbmhhaG4gPGJmcmllc2VuQHNpbXBsZXN5
    +c3RlbXMub3JnPoiWBBMRCAA+FiEE69/bIbAg7o/RUaiN4wEEfeEZiXUFAlvWDskC
    +GwMFCRLMAwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ4wEEfeEZiXWxkwD8
    +DK9I1UeGW8TIQQ5zzyk9Ue2+0C3RP5R45Dg3cg9W01oA+gIELZMu+15wCOG22dRO
    +NAvZUjNS8TrGIWtGvQNE5IYctC1Cb2IgRnJpZXNlbmhhaG4gPGJmcmllc2VuQGdy
    +YXBoaWNzbWFnaWNrLm9yZz6IlgQTEQgAPhYhBOvf2yGwIO6P0VGojeMBBH3hGYl1
    +BQJb1g7jAhsDBQkSzAMABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEOMBBH3h
    +GYl1RekA/2UUHeqkrePzLtI10VfprqAgjYYRIb4Ue/Y18hzSHYEyAP4+LBt/y6CS
    +5kq5G7RtM072ujLm4LMRu+KKGmSVQz1u2LQrQm9iIEZyaWVzZW5oYWhuIDxib2Jq
    +ZnJpZXNlbmhhaG5AZ21haWwuY29tPoiWBBMRCAA+FiEE69/bIbAg7o/RUaiN4wEE
    +feEZiXUFAlvWIvsCGwMFCRLMAwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ
    +4wEEfeEZiXWYugEAv6hEjxqDR2pZu6/2qrG642OMk0lHVlFjla3F8hpMabIBALNd
    +pWvc+nb/HbZTWT5cebhA8Z/dExYTjB9jUIdNYAbU0dKI0oYBEAABAQAAAAAAAAAA
    +AAAAAP/Y/+AAEEpGSUYAAQEBAEgASAAA/9sAQwAUDg8SDw0UEhASFxUUGB4yIR4c
    +HB49LC4kMklATEtHQEZFUFpzYlBVbVZFRmSIZW13e4GCgU5gjZeMfZZzfoF8/9sA
    +QwEVFxceGh47ISE7fFNGU3x8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8
    +fHx8fHx8fHx8fHx8fHx8fHx8/8AAEQgBBQDEAwEiAAIRAQMRAf/EABoAAAIDAQEA
    +AAAAAAAAAAAAAAABAwQFAgb/xAA1EAABBAAFAgQEBQQDAQEAAAABAAIDEQQSITFB
    +BVETImFxIzKBkRRCUqHBBrHR8CRy4VPx/8QAGQEAAwEBAQAAAAAAAAAAAAAAAAEC
    +AwQF/8QAIBEBAQACAgMAAwEAAAAAAAAAAAECERIhAzFBFDJRcf/aAAwDAQACEQMR
    +AD8A9MmkmmgJoQmDQhCQNCEJgJoQgBChfiWtdlaM55rYKE44NP5SeaKQ0uoConqL
    +QdRp6FdjHMcQMzWj1KNjS4hQiYH8wPsVK0gj0QDTQhACEIQAhCaASaEJGEIQglZN
    +CYVAIQmkAmhNACFHNNHBGXyvDWjkrCxfW5Z3+Dg2lpPNalAk228RiocMLleAeByV
    +hdQ67mOSG+xA3/ZRswMkvmxMpBO4adT7lWoMLDh21FG1oUXJrMGZHJ1DEnWIhg2B
    +8oVhuFxjmgOdG0e5K02hdAJbaTBnfgZq0kafbRP8JiAKDz9Fo0utktjgyM0+HdYF
    +fRXML1YWGygtPcK0Q1wIcL91Tn6bHJrGSw71xacqbg2sPiGTMBa4G+ymXlRJicBJ
    +rY107Fa3TerxYs5H3HJtR2JVysrjpqpICaaQhCEAIQhIwhCEwrppBNBBNJNANRYn
    +ENw8ZcdTsB3K7cQBrovO9Z6sG3HCC52wQNKWOkxvUcaIswaOa2aFo4TDRYSPJENe
    +XHd3uocLF4MWvzu1ee5VtgtZ2t8cdJAuwEmhdtClqAF1SNF0AkZUhd0kgOU6QnSA
    +5dG2RpY8AtPBWH1LAOw5EjLLBs69R7rfASexsjCxwBaRRBTlRZtmdK6zKwtixJL2
    +HQOO4Xo2PbIwOYQWnYheHxMBwGLfEbyEW0ntwtro+Py0x7hlO/v3WkrDLF6BCN0K
    +kBCEIMIQhIK6a5TTI00knGmknhAZfWcb4bPBjdT3D7DuvN4MHEYwvqo4/wBypMXi
    +XYnETSa+c0PZWcHEIcO0VqdSprTGLrNQpmLiIeVdtWbeJ2KVoChYpm6pKMjZABXR
    +GyKQBRQbQUAoBhMhIFdboIkIQgMzrmFM+E8WNtyRa1+ochY+EmEbWk2WO0BPHofV
    +eqdq0grzpwrRPPh3aNJtp7K8WWT1PT5fGwcbr1Aoqysb+nZiYJIX6PYdVtLRjSQm
    +kgBCEICradri07SDu1V6nJ4XT53XRy0FYtZ3XnV0yQDckD90B5iMgkWTZND0C1I9
    +aWTCfi2BY2WzBVWpya4rLRQXbVwx7CaDh90zLGzXMFDVO1WGBZoxsPiZQ4WrsMzX
    +mgUHtMQlei6cQHNHcII8pSNxVrsNSZRFrtppAKkFPMLSKZBCSaROSsrGDLjWkfmF
    +LVKzce23NPY/ZVPaMvSfpALcWTW4ylbqxeln/lHs4X9VtLVhSQhCAEIQgKNp2uLT
    +CRurWT/UcmXAtHd9/YKx1PqLenQskdE6QOdXl4WTNjGdadFC1ro3B1lpB2re0QMv
    +COLpAaJA9F3iJ5nGg6OMcHxAD9la69HHh3RQxU1gZfue5WWMGHZRkKSoCZLP/Miv
    +uHKF7cQbAlbIPR4/ytODpTHfN9lbHRoDu0JbiuNYMMkkcgE7HjsSKXpOm4gkgA7L
    +lvTGZXZSAGiyCd0mxtwoYQCHXr29KSt2qTTXM2ado9FZcaiJWTA/PPm4AWpYdGaI
    +Oilr8V/xGRt/dU39Re3K0aOOps1SeJJaSwDlVHYbO5zpDZIqhsE5EZVHP158DnBu
    +R3uaXcX9SsLR4jCL5GyryYPENPwGRtHfIFxLh+pvykyE0KALQaH2VaiO2tF1yB58
    +pDh2vVaWHxcOIAyPAJ4O68m6PFRn4kMT/eMD+ynwxLZB5fCdwWmwfoUuJ8q9Udln
    +Yt2Ug+qs4fEGQZJBlkq/Rw7hVMfpde6J7F9LfSac8G9iVsLB6K4+O5vG63lowoQh
    +CAEIQgM5MJJhSpFisNHi8O6GUeV3bceqzWfisFQxERxAhGWN8ernt9u4/dXsTjRC
    +7K0Znc9gqb8cXzxOc0AMu6PCNq43W2L1iZmM6lD4Ts8bwKKslrImhzjoOUY0RzdV
    +bNGwCm+Z1VZTdEZt9ApyqsIrnqDi7LG0l36Rx7lVD1jEFxADQB3ctiHBxsbo0A9w
    +qj+hwPmLjI5oOtCkTSrMvjnD46RznNf8KRhymzmaT7qeWd0rSx7HAkfk1P0XYwMU
    +EJjiILXGzm3KpY1skdRRE+cZRR2vc/b+6OtjvisdJwgxbc80kjh2ugtg9Oa2KoJZ
    +YqN+V3P1UfTomxQNa3QAK8HdlO6vj0ycOZfFlbNL4hj2NV/pUj5mMbZIACrYvxIc
    +c4Rg1I5poC7Gx/hdy4enEtIIGluKdTHbMW0nRjj76KwMYx7ySyu+TWvosHHskjlH
    +ntuW96srnARfiMZGGZ2fMXAPuv8AdE5iVy1XpS1k7aaQ4Kv+CLHG2HKPTZRQmWHE
    +hshzEEVIBv6OW9IGyREtcNtdUr0VZ2KbL4DPw+UTAjIXbLOkxM4kP4uB7DYAIAyg
    +HueVrv8AmjB4dazuqPANO0BBBVQrFzpDSzFubd0KK3Fh9Ft09uGoYL96C3FcZX2a
    +EIQQQhCAzkwkmFKnmcU/EPnd4ZoXa4OctIkAtwG3ZX8RHlne0dyFWxDalib62foF
    +M9ujP1NOWktpsu36uPr2V6JrXNGWj7KvCddiphDC45sgB7jT+yVTFlsY5T8JlWVA
    +2Ng2dKB2zlN0UVate/8A7OJSaK+JkYDkiGd/YbD3PCqMjLpc7zmLef8AHorkoOXK
    +0BjewUIAAIQFvDSHQBXm7WVRwjL1V9tbIUrYuMuyyNoOadCos4l/LRG4PBV1zbBB
    +5UEmHsB2ocNnD+U0a7Rsa2sr42lvqF3Fh4Y3EsjDeNBS5D5GkAta760rDJHf/B59
    +i0/ygWQNaL2UwBaw1suAZSfLAR/2cAuvDlefiva1v6Wc+5KNFa5Z8WW26sZoD3Kp
    +45oc9xrYi/RabGhgDQKA4VHGNqU38sjKKcqMp0v9MhbDDmLgZH6nXYdlfCzGECJl
    +18o3VrDSX5bscaqpl8Tl4+trKEIVMjQhCAzkwuUwpUz8c0NxLT31WdibGJbppS1e
    +os0jkH5TSysa4eNC6xRtR9bzvBZw40Vto0VSA6BWwdLCRwz2pRuPCkvRRlJcQTaN
    +Vbeh6qxLqCoZAI47JArkpwq0sOwBgpTtjJdfCp9PxQljFEEjkG1fbJqnobJzK1Qw
    +A6cIkkFgWBabRWyVDh+HadQFy1mUiiVYCKHZAJgJ5K7DAEAUmChNjl26p4s3LG29
    +CDatuPmIWfijnxbQD8oTib30vvY2SLVunCjwTGxYtwYTltSQOaWZfRPBsJlc/gFE
    +9rvWNX0JJrVyBCaEBmphJNSpzMzxInN53C851T4Yjygb3/lemWB1pmWUNrRwJCWu
    +1S9acYV9sDuFfD7CxMDMdWna91psfbjSmtcatNdaHBcRFSOdQUtIrzGmk9lR6phn
    +Y3Dhsb6G/ur0725aOqpRNklcRH5GcknhOSllZ9VukwzYAeeqcbIBsLdje5xvhcQw
    +HIM2ulFdyOc1lMGwGytH+MjDx4t/Vn4rEkhpcWMHGXhejjdY0WdHIS5zHjQa3Wy0
    +ImgN02U1eNmkoXYXC6UmLpLNok86KJ7twE00y7c9lVgp0ksjt/l912ZBIQBzofRT
    +QYcZibHsq+Il7EIy2eFoQMyRAcnUqsxpfLVeUH7q4njC82Xw00k1bAIQhAZqaSal
    +RrI64wlraGpBC11Q6nHnaK7FEDzTSYbaBbgaF+ivYeexRNqji7YGyaeTUqOCcNkA
    +HJ0SsaS6egErWNtxpVZcc296UTneNJlGrWts+/CrFzTiBoSAaHb3SmKrn/E7ZjPI
    +QbAHqruGDYcwNOOVun3A/hZ2Ghe3ERmVvlPblabXND3Ea63/AIVRnbatRSF0Ugde
    +hoouwATR0B9FA2VrXObqc2ug5Xcbmud5tB8pKD7jp7PzaZxYschd4fEtbe9Hj91F
    +LMDbjoAwnTdUnYjMyMtNOePlHFIolsb7XtdsV2CsSLEB5zG8xOlaa+qvYfFEnI/R
    +1WPVZ2NZktvIrVUZJhZYDr3UuImHgmjqs2I+JJbtDv8A+pyJtWMI7MTffRbDQAL5
    +WbhoqnAO1rVijsAnbgKtI3Jd1JGzKL5K7QhX6ZW7uzCaSaAEIQgM0JpIUKNQ4ttx
    +X2UyT252FvdM3kuoRfDu9CdlR8PLK0uFNvfst7FQZnlrhq02FRmhysLq0bdE+qDP
    +DuAwbnEAEmw30vS/suIp4g03Ys73qVSfO4wsDXZW0AQe4U7Mr21ltu59UWiTa67F
    +RuBLi0nvey6in8RtMzEDaguIRFuYmj6LSiEeW7LfdTttJFOOZ7Xi2kV6Ky97nNrK
    +6uNFbbC0nyuFrsQkncE+6e1ajOLixpu6OtEKIRxHKYyAW3QWx4RHDQqs+Fhf53AE
    +j9OiNpsjL8Tw3hwNg7g8lW2yuzMNgDVwJ40Uc+AY0Zm2Ne9rqDD5mPr5kts6c2Iz
    +OaRdEbKaOIuexxGlVf7qsxpMoBAFG233W3HBUbB20KqQrRGLksC/MFpMFNAKqYaE
    +tdbtVcTZ0JpJpkaaSEgaEIQGahJNSo0wkmg1PHRA+YDcarzmNmtkrR5gR27L1szP
    +EiI5XnJoWsxZz2WuFaDdUGPgsE7FSuLh5Wmr4Wo+BkDQ2MXQ0FLRw8LI4sopjBtl
    +1v8A9XMsVyBxbduAq1NVjYrQQuOYvdmIFG9gVaw7GeEC46uK5ja510QBZvTSu391
    +wHRweGXmg11C+AnBdrD/AJ5Xg5ctAWp35hqDu0G/2KqR4qN7HuLSA55FuG9jT/fZ
    +TjENcMgIOawD/CeoXKos73ucMxB0+65aHaG/RdNzid7OTlN/79FbDAS5vqVOlckD
    +2ktoV6qCAmKUHSgav0WjHCxwNGtPsoMVhHPBLBrzXdKQWqFEvAPzBxP0tbuCOaNz
    +SSaNi1jx+WVjng+ITRJ5W5hIso13O6uIqxEKGqkXIFBNNBppJpA0IQgGhCEBmJpI
    +UqNNJCDdcLHxI82bkHstdYeLxELZ/Bc8ZydAnCaOGa3L5tXFtk9go3NzyNNO9PQJ
    +wvDi4N9zamyB7zuTaoRAGBpNN04pRmIOcKs9waVp7fLTSA0bmlAb8IAD5jeqixrL
    +tCYBK5zKto3ICkiw4I20F/dON1AtbppqfqVLC7LGe5KQcxsBc11eZhrbcKWhmIH0
    ++6cDT+IBrQ3f0XToyXuGxHyn90y6d4YuzBrxRHNbqyYhR9eFxDTmBx0J0KlJNU5X
    +IzyrMlhBkAduTuB6/wB1oYY39lBLXzVvpqpMGbkefRK3s9dbW00kIQaaSaAaEIQD
    +QhCAy01nP6o0HyRkjuTSgl6nK8VG0R+u5UbjaeLKtaSVkTc0jg0dys6Tq4LqhZYH
    +LlmyOe+3PcXHuSowKAStbY+GfV6TqM8gIz0D2FKiyFrfinWV+uZMLsaxt9giU88Z
    +J0u4Kf5g7QVS1mWBodatedIc0B7SR7LTwWLa/IzMb222WkrmyxXg24DfJJUZFAkg
    +VltqkJDRpyVG7zUAf97J6TtXaKlDBp5QSiEF2dw+UaV90nSZJiSNtR9f/wAUkJIj
    +JA1ddUlo9rTfJzsAfupqtmY6ktUbMpaTuC0BSBwzDsdE9Fak0aRtqkX2wncqOaQE
    +V2XG+vdO3QmOyldXl4CgzOaSWuLT3C7fqVGNzysbW8nWleXFdQwzi9jzOz9JAsf5
    +VrB9Y8ePMWA8GtCEZbVANEeJmrSyL96RuqmMy6sehgxMc/yHXsd1MvOxyEPsGloY
    +HqQcfCnPmGzj/KqZIz8NncaaEgbTVOc0IQgPE7hACGbJhYvSIjRcOFKalwQg0QUk
    +Y+Dr7LghOF/mew+4REeT0sxAFhB4UbmOifnZpym05JG9ireXM2+FW2FiGLGTM3dp
    +6q14zZAasGvuoBC0k1SnjhA11VyouJkGQEHbddMaWM0qq0U0cYI7Fd+BYT2nTiKS
    +mhrj7qbOKAC48Dm1IG0jkOLkMvfZdONBdcKJ5oKLWkmnPdyTBaZ0aiMeW0jDnBjS
    +47ALLa4yFz/1G1Zx8t1C3d2/sq7RQUtvHPqRpoEqOJxyl252Se7yn9l3EKbXYIaL
    +cONlhAyutvYq5H1iO8srHA9wLCyeKKVJy2M8vHjl7egb1DCuF+KB7hCwLpCrkj8f
    +FRYu0IUtjCCEISNG4KJxyzMI5tpQhETn+q05vw77K9hzcYtCE4wFZXabFStOtUhC
    +ok7ApWuIQhNNMnZG6EJAHZQu+coQkopRTVy55jgLhqUIQGVGS8ukcbc4qW9EIUuq
    +enG8jRxuu2H4lIQg3ZCChCCcOOqEITD/2YiWBBMRCAA+FiEE69/bIbAg7o/RUaiN
    +4wEEfeEZiXUFAlvWLooCGwMFCRLMAwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA
    +CgkQ4wEEfeEZiXUcvgD8Dd3c9PMFe8l36YcKLs1ubSEF30mu3b/s8oG7CgeBdOcA
    +/062qY6F+Hy0GK/kc5WN9pr5rvFcdS/Tz8wDq5d1shjYuQINBFvWDmMQCAC0JHbI
    +pX4rz6HzifXiVvPKKgOFdxRs4xZkOA8/sPcK3rB34waMuOgBme6jL7iJNfbC60eo
    +TIMv75i0C1MWxQReoR+UA+mQctuvpcrkzzceEYH2JWFf0NZZtT5wYoJ8JNfW1ngi
    +r/QhPRWC4fNfJQiJhWdf4sdP2BnW0hi5IIPnmkHQ44G0xBQpOqPrv7A8F97ROGYD
    +oS3LNmKmfLV9nKRBH+NmQ+zdaToNcQTOlSbMVZ/hag1F9LSmAUFcqXr9bKKk/qKj
    +RBkEweAsYppTgn0N7StNtcT9aR5zZkqJ9FBgls6LSr2H6QPiaGZeixZrywjxz2ku
    +xz5C1D92ZVAe0qhTAAMFCACyCRhU7YmWUdC3D5rMna97JhFu2fQygn5FQEuHOFao
    +abaUicXCxlW3IKQqBjOcpN6rZl+crapYVKGCGM4nMvmxEqqRBYAHLw8vc3Nfys/O
    +AXWxI6kiZlVAIX/Q0IZveFejRCoEo6bBabGSfDHWH7QqZXEo2TNWiGJ6oLOyIISl
    +x1MM4e9jRSufukrtTfsU8HDoWKycRSnaxtYOz4FAAofrCeQ6/Nf3Vf887NXXD1I6
    +xMp9vyuYqx68SrqtmX9FauagsHzmLylYI42JciTCvje09D9kAHFaidkR58DVgzPW
    +xFQCGBDO8Rrk1lVjO2gX2bVzKW1J+67ENM1YdWjiVzt9iH4EGBEIACYWIQTr39sh
    +sCDuj9FRqI3jAQR94RmJdQUCW9YOYwIbDAUJEswDAAAKCRDjAQR94RmJdRzqAQCZ
    +KJFm7j0Zug7NN+IPTqnIrPCioJkt1iGbec6SbBHh5AEAy5JEbI2ugQEePaIMGWVV
    +akWaTz0WKIOiD9Lm2ylI9J0=
    +=UAq2
    +-----END PGP PUBLIC KEY BLOCK-----
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    + + diff --git a/www/security.rst b/www/security.rst index d187c8a..f039230 100644 --- a/www/security.rst +++ b/www/security.rst @@ -312,8 +312,3 @@ correspondence:: akWaTz0WKIOiD9Lm2ylI9J0= =UAq2 -----END PGP PUBLIC KEY BLOCK----- - - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/thanks.html b/www/thanks.html index f00f201..e36ac1b 100644 --- a/www/thanks.html +++ b/www/thanks.html @@ -3,7 +3,7 @@ - + GraphicsMagick Thanks @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -134,14 +134,12 @@ Utah Raster Toolkit.
    Inventor of the eight hull algorithm used for speckle reduction.
    -
    -
    -
    Copyright © GraphicsMagick Group 2002 - 2020
    -

    This program is covered by multiple licenses, which are described in -Copyright.txt. You should have received a copy of Copyright.txt with this -package; otherwise see http://www.graphicsmagick.org/Copyright.html.

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/thanks.html.orig b/www/thanks.html.orig new file mode 100644 index 0000000..72184cc --- /dev/null +++ b/www/thanks.html.orig @@ -0,0 +1,147 @@ + + + + + + +GraphicsMagick Thanks + + + + + + + +
    +

    GraphicsMagick Thanks

    + + + + +

    We would like to thank the following organizations or individuals who +may have not contributed code but contributed substantially in other +ways:

    + +
    +

    Fuzz Testing

    +
    +
      +
    • Gustavo Grieco
    • +
    • Agostino Sarubbo
    • +
    • Jodie Cunningham
    • +
    • Gynvael Coldwind and Mateusz Jurczyk of the Google Security Team
    • +
    • Hanno Böck
    • +
    • Tobias Ospelt
    • +
    • Michal Zalewski
    • +
    • Moshe Kaplan
    • +
    +
    +
    +
    +

    Security Analysis/Reports

    +
    +
      +
    • John Lightsey
    • +
    • David Chan
    • +
    • Federico Larumbe
    • +
    • Petr Gajdos
    • +
    +
    +
    +
    +

    Static Code Analysis

    +
    +
      +
    • Coverity was used (free of charge) to perform static code +analysis of the software. After resolving many issues, there are +now zero reported defects per 1000 lines of code.
    • +
    +
    +
    +
    +

    Software Analysis Tools

    +
    +
      +
    • American fuzzy lop was used (by many) to produce and discover +many of the files which caused problems for the software.
    • +
    • QuickFuzz was used (by Gustavo Grieco) to discover issues in the +SVG renderer. QuickFuzz provides specific support for a set of +file formats and is very good at chasing down and isolating +weaknesses.
    • +
    • AddressSanitizer (ASan) was used to detect and isolate memory +access issues.
    • +
    • Valgrind was used to detect and isolate memory access issues as +well as memory leaks.
    • +
    +
    +
    +
    +

    Additional Acknowledgements

    +
    +
    David Pensak, E. I. du Pont de Nemours and Company
    +
    For providing the computing environment that made +developing ImageMagick possible.
    +
    Alexander Zimmermann
    +
    Responsible for the ImageMagick Linux binary +distributions for many years. His efforts are very much +appreciated.
    +
    Paul Heckbert, Carnegie Mellon University
    +
    Image resizing is based on Paul Heckbert's Zoom program.
    +
    Paul Raveling, USC Information Sciences Institute
    +
    The spatial subdivision color reduction algorithm is +based on his Img software.
    +
    Michael Halle, Spatial Imaging Group at MIT
    +
    For the initial implementation of Alan Paeth's image +rotation algorithm.
    +
    Peder Langlo, Hewlett Packard
    +
    Made hundreds of suggestions and bug reports. Without +Peder, this software would not be nearly as useful as it +is today.
    +
    Rod Bogart and John W. Peterson, University of Utah
    +
    Image compositing is loosely based on rlecomp of the +Utah Raster Toolkit.
    +
    Alvy Ray Smith and Eric Ray Lyons
    +
    HWB color transform and algorithm.
    +
    Thomas R Crimmins
    +
    Inventor of the eight hull algorithm used for speckle +reduction.
    +
    +
    +
    +
    Copyright © GraphicsMagick Group 2002 - 2020
    +
    +

    This program is covered by multiple licenses, which are described in +Copyright.txt. You should have received a copy of Copyright.txt with this +package; otherwise see http://www.graphicsmagick.org/Copyright.html.

    +
    +
    + + diff --git a/www/thanks.rst b/www/thanks.rst index 0975ac9..ad53489 100644 --- a/www/thanks.rst +++ b/www/thanks.rst @@ -115,14 +115,3 @@ Alvy Ray Smith and Eric Ray Lyons Thomas R Crimmins Inventor of the eight hull algorithm used for speckle reduction. - - ---------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -| Copyright |copy| GraphicsMagick Group 2002 - 2020 - -This program is covered by multiple licenses, which are described in -Copyright.txt. You should have received a copy of Copyright.txt with this -package; otherwise see http://www.graphicsmagick.org/Copyright.html. diff --git a/www/time.html b/www/time.html index 7608c7a..8ee20ba 100644 --- a/www/time.html +++ b/www/time.html @@ -118,7 +118,7 @@ convert input.ppm -gaussian 0x2 output.ppm 22.60s user 0.00s system 2354% cpu
  • total - the total elapsed time consumed. -

    +

    Back to Contents  

    @@ -134,7 +134,7 @@ color="#00B04F">

    The time command reqires no options other than the gm command to execute.

    -

    +

    Back to Contents  

    diff --git a/www/tools.html b/www/tools.html index 8d80374..4a47e6e 100644 --- a/www/tools.html +++ b/www/tools.html @@ -3,7 +3,7 @@ - + GraphicsMagick Tools @@ -15,23 +15,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -177,8 +177,12 @@ a rotated version of them in TIFF format:

    Montage creates a composite by combining several separate images. The images are tiled on a composite image with the name of the image and its properties optionally appearing just below the individual tile.

    -

    Copyright © GraphicsMagick Group 2002 - 2020

    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/tools.html.orig b/www/tools.html.orig new file mode 100644 index 0000000..6aa0464 --- /dev/null +++ b/www/tools.html.orig @@ -0,0 +1,184 @@ + + + + + + +GraphicsMagick Tools + + + + + + + + + +
    +

    GraphicsMagick Tools

    + + + + + +
    +

    Animate: animate a sequence of images

    +

    Animate displays a sequence of images or an animation on any display +running an X server.

    +
    +
    +

    Compare: compare two images using statistics and/or visual differencing

    +

    Compare compares two images using either a specified standard +statistical metric (MAE, MSE, PAE, PSNR, RMSE), or a specified visual +differencing method (assign, threshold, tint, xor). The statistical +comparison produces a textual display of metric values while the visual +differencing method writes a difference image with the differences +annotated using the specified algorithm. For example:

    +
    +% gm convert input.jpg -blur 0x1.5 output.jpg
    +% gm compare -metric MSE input.jpg output.jpg
    +Image Difference (MeanSquaredError):
    +           Normalized    Absolute
    +          ============  ==========
    +     Red: 0.0014374614       94.2
    +   Green: 0.0014396270       94.3
    +    Blue: 0.0014464548       94.8
    +   Total: 0.0014411811       94.4
    +
    +
    +
    +

    Composite: composite images together

    +

    Composite blends and merges images to create new images.

    +
    +
    +

    Conjure: execute a Magick Scripting Language (MSL) XML script

    +

    Conjure interprets and executes scripts in the Magick Scripting Language +(MSL). The interpreter is called conjure and here is an example script:

    +
    +<?xml version="1.0" encoding="UTF-8"?>
    +<image size="400x400" >
    +  <read filename="image.gif" />
    +  <get width="base-width" height="base-height" />
    +  <resize geometry="%[dimensions]" />
    +  <get width="width" height="height" />
    +  <print output=
    +    "Image sized from %[base-width]x%[base-height]
    +     to %[width]x%[height].\n" />
    +  <write filename="image.png" />
    +</image>
    +
    +

    which is invoked like

    +
    +conjure -dimensions 400x400 incantation.msl
    +
    +

    All operations closely follow the key/value pairs defined in the +PerlMagick documentation, unless otherwise noted.

    +
    +
    +

    Convert: convert an image or sequence of images

    +

    Convert converts an input file using one image format to an output file +with using any of the supported writeable image formats. A large number +of image processing operations may be performed on the image before it is +written. By default, the input image format is determined by its magic +number. To specify a particular image format, precede the filename with +an image format name and a colon (i.e. ps:image) or specify the image +type as the filename suffix (i.e. image.ps). Specify file as - for +standard input or output. If file has the extension .Z, the file is +decoded with uncompress. For example:

    +
    +% gm convert input.jpg -rotate 90 rotated.tiff
    +
    +
    +
    +

    Display: display an image on a workstation running X

    +

    Display is a machine architecture independent image processing and +display program. It can display an image on any workstation display +running an X server. The image can be displayed as background image of +any window.

    +
    +
    +

    Identify: describe an image or image sequence

    +

    Identify describes the format and characteristics of one or more image +files. It will also report if an image is incomplete or corrupt. The +information displayed includes the scene number, the file name, the width +and height of the image, whether the image is colormapped or not, the +number of colors in the image, the number of bytes in the image, the +format of the image (JPEG, PNM, etc.), and finally the number of seconds +it took to read and process the image. For example:

    +
    +% gm identify tiger-1200-rgb16.tiff
    +tiger-1200-rgb16.tiff TIFF 9083x9450+0+0 DirectClass 16-bit 491.2M 0.000u 0:01
    +
    +
    +
    +

    Import: capture an application or X server screen

    +

    Import reads an image from any visible window on an X server and outputs +it as an image file. You can capture a single window, the entire screen, +or any rectangular portion of the screen.

    +

    The target window can be specified by id, name, or may be selected by +clicking the mouse in the desired window. If you press a button and then +drag, a rectangle will form which expands and contracts as the mouse +moves. To save the portion of the screen defined by the rectangle, just +release the button. The keyboard bell is rung once at the beginning of +the screen capture and twice when it completes. For example:

    +
    +% gm import capture.tiff
    +
    +
    +
    +

    Mogrify: transform an image or sequence of images

    +

    Mogrify transforms an image or a sequence of images "in place". These +transforms include image scaling, image rotation, color reduction, and +others. The transmogrified image overwrites the original image. Mogrify +is very similar to Convert except that it can operate on many images at +once, and overwrites the input files by default. However, Mogrify may +also be used to convert file formats, and send modified files to another +directory. For example, the following reads several JPEG files and writes +a rotated version of them in TIFF format:

    +
    +% gm mogrify -rotate 90 -format tiff image1.jpg image2.jpg image3.jpg
    +
    +
    +
    +

    Montage: create a composite image (in a grid) from separate images

    +

    Montage creates a composite by combining several separate images. The +images are tiled on a composite image with the name of the image and its +properties optionally appearing just below the individual tile.

    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    +
    + + diff --git a/www/tools.rst b/www/tools.rst index 5edb2d2..d9c86c6 100644 --- a/www/tools.rst +++ b/www/tools.rst @@ -167,8 +167,3 @@ Montage: create a composite image (in a grid) from separate images Montage_ creates a composite by combining several separate images. The images are tiled on a composite image with the name of the image and its properties optionally appearing just below the individual tile. - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 - diff --git a/www/utilities.html b/www/utilities.html index 7779217..c6fb87b 100644 --- a/www/utilities.html +++ b/www/utilities.html @@ -3,7 +3,7 @@ - + GraphicsMagick Utilities @@ -15,23 +15,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -96,8 +96,11 @@ commands are as follows:

    -
    -

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/utilities.html.orig b/www/utilities.html.orig new file mode 100644 index 0000000..c63ebda --- /dev/null +++ b/www/utilities.html.orig @@ -0,0 +1,103 @@ + + + + + + +GraphicsMagick Utilities + + + + + + + + + +
    +

    GraphicsMagick Utilities

    + + + + +

    GraphicsMagick provides a powerful command line utility gm, which +may be used to access all GraphicsMagick functions. Gm uses a +consistent set of options (see options documentation). GraphicsMagick provides access to major +commands via a single executable command-line program; for example, to +use the "convert" sub-command, type gm convert .... The available +commands are as follows:

    + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    animateAnimate a sequence of images
    batchExecutes an arbitary number of utility commands
    benchmarkMeasure and report utility command performance.
    compareCompare two images using statistics and/or visual differencing
    compositeComposite images together
    conjureExecute a Magick Scripting Language (MSL) XML script
    convertConvert an image or sequence of images
    displayDisplay an image on a workstation running X
    identifyDescribe an image or image sequence
    importCapture an application or X server screen
    mogrifyTransform an image or sequence of images
    montageCreate a composite image (in a grid) from separate images
    timeTime the execution of a utility command.
    versionReport GraphicsMagick version, features, and build options.
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    + + diff --git a/www/utilities.rst b/www/utilities.rst index f1b212f..33eacf1 100644 --- a/www/utilities.rst +++ b/www/utilities.rst @@ -61,9 +61,3 @@ montage_ Create a composite image (in a grid) from separate images time_ Time the execution of a utility command. version_ Report GraphicsMagick version, features, and build options. =============== ========================================================================= - --------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2002 - 2020 diff --git a/www/version.html b/www/version.html index 96ea0b0..1b4e4a2 100644 --- a/www/version.html +++ b/www/version.html @@ -149,7 +149,7 @@ color="#00B04F"> LIBS = ... -

    +

    Back to Contents  

    @@ -164,7 +164,7 @@ color="#00B04F">

    The version command does not currently support any options.

    -

    +

    Back to Contents  

    diff --git a/www/wand/drawing_wand.html b/www/wand/drawing_wand.html index 011bd69..887a5ae 100644 --- a/www/wand/drawing_wand.html +++ b/www/wand/drawing_wand.html @@ -3,7 +3,7 @@ - + drawing_wand @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -3241,5 +3241,10 @@ DrawingWand *NewDrawingWand( void );
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/wand/drawing_wand.html.orig b/www/wand/drawing_wand.html.orig new file mode 100644 index 0000000..596b9c9 --- /dev/null +++ b/www/wand/drawing_wand.html.orig @@ -0,0 +1,3245 @@ + + + + + + +drawing_wand + + + + + + + +
    +

    drawing_wand

    +

    Wand vector drawing interfaces

    + +
    +

    Contents

    + +
    +
    +

    CloneDrawingWand

    +
    +

    Synopsis

    +
    +DrawingWand *CloneDrawingWand( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    CloneDrawingWand() returns a new drawing wand which is a full (deep) copy +of an existing drawing wand.

    +

    The format of the CloneDrawingWand method is:

    +
    +DrawingWand *CloneDrawingWand( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand to copy
    +
    +
    +
    +
    +

    DestroyDrawingWand

    +
    +

    Synopsis

    +
    +void DestroyDrawingWand( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DestroyDrawingWand method is:

    +
    +void DestroyDrawingWand( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand to destroy.
    +
    +
    +
    +
    +

    DrawAnnotation

    +
    +

    Synopsis

    +
    +void DrawAnnotation( DrawingWand *drawing_wand, const double x, const double y,
    +                     const unsigned char *text );
    +
    +
    +
    +

    Description

    +

    DrawAnnotation() draws text on the image.

    +

    The format of the DrawAnnotation method is:

    +
    +void DrawAnnotation( DrawingWand *drawing_wand, const double x, const double y,
    +                     const unsigned char *text );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    x ordinate to left of text
    +
    y:
    +
    y ordinate to text baseline
    +
    text:
    +
    text to draw
    +
    +
    +
    +
    +

    DrawAffine

    +
    +

    Synopsis

    +
    +void DrawAffine( DrawingWand *drawing_wand, const AffineMatrix *affine );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawAffine method is:

    +
    +void DrawAffine( DrawingWand *drawing_wand, const AffineMatrix *affine );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    Drawing drawing_wand
    +
    affine:
    +
    Affine matrix parameters
    +
    +
    +
    +
    +

    DrawAllocateWand

    +
    +

    Synopsis

    +
    +DrawingWand DrawAllocateWand( const DrawInfo *draw_info, Image *image );
    +
    +
    +
    +

    Description

    +

    DrawAllocateWand() allocates an initial drawing wand which is an +opaque handle required by the remaining drawing methods.

    +

    The format of the DrawAllocateWand method is:

    +
    +DrawingWand DrawAllocateWand( const DrawInfo *draw_info, Image *image );
    +
    +

    A description of each parameter follows:

    +
    +
    draw_info:
    +
    Initial drawing defaults. Set to NULL to use +ImageMagick defaults.
    +
    image:
    +
    The image to draw on.
    +
    +
    +
    +
    +

    DrawArc

    +
    +

    Synopsis

    +
    +void DrawArc( DrawingWand *drawing_wand, const double sx, const double sy, const double ex,
    +              const double ey, const double sd, const double ed );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawArc method is:

    +
    +void DrawArc( DrawingWand *drawing_wand, const double sx, const double sy, const double ex,
    +              const double ey, const double sd, const double ed );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    sx:
    +
    starting x ordinate of bounding rectangle
    +
    sy:
    +
    starting y ordinate of bounding rectangle
    +
    ex:
    +
    ending x ordinate of bounding rectangle
    +
    ey:
    +
    ending y ordinate of bounding rectangle
    +
    sd:
    +
    starting degrees of rotation
    +
    ed:
    +
    ending degrees of rotation
    +
    +
    +
    +
    +

    DrawBezier

    +
    +

    Synopsis

    +
    +void DrawBezier( DrawingWand *drawing_wand, const unsigned long number_coordinates,
    +                 const PointInfo *coordinates );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawBezier method is:

    +
    +void DrawBezier( DrawingWand *drawing_wand, const unsigned long number_coordinates,
    +                 const PointInfo *coordinates );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    number_coordinates:
    +
    number of coordinates
    +
    coordinates:
    +
    coordinates
    +
    +
    +
    +
    +

    DrawCircle

    +
    +

    Synopsis

    +
    +void DrawCircle( DrawingWand *drawing_wand, const double ox, const double oy, const double px,
    +                 const double py );
    +
    +
    +
    +

    Description

    +

    DrawCircle() draws a circle on the image.

    +

    The format of the DrawCircle method is:

    +
    +void DrawCircle( DrawingWand *drawing_wand, const double ox, const double oy, const double px,
    +                 const double py );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    ox:
    +
    origin x ordinate
    +
    oy:
    +
    origin y ordinate
    +
    px:
    +
    perimeter x ordinate
    +
    py:
    +
    perimeter y ordinate
    +
    +
    +
    +
    +

    DrawClearException

    +
    +

    Synopsis

    +
    +MagickPassFail DrawClearException( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    DrawClearException() clears any existing exception from the drawing wand.

    +

    The format of the DrawGetException method is:

    +
    +MagickPassFail DrawClearException( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawGetClipPath

    +
    +

    Synopsis

    +
    +char *DrawGetClipPath( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetClipPath method is:

    +
    +char *DrawGetClipPath( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetClipPath

    +
    +

    Synopsis

    +
    +void DrawSetClipPath( DrawingWand *drawing_wand, const char *clip_path );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetClipPath method is:

    +
    +void DrawSetClipPath( DrawingWand *drawing_wand, const char *clip_path );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    clip_path:
    +
    name of clipping path to associate with image
    +
    +
    +
    +
    +

    DrawGetClipRule

    +
    +

    Synopsis

    +
    +FillRule DrawGetClipRule( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetClipRule method is:

    +
    +FillRule DrawGetClipRule( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetClipRule

    +
    +

    Synopsis

    +
    +void DrawSetClipRule( DrawingWand *drawing_wand, const FillRule fill_rule );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetClipRule method is:

    +
    +void DrawSetClipRule( DrawingWand *drawing_wand, const FillRule fill_rule );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    fill_rule:
    +
    fill rule (EvenOddRule or NonZeroRule)
    +
    +
    +
    +
    +

    DrawGetClipUnits

    +
    +

    Synopsis

    +
    +ClipPathUnits DrawGetClipUnits( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    DrawGetClipUnits() returns the interpretation of clip path units.

    +

    The format of the DrawGetClipUnits method is:

    +
    +ClipPathUnits DrawGetClipUnits( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawGetException

    +
    +

    Synopsis

    +
    +char *DrawGetException( const DrawingWand *drawing_wand, ExceptionType *severity );
    +
    +
    +
    +

    Description

    +

    DrawGetException() obtains error information associated with the last +exception (if any). If an exception did occur, an allocated text string +is returned which contains a detailed description of the exception. This +string must be deallocated by the user once it is no longer needed.

    +

    The format of the DrawGetException method is:

    +
    +char *DrawGetException( const DrawingWand *drawing_wand, ExceptionType *severity );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    severity:
    +
    Enumeration corresponding to last thrown exception.
    +
    +
    +
    +
    +

    DrawSetClipUnits

    +
    +

    Synopsis

    +
    +void DrawSetClipUnits( DrawingWand *drawing_wand, const ClipPathUnits clip_units );
    +
    +
    +
    +

    Description

    +

    DrawSetClipUnits() sets the interpretation of clip path units.

    +

    The format of the DrawSetClipUnits method is:

    +
    +void DrawSetClipUnits( DrawingWand *drawing_wand, const ClipPathUnits clip_units );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    clip_units:
    +
    units to use (UserSpace, UserSpaceOnUse, or ObjectBoundingBox)
    +
    +
    +
    +
    +

    DrawColor

    +
    +

    Synopsis

    +
    +void DrawColor( DrawingWand *drawing_wand, const double x, const double y,
    +                const PaintMethod paintMethod );
    +
    +
    +
    +

    Description

    +

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

    +

    PointMethod: Recolors the target pixel +ReplaceMethod: Recolor any pixel that matches the target pixel. +FloodfillMethod: Recolors target pixels and matching neighbors. +FillToBorderMethod: Recolor target pixels and neighbors not matching +ResetMethod: Recolor all pixels.

    +

    The format of the DrawColor method is:

    +
    +void DrawColor( DrawingWand *drawing_wand, const double x, const double y,
    +                const PaintMethod paintMethod );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    x ordinate
    +
    y:
    +
    y ordinate
    +
    paintMethod:
    +
    paint method
    +
    +
    +
    +
    +

    DrawComment

    +
    +

    Synopsis

    +
    +void DrawComment( DrawingWand *drawing_wand, const char *comment );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawComment method is:

    +
    +void DrawComment( DrawingWand *drawing_wand, const char *comment );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    comment:
    +
    comment text
    +
    +
    +
    +
    +

    DrawEllipse

    +
    +

    Synopsis

    +
    +void DrawEllipse( DrawingWand *drawing_wand, const double ox, const double oy, const double rx,
    +                  const double ry, const double start, const double end );
    +
    +
    +
    +

    Description

    +

    DrawEllipse() draws an ellipse on the image.

    +

    The format of the DrawEllipse method is:

    +
    +void DrawEllipse( DrawingWand *drawing_wand, const double ox, const double oy, const double rx,
    +                  const double ry, const double start, const double end );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    ox:
    +
    origin x ordinate
    +
    oy:
    +
    origin y ordinate
    +
    rx:
    +
    radius in x
    +
    ry:
    +
    radius in y
    +
    start:
    +
    starting rotation in degrees
    +
    end:
    +
    ending rotation in degrees
    +
    +
    +
    +
    +

    DrawGetFillColor

    +
    +

    Synopsis

    +
    +void DrawGetFillColor( const DrawingWand *drawing_wand, PixelWand *fill_color );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFillColor method is:

    +
    +void DrawGetFillColor( const DrawingWand *drawing_wand, PixelWand *fill_color );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    fill_color:
    +
    Return the fill color.
    +
    +
    +
    +
    +

    DrawSetFillColor

    +
    +

    Synopsis

    +
    +void DrawSetFillColor( DrawingWand *drawing_wand, const PixelWand *fill_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFillColor method is:

    +
    +void DrawSetFillColor( DrawingWand *drawing_wand, const PixelWand *fill_wand );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    fill_wand:
    +
    fill wand.
    +
    +
    +
    +
    +

    DrawSetFillPatternURL

    +
    +

    Synopsis

    +
    +void DrawSetFillPatternURL( DrawingWand *drawing_wand, const char *fill_url );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawSetFillPatternURL method is:

    +
    +void DrawSetFillPatternURL( DrawingWand *drawing_wand, const char *fill_url );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    fill_url:
    +
    URL to use to obtain fill pattern.
    +
    +
    +
    +
    +

    DrawGetFillOpacity

    +
    +

    Synopsis

    +
    +double DrawGetFillOpacity( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFillOpacity method is:

    +
    +double DrawGetFillOpacity( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetFillOpacity

    +
    +

    Synopsis

    +
    +void DrawSetFillOpacity( DrawingWand *drawing_wand, const double fill_opacity );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFillOpacity method is:

    +
    +void DrawSetFillOpacity( DrawingWand *drawing_wand, const double fill_opacity );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    fill_opacity:
    +
    fill opacity
    +
    +
    +
    +
    +

    DrawGetFillRule

    +
    +

    Synopsis

    +
    +FillRule DrawGetFillRule( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFillRule method is:

    +
    +FillRule DrawGetFillRule( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetFillRule

    +
    +

    Synopsis

    +
    +void DrawSetFillRule( DrawingWand *drawing_wand, const FillRule fill_rule );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFillRule method is:

    +
    +void DrawSetFillRule( DrawingWand *drawing_wand, const FillRule fill_rule );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    fill_rule:
    +
    fill rule (EvenOddRule or NonZeroRule)
    +
    +
    +
    +
    +

    DrawGetFont

    +
    +

    Synopsis

    +
    +char *DrawGetFont( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFont method is:

    +
    +char *DrawGetFont( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetFont

    +
    +

    Synopsis

    +
    +void DrawSetFont( DrawingWand *drawing_wand, const char *font_name );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFont method is:

    +
    +void DrawSetFont( DrawingWand *drawing_wand, const char *font_name );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    font_name:
    +
    font name
    +
    +
    +
    +
    +

    DrawGetFontFamily

    +
    +

    Synopsis

    +
    +char *DrawGetFontFamily( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetFontFamily method is:

    +
    +char *DrawGetFontFamily( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetFontFamily

    +
    +

    Synopsis

    +
    +void DrawSetFontFamily( DrawingWand *drawing_wand, const char *font_family );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFontFamily method is:

    +
    +void DrawSetFontFamily( DrawingWand *drawing_wand, const char *font_family );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    font_family:
    +
    font family
    +
    +
    +
    +
    +

    DrawGetFontSize

    +
    +

    Synopsis

    +
    +double DrawGetFontSize( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFontSize method is:

    +
    +double DrawGetFontSize( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetFontSize

    +
    +

    Synopsis

    +
    +void DrawSetFontSize( DrawingWand *drawing_wand, const double pointsize );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFontSize method is:

    +
    +void DrawSetFontSize( DrawingWand *drawing_wand, const double pointsize );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    pointsize:
    +
    text pointsize
    +
    +
    +
    +
    +

    DrawGetFontStretch

    +
    +

    Synopsis

    +
    +StretchType DrawGetFontStretch( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFontStretch method is:

    +
    +StretchType DrawGetFontStretch( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetFontStretch

    +
    +

    Synopsis

    +
    +void DrawSetFontStretch( DrawingWand *drawing_wand, const StretchType font_stretch );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFontStretch method is:

    +
    +void DrawSetFontStretch( DrawingWand *drawing_wand, const StretchType font_stretch );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    font_stretch:
    +
    font stretch (NormalStretch, UltraCondensedStretch, +CondensedStretch, SemiCondensedStretch, +SemiExpandedStretch, ExpandedStretch, +ExtraExpandedStretch, UltraExpandedStretch, AnyStretch)
    +
    +
    +
    +
    +

    DrawGetFontStyle

    +
    +

    Synopsis

    +
    +StyleType DrawGetFontStyle( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFontStyle method is:

    +
    +StyleType DrawGetFontStyle( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetFontStyle

    +
    +

    Synopsis

    +
    +void DrawSetFontStyle( DrawingWand *drawing_wand, const StyleType style );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFontStyle method is:

    +
    +void DrawSetFontStyle( DrawingWand *drawing_wand, const StyleType style );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    style:
    +
    font style (NormalStyle, ItalicStyle, ObliqueStyle, AnyStyle)
    +
    +
    +
    +
    +

    DrawGetFontWeight

    +
    +

    Synopsis

    +
    +unsigned long DrawGetFontWeight( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetFontWeight method is:

    +
    +unsigned long DrawGetFontWeight( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetFontWeight

    +
    +

    Synopsis

    +
    +void DrawSetFontWeight( DrawingWand *drawing_wand, const unsigned long font_weight );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetFontWeight method is:

    +
    +void DrawSetFontWeight( DrawingWand *drawing_wand, const unsigned long font_weight );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    font_weight:
    +
    font weight (valid range 100-900)
    +
    +
    +
    +
    +

    DrawGetGravity

    +
    +

    Synopsis

    +
    +GravityType DrawGetGravity( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetGravity method is:

    +
    +GravityType DrawGetGravity( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetGravity

    +
    +

    Synopsis

    +
    +void DrawSetGravity( DrawingWand *drawing_wand, const GravityType gravity );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetGravity method is:

    +
    +void DrawSetGravity( DrawingWand *drawing_wand, const GravityType gravity );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    gravity:
    +
    positioning gravity (NorthWestGravity, NorthGravity, +NorthEastGravity, WestGravity, CenterGravity, +EastGravity, SouthWestGravity, SouthGravity, +SouthEastGravity)
    +
    +
    +
    +
    +

    DrawComposite

    +
    +

    Synopsis

    +
    +void DrawComposite( DrawingWand *drawing_wand, const CompositeOperator composite_operator,
    +                    const double x, const double y, const double width, const double height,
    +                    const Image *image );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawComposite method is:

    +
    +void DrawComposite( DrawingWand *drawing_wand, const CompositeOperator composite_operator,
    +                    const double x, const double y, const double width, const double height,
    +                    const Image *image );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    composite_operator:
    +
    composition operator
    +
    x:
    +
    x ordinate of top left corner
    +
    y:
    +
    y ordinate of top left corner
    +
    width:
    +
    Width to resize image to prior to compositing. Specify zero to +use existing width.
    +
    height:
    +
    Height to resize image to prior to compositing. Specify zero +to use existing height.
    +
    image:
    +
    Image to composite
    +
    +
    +
    +
    +

    DrawLine

    +
    +

    Synopsis

    +
    +void DrawLine( DrawingWand *drawing_wand, const double sx, const double sy, const double ex,
    +               const double ey );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawLine method is:

    +
    +void DrawLine( DrawingWand *drawing_wand, const double sx, const double sy, const double ex,
    +               const double ey );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    sx:
    +
    starting x ordinate
    +
    sy:
    +
    starting y ordinate
    +
    ex:
    +
    ending x ordinate
    +
    ey:
    +
    ending y ordinate
    +
    +
    +
    +
    +

    DrawMatte

    +
    +

    Synopsis

    +
    +void DrawMatte( DrawingWand *drawing_wand, const double x, const double y,
    +                const PaintMethod paint_method );
    +
    +
    +
    +

    Description

    +

    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:

    +

    PointMethod: Select the target pixel +ReplaceMethod: Select any pixel that matches the target pixel. +FloodfillMethod: Select the target pixel and matching neighbors. +FillToBorderMethod: Select the target pixel and neighbors not matching +border color. +ResetMethod: Select all pixels.

    +

    The format of the DrawMatte method is:

    +
    +void DrawMatte( DrawingWand *drawing_wand, const double x, const double y,
    +                const PaintMethod paint_method );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    x ordinate
    +
    y:
    +
    y ordinate
    +
    +

    o paint_method:

    +
    +
    +
    +

    DrawPathClose

    +
    +

    Synopsis

    +
    +void DrawPathClose( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    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).

    +

    The format of the DrawPathClose method is:

    +
    +void DrawPathClose( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawPathCurveToAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathCurveToAbsolute( DrawingWand *drawing_wand, const double x1, const double y1,
    +                              const double x2, const double y2, const double x,
    +                              const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToAbsolute method is:

    +
    +void DrawPathCurveToAbsolute( DrawingWand *drawing_wand, const double x1, const double y1,
    +                              const double x2, const double y2, const double x,
    +                              const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x1:
    +
    x ordinate of control point for curve beginning
    +
    y1:
    +
    y ordinate of control point for curve beginning
    +
    x2:
    +
    x ordinate of control point for curve ending
    +
    y2:
    +
    y ordinate of control point for curve ending
    +
    x:
    +
    x ordinate of the end of the curve
    +
    y:
    +
    y ordinate of the end of the curve
    +
    +
    +
    +
    +

    DrawPathCurveToRelative

    +
    +

    Synopsis

    +
    +void DrawPathCurveToRelative( DrawingWand *drawing_wand, const double x1, const double y1,
    +                              const double x2, const double y2, const double x,
    +                              const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToRelative method is:

    +
    +void DrawPathCurveToRelative( DrawingWand *drawing_wand, const double x1, const double y1,
    +                              const double x2, const double y2, const double x,
    +                              const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x1:
    +
    x ordinate of control point for curve beginning
    +
    y1:
    +
    y ordinate of control point for curve beginning
    +
    x2:
    +
    x ordinate of control point for curve ending
    +
    y2:
    +
    y ordinate of control point for curve ending
    +
    x:
    +
    x ordinate of the end of the curve
    +
    y:
    +
    y ordinate of the end of the curve
    +
    +
    +
    +
    +

    DrawPathCurveToQuadraticBezierAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathCurveToQuadraticBezierAbsolute( DrawingWand *drawing_wand, const double x1,
    +                                             const double y1, onst double x, const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToQuadraticBezierAbsolute method is:

    +
    +void DrawPathCurveToQuadraticBezierAbsolute( DrawingWand *drawing_wand, const double x1,
    +                                             const double y1, onst double x, const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x1:
    +
    x ordinate of the control point
    +
    y1:
    +
    y ordinate of the control point
    +
    x:
    +
    x ordinate of final point
    +
    y:
    +
    y ordinate of final point
    +
    +
    +
    +
    +

    DrawPathCurveToQuadraticBezierRelative

    +
    +

    Synopsis

    +
    +void DrawPathCurveToQuadraticBezierRelative( DrawingWand *drawing_wand, const double x1,
    +                                             const double y1, const double x,
    +                                             const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToQuadraticBezierRelative method is:

    +
    +void DrawPathCurveToQuadraticBezierRelative( DrawingWand *drawing_wand, const double x1,
    +                                             const double y1, const double x,
    +                                             const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x1:
    +
    x ordinate of the control point
    +
    y1:
    +
    y ordinate of the control point
    +
    x:
    +
    x ordinate of final point
    +
    y:
    +
    y ordinate of final point
    +
    +
    +
    +
    +

    DrawPathCurveToQuadraticBezierSmoothAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathCurveToQuadraticBezierSmoothAbsolute( DrawingWand *drawing_wand, const double x,
    +                                                   const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToQuadraticBezierSmoothAbsolute method is:

    +
    +void DrawPathCurveToQuadraticBezierSmoothAbsolute( DrawingWand *drawing_wand, const double x,
    +                                                   const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    x ordinate of final point
    +
    y:
    +
    y ordinate of final point
    +
    +
    +
    +
    +

    DrawPathCurveToQuadraticBezierSmoothRelative

    +
    +

    Synopsis

    +
    +void DrawPathCurveToQuadraticBezierSmoothRelative( DrawingWand *drawing_wand, const double x,
    +                                                   const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToQuadraticBezierSmoothRelative method is:

    +
    +void DrawPathCurveToQuadraticBezierSmoothRelative( DrawingWand *drawing_wand, const double x,
    +                                                   const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    x ordinate of final point
    +
    y:
    +
    y ordinate of final point
    +
    +
    +
    +
    +

    DrawPathCurveToSmoothAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathCurveToSmoothAbsolute( DrawingWand *drawing_wand, const double x2const double y2,
    +                                    const double x, const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToSmoothAbsolute method is:

    +
    +void DrawPathCurveToSmoothAbsolute( DrawingWand *drawing_wand, const double x2const double y2,
    +                                    const double x, const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x2:
    +
    x ordinate of second control point
    +
    y2:
    +
    y ordinate of second control point
    +
    x:
    +
    x ordinate of termination point
    +
    y:
    +
    y ordinate of termination point
    +
    +
    +
    +
    +

    DrawPathCurveToSmoothRelative

    +
    +

    Synopsis

    +
    +void DrawPathCurveToSmoothRelative( DrawingWand *drawing_wand, const double x2,
    +                                    const double y2, const double x, const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathCurveToSmoothRelative method is:

    +
    +void DrawPathCurveToSmoothRelative( DrawingWand *drawing_wand, const double x2,
    +                                    const double y2, const double x, const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x2:
    +
    x ordinate of second control point
    +
    y2:
    +
    y ordinate of second control point
    +
    x:
    +
    x ordinate of termination point
    +
    y:
    +
    y ordinate of termination point
    +
    +
    +
    +
    +

    DrawPathEllipticArcAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathEllipticArcAbsolute( DrawingWand *drawing_wand, const double rx, const double ry,
    +                                  const double x_axis_rotation,
    +                                  unsigned int large_arc_flag, unsigned int sweep_flag,
    +                                  const double x, const double y );
    +
    +
    +
    +

    Description

    +

    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 automatically 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.

    +

    The format of the DrawPathEllipticArcAbsolute method is:

    +
    +void DrawPathEllipticArcAbsolute( DrawingWand *drawing_wand, const double rx, const double ry,
    +                                  const double x_axis_rotation,
    +                                  unsigned int large_arc_flag, unsigned int sweep_flag,
    +                                  const double x, const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    rx:
    +
    x radius
    +
    ry:
    +
    y radius
    +
    x_axis_rotation:
    +
    indicates how the ellipse as a whole is rotated +relative to the current coordinate system
    +
    large_arc_flag:
    +
    If non-zero (true) then draw the larger of the +available arcs
    +
    sweep_flag:
    +
    If non-zero (true) then draw the arc matching a +clock-wise rotation
    +
    +
    +
    +
    +

    DrawPathEllipticArcRelative

    +
    +

    Synopsis

    +
    +void DrawPathEllipticArcRelative( DrawingWand *drawing_wand, const double rx, const double ry,
    +                                  const double x_axis_rotation,
    +                                  unsigned int large_arc_flag, unsigned int sweep_flag,
    +                                  const double x, const double y );
    +
    +
    +
    +

    Description

    +

    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 automatically 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.

    +

    The format of the DrawPathEllipticArcRelative method is:

    +
    +void DrawPathEllipticArcRelative( DrawingWand *drawing_wand, const double rx, const double ry,
    +                                  const double x_axis_rotation,
    +                                  unsigned int large_arc_flag, unsigned int sweep_flag,
    +                                  const double x, const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    rx:
    +
    x radius
    +
    ry:
    +
    y radius
    +
    x_axis_rotation:
    +
    indicates how the ellipse as a whole is rotated +relative to the current coordinate system
    +
    large_arc_flag:
    +
    If non-zero (true) then draw the larger of the +available arcs
    +
    sweep_flag:
    +
    If non-zero (true) then draw the arc matching a +clock-wise rotation
    +
    +
    +
    +
    +

    DrawPathFinish

    +
    +

    Synopsis

    +
    +void DrawPathFinish( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    DrawPathFinish() terminates the current path.

    +

    The format of the DrawPathFinish method is:

    +
    +void DrawPathFinish( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawPathLineToAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathLineToAbsolute( DrawingWand *drawing_wand, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPathLineToAbsolute method is:

    +
    +void DrawPathLineToAbsolute( DrawingWand *drawing_wand, const double x, const double y );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    target x ordinate
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathLineToRelative

    +
    +

    Synopsis

    +
    +void DrawPathLineToRelative( DrawingWand *drawing_wand, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPathLineToRelative method is:

    +
    +void DrawPathLineToRelative( DrawingWand *drawing_wand, const double x, const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    target x ordinate
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathLineToHorizontalAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathLineToHorizontalAbsolute( DrawingWand *drawing_wand, const PathMode mode,
    +                                       const double x );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathLineToHorizontalAbsolute method is:

    +
    +void DrawPathLineToHorizontalAbsolute( DrawingWand *drawing_wand, const PathMode mode,
    +                                       const double x );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    target x ordinate
    +
    +
    +
    +
    +

    DrawPathLineToHorizontalRelative

    +
    +

    Synopsis

    +
    +void DrawPathLineToHorizontalRelative( DrawingWand *drawing_wand, const double x );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathLineToHorizontalRelative method is:

    +
    +void DrawPathLineToHorizontalRelative( DrawingWand *drawing_wand, const double x );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    target x ordinate
    +
    +
    +
    +
    +

    DrawPathLineToVerticalAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathLineToVerticalAbsolute( DrawingWand *drawing_wand, const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathLineToVerticalAbsolute method is:

    +
    +void DrawPathLineToVerticalAbsolute( DrawingWand *drawing_wand, const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathLineToVerticalRelative

    +
    +

    Synopsis

    +
    +void DrawPathLineToVerticalRelative( DrawingWand *drawing_wand, const double y );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathLineToVerticalRelative method is:

    +
    +void DrawPathLineToVerticalRelative( DrawingWand *drawing_wand, const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathMoveToAbsolute

    +
    +

    Synopsis

    +
    +void DrawPathMoveToAbsolute( DrawingWand *drawing_wand, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPathMoveToAbsolute method is:

    +
    +void DrawPathMoveToAbsolute( DrawingWand *drawing_wand, const double x, const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    target x ordinate
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathMoveToRelative

    +
    +

    Synopsis

    +
    +void DrawPathMoveToRelative( DrawingWand *drawing_wand, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPathMoveToRelative method is:

    +
    +void DrawPathMoveToRelative( DrawingWand *drawing_wand, const double x, const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    target x ordinate
    +
    y:
    +
    target y ordinate
    +
    +
    +
    +
    +

    DrawPathStart

    +
    +

    Synopsis

    +
    +void DrawPathStart( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPathStart method is:

    +
    +void DrawPathStart( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawPeekGraphicContext

    +
    +

    Synopsis

    +
    +DrawInfo *DrawPeekGraphicContext( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    DrawPeekGraphicContext() returns the current graphic drawing_wand.

    +

    The format of the DrawPeekGraphicContext method is:

    +
    +DrawInfo *DrawPeekGraphicContext( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawPoint

    +
    +

    Synopsis

    +
    +void DrawPoint( DrawingWand *drawing_wand, const double x, const double y );
    +
    +
    +
    +

    Description

    +

    DrawPoint() draws a point using the current stroke color and stroke +thickness at the specified coordinates.

    +

    The format of the DrawPoint method is:

    +
    +void DrawPoint( DrawingWand *drawing_wand, const double x, const double y );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    target x coordinate
    +
    y:
    +
    target y coordinate
    +
    +
    +
    +
    +

    DrawPolygon

    +
    +

    Synopsis

    +
    +void DrawPolygon( DrawingWand *drawing_wand, const unsigned long number_coordinates,
    +                  const PointInfo *coordinates );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPolygon method is:

    +
    +void DrawPolygon( DrawingWand *drawing_wand, const unsigned long number_coordinates,
    +                  const PointInfo *coordinates );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    number_coordinates:
    +
    number of coordinates
    +
    coordinates:
    +
    coordinate array
    +
    +
    +
    +
    +

    DrawPolyline

    +
    +

    Synopsis

    +
    +void DrawPolyline( DrawingWand *drawing_wand, const unsigned long number_coordinates,
    +                   const PointInfo *coordinates );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPolyline method is:

    +
    +void DrawPolyline( DrawingWand *drawing_wand, const unsigned long number_coordinates,
    +                   const PointInfo *coordinates );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    number_coordinates:
    +
    number of coordinates
    +
    coordinates:
    +
    coordinate array
    +
    +
    +
    +
    +

    DrawPopClipPath

    +
    +

    Synopsis

    +
    +void DrawPopClipPath( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    DrawPopClipPath() terminates a clip path definition.

    +

    The format of the DrawPopClipPath method is:

    +
    +void DrawPopClipPath( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawPopDefs

    +
    +

    Synopsis

    +
    +void DrawPopDefs( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    DrawPopDefs() terminates a definition list

    +

    The format of the DrawPopDefs method is:

    +
    +void DrawPopDefs( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawPopGraphicContext

    +
    +

    Synopsis

    +
    +void DrawPopGraphicContext( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    DrawPopGraphicContext() destroys the current drawing_wand returning to the +previously pushed drawing wand. Multiple drawing wand 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:

    +
    +void DrawPopGraphicContext( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawPopPattern

    +
    +

    Synopsis

    +
    +void DrawPopPattern( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    DrawPopPattern() terminates a pattern definition.

    +

    The format of the DrawPopPattern method is:

    +
    +void DrawPopPattern( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawPushClipPath

    +
    +

    Synopsis

    +
    +void DrawPushClipPath( DrawingWand *drawing_wand, const char *clip_path_id );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawPushClipPath method is:

    +
    +void DrawPushClipPath( DrawingWand *drawing_wand, const char *clip_path_id );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    clip_path_id:
    +
    string identifier to associate with the clip path for +later use.
    +
    +
    +
    +
    +

    DrawPushDefs

    +
    +

    Synopsis

    +
    +void DrawPushDefs( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPushDefs method is:

    +
    +void DrawPushDefs( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawPushGraphicContext

    +
    +

    Synopsis

    +
    +void DrawPushGraphicContext( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    DrawPushGraphicContext() clones the current drawing wand to create a +new drawing wand. The original drawing drawing_wand(s) may be returned to +by invoking DrawPopGraphicContext(). 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:

    +
    +void DrawPushGraphicContext( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawPushPattern

    +
    +

    Synopsis

    +
    +void DrawPushPattern( DrawingWand *drawing_wand, const char *pattern_id, const double x,
    +                      const double y, const double width, const double height );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawPushPattern method is:

    +
    +void DrawPushPattern( DrawingWand *drawing_wand, const char *pattern_id, const double x,
    +                      const double y, const double width, const double height );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    pattern_id:
    +
    pattern identification for later reference
    +
    x:
    +
    x ordinate of top left corner
    +
    y:
    +
    y ordinate of top left corner
    +
    width:
    +
    width of pattern space
    +
    height:
    +
    height of pattern space
    +
    +
    +
    +
    +

    DrawRectangle

    +
    +

    Synopsis

    +
    +void DrawRectangle( DrawingWand *drawing_wand, const double x1, const double y1,
    +                    const double x2, const double y2 );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawRectangle method is:

    +
    +void DrawRectangle( DrawingWand *drawing_wand, const double x1, const double y1,
    +                    const double x2, const double y2 );
    +
    +
    +
    x1:
    +
    x ordinate of first coordinate
    +
    y1:
    +
    y ordinate of first coordinate
    +
    x2:
    +
    x ordinate of second coordinate
    +
    y2:
    +
    y ordinate of second coordinate
    +
    +
    +
    +
    +

    DrawRender

    +
    +

    Synopsis

    +
    +unsigned int DrawRender( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    DrawRender() renders all preceding drawing commands onto the image. +This function is deprecated. Use MagickDrawImage() instead.

    +

    The format of the DrawRender method is:

    +
    +unsigned int DrawRender( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawRotate

    +
    +

    Synopsis

    +
    +void DrawRotate( DrawingWand *drawing_wand, const double degrees );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawRotate method is:

    +
    +void DrawRotate( DrawingWand *drawing_wand, const double degrees );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    degrees:
    +
    degrees of rotation
    +
    +
    +
    +
    +

    DrawRoundRectangle

    +
    +

    Synopsis

    +
    +void DrawRoundRectangle( DrawingWand *drawing_wand, double x1, double y1, double x2, double y2,
    +                         double rx, double ry );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawRoundRectangle method is:

    +
    +void DrawRoundRectangle( DrawingWand *drawing_wand, double x1, double y1, double x2, double y2,
    +                         double rx, double ry );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x1:
    +
    x ordinate of first coordinate
    +
    y1:
    +
    y ordinate of first coordinate
    +
    x2:
    +
    x ordinate of second coordinate
    +
    y2:
    +
    y ordinate of second coordinate
    +
    rx:
    +
    radius of corner in horizontal direction
    +
    ry:
    +
    radius of corner in vertical direction
    +
    +
    +
    +
    +

    DrawScale

    +
    +

    Synopsis

    +
    +void DrawScale( DrawingWand *drawing_wand, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawScale method is:

    +
    +void DrawScale( DrawingWand *drawing_wand, const double x, const double y );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    horizontal scale factor
    +
    y:
    +
    vertical scale factor
    +
    +
    +
    +
    +

    DrawSkewX

    +
    +

    Synopsis

    +
    +void DrawSkewX( DrawingWand *drawing_wand, const double degrees );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSkewX method is:

    +
    +void DrawSkewX( DrawingWand *drawing_wand, const double degrees );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    degrees:
    +
    number of degrees to skew the coordinates
    +
    +
    +
    +
    +

    DrawSkewY

    +
    +

    Synopsis

    +
    +void DrawSkewY( DrawingWand *drawing_wand, const double degrees );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSkewY method is:

    +
    +void DrawSkewY( DrawingWand *drawing_wand, const double degrees );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    degrees:
    +
    number of degrees to skew the coordinates
    +
    +
    +
    +
    +

    DrawSetStopColor

    +
    +

    Synopsis

    +
    +void DrawSetStopColor( DrawingWand *drawing_wand, const PixelPacket *stop_color,
    +                       const double offset );
    +
    +
    +
    +

    Description

    +

    DrawSetStopColor() sets the stop color and offset for gradients

    +

    The format of the DrawSetStopColor method is:

    +
    +void DrawSetStopColor( DrawingWand *drawing_wand, const PixelPacket *stop_color,
    +                       const double offset );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +

    o stop_color:

    +

    o offset:

    +
    +
    +
    +

    DrawGetStrokeColor

    +
    +

    Synopsis

    +
    +void DrawGetStrokeColor( const DrawingWand *drawing_wand, ;
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetStrokeColor method is:

    +
    +void DrawGetStrokeColor( const DrawingWand *drawing_wand, ;
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    stroke_color:
    +
    Return the stroke color.
    +
    +
    +
    +
    +

    DrawSetStrokeColor

    +
    +

    Synopsis

    +
    +void DrawSetStrokeColor( DrawingWand *drawing_wand, const PixelWand *stroke_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetStrokeColor method is:

    +
    +void DrawSetStrokeColor( DrawingWand *drawing_wand, const PixelWand *stroke_wand );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    stroke_wand:
    +
    stroke wand.
    +
    +
    +
    +
    +

    DrawSetStrokePatternURL

    +
    +

    Synopsis

    +
    +void DrawSetStrokePatternURL( DrawingWand *drawing_wand, const char *stroke_url );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetStrokePatternURL method is:

    +
    +void DrawSetStrokePatternURL( DrawingWand *drawing_wand, const char *stroke_url );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    stroke_url:
    +
    URL specifying pattern ID (e.g. "#pattern_id")
    +
    +
    +
    +
    +

    DrawGetStrokeAntialias

    +
    +

    Synopsis

    +
    +unsigned int DrawGetStrokeAntialias( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetStrokeAntialias method is:

    +
    +unsigned int DrawGetStrokeAntialias( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetStrokeAntialias

    +
    +

    Synopsis

    +
    +void DrawSetStrokeAntialias( DrawingWand *drawing_wand,
    +                             const unsigned int stroke_antialias );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawSetStrokeAntialias method is:

    +
    +void DrawSetStrokeAntialias( DrawingWand *drawing_wand,
    +                             const unsigned int stroke_antialias );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    stroke_antialias:
    +
    set to false (zero) to disable antialiasing
    +
    +
    +
    +
    +

    DrawGetStrokeDashArray

    +
    +

    Synopsis

    +
    +double *DrawGetStrokeDashArray( const DrawingWand *drawing_wand,
    +                                unsigned long *number_elements );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetStrokeDashArray method is:

    +
    +double *DrawGetStrokeDashArray( const DrawingWand *drawing_wand,
    +                                unsigned long *number_elements );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    number_elements:
    +
    address to place number of elements in dash array
    +
    +
    +
    +
    +

    DrawSetStrokeDashArray

    +
    +

    Synopsis

    +
    +void DrawSetStrokeDashArray( DrawingWand *drawing_wand, const unsigned long number_elements,
    +                             const double *dash_array );
    +
    +
    +
    +

    Description

    +

    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 dash_array. +A typical stroke dash array might contain the members 5 3 2.

    +

    The format of the DrawSetStrokeDashArray method is:

    +
    +void DrawSetStrokeDashArray( DrawingWand *drawing_wand, const unsigned long number_elements,
    +                             const double *dash_array );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    number_elements:
    +
    number of elements in dash array
    +
    dash_array:
    +
    dash array values
    +
    +
    +
    +
    +

    DrawGetStrokeDashOffset

    +
    +

    Synopsis

    +
    +double DrawGetStrokeDashOffset( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetStrokeDashOffset method is:

    +
    +double DrawGetStrokeDashOffset( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetStrokeDashOffset

    +
    +

    Synopsis

    +
    +void DrawSetStrokeDashOffset( DrawingWand *drawing_wand, const double dash_offset );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetStrokeDashOffset method is:

    +
    +void DrawSetStrokeDashOffset( DrawingWand *drawing_wand, const double dash_offset );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    dash_offset:
    +
    dash offset
    +
    +
    +
    +
    +

    DrawGetStrokeLineCap

    +
    +

    Synopsis

    +
    +LineCap DrawGetStrokeLineCap( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetStrokeLineCap method is:

    +
    +LineCap DrawGetStrokeLineCap( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetStrokeLineCap

    +
    +

    Synopsis

    +
    +void DrawSetStrokeLineCap( DrawingWand *drawing_wand, const LineCap linecap );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawSetStrokeLineCap method is:

    +
    +void DrawSetStrokeLineCap( DrawingWand *drawing_wand, const LineCap linecap );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    linecap:
    +
    linecap style
    +
    +
    +
    +
    +

    DrawGetStrokeLineJoin

    +
    +

    Synopsis

    +
    +LineJoin DrawGetStrokeLineJoin( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetStrokeLineJoin method is:

    +
    +LineJoin DrawGetStrokeLineJoin( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetStrokeLineJoin

    +
    +

    Synopsis

    +
    +void DrawSetStrokeLineJoin( DrawingWand *drawing_wand, const LineJoin linejoin );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawSetStrokeLineJoin method is:

    +
    +void DrawSetStrokeLineJoin( DrawingWand *drawing_wand, const LineJoin linejoin );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    linejoin:
    +
    line join style
    +
    +
    +
    +
    +

    DrawGetStrokeMiterLimit

    +
    +

    Synopsis

    +
    +unsigned long DrawGetStrokeMiterLimit( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    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'.

    +

    The format of the DrawGetStrokeMiterLimit method is:

    +
    +unsigned long DrawGetStrokeMiterLimit( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetStrokeMiterLimit

    +
    +

    Synopsis

    +
    +void DrawSetStrokeMiterLimit( DrawingWand *drawing_wand, const unsigned long miterlimit );
    +
    +
    +
    +

    Description

    +

    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'.

    +

    The format of the DrawSetStrokeMiterLimit method is:

    +
    +void DrawSetStrokeMiterLimit( DrawingWand *drawing_wand, const unsigned long miterlimit );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    miterlimit:
    +
    miter limit
    +
    +
    +
    +
    +

    DrawGetStrokeOpacity

    +
    +

    Synopsis

    +
    +double DrawGetStrokeOpacity( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    DrawGetStrokeOpacity() returns the opacity of stroked object outlines.

    +

    The format of the DrawGetStrokeOpacity method is:

    +
    +double DrawGetStrokeOpacity( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetStrokeOpacity

    +
    +

    Synopsis

    +
    +void DrawSetStrokeOpacity( DrawingWand *drawing_wand, const double stroke_opacity );
    +
    +
    +
    +

    Description

    +

    DrawSetStrokeOpacity() specifies the opacity of stroked object outlines.

    +

    The format of the DrawSetStrokeOpacity method is:

    +
    +void DrawSetStrokeOpacity( DrawingWand *drawing_wand, const double stroke_opacity );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    stroke_opacity:
    +
    stroke opacity. The value 1.0 is opaque.
    +
    +
    +
    +
    +

    DrawGetStrokeWidth

    +
    +

    Synopsis

    +
    +double DrawGetStrokeWidth( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetStrokeWidth method is:

    +
    +double DrawGetStrokeWidth( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetStrokeWidth

    +
    +

    Synopsis

    +
    +void DrawSetStrokeWidth( DrawingWand *drawing_wand, const double stroke_width );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetStrokeWidth method is:

    +
    +void DrawSetStrokeWidth( DrawingWand *drawing_wand, const double stroke_width );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    stroke_width:
    +
    stroke width
    +
    +
    +
    +
    +

    DrawGetTextAntialias

    +
    +

    Synopsis

    +
    +unsigned int DrawGetTextAntialias( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetTextAntialias method is:

    +
    +unsigned int DrawGetTextAntialias( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetTextAntialias

    +
    +

    Synopsis

    +
    +void DrawSetTextAntialias( DrawingWand *drawing_wand, const unsigned int text_antialias );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetTextAntialias method is:

    +
    +void DrawSetTextAntialias( DrawingWand *drawing_wand, const unsigned int text_antialias );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    text_antialias:
    +
    antialias boolean. Set to false (0) to disable +antialiasing.
    +
    +
    +
    +
    +

    DrawGetTextDecoration

    +
    +

    Synopsis

    +
    +DecorationType DrawGetTextDecoration( DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetTextDecoration method is:

    +
    +DecorationType DrawGetTextDecoration( DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetTextDecoration

    +
    +

    Synopsis

    +
    +void DrawSetTextDecoration( DrawingWand *drawing_wand, const DecorationType decoration );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetTextDecoration method is:

    +
    +void DrawSetTextDecoration( DrawingWand *drawing_wand, const DecorationType decoration );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    decoration:
    +
    text decoration. One of NoDecoration, UnderlineDecoration, +OverlineDecoration, or LineThroughDecoration
    +
    +
    +
    +
    +

    DrawGetTextEncoding

    +
    +

    Synopsis

    +
    +char *DrawGetTextEncoding( const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawGetTextEncoding method is:

    +
    +char *DrawGetTextEncoding( const DrawingWand *drawing_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    +
    +
    +
    +

    DrawSetTextEncoding

    +
    +

    Synopsis

    +
    +void DrawSetTextEncoding( DrawingWand *drawing_wand, const char *encoding );
    +
    +
    +
    +

    Description

    +

    DrawSetTextEncoding() specifies 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.

    +

    The format of the DrawSetTextEncoding method is:

    +
    +void DrawSetTextEncoding( DrawingWand *drawing_wand, const char *encoding );
    +
    +

    A description of each parameter follows:

    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    encoding:
    +
    character string specifying text encoding
    +
    +
    +
    +
    +

    DrawGetTextUnderColor

    +
    +

    Synopsis

    +
    +void DrawGetTextUnderColor( const DrawingWand *drawing_wand, PixelWand *under_color );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawGetTextUnderColor method is:

    +
    +void DrawGetTextUnderColor( const DrawingWand *drawing_wand, PixelWand *under_color );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    under_color:
    +
    Return the under color.
    +
    +
    +
    +
    +

    DrawSetTextUnderColor

    +
    +

    Synopsis

    +
    +void DrawSetTextUnderColor( DrawingWand *drawing_wand, const PixelWand *under_wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawSetTextUnderColor method is:

    +
    +void DrawSetTextUnderColor( DrawingWand *drawing_wand, const PixelWand *under_wand );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    under_wand.:
    +
    text under wand.
    +
    +
    +
    +
    +

    DrawTranslate

    +
    +

    Synopsis

    +
    +void DrawTranslate( DrawingWand *drawing_wand, const double x, const double y );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the DrawTranslate method is:

    +
    +void DrawTranslate( DrawingWand *drawing_wand, const double x, const double y );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x:
    +
    new x ordinate for coordinate system origin
    +
    y:
    +
    new y ordinate for coordinate system origin
    +
    +
    +
    +
    +

    DrawSetViewbox

    +
    +

    Synopsis

    +
    +void DrawSetViewbox( DrawingWand *drawing_wand, unsigned long x1, unsigned long y1,
    +                     unsigned long x2, unsigned long y2 );
    +
    +
    +
    +

    Description

    +

    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.

    +

    The format of the DrawSetViewbox method is:

    +
    +void DrawSetViewbox( DrawingWand *drawing_wand, unsigned long x1, unsigned long y1,
    +                     unsigned long x2, unsigned long y2 );
    +
    +
    +
    drawing_wand:
    +
    The drawing wand.
    +
    x1:
    +
    left x ordinate
    +
    y1:
    +
    top y ordinate
    +
    x2:
    +
    right x ordinate
    +
    y2:
    +
    bottom y ordinate
    +
    +
    +
    +
    +

    NewDrawingWand

    +
    +

    Synopsis

    +
    +DrawingWand *NewDrawingWand( void );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the NewDrawingWand method is:

    +
    +DrawingWand *NewDrawingWand( void );
    +
    +
    +
    +
    + + diff --git a/www/wand/magick_wand.html b/www/wand/magick_wand.html index 9b96935..cd9ab42 100644 --- a/www/wand/magick_wand.html +++ b/www/wand/magick_wand.html @@ -3,7 +3,7 @@ - + magick_wand @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -5986,11 +5986,13 @@ unsigned int MagickSetSamplingFactors( MagickWand *wand, const unsigned long num
    wand:
    The magick wand.
    -
    number_factoes:
    -
    The number of factors.
    +
    number_factors:
    +
    The number of factors. This value should be evenly +divisible by two.
    sampling_factors:
    An array of doubles representing the sampling factor -for each color component (in RGB order).
    +for each color component (in RGB order). Two double values must be +provided for each color component.
    @@ -6766,5 +6768,10 @@ MagickWand NewMagickWand( void ); + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/wand/magick_wand.html.orig b/www/wand/magick_wand.html.orig new file mode 100644 index 0000000..73e82bd --- /dev/null +++ b/www/wand/magick_wand.html.orig @@ -0,0 +1,6770 @@ + + + + + + +magick_wand + + + + + + + +
    +

    magick_wand

    +

    Wand image processing interfaces

    + +
    +

    Contents

    + +
    +
    +

    CloneMagickWand

    +
    +

    Synopsis

    +
    +MagickWand *CloneMagickWand( const MagickWand *wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the CloneMagickWand method is:

    +
    +MagickWand *CloneMagickWand( const MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand to clone.
    +
    +
    +
    +
    +

    DestroyMagickWand

    +
    +

    Synopsis

    +
    +void DestroyMagickWand( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    DestroyMagickWand() deallocates memory associated with an MagickWand.

    +

    The format of the DestroyMagickWand method is:

    +
    +void DestroyMagickWand( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickAdaptiveThresholdImage

    +
    +

    Synopsis

    +
    +unsigned int MagickAdaptiveThresholdImage( MagickWand *wand, const unsigned long width,
    +                                           const unsigned long height, const long offset );
    +
    +
    +
    +

    Description

    +

    MagickAdaptiveThresholdImage() selects an individual threshold for each pixel +based on the range of intensity values in its local neighborhood. This +allows for thresholding of an image whose global intensity histogram +doesn't contain distinctive peaks.

    +

    The format of the MagickAdaptiveThresholdImage method is:

    +
    +unsigned int MagickAdaptiveThresholdImage( MagickWand *wand, const unsigned long width,
    +                                           const unsigned long height, const long offset );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    width:
    +
    The width of the local neighborhood.
    +
    height:
    +
    The height of the local neighborhood.
    +
    offset:
    +
    The mean offset.
    +
    +
    +
    +
    +

    MagickAddImage

    +
    +

    Synopsis

    +
    +unsigned int MagickAddImage( MagickWand *wand, const MagickWand *add_wand );
    +
    +
    +
    +

    Description

    +

    MagickAddImage() adds the specified images at the current image location.

    +

    The format of the MagickAddImage method is:

    +
    +unsigned int MagickAddImage( MagickWand *wand, const MagickWand *add_wand );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    insert:
    +
    The splice wand.
    +
    +
    +
    +
    +

    MagickAddNoiseImage

    +
    +

    Synopsis

    +
    +unsigned int MagickAddNoiseImage( MagickWand *wand, const NoiseType noise_type );
    +
    +
    +
    +

    Description

    +

    MagickAddNoiseImage() adds random noise to the image.

    +

    The format of the MagickAddNoiseImage method is:

    +
    +unsigned int MagickAddNoiseImage( MagickWand *wand, const NoiseType noise_type );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    noise_type:
    +
    The type of noise: Uniform, Gaussian, Multiplicative, +Impulse, Laplacian, Poisson, or Random.
    +
    +
    +
    +
    +

    MagickAffineTransformImage

    +
    +

    Synopsis

    +
    +unsigned int MagickAffineTransformImage( MagickWand *wand, const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    MagickAffineTransformImage() transforms an image as dictated by the affine +matrix of the drawing wand.

    +

    The format of the MagickAffineTransformImage method is:

    +
    +unsigned int MagickAffineTransformImage( MagickWand *wand, const DrawingWand *drawing_wand );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    drawing_wand:
    +
    The draw wand.
    +
    +
    +
    +
    +

    MagickAnnotateImage

    +
    +

    Synopsis

    +
    +unsigned int MagickAnnotateImage( MagickWand *wand, const DrawingWand *drawing_wand,
    +                                  const double x, const double y, const double angle,
    +                                  const char *text );
    +
    +
    +
    +

    Description

    +

    MagickAnnotateImage() annotates an image with text.

    +

    The format of the MagickAnnotateImage method is:

    +
    +unsigned int MagickAnnotateImage( MagickWand *wand, const DrawingWand *drawing_wand,
    +                                  const double x, const double y, const double angle,
    +                                  const char *text );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    drawing_wand:
    +
    The draw wand.
    +
    x:
    +
    x ordinate to left of text
    +
    y:
    +
    y ordinate to text baseline
    +
    angle:
    +
    rotate text relative to this angle.
    +
    text:
    +
    text to draw
    +
    +
    +
    +
    +

    MagickAnimateImages

    +
    +

    Synopsis

    +
    +unsigned int MagickAnimateImages( MagickWand *wand, const char *server_name );
    +
    +
    +
    +

    Description

    +

    MagickAnimateImages() animates an image or image sequence.

    +

    The format of the MagickAnimateImages method is:

    +
    +unsigned int MagickAnimateImages( MagickWand *wand, const char *server_name );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    server_name:
    +
    The X server name.
    +
    +
    +
    +
    +

    MagickAppendImages

    +
    +

    Synopsis

    +
    +MagickWand *MagickAppendImages( MagickWand *wand, const unsigned int stack );
    +
    +
    +
    +

    Description

    +

    MagickAppendImages() append a set of images.

    +

    The format of the MagickAppendImages method is:

    +
    +MagickWand *MagickAppendImages( MagickWand *wand, const unsigned int stack );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    stack:
    +
    By default, images are stacked left-to-right. Set stack to True +to stack them top-to-bottom.
    +
    +
    +
    +
    +

    MagickAutoOrientImage

    +
    +

    Synopsis

    +
    +unsigned int MagickAutoOrientImage( MagickWand *wand,
    +                                    const OrientationType current_orientation,
    +                                    ExceptionInfo *exception );
    +
    +
    +
    +

    Description

    +

    MagickAutoOrientImage() adjusts the current image so that its orientation +is suitable for viewing (i.e. top-left orientation).

    +

    The format of the MagickAutoOrientImage method is:

    +
    +unsigned int MagickAutoOrientImage( MagickWand *wand,
    +                                    const OrientationType current_orientation,
    +                                    ExceptionInfo *exception );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    current_orientation:
    +
    Current image orientation. May be one of: +TopLeftOrientation Left to right and Top to bottom +TopRightOrientation Right to left and Top to bottom +BottomRightOrientation Right to left and Bottom to top +BottomLeftOrientation Left to right and Bottom to top +LeftTopOrientation Top to bottom and Left to right +RightTopOrientation Top to bottom and Right to left +RightBottomOrientation Bottom to top and Right to left +LeftBottomOrientation Bottom to top and Left to right +UndefinedOrientation Current orientation is not known. +Use orientation defined by the +current image if any. Equivalent +to MagickGetImageOrientation().
    +
    +

    Returns True on success, False otherwise.

    +

    Note that after successful auto-orientation the internal orientation will +be set to TopLeftOrientation. However this internal value is only written +to TIFF files. For JPEG files, there is currently no support for resetting +the EXIF orientation tag to TopLeft so the JPEG should be stripped or EXIF +profile removed if present to prevent saved auto-oriented images from being +incorrectly rotated a second time by follow-on viewers that understand the +EXIF orientation tag.

    +
    +
    +
    +

    MagickAverageImages

    +
    +

    Synopsis

    +
    +MagickWand *MagickAverageImages( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    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.
    +
    +
    +
    +
    +

    MagickBlackThresholdImage

    +
    +

    Synopsis

    +
    +unsigned int MagickBlackThresholdImage( MagickWand *wand, const PixelWand *threshold );
    +
    +
    +
    +

    Description

    +

    MagickBlackThresholdImage() is like MagickThresholdImage() but forces all +pixels below the threshold into black while leaving all pixels above the +threshold unchanged.

    +

    The format of the MagickBlackThresholdImage method is:

    +
    +unsigned int MagickBlackThresholdImage( MagickWand *wand, const PixelWand *threshold );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    threshold:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    MagickBlurImage

    +
    +

    Synopsis

    +
    +unsigned int MagickBlurImage( MagickWand *wand, const double radius, const double sigma );
    +
    +
    +
    +

    Description

    +

    MagickBlurImage() 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.

    +

    The format of the MagickBlurImage method is:

    +
    +unsigned int MagickBlurImage( MagickWand *wand, const double radius, const double sigma );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    +
    +
    +
    +

    MagickBorderImage

    +
    +

    Synopsis

    +
    +unsigned int MagickBorderImage( MagickWand *wand, const PixelWand *bordercolor,
    +                                const unsigned long width, const unsigned long height );
    +
    +
    +
    +

    Description

    +

    MagickBorderImage() surrounds the image with a border of the color defined +by the bordercolor pixel wand.

    +

    The format of the MagickBorderImage method is:

    +
    +unsigned int MagickBorderImage( MagickWand *wand, const PixelWand *bordercolor,
    +                                const unsigned long width, const unsigned long height );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    bordercolor:
    +
    The border color pixel wand.
    +
    width:
    +
    The border width.
    +
    height:
    +
    The border height.
    +
    +
    +
    +
    +

    MagickCdlImage

    +
    +

    Synopsis

    +
    +MagickPassFail MagickCdlImage( MagickWand *wand, const char *cdl );
    +
    +
    +
    +

    Description

    +

    The MagickCdlImage() method applies ("bakes in") the ASC-CDL which is a +format for the exchange of basic primary color grading information between +equipment and software from different manufacturers. The format defines +the math for three functions: slope, offset and power. Each function uses +a number for the red, green, and blue color channels for a total of nine +numbers comprising a single color decision. A tenth number for chrominance +(saturation) has been proposed but is not yet standardized.

    +

    The cdl argument string is comma delimited and is in the form (but +without invervening spaces or line breaks):

    +

    redslope, redoffset, redpower : +greenslope, greenoffset, greenpower : +blueslope, blueoffset, bluepower : +saturation

    +

    with the unity (no change) specification being:

    +

    "1.0,0.0,1.0:1.0,0.0,1.0:1.0,0.0,1.0:0.0"

    +

    See http://en.wikipedia.org/wiki/ASC_CDL for more information.

    +

    The format of the MagickCdlImage method is:

    +
    +MagickPassFail MagickCdlImage( MagickWand *wand, const char *cdl );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The image wand.
    +
    cdl:
    +
    Define the coefficients for slope offset and power in the +red green and blue channels, plus saturation.
    +
    +
    +
    +
    +

    MagickCharcoalImage

    +
    +

    Synopsis

    +
    +unsigned int MagickCharcoalImage( MagickWand *wand, const double radius, const double sigma );
    +
    +
    +
    +

    Description

    +

    MagickCharcoalImage() simulates a charcoal drawing.

    +

    The format of the MagickCharcoalImage method is:

    +
    +unsigned int MagickCharcoalImage( MagickWand *wand, const double radius, const double sigma );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    +
    +
    +
    +

    MagickChopImage

    +
    +

    Synopsis

    +
    +unsigned int MagickChopImage( MagickWand *wand, const unsigned long width,
    +                              const unsigned long height, const long x, const long y );
    +
    +
    +
    +

    Description

    +

    MagickChopImage() removes a region of an image and collapses the image to +occupy the removed portion

    +

    The format of the MagickChopImage method is:

    +
    +unsigned int MagickChopImage( MagickWand *wand, const unsigned long width,
    +                              const unsigned long height, const long x, const long y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    width:
    +
    The region width.
    +
    height:
    +
    The region height.
    +
    x:
    +
    The region x offset.
    +
    y:
    +
    The region y offset.
    +
    +
    +
    +
    +

    MagickClearException

    +
    +

    Synopsis

    +
    +void MagickClearException( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickClearException() clears the last wand exception.

    +

    The format of the MagickClearException method is:

    +
    +void MagickClearException( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickClipImage

    +
    +

    Synopsis

    +
    +unsigned int MagickClipImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickClipImage() clips along the first path from the 8BIM profile, if +present.

    +

    The format of the MagickClipImage method is:

    +
    +unsigned int MagickClipImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickClipPathImage

    +
    +

    Synopsis

    +
    +unsigned int MagickClipPathImage( MagickWand *wand, const char *pathname,
    +                                  const unsigned int inside );
    +
    +
    +
    +

    Description

    +

    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:

    +
    +unsigned int MagickClipPathImage( MagickWand *wand, const char *pathname,
    +                                  const unsigned int inside );
    +
    +
    +
    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.
    +
    +
    +
    +
    +

    MagickCoalesceImages

    +
    +

    Synopsis

    +
    +MagickWand *MagickCoalesceImages( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickCoalesceImages() 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. MagickCoalesceImages() returns a new sequence +where each image in the sequence is the same size as the first and +composited with the next image in the sequence.

    +

    The format of the MagickCoalesceImages method is:

    +
    +MagickWand *MagickCoalesceImages( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickColorFloodfillImage

    +
    +

    Synopsis

    +
    +unsigned int MagickColorFloodfillImage( MagickWand *wand, const PixelWand *fill,
    +                                        const double fuzz, const PixelWand *bordercolor,
    +                                        const long x, const long y );
    +
    +
    +
    +

    Description

    +

    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:

    +
    +unsigned int MagickColorFloodfillImage( MagickWand *wand, const PixelWand *fill,
    +                                        const double fuzz, const PixelWand *bordercolor,
    +                                        const long x, const long y );
    +
    +
    +
    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.
    +
    +
    +
    +
    +

    MagickColorizeImage

    +
    +

    Synopsis

    +
    +unsigned int MagickColorizeImage( MagickWand *wand, const PixelWand *colorize,
    +                                  const PixelWand *opacity );
    +
    +
    +
    +

    Description

    +

    MagickColorizeImage() blends the fill color with each pixel in the image.

    +

    The format of the MagickColorizeImage method is:

    +
    +unsigned int MagickColorizeImage( MagickWand *wand, const PixelWand *colorize,
    +                                  const PixelWand *opacity );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    colorize:
    +
    The colorize pixel wand.
    +
    opacity:
    +
    The opacity pixel wand.
    +
    +
    +
    +
    +

    MagickCommentImage

    +
    +

    Synopsis

    +
    +unsigned int MagickCommentImage( MagickWand *wand, const char *comment );
    +
    +
    +
    +

    Description

    +

    MagickCommentImage() adds a comment to your image.

    +

    The format of the MagickCommentImage method is:

    +
    +unsigned int MagickCommentImage( MagickWand *wand, const char *comment );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    comment:
    +
    The image comment.
    +
    +
    +
    +
    +

    MagickCompareImageChannels

    +
    +

    Synopsis

    +
    +MagickWand *MagickCompareImageChannels( MagickWand *wand, const MagickWand *reference,
    +                                        const ChannelType channel, const MetricType metric,
    +                                        double *distortion );
    +
    +
    +
    +

    Description

    +

    MagickCompareImageChannels() compares one or more image channels and +returns the specified distortion metric.

    +

    The format of the MagickCompareImageChannels method is:

    +
    +MagickWand *MagickCompareImageChannels( MagickWand *wand, const MagickWand *reference,
    +                                        const ChannelType channel, const MetricType metric,
    +                                        double *distortion );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    reference:
    +
    The reference wand.
    +
    channel:
    +
    The channel.
    +
    metric:
    +
    The metric.
    +
    distortion:
    +
    The computed distortion between the images.
    +
    +
    +
    +
    +

    MagickCompareImages

    +
    +

    Synopsis

    +
    +MagickWand *MagickCompareImages( MagickWand *wand, const MagickWand *reference,
    +                                 const MetricType metric, double *distortion );
    +
    +
    +
    +

    Description

    +

    MagickCompareImage() compares one or more images and returns the specified +distortion metric.

    +

    The format of the MagickCompareImages method is:

    +
    +MagickWand *MagickCompareImages( MagickWand *wand, const MagickWand *reference,
    +                                 const MetricType metric, double *distortion );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    reference:
    +
    The reference wand.
    +
    metric:
    +
    The metric.
    +
    distortion:
    +
    The computed distortion between the images.
    +
    +
    +
    +
    +

    MagickCompositeImage

    +
    +

    Synopsis

    +
    +unsigned int MagickCompositeImage( MagickWand *wand, const MagickWand *composite_wand,
    +                                   const CompositeOperator compose, const long x,
    +                                   const long y );
    +
    +
    +
    +

    Description

    +

    MagickCompositeImage() composite one image onto another at the specified +offset.

    +

    The format of the MagickCompositeImage method is:

    +
    +unsigned int MagickCompositeImage( MagickWand *wand, const MagickWand *composite_wand,
    +                                   const CompositeOperator compose, const long x,
    +                                   const long y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    composite_image:
    +
    The composite image.
    +
    compose:
    +
    This operator affects how the composite is applied to the +image. The default is Over. Choose from these operators:
    +
    +

    OverCompositeOp InCompositeOp OutCompositeOP +AtopCompositeOP XorCompositeOP PlusCompositeOP +MinusCompositeOP AddCompositeOP SubtractCompositeOP +DifferenceCompositeOP BumpmapCompositeOP CopyCompositeOP +DisplaceCompositeOP

    +
    +
    x_offset:
    +
    The column offset of the composited image.
    +
    y_offset:
    +
    The row offset of the composited image.
    +
    +
    +
    +
    +

    MagickContrastImage

    +
    +

    Synopsis

    +
    +unsigned int MagickContrastImage( MagickWand *wand, const unsigned int sharpen );
    +
    +
    +
    +

    Description

    +

    MagickContrastImage() enhances the intensity differences between the lighter +and darker elements of the image. Set sharpen to a value other than 0 to +increase the image contrast otherwise the contrast is reduced.

    +

    The format of the MagickContrastImage method is:

    +
    +unsigned int MagickContrastImage( MagickWand *wand, const unsigned int sharpen );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    sharpen:
    +
    Increase or decrease image contrast.
    +
    +
    +
    +
    +

    MagickConvolveImage

    +
    +

    Synopsis

    +
    +unsigned int MagickConvolveImage( MagickWand *wand, const unsigned long order,
    +                                  const double *kernel );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the MagickConvolveImage method is:

    +
    +unsigned int MagickConvolveImage( MagickWand *wand, const unsigned long order,
    +                                  const double *kernel );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    order:
    +
    The number of columns and rows in the filter kernel.
    +
    kernel:
    +
    An array of doubles representing the convolution kernel.
    +
    +
    +
    +
    +

    MagickCropImage

    +
    +

    Synopsis

    +
    +unsigned int MagickCropImage( MagickWand *wand, const unsigned long width,
    +                              const unsigned long height, const long x, const long y );
    +
    +
    +
    +

    Description

    +

    MagickCropImage() extracts a region of the image.

    +

    The format of the MagickCropImage method is:

    +
    +unsigned int MagickCropImage( MagickWand *wand, const unsigned long width,
    +                              const unsigned long height, const long x, const long y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    width:
    +
    The region width.
    +
    height:
    +
    The region height.
    +
    x:
    +
    The region x offset.
    +
    y:
    +
    The region y offset.
    +
    +
    +
    +
    +

    MagickCycleColormapImage

    +
    +

    Synopsis

    +
    +unsigned int MagickCycleColormapImage( MagickWand *wand, const long displace );
    +
    +
    +
    +

    Description

    +

    MagickCycleColormapImage() 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.

    +

    The format of the MagickCycleColormapImage method is:

    +
    +unsigned int MagickCycleColormapImage( MagickWand *wand, const long displace );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    pixel_wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    MagickDeconstructImages

    +
    +

    Synopsis

    +
    +MagickWand *MagickDeconstructImages( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickDeconstructImages() compares each image with the next in a sequence +and returns the maximum bounding region of any pixel differences it +discovers.

    +

    The format of the MagickDeconstructImages method is:

    +
    +MagickWand *MagickDeconstructImages( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickDescribeImage

    +
    +

    Synopsis

    +
    +const char *MagickDescribeImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickDescribeImage() describes an image by formatting its attributes +to an allocated string which must be freed by the user. Attributes +include the image width, height, size, and others. The string is +similar to the output of 'identify -verbose'.

    +

    The format of the MagickDescribeImage method is:

    +
    +const char *MagickDescribeImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickDespeckleImage

    +
    +

    Synopsis

    +
    +unsigned int MagickDespeckleImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickDespeckleImage() reduces the speckle noise in an image while +perserving the edges of the original image.

    +

    The format of the MagickDespeckleImage method is:

    +
    +unsigned int MagickDespeckleImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickDisplayImage

    +
    +

    Synopsis

    +
    +unsigned int MagickDisplayImage( MagickWand *wand, const char *server_name );
    +
    +
    +
    +

    Description

    +

    MagickDisplayImage() displays an image.

    +

    The format of the MagickDisplayImage method is:

    +
    +unsigned int MagickDisplayImage( MagickWand *wand, const char *server_name );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    server_name:
    +
    The X server name.
    +
    +
    +
    +
    +

    MagickDisplayImages

    +
    +

    Synopsis

    +
    +unsigned int MagickDisplayImages( MagickWand *wand, const char *server_name );
    +
    +
    +
    +

    Description

    +

    MagickDisplayImages() displays an image or image sequence.

    +

    The format of the MagickDisplayImages method is:

    +
    +unsigned int MagickDisplayImages( MagickWand *wand, const char *server_name );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    server_name:
    +
    The X server name.
    +
    +
    +
    +
    +

    MagickDrawImage

    +
    +

    Synopsis

    +
    +unsigned int MagickDrawImage( MagickWand *wand, const DrawingWand *drawing_wand );
    +
    +
    +
    +

    Description

    +

    MagickDrawImage() draws vectors on the image as described by DrawingWand.

    +

    The format of the MagickDrawImage method is:

    +
    +unsigned int MagickDrawImage( MagickWand *wand, const DrawingWand *drawing_wand );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    drawing_wand:
    +
    The draw wand.
    +
    +
    +
    +
    +

    MagickEdgeImage

    +
    +

    Synopsis

    +
    +unsigned int MagickEdgeImage( MagickWand *wand, const double radius );
    +
    +
    +
    +

    Description

    +

    MagickEdgeImage() enhance edges within the image with a convolution filter +of the given radius. Use a radius of 0 and Edge() selects a suitable +radius for you.

    +

    The format of the MagickEdgeImage method is:

    +
    +unsigned int MagickEdgeImage( MagickWand *wand, const double radius );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    radius:
    +
    the radius of the pixel neighborhood.
    +
    +
    +
    +
    +

    MagickEmbossImage

    +
    +

    Synopsis

    +
    +unsigned int MagickEmbossImage( MagickWand *wand, const double radius, const double sigma );
    +
    +
    +
    +

    Description

    +

    MagickEmbossImage() 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.

    +

    The format of the MagickEmbossImage method is:

    +
    +unsigned int MagickEmbossImage( MagickWand *wand, const double radius, const double sigma );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    +
    +
    +
    +

    MagickEnhanceImage

    +
    +

    Synopsis

    +
    +unsigned int MagickEnhanceImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the MagickEnhanceImage method is:

    +
    +unsigned int MagickEnhanceImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickEqualizeImage

    +
    +

    Synopsis

    +
    +unsigned int MagickEqualizeImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickEqualizeImage() equalizes the image histogram.

    +

    The format of the MagickEqualizeImage method is:

    +
    +unsigned int MagickEqualizeImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickExtentImage

    +
    +

    Synopsis

    +
    +unsigned int MagickExtentImage( MagickWand *wand, const size_t width, const size_t height,
    +                                const ssize_t x, const ssize_t y );
    +
    +
    +
    +

    Description

    +

    Use MagickExtentImage() to change the image dimensions as specified by +geometry width and height. The existing image content is composited at +the position specified by geometry x and y using the image compose method. +Existing image content which falls outside the bounds of the new image +dimensions is discarded.

    +

    The format of the MagickExtentImage method is:

    +
    +unsigned int MagickExtentImage( MagickWand *wand, const size_t width, const size_t height,
    +                                const ssize_t x, const ssize_t y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    width:
    +
    New image width
    +
    height:
    +
    New image height
    +
    x, y:
    +
    Top left composition coordinate to place existing image content +on the new image.
    +
    +
    +
    +
    +

    MagickFlattenImages

    +
    +

    Synopsis

    +
    +MagickWand *MagickFlattenImages( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickFlattenImages() merges a sequence of images. This is 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.
    +
    +
    +
    +
    +

    MagickFlipImage

    +
    +

    Synopsis

    +
    +unsigned int MagickFlipImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickFlipImage() creates a vertical mirror image by reflecting the pixels +around the central x-axis.

    +

    The format of the MagickFlipImage method is:

    +
    +unsigned int MagickFlipImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickFlopImage

    +
    +

    Synopsis

    +
    +unsigned int MagickFlopImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickFlopImage() creates a horizontal mirror image by reflecting the pixels +around the central y-axis.

    +

    The format of the MagickFlopImage method is:

    +
    +unsigned int MagickFlopImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickFrameImage

    +
    +

    Synopsis

    +
    +unsigned int MagickFrameImage( MagickWand *wand, const PixelWand *matte_color,
    +                               const unsigned long width, const unsigned long height,
    +                               const long inner_bevel, const long outer_bevel );
    +
    +
    +
    +

    Description

    +

    MagickFrameImage() adds a simulated three-dimensional border around the +image. The width and height specify the border width of the vertical and +horizontal sides of the frame. The inner and outer bevels indicate the +width of the inner and outer shadows of the frame.

    +

    The format of the MagickFrameImage method is:

    +
    +unsigned int MagickFrameImage( MagickWand *wand, const PixelWand *matte_color,
    +                               const unsigned long width, const unsigned long height,
    +                               const long inner_bevel, const long outer_bevel );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    matte_color:
    +
    The frame color pixel wand.
    +
    width:
    +
    The border width.
    +
    height:
    +
    The border height.
    +
    inner_bevel:
    +
    The inner bevel width.
    +
    outer_bevel:
    +
    The outer bevel width.
    +
    +
    +
    +
    +

    MagickFxImage

    +
    +

    Synopsis

    +
    +MagickWand *MagickFxImage( MagickWand *wand, const char *expression );
    +
    +
    +
    +

    Description

    +

    MagickFxImage() evaluate expression for each pixel in the image.

    +

    The format of the MagickFxImage method is:

    +
    +MagickWand *MagickFxImage( MagickWand *wand, const char *expression );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    expression:
    +
    The expression.
    +
    +
    +
    +
    +

    MagickFxImageChannel

    +
    +

    Synopsis

    +
    +MagickWand *MagickFxImageChannel( MagickWand *wand, const ChannelType channel,
    +                                  const char *expression );
    +
    +
    +
    +

    Description

    +

    MagickFxImageChannel() evaluate expression for each pixel in the specified +channel.

    +

    The format of the MagickFxImageChannel method is:

    +
    +MagickWand *MagickFxImageChannel( MagickWand *wand, const ChannelType channel,
    +                                  const char *expression );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    channel:
    +
    Identify which channel to level: RedChannel, GreenChannel, +BlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel, +BlackChannel.
    +
    expression:
    +
    The expression.
    +
    +
    +
    +
    +

    MagickGammaImage

    +
    +

    Synopsis

    +
    +unsigned int MagickGammaImage( MagickWand *wand, const double gamma );
    +
    +
    +
    +

    Description

    +

    Use MagickGammaImage() to gamma-correct an image. 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.

    +

    You can also reduce the influence of a particular channel with a gamma +value of 0.

    +

    The format of the MagickGammaImage method is:

    +
    +unsigned int MagickGammaImage( MagickWand *wand, const double gamma );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    gamme:
    +
    Define the level of gamma correction.
    +
    +
    +
    +
    +

    MagickGammaImageChannel

    +
    +

    Synopsis

    +
    +unsigned int MagickGammaImageChannel( MagickWand *wand, const ChannelType channel,
    +                                      const double gamma );
    +
    +
    +
    +

    Description

    +

    Use MagickGammaImageChannel() to gamma-correct 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.

    +

    You can also reduce the influence of a particular channel with a gamma +value of 0.

    +

    The format of the MagickGammaImageChannel method is:

    +
    +unsigned int MagickGammaImageChannel( MagickWand *wand, const ChannelType channel,
    +                                      const double gamma );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    channel:
    +
    The channel.
    +
    level:
    +
    Define the level of gamma correction.
    +
    +
    +
    +
    +

    MagickGetConfigureInfo

    +
    +

    Synopsis

    +
    +char *MagickGetConfigureInfo( MagickWand *wand, const char *name );
    +
    +
    +
    +

    Description

    +

    MagickGetConfigureInfo() returns ImageMagick configure attributes such as +NAME, VERSION, LIB_VERSION, COPYRIGHT, etc.

    +

    The format of the MagickGetConfigureInfo() method is:

    +
    +char *MagickGetConfigureInfo( MagickWand *wand, const char *name );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    name:
    +
    Return the attribute associated with this name.
    +
    +
    +
    +
    +

    MagickGetCopyright

    +
    +

    Synopsis

    +
    +const char *MagickGetCopyright( void );
    +
    +
    +
    +

    Description

    +

    MagickGetCopyright() returns the ImageMagick API copyright as a string.

    +

    The format of the MagickGetCopyright method is:

    +
    +const char *MagickGetCopyright( void );
    +
    +
    +
    +
    +

    MagickGetException

    +
    +

    Synopsis

    +
    +char *MagickGetException( const MagickWand *wand, ExceptionType *severity );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the MagickGetException method is:

    +
    +char *MagickGetException( const MagickWand *wand, ExceptionType *severity );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    severity:
    +
    The severity of the error is returned here.
    +
    +
    +
    +
    +

    MagickGetFilename

    +
    +

    Synopsis

    +
    +const char *MagickGetFilename( const MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetFilename() returns the filename associated with an image sequence.

    +

    The format of the MagickGetFilename method is:

    +
    +const char *MagickGetFilename( const MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetHomeURL

    +
    +

    Synopsis

    +
    +const char *MagickGetHomeURL( void );
    +
    +
    +
    +

    Description

    +

    MagickGetHomeURL() returns the ImageMagick home URL.

    +

    The format of the MagickGetHomeURL method is:

    +
    +const char *MagickGetHomeURL( void );
    +
    +
    +
    +
    +

    MagickGetImage

    +
    +

    Synopsis

    +
    +MagickWand *MagickGetImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImage() clones the image at the current image index.

    +

    The format of the MagickGetImage method is:

    +
    +MagickWand *MagickGetImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageAttribute

    +
    +

    Synopsis

    +
    +char *MagickGetImageAttribute( MagickWand *wand, const char *name );
    +
    +
    +
    +

    Description

    +

    MagickGetImageAttribute returns an image attribute as a string

    +

    The format of the MagickGetImageAttribute method is:

    +
    +char *MagickGetImageAttribute( MagickWand *wand, const char *name );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    name:
    +
    The name of the attribute
    +
    +
    +
    +
    +

    MagickGetImageBackgroundColor

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageBackgroundColor( MagickWand *wand, PixelWand *background_color );
    +
    +
    +
    +

    Description

    +

    MagickGetImageBackgroundColor() returns the image background color.

    +

    The format of the MagickGetImageBackgroundColor method is:

    +
    +unsigned int MagickGetImageBackgroundColor( MagickWand *wand, PixelWand *background_color );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    background_color:
    +
    Return the background color.
    +
    +
    +
    +
    +

    MagickGetImageBluePrimary

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageBluePrimary( MagickWand *wand, double *x, double *y );
    +
    +
    +
    +

    Description

    +

    MagickGetImageBluePrimary() returns the chromaticy blue primary point for the +image.

    +

    The format of the MagickGetImageBluePrimary method is:

    +
    +unsigned int MagickGetImageBluePrimary( MagickWand *wand, double *x, double *y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x:
    +
    The chromaticity blue primary x-point.
    +
    y:
    +
    The chromaticity blue primary y-point.
    +
    +
    +
    +
    +

    MagickGetImageBorderColor

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageBorderColor( MagickWand *wand, PixelWand *border_color );
    +
    +
    +
    +

    Description

    +

    MagickGetImageBorderColor() returns the image border color.

    +

    The format of the MagickGetImageBorderColor method is:

    +
    +unsigned int MagickGetImageBorderColor( MagickWand *wand, PixelWand *border_color );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    border_color:
    +
    Return the border color.
    +
    +
    +
    +
    +

    MagickGetImageBoundingBox

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageBoundingBox( MagickWand *wand, const double fuzz,
    +                                        unsigned long *width, unsigned long *height,
    +                                        long *x, long *y );
    +
    +
    +
    +

    Description

    +

    MagickGetImageBoundingBox() obtains the crop bounding box required to +remove a solid-color border from the image. Color quantums which differ +less than the fuzz setting are considered to be the same. If a border is +not detected, then the the original image dimensions are returned. The +crop bounding box estimation uses the same algorithm as MagickTrimImage().

    +

    The format of the MagickGetImageBoundingBox method is:

    +
    +unsigned int MagickGetImageBoundingBox( MagickWand *wand, const double fuzz,
    +                                        unsigned long *width, unsigned long *height,
    +                                        long *x, long *y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    fuzz:
    +
    Color comparison fuzz factor. Use 0.0 for exact match.
    +
    width:
    +
    The crop width
    +
    height:
    +
    The crop height
    +
    x:
    +
    The crop x offset
    +
    y:
    +
    The crop y offset
    +
    +
    +
    +
    +

    MagickGetImageChannelDepth

    +
    +

    Synopsis

    +
    +unsigned long MagickGetImageChannelDepth( MagickWand *wand, const ChannelType channel );
    +
    +
    +
    +

    Description

    +

    MagickGetImageChannelDepth() gets the depth for a particular image channel.

    +

    The format of the MagickGetImageChannelDepth method is:

    +
    +unsigned long MagickGetImageChannelDepth( MagickWand *wand, const ChannelType channel );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    channel:
    +
    Identify which channel to extract: RedChannel, GreenChannel, +BlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel, +BlackChannel.
    +
    +
    +
    +
    +

    MagickGetImageChannelExtrema

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageChannelExtrema( MagickWand *wand, const ChannelType channel,
    +                                           unsigned long *minima, unsigned long *maxima );
    +
    +
    +
    +

    Description

    +

    MagickGetImageChannelExtrema() gets the extrema for one or more image +channels.

    +

    The format of the MagickGetImageChannelExtrema method is:

    +
    +unsigned int MagickGetImageChannelExtrema( MagickWand *wand, const ChannelType channel,
    +                                           unsigned long *minima, unsigned long *maxima );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    channel:
    +
    Identify which channel to extract: RedChannel, GreenChannel, +BlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel, +or BlackChannel.
    +
    minima:
    +
    The minimum pixel value for the specified channel(s).
    +
    maxima:
    +
    The maximum pixel value for the specified channel(s).
    +
    +
    +
    +
    +

    MagickGetImageChannelMean

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageChannelMean( MagickWand *wand, const ChannelType channel,
    +                                        double *mean, double *standard_deviation );
    +
    +
    +
    +

    Description

    +

    MagickGetImageChannelMean() gets the mean and standard deviation of one or +more image channels.

    +

    The format of the MagickGetImageChannelMean method is:

    +
    +unsigned int MagickGetImageChannelMean( MagickWand *wand, const ChannelType channel,
    +                                        double *mean, double *standard_deviation );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    channel:
    +
    Identify which channel to extract: RedChannel, GreenChannel, +BlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel, +or BlackChannel.
    +
    mean:
    +
    The mean pixel value for the specified channel(s).
    +
    standard_deviation:
    +
    The standard deviation for the specified channel(s).
    +
    +
    +
    +
    +

    MagickGetImageColormapColor

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageColormapColor( MagickWand *wand, const unsigned long index,
    +                                          PixelWand *color );
    +
    +
    +
    +

    Description

    +

    MagickGetImageColormapColor() returns the color of the specified colormap +index.

    +

    The format of the MagickGetImageColormapColor method is:

    +
    +unsigned int MagickGetImageColormapColor( MagickWand *wand, const unsigned long index,
    +                                          PixelWand *color );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    index:
    +
    The offset into the image colormap.
    +
    color:
    +
    Return the colormap color in this wand.
    +
    +
    +
    +
    +

    MagickGetImageColors

    +
    +

    Synopsis

    +
    +unsigned long MagickGetImageColors( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageColors() gets the number of unique colors in the image.

    +

    The format of the MagickGetImageColors method is:

    +
    +unsigned long MagickGetImageColors( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageColorspace

    +
    +

    Synopsis

    +
    +ColorspaceType MagickGetImageColorspace( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageColorspace() gets the image colorspace.

    +

    The format of the MagickGetImageColorspace method is:

    +
    +ColorspaceType MagickGetImageColorspace( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageCompose

    +
    +

    Synopsis

    +
    +CompositeOperator MagickGetImageCompose( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageCompose() returns the composite operator associated with the +image.

    +

    The format of the MagickGetImageCompose method is:

    +
    +CompositeOperator MagickGetImageCompose( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageCompression

    +
    +

    Synopsis

    +
    +CompressionType MagickGetImageCompression( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageCompression() gets the image compression.

    +

    The format of the MagickGetImageCompression method is:

    +
    +CompressionType MagickGetImageCompression( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageDelay

    +
    +

    Synopsis

    +
    +unsigned long MagickGetImageDelay( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageDelay() gets the image delay.

    +

    The format of the MagickGetImageDelay method is:

    +
    +unsigned long MagickGetImageDelay( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageDepth

    +
    +

    Synopsis

    +
    +unsigned long MagickGetImageDepth( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageDepth() gets the image depth.

    +

    The format of the MagickGetImageDepth method is:

    +
    +unsigned long MagickGetImageDepth( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageExtrema

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageExtrema( MagickWand *wand, unsigned long *min,
    +                                    unsigned long *max );
    +
    +
    +
    +

    Description

    +

    MagickGetImageExtrema() gets the extrema for the image.

    +

    The format of the MagickGetImageExtrema method is:

    +
    +unsigned int MagickGetImageExtrema( MagickWand *wand, unsigned long *min,
    +                                    unsigned long *max );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    min:
    +
    The minimum pixel value for the specified channel(s).
    +
    max:
    +
    The maximum pixel value for the specified channel(s).
    +
    +
    +
    +
    +

    MagickGetImageDispose

    +
    +

    Synopsis

    +
    +DisposeType MagickGetImageDispose( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageDispose() gets the image disposal method.

    +

    The format of the MagickGetImageDispose method is:

    +
    +DisposeType MagickGetImageDispose( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageFilename

    +
    +

    Synopsis

    +
    +const char MagickGetImageFilename( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageFilename() returns the filename of a particular image in a +sequence.

    +

    The format of the MagickGetImageFilename method is:

    +
    +const char MagickGetImageFilename( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageFormat

    +
    +

    Synopsis

    +
    +const char MagickGetImageFormat( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageFormat() returns the format of a particular image in a +sequence.

    +

    The format of the MagickGetImageFormat method is:

    +
    +const char MagickGetImageFormat( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageFuzz

    +
    +

    Synopsis

    +
    +double MagickGetImageFuzz( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageFuzz() returns the color comparison fuzz factor. Colors +closer than the fuzz factor are considered to be the same when comparing +colors. Note that some other functions such as MagickColorFloodfillImage() +implicitly set this value.

    +

    The format of the MagickGetImageFuzz method is:

    +
    +double MagickGetImageFuzz( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageGamma

    +
    +

    Synopsis

    +
    +double MagickGetImageGamma( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageGamma() gets the image gamma.

    +

    The format of the MagickGetImageGamma method is:

    +
    +double MagickGetImageGamma( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageGravity

    +
    +

    Synopsis

    +
    +GravityType MagickGetImageGravity( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageGravity() gets the image gravity.

    +

    The format of the MagickGetImageGravity method is:

    +
    +GravityType MagickGetImageGravity( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageGreenPrimary

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageGreenPrimary( MagickWand *wand, double *x, double *y );
    +
    +
    +
    +

    Description

    +

    MagickGetImageGreenPrimary() returns the chromaticy green primary point.

    +

    The format of the MagickGetImageGreenPrimary method is:

    +
    +unsigned int MagickGetImageGreenPrimary( MagickWand *wand, double *x, double *y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x:
    +
    The chromaticity green primary x-point.
    +
    y:
    +
    The chromaticity green primary y-point.
    +
    +
    +
    +
    +

    MagickGetImageHeight

    +
    +

    Synopsis

    +
    +unsigned long MagickGetImageHeight( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageHeight() returns the image height.

    +

    The format of the MagickGetImageHeight method is:

    +
    +unsigned long MagickGetImageHeight( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageHistogram

    +
    +

    Synopsis

    +
    +PixelWand *MagickGetImageHistogram( MagickWand *wand, unsigned long *number_colors );
    +
    +
    +
    +

    Description

    +

    MagickGetImageHistogram() returns the image histogram as an array of +PixelWand wands.

    +

    The format of the MagickGetImageHistogram method is:

    +
    +PixelWand *MagickGetImageHistogram( MagickWand *wand, unsigned long *number_colors );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    number_colors:
    +
    The number of unique colors in the image and the number +of pixel wands returned.
    +
    +
    +
    +
    +

    MagickGetImageIndex

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageIndex( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageIndex() returns the index of the current image.

    +

    The format of the MagickGetImageIndex method is:

    +
    +unsigned int MagickGetImageIndex( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageInterlaceScheme

    +
    +

    Synopsis

    +
    +InterlaceType MagickGetImageInterlaceScheme( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageInterlaceScheme() gets the image interlace scheme.

    +

    The format of the MagickGetImageInterlaceScheme method is:

    +
    +InterlaceType MagickGetImageInterlaceScheme( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageIterations

    +
    +

    Synopsis

    +
    +unsigned long MagickGetImageIterations( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageIterations() gets the image iterations.

    +

    The format of the MagickGetImageIterations method is:

    +
    +unsigned long MagickGetImageIterations( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageMatteColor

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageMatteColor( MagickWand *wand, PixelWand *matte_color );
    +
    +
    +
    +

    Description

    +

    MagickGetImageMatteColor() returns the image matte color.

    +

    The format of the MagickGetImageMatteColor method is:

    +
    +unsigned int MagickGetImageMatteColor( MagickWand *wand, PixelWand *matte_color );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    matte_color:
    +
    Return the matte color.
    +
    +
    +
    +
    +

    MagickGetImageOrientation

    +
    +

    Synopsis

    +
    +OrientationType MagickGetImageOrientation( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageOrientation() gets the image orientation type. May be one of:

    +

    UndefinedOrientation Image orientation not specified or error. +TopLeftOrientation Left to right and Top to bottom. +TopRightOrientation Right to left and Top to bottom. +BottomRightOrientation Right to left and Bottom to top. +BottomLeftOrientation Left to right and Bottom to top. +LeftTopOrientation Top to bottom and Left to right. +RightTopOrientation Top to bottom and Right to left. +RightBottomOrientation Bottom to top and Right to left. +LeftBottomOrientation Bottom to top and Left to right.

    +

    The format of the MagickGetImageOrientation method is:

    +
    +OrientationType MagickGetImageOrientation( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImagePage

    +
    +

    Synopsis

    +
    +MagickGetImagePage( MagickWand *wand, unsigned long *width, unsigned long *height, long *x,
    +                    long *y );
    +
    +
    +
    +

    Description

    +

    MagickGetImagePage() retrieves the image page size and offset used when +placing (e.g. compositing) the image.

    +

    The format of the MagickGetImagePage method is:

    +
    +MagickGetImagePage( MagickWand *wand, unsigned long *width, unsigned long *height, long *x,
    +                    long *y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    width, height:
    +
    The region size.
    +
    x, y:
    +
    Offset (from top left) on base canvas image on +which to composite image data.
    +
    +
    +
    +
    +

    MagickGetImagePixels

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImagePixels( MagickWand *wand, const long x_offset, const long y_offset,
    +                                   const unsigned long columns, const unsigned long rows,
    +                                   const char *map, const StorageType storage,
    +                                   unsigned char *pixels );
    +
    +
    +
    +

    Description

    +

    MagickGetImagePixels() extracts pixel data from an image and returns it to +you. The method returns False on success otherwise True if an error is +encountered. The data is returned as char, short int, int, long, 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:

    +
    +unsigned int MagickGetImagePixels( MagickWand *wand, const long x_offset, const long y_offset,
    +                                   const unsigned long columns, const unsigned long rows,
    +                                   const char *map, const StorageType storage,
    +                                   unsigned char *pixels );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x_offset, y_offset, 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, C = cyan, Y = yellow, M = magenta, K = black, or +I = intensity (for grayscale).
    +
    storage:
    +
    Define the data type of the pixels. Float and double types are +expected to be normalized [0..1] otherwise [0..MaxRGB]. 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.
    +
    +
    +
    +
    +

    MagickGetImageProfile

    +
    +

    Synopsis

    +
    +unsigned char *MagickGetImageProfile( MagickWand *wand, const char *name,
    +                                      unsigned long *length );
    +
    +
    +
    +

    Description

    +

    MagickGetImageProfile() returns the named image profile.

    +

    The format of the MagickGetImageProfile method is:

    +
    +unsigned char *MagickGetImageProfile( MagickWand *wand, const char *name,
    +                                      unsigned long *length );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    name:
    +
    Name of profile to return: ICC, IPTC, or generic profile.
    +
    length:
    +
    The length of the profile.
    +
    +
    +
    +
    +

    MagickGetImageRedPrimary

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageRedPrimary( MagickWand *wand, double *x, double *y );
    +
    +
    +
    +

    Description

    +

    MagickGetImageRedPrimary() returns the chromaticy red primary point.

    +

    The format of the MagickGetImageRedPrimary method is:

    +
    +unsigned int MagickGetImageRedPrimary( MagickWand *wand, double *x, double *y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x:
    +
    The chromaticity red primary x-point.
    +
    y:
    +
    The chromaticity red primary y-point.
    +
    +
    +
    +
    +

    MagickGetImageRenderingIntent

    +
    +

    Synopsis

    +
    +RenderingIntent MagickGetImageRenderingIntent( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageRenderingIntent() gets the image rendering intent.

    +

    The format of the MagickGetImageRenderingIntent method is:

    +
    +RenderingIntent MagickGetImageRenderingIntent( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageResolution

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageResolution( MagickWand *wand, double *x, double *y );
    +
    +
    +
    +

    Description

    +

    MagickGetImageResolution() gets the image X & Y resolution.

    +

    The format of the MagickGetImageResolution method is:

    +
    +unsigned int MagickGetImageResolution( MagickWand *wand, double *x, double *y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x:
    +
    The image x-resolution.
    +
    y:
    +
    The image y-resolution.
    +
    +
    +
    +
    +

    MagickGetImageScene

    +
    +

    Synopsis

    +
    +unsigned long MagickGetImageScene( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageScene() gets the image scene.

    +

    The format of the MagickGetImageScene method is:

    +
    +unsigned long MagickGetImageScene( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageSignature

    +
    +

    Synopsis

    +
    +const char MagickGetImageSignature( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageSignature() generates an SHA-256 message digest for the image +pixel stream.

    +

    The format of the MagickGetImageSignature method is:

    +
    +const char MagickGetImageSignature( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageSize

    +
    +

    Synopsis

    +
    +MagickSizeType MagickGetImageSize( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageSize() returns the image size.

    +

    The format of the MagickGetImageSize method is:

    +
    +MagickSizeType MagickGetImageSize( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageType

    +
    +

    Synopsis

    +
    +ImageType MagickGetImageType( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageType() gets the image type.

    +

    The format of the MagickGetImageType method is:

    +
    +ImageType MagickGetImageType( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageSavedType

    +
    +

    Synopsis

    +
    +ImageType MagickGetImageSavedType( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageSavedType() gets the image type that will be used when the +image is saved. This may be different to the current image type, returned +by MagickGetImageType().

    +

    The format of the MagickGetImageSavedType method is:

    +
    +ImageType MagickGetImageSavedType( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageUnits

    +
    +

    Synopsis

    +
    +ResolutionType MagickGetImageUnits( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageUnits() gets the image units of resolution.

    +

    The format of the MagickGetImageUnits method is:

    +
    +ResolutionType MagickGetImageUnits( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageVirtualPixelMethod

    +
    +

    Synopsis

    +
    +VirtualPixelMethod MagickGetImageVirtualPixelMethod( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the +sepcified image.

    +

    The format of the MagickGetImageVirtualPixelMethod method is:

    +
    +VirtualPixelMethod MagickGetImageVirtualPixelMethod( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetImageWhitePoint

    +
    +

    Synopsis

    +
    +unsigned int MagickGetImageWhitePoint( MagickWand *wand, double *x, double *y );
    +
    +
    +
    +

    Description

    +

    MagickGetImageWhitePoint() returns the chromaticy white point.

    +

    The format of the MagickGetImageWhitePoint method is:

    +
    +unsigned int MagickGetImageWhitePoint( MagickWand *wand, double *x, double *y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x:
    +
    The chromaticity white x-point.
    +
    y:
    +
    The chromaticity white y-point.
    +
    +
    +
    +
    +

    MagickGetImageWidth

    +
    +

    Synopsis

    +
    +unsigned long MagickGetImageWidth( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetImageWidth() returns the image width.

    +

    The format of the MagickGetImageWidth method is:

    +
    +unsigned long MagickGetImageWidth( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetNumberImages

    +
    +

    Synopsis

    +
    +unsigned long MagickGetNumberImages( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickGetNumberOfImages() returns the number of images associated with a +magick wand.

    +

    The format of the MagickGetNumberImages method is:

    +
    +unsigned long MagickGetNumberImages( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetPackageName

    +
    +

    Synopsis

    +
    +const char *MagickGetPackageName( void );
    +
    +
    +
    +

    Description

    +

    MagickGetPackageName() returns the ImageMagick package name.

    +

    The format of the MagickGetPackageName method is:

    +
    +const char *MagickGetPackageName( void );
    +
    +
    +
    +
    +

    MagickGetQuantumDepth

    +
    +

    Synopsis

    +
    +const char *MagickGetQuantumDepth( unsigned long *depth );
    +
    +
    +
    +

    Description

    +

    MagickGetQuantumDepth() returns the ImageMagick quantum depth.

    +

    The format of the MagickGetQuantumDepth method is:

    +
    +const char *MagickGetQuantumDepth( unsigned long *depth );
    +
    +

    A description of each parameter follows:

    +
    +
    depth:
    +
    The quantum depth is returned as a number.
    +
    +
    +
    +
    +

    MagickGetReleaseDate

    +
    +

    Synopsis

    +
    +const char *MagickGetReleaseDate( void );
    +
    +
    +
    +

    Description

    +

    MagickGetReleaseDate() returns the ImageMagick release date.

    +

    The format of the MagickGetReleaseDate method is:

    +
    +const char *MagickGetReleaseDate( void );
    +
    +
    +
    +
    +

    MagickGetResourceLimit

    +
    +

    Synopsis

    +
    +unsigned long MagickGetResourceLimit( const ResourceType type );
    +
    +
    +
    +

    Description

    +

    MagickGetResourceLimit() returns the the specified resource in megabytes.

    +

    The format of the MagickGetResourceLimit method is:

    +
    +unsigned long MagickGetResourceLimit( const ResourceType type );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickGetSamplingFactors

    +
    +

    Synopsis

    +
    +double *MagickGetSamplingFactors( MagickWand *wand, unsigned long *number_factors );
    +
    +
    +
    +

    Description

    +

    MagickGetSamplingFactors() gets the horizontal and vertical sampling factor.

    +

    The format of the MagickGetSamplingFactors method is:

    +
    +double *MagickGetSamplingFactors( MagickWand *wand, unsigned long *number_factors );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    number_factors:
    +
    The number of factors in the returned array.
    +
    +
    +
    +
    +

    MagickGetSize

    +
    +

    Synopsis

    +
    +unsigned int MagickGetSize( const MagickWand *wand, unsigned long *columns,
    +                            unsigned long *rows );
    +
    +
    +
    +

    Description

    +

    MagickGetSize() returns the size associated with the magick wand.

    +

    The format of the MagickGetSize method is:

    +
    +unsigned int MagickGetSize( const MagickWand *wand, unsigned long *columns,
    +                            unsigned long *rows );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    columns:
    +
    The width in pixels.
    +
    height:
    +
    The height in pixels.
    +
    +
    +
    +
    +

    MagickGetVersion

    +
    +

    Synopsis

    +
    +const char *MagickGetVersion( unsigned long *version );
    +
    +
    +
    +

    Description

    +

    MagickGetVersion() returns the ImageMagick API version as a string and +as a number.

    +

    The format of the MagickGetVersion method is:

    +
    +const char *MagickGetVersion( unsigned long *version );
    +
    +

    A description of each parameter follows:

    +
    +
    version:
    +
    The ImageMagick version is returned as a number.
    +
    +
    +
    +
    +

    MagickHaldClutImage

    +
    +

    Synopsis

    +
    +MagickPassFail MagickHaldClutImage( MagickWand *wand, const MagickWand *clut_wand );
    +
    +
    +
    +

    Description

    +

    The MagickHaldClutImage() method apply a color lookup table (Hald CLUT) to +the image. The fundamental principle of the Hald CLUT algorithm is that +application of an identity CLUT causes no change to the input image, +but an identity CLUT image which has had its colors transformed in +some way (e.g. in Adobe Photoshop) may be used to implement an identical +transform on any other image.

    +

    The minimum CLUT level is 2, and the maximum depends on available memory +(largest successfully tested is 24). A CLUT image is required to have equal +width and height. A CLUT of level 8 is an image of dimension 512x512, a CLUT +of level 16 is an image of dimension 4096x4096. Interpolation is used so +extremely large CLUT images are not required.

    +

    GraphicsMagick provides an 'identity' coder which may be used to generate +identity HLUTs. For example, reading from "identity:8" creates an identity +CLUT of order 8.

    +

    The Hald CLUT algorithm has been developed by Eskil Steenberg as described +at http://www.quelsolaar.com/technology/clut.html, and was adapted for +GraphicsMagick by Clément Follet with support from Cédric Lejeune of +Workflowers.

    +

    The format of the HaldClutImage method is:

    +
    +MagickPassFail MagickHaldClutImage( MagickWand *wand, const MagickWand *clut_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The image wand.
    +
    clut_wand:
    +
    The color lookup table image wand
    +
    +
    +
    +
    +

    MagickHasColormap

    +
    +

    Synopsis

    +
    +unsigned int MagickHasColormap( MagickWand *wand, unsigned int *colormap );
    +
    +
    +
    +

    Description

    +

    MagickHasColormap() returns True if the check was successful with the +colormap parameter set to a boolean value indicating whether the current +wand image uses a color map or not. Returns False if there are no wand +images available.

    +

    The format of the MagickHasColormap method is:

    +
    +unsigned int MagickHasColormap( MagickWand *wand, unsigned int *colormap );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    colormap:
    +
    Set to True if current image uses a color map, False if not.
    +
    +
    +
    +
    +

    MagickHasNextImage

    +
    +

    Synopsis

    +
    +unsigned int MagickHasNextImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickHasNextImage() returns True if the wand has more images when +traversing the list in the forward direction

    +

    The format of the MagickHasNextImage method is:

    +
    +unsigned int MagickHasNextImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickHasPreviousImage

    +
    +

    Synopsis

    +
    +unsigned int MagickHasPreviousImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickHasPreviousImage() returns True if the wand has more images when +traversing the list in the reverse direction

    +

    The format of the MagickHasPreviousImage method is:

    +
    +unsigned int MagickHasPreviousImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickImplodeImage

    +
    +

    Synopsis

    +
    +unsigned int MagickImplodeImage( MagickWand *wand, const double radius );
    +
    +
    +
    +

    Description

    +

    MagickImplodeImage() creates a new image that is a copy of an existing +one with the image pixels "implode" by the specified percentage. It +allocates the memory necessary for the new Image structure and returns a +pointer to the new image.

    +

    The format of the MagickImplodeImage method is:

    +
    +unsigned int MagickImplodeImage( MagickWand *wand, const double radius );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    amount:
    +
    Define the extent of the implosion.
    +
    +
    +
    +
    +

    MagickIsGrayImage

    +
    +

    Synopsis

    +
    +unsigned int MagickIsGrayImage( MagickWand *wand, unsigned int *grayimage );
    +
    +
    +
    +

    Description

    +

    MagickIsGrayImage() returns True if the check was successful with the +grayimage parameter set to a boolean value indicating whether the current +wand image is a gray-scale image or not. Returns False if there was +an error.

    +

    The format of the MagickIsGrayImage method is:

    +
    +unsigned int MagickIsGrayImage( MagickWand *wand, unsigned int *grayimage );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    grayimage:
    +
    Set to True if current image is a gray-scale image, +False if not.
    +
    +
    +
    +
    +

    MagickIsMonochromeImage

    +
    +

    Synopsis

    +
    +unsigned int MagickIsMonochromeImage( MagickWand *wand, unsigned int *monochrome );
    +
    +
    +
    +

    Description

    +

    MagickIsMonochromeImage() returns True if the check was successful with the +monochrome parameter set to a boolean value indicating whether the current +wand image is a monochrome image or not. Returns False if there was +an error.

    +

    The format of the MagickIsMonochromeImage method is:

    +
    +unsigned int MagickIsMonochromeImage( MagickWand *wand, unsigned int *monochrome );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    monochrome:
    +
    Set to True if current image is a monochrome image, +False if not.
    +
    +
    +
    +
    +

    MagickIsOpaqueImage

    +
    +

    Synopsis

    +
    +unsigned int MagickIsOpaqueImage( MagickWand *wand, unsigned int *opaque );
    +
    +
    +
    +

    Description

    +

    MagickIsOpaqueImage() returns True if the check was successful with the +opaque parameter set to a boolean value indicating whether the current +wand image is entirely opaque or not. Returns False if there was +an error.

    +

    The format of the MagickIsOpaqueImage method is:

    +
    +unsigned int MagickIsOpaqueImage( MagickWand *wand, unsigned int *opaque );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    opaque:
    +
    Set to True if current image is entirely opaque, +False if not.
    +
    +
    +
    +
    +

    MagickIsPaletteImage

    +
    +

    Synopsis

    +
    +unsigned int MagickIsPaletteImage( MagickWand *wand, unsigned int *palette );
    +
    +
    +
    +

    Description

    +

    MagickIsPaletteImage() returns True if the check was successful with the +palette parameter set to a boolean value indicating whether the current +wand image is an image with 256 unique colors or less. Returns False if +there was an error. Note that a palette image does not necessarily use a +colormap. See MagickHasColormap() if needing to determine whether a +colormap is in use.

    +

    The format of the MagickIsPaletteImage method is:

    +
    +unsigned int MagickIsPaletteImage( MagickWand *wand, unsigned int *palette );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    palette:
    +
    Set to True if current image is 256 colors or less, +False if not.
    +
    +
    +
    +
    +

    MagickLabelImage

    +
    +

    Synopsis

    +
    +unsigned int MagickLabelImage( MagickWand *wand, const char *label );
    +
    +
    +
    +

    Description

    +

    MagickLabelImage() adds a label to your image.

    +

    The format of the MagickLabelImage method is:

    +
    +unsigned int MagickLabelImage( MagickWand *wand, const char *label );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    label:
    +
    The image label.
    +
    +
    +
    +
    +

    MagickLevelImage

    +
    +

    Synopsis

    +
    +unsigned int MagickLevelImage( MagickWand *wand, const double black_point, const double gamma,
    +                               const double white_point );
    +
    +
    +
    +

    Description

    +

    MagickLevelImage() adjusts the levels of an image by scaling the colors +falling between specified white and black points to the full available +quantum range. The parameters provided represent the black, mid, and white +points. The black point specifies the darkest color in the image. Colors +darker than the black point are set to zero. Mid point specifies a gamma +correction to apply to the image. White point specifies the lightest color +in the image. Colors brighter than the white point are set to the maximum +quantum value.

    +

    The format of the MagickLevelImage method is:

    +
    +unsigned int MagickLevelImage( MagickWand *wand, const double black_point, const double gamma,
    +                               const double white_point );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    black_point:
    +
    The black point.
    +
    gamma:
    +
    The gamma.
    +
    white_point:
    +
    The white point.
    +
    +
    +
    +
    +

    MagickLevelImageChannel

    +
    +

    Synopsis

    +
    +unsigned int MagickLevelImageChannel( MagickWand *wand, const ChannelType channel,
    +                                      const double black_point, const double gamma,
    +                                      const double white_point );
    +
    +
    +
    +

    Description

    +

    MagickLevelImageChannel() adjusts the levels of the specified channel of +the reference image by scaling the colors falling between specified white +and black points to the full available quantum range. The parameters +provided represent the black, mid, and white points. The black point +specifies the darkest color in the image. Colors darker than the black +point are set to zero. Mid point specifies a gamma correction to apply +to the image. White point specifies the lightest color in the image. +Colors brighter than the white point are set to the maximum quantum value.

    +

    The format of the MagickLevelImageChannel method is:

    +
    +unsigned int MagickLevelImageChannel( MagickWand *wand, const ChannelType channel,
    +                                      const double black_point, const double gamma,
    +                                      const double white_point );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    channel:
    +
    Identify which channel to level: RedChannel, GreenChannel, +BlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel, +BlackChannel.
    +
    black_point:
    +
    The black point.
    +
    gamma:
    +
    The gamma.
    +
    white_point:
    +
    The white point.
    +
    +
    +
    +
    +

    MagickMagnifyImage

    +
    +

    Synopsis

    +
    +unsigned int MagickMagnifyImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickMagnifyImage() is a convenience method that scales an image +proportionally to twice its original size.

    +

    The format of the MagickMagnifyImage method is:

    +
    +unsigned int MagickMagnifyImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickMapImage

    +
    +

    Synopsis

    +
    +unsigned int MagickMapImage( MagickWand *wand, const MagickWand *map_wand,
    +                             const unsigned int dither );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the MagickMapImage method is:

    +
    +unsigned int MagickMapImage( MagickWand *wand, const MagickWand *map_wand,
    +                             const unsigned int dither );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    map:
    +
    The map wand.
    +
    dither:
    +
    Set this integer value to something other than zero to dither +the mapped image.
    +
    +
    +
    +
    +

    MagickMatteFloodfillImage

    +
    +

    Synopsis

    +
    +unsigned int MagickMatteFloodfillImage( MagickWand *wand, const Quantum opacity,
    +                                        const double fuzz, const PixelWand *bordercolor,
    +                                        const long x, const long y );
    +
    +
    +
    +

    Description

    +

    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:

    +
    +unsigned int MagickMatteFloodfillImage( MagickWand *wand, const Quantum opacity,
    +                                        const double fuzz, const PixelWand *bordercolor,
    +                                        const long x, const long y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    opacity:
    +
    The opacity.
    +
    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

    +
    +

    Synopsis

    +
    +unsigned int MagickMedianFilterImage( MagickWand *wand, const double radius );
    +
    +
    +
    +

    Description

    +

    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:

    +
    +unsigned int MagickMedianFilterImage( MagickWand *wand, const double radius );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    radius:
    +
    The radius of the pixel neighborhood.
    +
    +
    +
    +
    +

    MagickMinifyImage

    +
    +

    Synopsis

    +
    +unsigned int MagickMinifyImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickMinifyImage() is a convenience method that scales an image +proportionally to one-half its original size

    +

    The format of the MagickMinifyImage method is:

    +
    +unsigned int MagickMinifyImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickModulateImage

    +
    +

    Synopsis

    +
    +unsigned int MagickModulateImage( MagickWand *wand, const double brightness,
    +                                  const double saturation, const double hue );
    +
    +
    +
    +

    Description

    +

    MagickModulateImage() lets you control the brightness, saturation, and hue +of an image.

    +

    The format of the MagickModulateImage method is:

    +
    +unsigned int MagickModulateImage( MagickWand *wand, const double brightness,
    +                                  const double saturation, const double hue );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    brightness:
    +
    The percent change in brighness (-100 thru +100).
    +
    saturation:
    +
    The percent change in saturation (-100 thru +100)
    +
    hue:
    +
    The percent change in hue (-100 thru +100)
    +
    +
    +
    +
    +

    MagickMontageImage

    +
    +

    Synopsis

    +
    +MagickWand MagickMontageImage( MagickWand *wand, const DrawingWand drawing_wand,
    +                               const char *tile_geometry, const char *thumbnail_geometry,
    +                               const MontageMode mode, const char *frame );
    +
    +
    +
    +

    Description

    +

    Use MagickMontageImage() to create a composite image by combining several +separate images. The images are tiled on the composite image with the name +of the image optionally appearing just below the individual tile.

    +

    The format of the MagickMontageImage method is:

    +
    +MagickWand MagickMontageImage( MagickWand *wand, const DrawingWand drawing_wand,
    +                               const char *tile_geometry, const char *thumbnail_geometry,
    +                               const MontageMode mode, const char *frame );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    drawing_wand:
    +
    The drawing wand. The font name, size, and color are +obtained from this wand.
    +
    tile_geometry:
    +
    the number of tiles per row and page (e.g. 6x4+0+0).
    +
    thumbnail_geometry:
    +
    Preferred image size and border size of each +thumbnail (e.g. 120x120+4+3>).
    +
    mode:
    +
    Thumbnail framing mode: Frame, Unframe, or Concatenate.
    +
    frame:
    +
    Surround the image with an ornamental border (e.g. 15x15+3+3). +The frame color is that of the thumbnail's matte color.
    +
    +
    +
    +
    +

    MagickMorphImages

    +
    +

    Synopsis

    +
    +MagickWand *MagickMorphImages( MagickWand *wand, const unsigned long number_frames );
    +
    +
    +
    +

    Description

    +

    MagickMorphImages() method morphs a set of images. Both the image pixels +and size are linearly interpolated to give the appearance of a +meta-morphosis from one image to the next.

    +

    The format of the MagickMorphImages method is:

    +
    +MagickWand *MagickMorphImages( MagickWand *wand, const unsigned long number_frames );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    number_frames:
    +
    The number of in-between images to generate.
    +
    +
    +
    +
    +

    MagickMosaicImages

    +
    +

    Synopsis

    +
    +MagickWand *MagickMosaicImages( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    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.
    +
    +
    +
    +
    +

    MagickMotionBlurImage

    +
    +

    Synopsis

    +
    +unsigned int MagickMotionBlurImage( MagickWand *wand, const double radius, const double sigma,
    +                                    const double angle );
    +
    +
    +
    +

    Description

    +

    MagickMotionBlurImage() 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.

    +

    The format of the MagickMotionBlurImage method is:

    +
    +unsigned int MagickMotionBlurImage( MagickWand *wand, const double radius, const double sigma,
    +                                    const double angle );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting +the center pixel.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    angle:
    +
    Apply the effect along this angle.
    +
    +
    +
    +
    +

    MagickNegateImage

    +
    +

    Synopsis

    +
    +unsigned int MagickNegateImage( MagickWand *wand, const unsigned int gray );
    +
    +
    +
    +

    Description

    +

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

    +

    You can also reduce the influence of a particular channel with a gamma +value of 0.

    +

    The format of the MagickNegateImage method is:

    +
    +unsigned int MagickNegateImage( MagickWand *wand, const unsigned int gray );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    gray:
    +
    If True, only negate grayscale pixels within the image.
    +
    +
    +
    +
    +

    MagickNegateImageChannel

    +
    +

    Synopsis

    +
    +unsigned int MagickNegateImageChannel( MagickWand *wand, const ChannelType channel,
    +                                       const unsigned int gray );
    +
    +
    +
    +

    Description

    +

    MagickNegateImageChannel() negates the colors in the specified channel of the +reference image. The Grayscale option means that only grayscale values +within the image are negated. Note that the Grayscale option has no +effect for GraphicsMagick.

    +

    You can also reduce the influence of a particular channel with a gamma +value of 0.

    +

    The format of the MagickNegateImageChannel method is:

    +
    +unsigned int MagickNegateImageChannel( MagickWand *wand, const ChannelType channel,
    +                                       const unsigned int gray );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    channel:
    +
    Identify which channel to extract: RedChannel, GreenChannel, +BlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel, +BlackChannel.
    +
    gray:
    +
    If True, only negate grayscale pixels within the image.
    +
    +
    +
    +
    +

    MagickNextImage

    +
    +

    Synopsis

    +
    +unsigned int MagickNextImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickNextImage() associates the next image in the image list with a magick +wand. True is returned if the Wand iterated to a next image, or False is +returned if the wand did not iterate to a next image.

    +

    The format of the MagickNextImage method is:

    +
    +unsigned int MagickNextImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickNormalizeImage

    +
    +

    Synopsis

    +
    +unsigned int MagickNormalizeImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickNormalizeImage() enhances the contrast of a color image by adjusting +the pixels color to span the entire range of colors available

    +

    You can also reduce the influence of a particular channel with a gamma +value of 0.

    +

    The format of the MagickNormalizeImage method is:

    +
    +unsigned int MagickNormalizeImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickOilPaintImage

    +
    +

    Synopsis

    +
    +unsigned int MagickOilPaintImage( MagickWand *wand, const double radius );
    +
    +
    +
    +

    Description

    +

    MagickOilPaintImage() applies a special effect filter that simulates an oil +painting. Each pixel is replaced by the most frequent color occurring +in a circular region defined by radius.

    +

    The format of the MagickOilPaintImage method is:

    +
    +unsigned int MagickOilPaintImage( MagickWand *wand, const double radius );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    radius:
    +
    The radius of the circular neighborhood.
    +
    +
    +
    +
    +

    MagickOpaqueImage

    +
    +

    Synopsis

    +
    +unsigned int MagickOpaqueImage( MagickWand *wand, const PixelWand *target,
    +                                const PixelWand *fill, const double fuzz );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the MagickOpaqueImage method is:

    +
    +unsigned int MagickOpaqueImage( MagickWand *wand, const PixelWand *target,
    +                                const PixelWand *fill, const double fuzz );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    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.
    +
    +
    +
    +
    +

    MagickPingImage

    +
    +

    Synopsis

    +
    +unsigned int MagickPingImage( MagickWand *wand, const char *filename );
    +
    +
    +
    +

    Description

    +

    MagickPingImage() is like MagickReadImage() except the only valid +information returned is the image width, height, size, and format. It +is designed to efficiently obtain this information from a file without +reading the entire image sequence into memory.

    +

    The format of the MagickPingImage method is:

    +
    +unsigned int MagickPingImage( MagickWand *wand, const char *filename );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    filename:
    +
    The image filename.
    +
    +
    +
    +
    +

    MagickPreviewImages

    +
    +

    Synopsis

    +
    +MagickWand *MagickPreviewImages( MagickWand *wand, const PreviewType preview );
    +
    +
    +
    +

    Description

    +

    MagickPreviewImages() tiles 9 thumbnails of the specified image with an +image processing operation applied at varying strengths. This is helpful +to quickly pin-point an appropriate parameter for an image processing +operation.

    +

    The format of the MagickPreviewImages method is:

    +
    +MagickWand *MagickPreviewImages( MagickWand *wand, const PreviewType preview );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    preview:
    +
    The preview type.
    +
    +
    +
    +
    +

    MagickPreviousImage

    +
    +

    Synopsis

    +
    +unsigned int MagickPreviousImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickPreviousImage() selects the previous image associated with a magick +wand.

    +

    The format of the MagickPreviousImage method is:

    +
    +unsigned int MagickPreviousImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickProfileImage

    +
    +

    Synopsis

    +
    +unsigned int MagickProfileImage( MagickWand *wand, const char *name,
    +                                 const unsigned char *profile, const size_t length );
    +
    +
    +
    +

    Description

    +

    Use MagickProfileImage() to add or remove a ICC, IPTC, or generic profile +from an image. If the profile is NULL, it is removed from the image +otherwise added. Use a name of '*' and a profile of NULL to remove all +profiles from the image.

    +

    The format of the MagickProfileImage method is:

    +
    +unsigned int MagickProfileImage( MagickWand *wand, const char *name,
    +                                 const unsigned char *profile, const size_t length );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    name:
    +
    Name of profile to add or remove: ICC, IPTC, or generic profile.
    +
    profile:
    +
    The profile.
    +
    length:
    +
    The length of the profile.
    +
    +
    +
    +
    +

    MagickQuantizeImage

    +
    +

    Synopsis

    +
    +unsigned int MagickQuantizeImage( MagickWand *wand, const unsigned long number_colors,
    +                                  const ColorspaceType colorspace,
    +                                  const unsigned long treedepth, const unsigned int dither,
    +                                  const unsigned int measure_error );
    +
    +
    +
    +

    Description

    +

    MagickQuantizeImage() analyzes the colors within a reference image and +chooses a fixed number of colors to represent the image. The goal of the +algorithm is to minimize the color difference between the input and output +image while minimizing the processing time.

    +

    The format of the MagickQuantizeImage method is:

    +
    +unsigned int MagickQuantizeImage( MagickWand *wand, const unsigned long number_colors,
    +                                  const ColorspaceType colorspace,
    +                                  const unsigned long treedepth, const unsigned int dither,
    +                                  const unsigned int measure_error );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    number_colors:
    +
    The number of colors.
    +
    colorspace:
    +
    Perform color reduction in this colorspace, typically +RGBColorspace.
    +
    treedepth:
    +
    Normally, this integer value is zero or one. A zero or +one tells Quantize to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally allows the best representation of the +reference image with the least amount of memory and the fastest +computational speed. In some cases, such as an image with low color +dispersion (a few number of colors), a value other than +Log4(number_colors) is required. To expand the color tree completely, +use a value of 8.
    +
    dither:
    +
    A value other than zero distributes the difference between an +original image and the corresponding color reduced algorithm to +neighboring pixels along a Hilbert curve.
    +
    measure_error:
    +
    A value other than zero measures the difference between +the original and quantized images. This difference is the total +quantization error. The error is computed by summing over all pixels +in an image the distance squared in RGB space between each reference +pixel value and its quantized value.
    +
    +
    +
    +
    +

    MagickQuantizeImages

    +
    +

    Synopsis

    +
    +unsigned int MagickQuantizeImages( MagickWand *wand, const unsigned long number_colors,
    +                                   const ColorspaceType colorspace,
    +                                   const unsigned long treedepth, const unsigned int dither,
    +                                   const unsigned int measure_error );
    +
    +
    +
    +

    Description

    +

    MagickQuantizeImage() analyzes the colors within a sequence of images and +chooses a fixed number of colors to represent the image. The goal of the +algorithm is to minimize the color difference between the input and output +image while minimizing the processing time.

    +

    The format of the MagickQuantizeImages method is:

    +
    +unsigned int MagickQuantizeImages( MagickWand *wand, const unsigned long number_colors,
    +                                   const ColorspaceType colorspace,
    +                                   const unsigned long treedepth, const unsigned int dither,
    +                                   const unsigned int measure_error );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    number_colors:
    +
    The number of colors.
    +
    colorspace:
    +
    Perform color reduction in this colorspace, typically +RGBColorspace.
    +
    treedepth:
    +
    Normally, this integer value is zero or one. A zero or +one tells Quantize to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally allows the best representation of the +reference image with the least amount of memory and the fastest +computational speed. In some cases, such as an image with low color +dispersion (a few number of colors), a value other than +Log4(number_colors) is required. To expand the color tree completely, +use a value of 8.
    +
    dither:
    +
    A value other than zero distributes the difference between an +original image and the corresponding color reduced algorithm to +neighboring pixels along a Hilbert curve.
    +
    measure_error:
    +
    A value other than zero measures the difference between +the original and quantized images. This difference is the total +quantization error. The error is computed by summing over all pixels +in an image the distance squared in RGB space between each reference +pixel value and its quantized value.
    +
    +
    +
    +
    +

    MagickQueryFontMetrics

    +
    +

    Synopsis

    +
    +double *MagickQueryFontMetrics( MagickWand *wand, const DrawingWand *drawing_wand,
    +                                const char *text );
    +
    +
    +
    +

    Description

    +

    MagickQueryFontMetrics() returns a 7 element array representing the +following font metrics:

    +
    +
    +

    Element Description

    +

    0 character width +1 character height +2 ascender +3 descender +4 text width +5 text height +6 maximum horizontal advance

    +

    The format of the MagickQueryFontMetrics method is:

    +
    +double *MagickQueryFontMetrics( MagickWand *wand, const DrawingWand *drawing_wand,
    +                                const char *text );
    +
    +
    +
    wand:
    +
    The Magick wand.
    +
    drawing_wand:
    +
    The drawing wand.
    +
    text:
    +
    The text.
    +
    +
    +
    +
    +

    MagickQueryFonts

    +
    +

    Synopsis

    +
    +char ** MagickQueryFonts( const char *pattern, unsigned long *number_fonts );
    +
    +
    +
    +

    Description

    +

    MagickQueryFonts() returns any font that match the specified pattern.

    +

    The format of the MagickQueryFonts function is:

    +
    +char ** MagickQueryFonts( const char *pattern, unsigned long *number_fonts );
    +
    +

    A description of each parameter follows:

    +
    +
    pattern:
    +
    Specifies a pointer to a text string containing a pattern.
    +
    number_fonts:
    +
    This integer returns the number of fonts in the list.
    +
    +
    +
    +
    +

    MagickQueryFormats

    +
    +

    Synopsis

    +
    +char ** MagickQueryFormats( const char *pattern, unsigned long *number_formats );
    +
    +
    +
    +

    Description

    +

    MagickQueryFormats() returns any image formats that match the specified +pattern.

    +

    The format of the MagickQueryFormats function is:

    +
    +char ** MagickQueryFormats( const char *pattern, unsigned long *number_formats );
    +
    +
    +
    pattern:
    +
    Specifies a pointer to a text string containing a pattern.
    +
    number_formats:
    +
    This integer returns the number of image formats in the +list.
    +
    +
    +
    +
    +

    MagickRadialBlurImage

    +
    +

    Synopsis

    +
    +unsigned int MagickRadialBlurImage( MagickWand *wand, const double angle );
    +
    +
    +
    +

    Description

    +

    MagickRadialBlurImage() radial blurs an image.

    +

    The format of the MagickRadialBlurImage method is:

    +
    +unsigned int MagickRadialBlurImage( MagickWand *wand, const double angle );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    angle:
    +
    The angle of the blur in degrees.
    +
    +
    +
    +
    +

    MagickRaiseImage

    +
    +

    Synopsis

    +
    +unsigned int MagickRaiseImage( MagickWand *wand, const unsigned long width,
    +                               const unsigned long height, const long x, const long y,
    +                               const unsigned int raise_flag );
    +
    +
    +
    +

    Description

    +

    MagickRaiseImage() 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.

    +

    The format of the MagickRaiseImage method is:

    +
    +unsigned int MagickRaiseImage( MagickWand *wand, const unsigned long width,
    +                               const unsigned long height, const long x, const long y,
    +                               const unsigned int raise_flag );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    width,height,x,y:
    +
    Define the dimensions of the area to raise.
    +
    raise_flag:
    +
    A value other than zero creates a 3-D raise effect, +otherwise it has a lowered effect.
    +
    +
    +
    +
    +

    MagickReadImage

    +
    +

    Synopsis

    +
    +unsigned int MagickReadImage( MagickWand *wand, const char *filename );
    +
    +
    +
    +

    Description

    +

    MagickReadImage() reads an image or image sequence.

    +

    The format of the MagickReadImage method is:

    +
    +unsigned int MagickReadImage( MagickWand *wand, const char *filename );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    filename:
    +
    The image filename.
    +
    +
    +
    +
    +

    MagickReadImageBlob

    +
    +

    Synopsis

    +
    +unsigned int MagickReadImageBlob( MagickWand *wand, const unsigned char *blob,
    +                                  const size_t length );
    +
    +
    +
    +

    Description

    +

    MagickReadImageBlob() reads an image or image sequence from a blob.

    +

    The format of the MagickReadImageBlob method is:

    +
    +unsigned int MagickReadImageBlob( MagickWand *wand, const unsigned char *blob,
    +                                  const size_t length );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    blob:
    +
    The blob.
    +
    length:
    +
    The blob length.
    +
    +
    +
    +
    +

    MagickReadImageFile

    +
    +

    Synopsis

    +
    +unsigned int MagickReadImageFile( MagickWand *wand, FILE *file );
    +
    +
    +
    +

    Description

    +

    MagickReadImageFile() reads an image or image sequence from an open file +descriptor.

    +

    The format of the MagickReadImageFile method is:

    +
    +unsigned int MagickReadImageFile( MagickWand *wand, FILE *file );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    file:
    +
    The file descriptor.
    +
    +
    +
    +
    +

    MagickReduceNoiseImage

    +
    +

    Synopsis

    +
    +unsigned int MagickReduceNoiseImage( MagickWand *wand, const double radius );
    +
    +
    +
    +

    Description

    +

    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:

    +
    +unsigned int MagickReduceNoiseImage( MagickWand *wand, const double radius );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    radius:
    +
    The radius of the pixel neighborhood.
    +
    +
    +
    +
    +

    MagickRelinquishMemory

    +
    +

    Synopsis

    +
    +unsigned int MagickRelinquishMemory( void *resource );
    +
    +
    +
    +

    Description

    +

    MagickRelinquishMemory() relinquishes memory resources returned by such +methods as MagickDescribeImage(), MagickGetException(), etc.

    +

    The format of the MagickRelinquishMemory method is:

    +
    +unsigned int MagickRelinquishMemory( void *resource );
    +
    +

    A description of each parameter follows:

    +
    +
    resource:
    +
    Relinquish the memory associated with this resource.
    +
    +
    +
    +
    +

    MagickRemoveImage

    +
    +

    Synopsis

    +
    +unsigned int MagickRemoveImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickRemoveImage() removes an image from the image list.

    +

    The format of the MagickRemoveImage method is:

    +
    +unsigned int MagickRemoveImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickRemoveImageOption

    +
    +

    Synopsis

    +
    +unsigned int MagickRemoveImageOption( MagickWand *wand, const char *format,
    +                                      const char *key );
    +
    +
    +
    +

    Description

    +

    MagickRemoveImageOption() removes an image format-specific option from the +the image (.e.g MagickRemoveImageOption(wand,"jpeg","preserve-settings").

    +

    The format of the MagickRemoveImageOption method is:

    +
    +unsigned int MagickRemoveImageOption( MagickWand *wand, const char *format,
    +                                      const char *key );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    format:
    +
    The image format.
    +
    key:
    +
    The key.
    +
    +
    +
    +
    +

    MagickRemoveImageProfile

    +
    +

    Synopsis

    +
    +unsigned char *MagickRemoveImageProfile( MagickWand *wand, const char *name,
    +                                         unsigned long *length );
    +
    +
    +
    +

    Description

    +

    MagickRemoveImageProfile() removes the named image profile and returns it.

    +

    The format of the MagickRemoveImageProfile method is:

    +
    +unsigned char *MagickRemoveImageProfile( MagickWand *wand, const char *name,
    +                                         unsigned long *length );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    name:
    +
    Name of profile to return: ICC, IPTC, or generic profile.
    +
    length:
    +
    The length of the profile.
    +
    +
    +
    +
    +

    MagickResetIterator

    +
    +

    Synopsis

    +
    +void MagickResetIterator( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickReset() resets the wand iterator. Use it in conjunction +with MagickNextImage() to iterate over all the images in a wand +container.

    +

    The format of the MagickReset method is:

    +
    +void MagickResetIterator( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickResampleImage

    +
    +

    Synopsis

    +
    +unsigned int MagickResampleImage( MagickWand *wand, const double x_resolution,
    +                                  const double y_resolution, const FilterTypes filter,
    +                                  const double blur );
    +
    +
    +
    +

    Description

    +

    MagickResampleImage() resample image to desired resolution.

    +

    Bessel Blackman Box +Catrom Cubic Gaussian +Hanning Hermite Lanczos +Mitchell Point Quandratic +Sinc Triangle

    +

    Most of the filters are FIR (finite impulse response), however, Bessel, +Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc +are windowed (brought down to zero) with the Blackman filter.

    +

    The format of the MagickResampleImage method is:

    +
    +unsigned int MagickResampleImage( MagickWand *wand, const double x_resolution,
    +                                  const double y_resolution, const FilterTypes filter,
    +                                  const double blur );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x_resolution:
    +
    The new image x resolution.
    +
    y_resolution:
    +
    The new image y resolution.
    +
    filter:
    +
    Image filter to use.
    +
    blur:
    +
    The blur factor where > 1 is blurry, < 1 is sharp.
    +
    +
    +
    +
    +

    MagickResizeImage

    +
    +

    Synopsis

    +
    +unsigned int MagickResizeImage( MagickWand *wand, const unsigned long columns,
    +                                const unsigned long rows, const FilterTypes filter,
    +                                const double blur );
    +
    +
    +
    +

    Description

    +

    MagickResizeImage() scales an image to the desired dimensions with one of +these filters:

    +

    Bessel Blackman Box +Catrom Cubic Gaussian +Hanning Hermite Lanczos +Mitchell Point Quandratic +Sinc Triangle

    +

    Most of the filters are FIR (finite impulse response), however, Bessel, +Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc +are windowed (brought down to zero) with the Blackman filter.

    +

    The format of the MagickResizeImage method is:

    +
    +unsigned int MagickResizeImage( MagickWand *wand, const unsigned long columns,
    +                                const unsigned long rows, const FilterTypes filter,
    +                                const double blur );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    columns:
    +
    The number of columns in the scaled image.
    +
    rows:
    +
    The number of rows in the scaled image.
    +
    filter:
    +
    Image filter to use.
    +
    blur:
    +
    The blur factor where > 1 is blurry, < 1 is sharp.
    +
    +
    +
    +
    +

    MagickRollImage

    +
    +

    Synopsis

    +
    +unsigned int MagickRollImage( MagickWand *wand, const long x_offset,
    +                              const unsigned long y_offset );
    +
    +
    +
    +

    Description

    +

    MagickRollImage() offsets an image as defined by x_offset and y_offset.

    +

    The format of the MagickRollImage method is:

    +
    +unsigned int MagickRollImage( MagickWand *wand, const long x_offset,
    +                              const unsigned long y_offset );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x_offset:
    +
    The x offset.
    +
    y_offset:
    +
    The y offset.
    +
    +
    +
    +
    +

    MagickRotateImage

    +
    +

    Synopsis

    +
    +unsigned int MagickRotateImage( MagickWand *wand, const PixelWand *background,
    +                                const double degrees );
    +
    +
    +
    +

    Description

    +

    MagickRotateImage() rotates an image the specified number of degrees. Empty +triangles left over from rotating the image are filled with the +background color.

    +

    The format of the MagickRotateImage method is:

    +
    +unsigned int MagickRotateImage( MagickWand *wand, const PixelWand *background,
    +                                const double degrees );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    background:
    +
    The background pixel wand.
    +
    degrees:
    +
    The number of degrees to rotate the image.
    +
    +
    +
    +
    +

    MagickSampleImage

    +
    +

    Synopsis

    +
    +unsigned int MagickSampleImage( MagickWand *wand, const unsigned long columns,
    +                                const unsigned long rows );
    +
    +
    +
    +

    Description

    +

    MagickSampleImage() scales an image to the desired dimensions with pixel +sampling. Unlike other scaling methods, this method does not introduce +any additional color into the scaled image.

    +

    The format of the MagickSampleImage method is:

    +
    +unsigned int MagickSampleImage( MagickWand *wand, const unsigned long columns,
    +                                const unsigned long rows );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    columns:
    +
    The number of columns in the scaled image.
    +
    rows:
    +
    The number of rows in the scaled image.
    +
    +
    +
    +
    +

    MagickScaleImage

    +
    +

    Synopsis

    +
    +unsigned int MagickScaleImage( MagickWand *wand, const unsigned long columns,
    +                               const unsigned long rows );
    +
    +
    +
    +

    Description

    +

    MagickScaleImage() scales the size of an image to the given dimensions.

    +

    The format of the MagickScaleImage method is:

    +
    +unsigned int MagickScaleImage( MagickWand *wand, const unsigned long columns,
    +                               const unsigned long rows );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    columns:
    +
    The number of columns in the scaled image.
    +
    rows:
    +
    The number of rows in the scaled image.
    +
    +
    +
    +
    +

    MagickSeparateImageChannel

    +
    +

    Synopsis

    +
    +unsigned int MagickSeparateImageChannel( MagickWand *wand, const ChannelType channel );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the MagickChannelImage method is:

    +
    +unsigned int MagickSeparateImageChannel( MagickWand *wand, const ChannelType channel );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    channel:
    +
    Identify which channel to extract: RedChannel, GreenChannel, +BlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel, +BlackChannel.
    +
    +
    +
    +
    +

    MagickSetCompressionQuality

    +
    +

    Synopsis

    +
    +unsigned int MagickSetCompressionQuality( MagickWand *wand, const unsigned long quality );
    +
    +
    +
    +

    Description

    +

    MagickSetCompressionQuality() sets the image quality factor, which +determines compression options when saving the file.

    +

    For the JPEG and MPEG image formats, quality is 0 (lowest image +quality and highest compression) to 100 (best quality but least +effective compression). The default quality is 75. Use the +-sampling-factor option to specify the factors for chroma +downsampling. To use the same quality value as that found by the +JPEG decoder, use the -define jpeg:preserve-settings flag.

    +

    For the MIFF image format, and the TIFF format while using ZIP +compression, quality/10 is the zlib compres- sion level, which is 0 +(worst but fastest compression) to 9 (best but slowest). It has no +effect on the image appearance, since the compression is always +lossless.

    +

    For the JPEG-2000 image format, quality is mapped using a non-linear +equation to the compression ratio required by the Jasper library. +This non-linear equation is intended to loosely approximate the +quality provided by the JPEG v1 format. The default quality value 75 +results in a request for 16:1 compression. The quality value 100 +results in a request for non-lossy compres- sion.

    +

    For the MNG and PNG image formats, the quality value sets the zlib +compression level (quality / 10) and filter-type (quality % 10). +Compression levels range from 0 (fastest compression) to 100 (best +but slowest). For compression level 0, the Huffman-only strategy is +used, which is fastest but not necessarily the worst compression. If +filter-type is 4 or less, the specified filter-type is used for all +scanlines:

    +
      +
    1. none
    2. +
    3. sub
    4. +
    5. up
    6. +
    7. average
    8. +
    9. Paeth
    10. +
    +

    If filter-type is 5, adaptive filtering is used when quality is +greater than 50 and the image does not have a color map, otherwise no +filtering is used.

    +

    If filter-type is 6, adaptive filtering with minimum- +sum-of-absolute-values is used.

    +

    Only if the output is MNG, if filter-type is 7, the LOCO color +transformation and adaptive filtering with +minimum-sum-of-absolute-values are used.

    +

    The default is quality is 75, which means nearly the best compression +with adaptive filtering. The quality setting has no effect on the +appearance of PNG and MNG images, since the compression is always +lossless.

    +

    For further information, see the PNG specification.

    +

    When writing a JNG image with transparency, two quality values are +required, one for the main image and one for the grayscale image that +conveys the opacity channel. These are written as a single integer +equal to the main image quality plus 1000 times the opacity quality. +For example, if you want to use quality 75 for the main image and +quality 90 to compress the opacity data, use -quality 90075.

    +

    For the PNM family of formats (PNM, PGM, and PPM) specify a quality +factor of zero in order to obtain the ASCII variant of the +format. Note that -compress none used to be used to trigger ASCII +output but provided the opposite result of what was expected as +compared with other formats.

    +

    The format of the MagickSetCompressionQuality method is:

    +
    +unsigned int MagickSetCompressionQuality( MagickWand *wand, const unsigned long quality );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    delay:
    +
    The image quality.
    +
    +
    +
    +
    +

    MagickSetDepth

    +
    +

    Synopsis

    +
    +unsigned int MagickSetDepth( MagickWand *wand, const size_t depth );
    +
    +
    +
    +

    Description

    +

    MagickSetDepth() sets the sample depth to be used when reading from a +raw image or a format which requires that the depth be specified in +advance by the user.

    +

    The format of the MagickSetDepth method is:

    +
    +unsigned int MagickSetDepth( MagickWand *wand, const size_t depth );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    depth:
    +
    The sample depth.
    +
    +
    +
    +
    +

    MagickSetFilename

    +
    +

    Synopsis

    +
    +unsigned int MagickSetFilename( MagickWand *wand, const char *filename );
    +
    +
    +
    +

    Description

    +

    MagickSetFilename() sets the filename before you read or write an image file.

    +

    The format of the MagickSetFilename method is:

    +
    +unsigned int MagickSetFilename( MagickWand *wand, const char *filename );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    filename:
    +
    The image filename.
    +
    +
    +
    +
    +

    MagickSetFormat

    +
    +

    Synopsis

    +
    +unsigned int MagickSetFormat( MagickWand *wand, const char *format );
    +
    +
    +
    +

    Description

    +

    MagickSetFormat() sets the file or blob format (e.g. "BMP") to be used +when a file or blob is read. Usually this is not necessary because +GraphicsMagick is able to auto-detect the format based on the file +header (or the file extension), but some formats do not use a unique +header or the selection may be ambigious. Use MagickSetImageFormat() +to set the format to be used when a file or blob is to be written.

    +

    The format of the MagickSetFormat method is:

    +
    +unsigned int MagickSetFormat( MagickWand *wand, const char *format );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    filename:
    +
    The file or blob format.
    +
    +
    +
    +
    +

    MagickSetImage

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImage( MagickWand *wand, const MagickWand *set_wand );
    +
    +
    +
    +

    Description

    +

    MagickSetImage() replaces the last image returned by MagickSetImageIndex(), +MagickNextImage(), MagickPreviousImage() with the images from the specified +wand.

    +

    The format of the MagickSetImage method is:

    +
    +unsigned int MagickSetImage( MagickWand *wand, const MagickWand *set_wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    set_wand:
    +
    The set_wand wand.
    +
    +
    +
    +
    +

    MagickSetImageAttribute

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageAttribute( MagickWand *wand, const char *name,
    +                                      const char *value );
    +
    +
    +
    +

    Description

    +

    MagickSetImageAttribute sets an image attribute

    +

    The format of the MagickSetImageAttribute method is:

    +
    +unsigned int MagickSetImageAttribute( MagickWand *wand, const char *name,
    +                                      const char *value );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    name:
    +
    The name of the attribute
    +
    value:
    +
    The value of the attribute
    +
    +
    +
    +
    +

    MagickSetImageBackgroundColor

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageBackgroundColor( MagickWand *wand, const PixelWand *background );
    +
    +
    +
    +

    Description

    +

    MagickSetImageBackgroundColor() sets the image background color.

    +

    The format of the MagickSetImageBackgroundColor method is:

    +
    +unsigned int MagickSetImageBackgroundColor( MagickWand *wand, const PixelWand *background );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    background:
    +
    The background pixel wand.
    +
    +
    +
    +
    +

    MagickSetImageBluePrimary

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageBluePrimary( MagickWand *wand, const double x, const double y );
    +
    +
    +
    +

    Description

    +

    MagickSetImageBluePrimary() sets the image chromaticity blue primary point.

    +

    The format of the MagickSetImageBluePrimary method is:

    +
    +unsigned int MagickSetImageBluePrimary( MagickWand *wand, const double x, const double y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x:
    +
    The blue primary x-point.
    +
    y:
    +
    The blue primary y-point.
    +
    +
    +
    +
    +

    MagickSetImageBorderColor

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageBorderColor( MagickWand *wand, const PixelWand *border );
    +
    +
    +
    +

    Description

    +

    MagickSetImageBorderColor() sets the image border color.

    +

    The format of the MagickSetImageBorderColor method is:

    +
    +unsigned int MagickSetImageBorderColor( MagickWand *wand, const PixelWand *border );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    border:
    +
    The border pixel wand.
    +
    +
    +
    +
    +

    MagickSetImageColormapColor

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageColormapColor( MagickWand *wand, const unsigned long index,
    +                                          const PixelWand *color );
    +
    +
    +
    +

    Description

    +

    MagickSetImageColormapColor() sets the color of the specified colormap +index.

    +

    The format of the MagickSetImageColormapColor method is:

    +
    +unsigned int MagickSetImageColormapColor( MagickWand *wand, const unsigned long index,
    +                                          const PixelWand *color );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    index:
    +
    The offset into the image colormap.
    +
    color:
    +
    Return the colormap color in this wand.
    +
    +
    +
    +
    +

    MagickSetImageColorspace

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageColorspace( MagickWand *wand, const ColorspaceType colorspace );
    +
    +
    +
    +

    Description

    +

    MagickSetImageColorspace() sets the image colorspace.

    +

    The format of the MagickSetImageColorspace method is:

    +
    +unsigned int MagickSetImageColorspace( MagickWand *wand, const ColorspaceType colorspace );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    colorspace:
    +
    The image colorspace: UndefinedColorspace, RGBColorspace, +GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace, +YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace, +YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace, +HSLColorspace, or HWBColorspace.
    +
    +
    +
    +
    +

    MagickSetImageCompose

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageCompose( MagickWand *wand, const CompositeOperator compose );
    +
    +
    +
    +

    Description

    +

    MagickSetImageCompose() sets the image composite operator, useful for +specifying how to composite the image thumbnail when using the +MagickMontageImage() method.

    +

    The format of the MagickSetImageCompose method is:

    +
    +unsigned int MagickSetImageCompose( MagickWand *wand, const CompositeOperator compose );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    compose:
    +
    The image composite operator.
    +
    +
    +
    +
    +

    MagickSetImageCompression

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageCompression( MagickWand *wand,
    +                                        const CompressionType compression );
    +
    +
    +
    +

    Description

    +

    MagickSetImageCompression() sets the image compression.

    +

    The format of the MagickSetImageCompression method is:

    +
    +unsigned int MagickSetImageCompression( MagickWand *wand,
    +                                        const CompressionType compression );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    compression:
    +
    The image compression type.
    +
    +
    +
    +
    +

    MagickSetImageDelay

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageDelay( MagickWand *wand, const unsigned long delay );
    +
    +
    +
    +

    Description

    +

    MagickSetImageDelay() sets the image delay.

    +

    The format of the MagickSetImageDelay method is:

    +
    +unsigned int MagickSetImageDelay( MagickWand *wand, const unsigned long delay );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    delay:
    +
    The image delay in 1/100th of a second.
    +
    +
    +
    +
    +

    MagickSetImageChannelDepth

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageChannelDepth( MagickWand *wand, const ChannelType channel,
    +                                         const unsigned long depth );
    +
    +
    +
    +

    Description

    +

    MagickSetImageChannelDepth() sets the depth of a particular image channel.

    +

    The format of the MagickSetImageChannelDepth method is:

    +
    +unsigned int MagickSetImageChannelDepth( MagickWand *wand, const ChannelType channel,
    +                                         const unsigned long depth );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    channel:
    +
    Identify which channel to extract: RedChannel, GreenChannel, +BlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel, +BlackChannel.
    +
    depth:
    +
    The image depth in bits.
    +
    +
    +
    +
    +

    MagickSetImageDepth

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageDepth( MagickWand *wand, const unsigned long depth );
    +
    +
    +
    +

    Description

    +

    MagickSetImageDepth() sets the image depth.

    +

    The format of the MagickSetImageDepth method is:

    +
    +unsigned int MagickSetImageDepth( MagickWand *wand, const unsigned long depth );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    depth:
    +
    The image depth in bits: 8, 16, or 32.
    +
    +
    +
    +
    +

    MagickSetImageDispose

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageDispose( MagickWand *wand, const DisposeType dispose );
    +
    +
    +
    +

    Description

    +

    MagickSetImageDispose() sets the image disposal method.

    +

    The format of the MagickSetImageDispose method is:

    +
    +unsigned int MagickSetImageDispose( MagickWand *wand, const DisposeType dispose );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    dispose:
    +
    The image disposeal type.
    +
    +
    +
    +
    +

    MagickSetImageFilename

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageFilename( MagickWand *wand, const char *filename );
    +
    +
    +
    +

    Description

    +

    MagickSetImageFilename() sets the filename of a particular image in a +sequence.

    +

    The format of the MagickSetImageFilename method is:

    +
    +unsigned int MagickSetImageFilename( MagickWand *wand, const char *filename );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    filename:
    +
    The image filename.
    +
    +
    +
    +
    +

    MagickSetImageFormat

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageFormat( MagickWand *wand, const char *format );
    +
    +
    +
    +

    Description

    +

    MagickSetImageFormat() sets the format of a particular image in a +sequence. The format is designated by a magick string (e.g. "GIF").

    +

    The format of the MagickSetImageFormat method is:

    +
    +unsigned int MagickSetImageFormat( MagickWand *wand, const char *format );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    magick:
    +
    The image format.
    +
    +
    +
    +
    +

    MagickSetImageFuzz

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageFuzz( MagickWand *wand, const double fuzz );
    +
    +
    +
    +

    Description

    +

    MagickSetImageFuzz() sets the color comparison fuzz factor. Colors +closer than the fuzz factor are considered to be the same when comparing +colors. Note that some other functions such as MagickColorFloodfillImage() +implicitly set this value.

    +

    The format of the MagickSetImageFuzz method is:

    +
    +unsigned int MagickSetImageFuzz( MagickWand *wand, const double fuzz );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    fuzz:
    +
    The color comparison fuzz factor
    +
    +
    +
    +
    +

    MagickSetImageGamma

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageGamma( MagickWand *wand, const double gamma );
    +
    +
    +
    +

    Description

    +

    MagickSetImageGamma() sets the image gamma.

    +

    The format of the MagickSetImageGamma method is:

    +
    +unsigned int MagickSetImageGamma( MagickWand *wand, const double gamma );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    gamma:
    +
    The image gamma.
    +
    +
    +
    +
    +

    MagickSetImageGravity

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageGravity( MagickWand *wand, const GravityType );
    +
    +
    +
    +

    Description

    +

    MagickSetImageGravity() sets the image gravity. This is used +when evaluating regions defined by a geometry and the image +dimensions. It may be used in conjunction with operations which +use a geometry parameter to adjust the x, y parameters of the +final operation. Gravity is used in composition to determine where +the image should be placed within the defined geometry region. +It may be used with montage to effect placement of the image within +the tile.

    +

    The format of the MagickSetImageGravity method is:

    +
    +unsigned int MagickSetImageGravity( MagickWand *wand, const GravityType );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    gravity:
    +
    The image gravity. Available values are ForgetGravity, +NorthWestGravity, NorthGravity, NorthEastGravity, WestGravity, +CenterGravity, EastGravity, SouthWestGravity, SouthGravity, +SouthEastGravity, and StaticGravity
    +
    +
    +
    +
    +

    MagickSetImageGreenPrimary

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageGreenPrimary( MagickWand *wand, const double x, const double y );
    +
    +
    +
    +

    Description

    +

    MagickSetImageGreenPrimary() sets the image chromaticity green primary +point.

    +

    The format of the MagickSetImageGreenPrimary method is:

    +
    +unsigned int MagickSetImageGreenPrimary( MagickWand *wand, const double x, const double y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x:
    +
    The green primary x-point.
    +
    y:
    +
    The green primary y-point.
    +
    +
    +
    +
    +

    MagickSetImageIndex

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageIndex( MagickWand *wand, const long index );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the MagickSetImageIndex method is:

    +
    +unsigned int MagickSetImageIndex( MagickWand *wand, const long index );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    index:
    +
    The scene number.
    +
    +
    +
    +
    +

    MagickSetImageInterlaceScheme

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageInterlaceScheme( MagickWand *wand,
    +                                            const InterlaceType interlace_scheme );
    +
    +
    +
    +

    Description

    +

    MagickSetImageInterlaceScheme() sets the image interlace scheme. Please +use SetInterlaceScheme() instead to change the interlace scheme used when +writing the image.

    +

    The format of the MagickSetImageInterlaceScheme method is:

    +
    +unsigned int MagickSetImageInterlaceScheme( MagickWand *wand,
    +                                            const InterlaceType interlace_scheme );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    interlace_scheme:
    +
    The image interlace scheme: NoInterlace, LineInterlace, +PlaneInterlace, PartitionInterlace.
    +
    +
    +
    +
    +

    MagickSetImageIterations

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageIterations( MagickWand *wand, const unsigned long iterations );
    +
    +
    +
    +

    Description

    +

    MagickSetImageIterations() sets the image iterations.

    +

    The format of the MagickSetImageIterations method is:

    +
    +unsigned int MagickSetImageIterations( MagickWand *wand, const unsigned long iterations );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    delay:
    +
    The image delay in 1/100th of a second.
    +
    +
    +
    +
    +

    MagickSetImageMatteColor

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageMatteColor( MagickWand *wand, const PixelWand *matte );
    +
    +
    +
    +

    Description

    +

    MagickSetImageMatteColor() sets the image matte color.

    +

    The format of the MagickSetImageMatteColor method is:

    +
    +unsigned int MagickSetImageMatteColor( MagickWand *wand, const PixelWand *matte );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    matte:
    +
    The matte pixel wand.
    +
    +
    +
    +
    +

    MagickSetImageOption

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageOption( MagickWand *wand, const char *format, const char *key,
    +                                   const char *value );
    +
    +
    +
    +

    Description

    +

    MagickSetImageOption() associates one or options with a particular image +format (.e.g MagickSetImageOption(wand,"jpeg","preserve-settings","true").

    +

    The format of the MagickSetImageOption method is:

    +
    +unsigned int MagickSetImageOption( MagickWand *wand, const char *format, const char *key,
    +                                   const char *value );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    format:
    +
    The image format.
    +
    key:
    +
    The key.
    +
    value:
    +
    The value.
    +
    +
    +
    +
    +

    MagickSetImageOrientation

    +
    +

    Synopsis

    +
    +MagickSetImageOrientation( MagickWand *wand, OrientationType new_orientation );
    +
    +
    +
    +

    Description

    +

    MagickSetImageOrientation() sets the internal image orientation type. +The EXIF orientation tag will be updated if present.

    +

    The format of the MagickSetImageOrientation method is:

    +
    +MagickSetImageOrientation( MagickWand *wand, OrientationType new_orientation );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    new_orientation:
    +
    The new orientation of the image. One of:
    +
    +

    UndefinedOrientation Image orientation not specified. +TopLeftOrientation Left to right and Top to bottom. +TopRightOrientation Right to left and Top to bottom. +BottomRightOrientation Right to left and Bottom to top. +BottomLeftOrientation Left to right and Bottom to top. +LeftTopOrientation Top to bottom and Left to right. +RightTopOrientation Top to bottom and Right to left. +RightBottomOrientation Bottom to top and Right to left. +LeftBottomOrientation Bottom to top and Left to right.

    +

    Returns True on success, False otherwise.

    +
    +
    +
    +

    MagickSetImagePage

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImagePage( MagickWand *wand, const unsigned long width,
    +                                 const unsigned long height, const long x, const long y );
    +
    +
    +
    +

    Description

    +

    MagickSetImagePage() sets the image page size and offset used when +placing (e.g. compositing) the image. Pass all zeros for the +default placement.

    +

    The format of the MagickSetImagePage method is:

    +
    +unsigned int MagickSetImagePage( MagickWand *wand, const unsigned long width,
    +                                 const unsigned long height, const long x, const long y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    width, height:
    +
    The region size.
    +
    x, y:
    +
    Offset (from top left) on base canvas image on +which to composite image data.
    +
    +
    +
    +
    +

    MagickSetImagePixels

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImagePixels( MagickWand *wand, const long x_offset, const long y_offset,
    +                                   const unsigned long columns, const unsigned long rows,
    +                                   const char *map, const StorageType storage,
    +                                   unsigned char *pixels );
    +
    +
    +
    +

    Description

    +

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

    +

    Suppose your want want to upload the first scanline of a 640x480 image from +character data in red-green-blue order:

    +

    MagickSetImagePixels(wand,0,0,0,640,1,"RGB",CharPixel,pixels);

    +

    The format of the MagickSetImagePixels method is:

    +
    +unsigned int MagickSetImagePixels( MagickWand *wand, const long x_offset, const long y_offset,
    +                                   const unsigned long columns, const unsigned long rows,
    +                                   const char *map, const StorageType storage,
    +                                   unsigned char *pixels );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x_offset, y_offset:
    +
    Offset (from top left) on base canvas image on +which to composite image data.
    +
    columns, rows:
    +
    Dimensions of image.
    +
    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 (same as Transparency), O = Opacity, T = Transparency, +C = cyan, Y = yellow, M = magenta, K = black, or I = intensity +(for grayscale). Specify "P" = pad, to skip over a quantum which is +intentionally ignored. Creation of an alpha channel for CMYK images +is currently not supported.
    +
    storage:
    +
    Define the data type of the pixels. Float and double types are +expected to be normalized [0..1] otherwise [0..MaxRGB]. 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.
    +
    +
    +
    +
    +

    MagickSetImageProfile

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageProfile( MagickWand *wand, const char *name,
    +                                    const unsigned char *profile,
    +                                    const unsigned long length );
    +
    +
    +
    +

    Description

    +

    MagickSetImageProfile() adds a named profile to the magick wand. If a +profile with the same name already exists, it is replaced. This method +differs from the MagickProfileImage() method in that it does not apply any +CMS color profiles.

    +

    The format of the MagickSetImageProfile method is:

    +
    +unsigned int MagickSetImageProfile( MagickWand *wand, const char *name,
    +                                    const unsigned char *profile,
    +                                    const unsigned long length );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    name:
    +
    Name of profile to add or remove: ICC, IPTC, or generic profile.
    +
    profile:
    +
    The profile.
    +
    length:
    +
    The length of the profile.
    +
    +
    +
    +
    +

    MagickSetImageRedPrimary

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageRedPrimary( MagickWand *wand, const double x, const double y );
    +
    +
    +
    +

    Description

    +

    MagickSetImageRedPrimary() sets the image chromaticity red primary point.

    +

    The format of the MagickSetImageRedPrimary method is:

    +
    +unsigned int MagickSetImageRedPrimary( MagickWand *wand, const double x, const double y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x:
    +
    The red primary x-point.
    +
    y:
    +
    The red primary y-point.
    +
    +
    +
    +
    +

    MagickSetImageRenderingIntent

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageRenderingIntent( MagickWand *wand,
    +                                            const RenderingIntent rendering_intent );
    +
    +
    +
    +

    Description

    +

    MagickSetImageRenderingIntent() sets the image rendering intent.

    +

    The format of the MagickSetImageRenderingIntent method is:

    +
    +unsigned int MagickSetImageRenderingIntent( MagickWand *wand,
    +                                            const RenderingIntent rendering_intent );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    rendering_intent:
    +
    The image rendering intent: UndefinedIntent, +SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.
    +
    +
    +
    +
    +

    MagickSetImageResolution

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageResolution( MagickWand *wand, const double x_resolution,
    +                                       const doubtl y_resolution );
    +
    +
    +
    +

    Description

    +

    MagickSetImageResolution() sets the image resolution.

    +

    The format of the MagickSetImageResolution method is:

    +
    +unsigned int MagickSetImageResolution( MagickWand *wand, const double x_resolution,
    +                                       const doubtl y_resolution );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x_resolution:
    +
    The image x resolution.
    +
    y_resolution:
    +
    The image y resolution.
    +
    +
    +
    +
    +

    MagickSetImageScene

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageScene( MagickWand *wand, const unsigned long scene );
    +
    +
    +
    +

    Description

    +

    MagickSetImageScene() sets the image scene.

    +

    The format of the MagickSetImageScene method is:

    +
    +unsigned int MagickSetImageScene( MagickWand *wand, const unsigned long scene );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    delay:
    +
    The image scene number.
    +
    +
    +
    +
    +

    MagickSetImageType

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageType( MagickWand *wand, const ImageType image_type );
    +
    +
    +
    +

    Description

    +

    MagickSetImageType() sets the image type.

    +

    The format of the MagickSetImageType method is:

    +
    +unsigned int MagickSetImageType( MagickWand *wand, const ImageType image_type );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    image_type:
    +
    The image type: UndefinedType, BilevelType, GrayscaleType, +GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType, +TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType, +or OptimizeType.
    +
    +
    +
    +
    +

    MagickSetImageSavedType

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageSavedType( MagickWand *wand, const ImageType image_type );
    +
    +
    +
    +

    Description

    +

    MagickSetImageSavedType() sets the image type that will be used when the +image is saved.

    +

    The format of the MagickSetImageSavedType method is:

    +
    +unsigned int MagickSetImageSavedType( MagickWand *wand, const ImageType image_type );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    image_type:
    +
    The image type: UndefinedType, BilevelType, GrayscaleType, +GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType, +TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType, +or OptimizeType.
    +
    +
    +
    +
    +

    MagickSetImageUnits

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageUnits( MagickWand *wand, const ResolutionType units );
    +
    +
    +
    +

    Description

    +

    MagickSetImageUnits() sets the image units of resolution.

    +

    The format of the MagickSetImageUnits method is:

    +
    +unsigned int MagickSetImageUnits( MagickWand *wand, const ResolutionType units );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    units:
    +
    The image units of resolution : Undefinedresolution, +PixelsPerInchResolution, or PixelsPerCentimeterResolution.
    +
    +
    +
    +
    +

    MagickSetImageVirtualPixelMethod

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageVirtualPixelMethod( MagickWand *wand,
    +                                               const VirtualPixelMethod method );
    +
    +
    +
    +

    Description

    +

    MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.

    +

    The format of the MagickSetImageVirtualPixelMethod method is:

    +
    +unsigned int MagickSetImageVirtualPixelMethod( MagickWand *wand,
    +                                               const VirtualPixelMethod method );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    method:
    +
    The image virtual pixel method : UndefinedVirtualPixelMethod, +ConstantVirtualPixelMethod, EdgeVirtualPixelMethod, +MirrorVirtualPixelMethod, or TileVirtualPixelMethod.
    +
    +
    +
    +
    +

    MagickSetInterlaceScheme

    +
    +

    Synopsis

    +
    +unsigned int MagickSetInterlaceScheme( MagickWand *wand,
    +                                       const InterlaceType interlace_scheme );
    +
    +
    +
    +

    Description

    +

    MagickSetInterlaceScheme() sets the interlace scheme used when writing +the image.

    +

    The format of the MagickSetInterlaceScheme method is:

    +
    +unsigned int MagickSetInterlaceScheme( MagickWand *wand,
    +                                       const InterlaceType interlace_scheme );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    interlace_scheme:
    +
    The image interlace scheme: NoInterlace, LineInterlace, +PlaneInterlace, PartitionInterlace.
    +
    +
    +
    +
    +

    MagickSetResolution

    +
    +

    Synopsis

    +
    +unsigned int MagickSetResolution( MagickWand *wand, const double x_resolution,
    +                                  const double y_resolution );
    +
    +
    +
    +

    Description

    +

    MagickSetResolution() sets the resolution (density) of the magick wand. +Set it before you read an EPS, PDF, or Postscript file in order to +influence the size of the returned image, or after an image has already +been created to influence the rendered image size when used with +typesetting software.

    +

    Also see MagickSetResolutionUnits() which specifies the units to use for +the image resolution.

    +

    The format of the MagickSetResolution method is:

    +
    +unsigned int MagickSetResolution( MagickWand *wand, const double x_resolution,
    +                                  const double y_resolution );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x_resolution:
    +
    The horizontal resolution
    +
    y_resolution:
    +
    The vertical reesolution
    +
    +
    +
    +
    +

    MagickSetResolutionUnits

    +
    +

    Synopsis

    +
    +unsigned int MagickSetResolutionUnits( MagickWand *wand, const ResolutionType units );
    +
    +
    +
    +

    Description

    +

    MagickSetResolutionUnits() sets the resolution units of the magick wand. +It should be used in conjunction with MagickSetResolution(). +This method works both before and after an image has been read.

    +

    Also see MagickSetImageUnits() which specifies the units which apply to +the image resolution setting after an image has been read.

    +

    The format of the MagickSetResolutionUnits method is:

    +
    +unsigned int MagickSetResolutionUnits( MagickWand *wand, const ResolutionType units );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    units:
    +
    The image units of resolution : Undefinedresolution, +PixelsPerInchResolution, or PixelsPerCentimeterResolution.
    +
    +
    +
    +
    +

    MagickSetResourceLimit

    +
    +

    Synopsis

    +
    +unsigned int MagickSetResourceLimit( const ResourceType type, const unsigned long *limit );
    +
    +
    +
    +

    Description

    +

    MagickSetResourceLimit() sets the limit for a particular resource in +megabytes.

    +

    The format of the MagickSetResourceLimit method is:

    +
    +unsigned int MagickSetResourceLimit( const ResourceType type, const unsigned long *limit );
    +
    +
    +
    type:
    +
    The type of resource: DiskResource, FileResource, MapResource, +MemoryResource, PixelsResource, ThreadsResource, WidthResource, +HeightResource.
    +
    +

    o The maximum limit for the resource.

    +
    +
    +
    +

    MagickSetSamplingFactors

    +
    +

    Synopsis

    +
    +unsigned int MagickSetSamplingFactors( MagickWand *wand, const unsigned long number_factors,
    +                                       const double *sampling_factors );
    +
    +
    +
    +

    Description

    +

    MagickSetSamplingFactors() sets the image sampling factors.

    +

    The format of the MagickSetSamplingFactors method is:

    +
    +unsigned int MagickSetSamplingFactors( MagickWand *wand, const unsigned long number_factors,
    +                                       const double *sampling_factors );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    number_factoes:
    +
    The number of factors.
    +
    sampling_factors:
    +
    An array of doubles representing the sampling factor +for each color component (in RGB order).
    +
    +
    +
    +
    +

    MagickSetSize

    +
    +

    Synopsis

    +
    +unsigned int MagickSetSize( MagickWand *wand, const unsigned long columns,
    +                            const unsigned long rows );
    +
    +
    +
    +

    Description

    +

    MagickSetSize() sets the size of the magick wand. Set it before you +read a raw image format such as RGB, GRAY, or CMYK.

    +

    The format of the MagickSetSize method is:

    +
    +unsigned int MagickSetSize( MagickWand *wand, const unsigned long columns,
    +                            const unsigned long rows );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    columns:
    +
    The width in pixels.
    +
    height:
    +
    The height in pixels.
    +
    +
    +
    +
    +

    MagickSetImageWhitePoint

    +
    +

    Synopsis

    +
    +unsigned int MagickSetImageWhitePoint( MagickWand *wand, const double x, const double y );
    +
    +
    +
    +

    Description

    +

    MagickSetImageWhitePoint() sets the image chromaticity white point.

    +

    The format of the MagickSetImageWhitePoint method is:

    +
    +unsigned int MagickSetImageWhitePoint( MagickWand *wand, const double x, const double y );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    x:
    +
    The white x-point.
    +
    y:
    +
    The white y-point.
    +
    +
    +
    +
    +

    MagickSetPassphrase

    +
    +

    Synopsis

    +
    +unsigned int MagickSetPassphrase( MagickWand *wand, const char *passphrase );
    +
    +
    +
    +

    Description

    +

    MagickSetPassphrase() sets the passphrase.

    +

    The format of the MagickSetPassphrase method is:

    +
    +unsigned int MagickSetPassphrase( MagickWand *wand, const char *passphrase );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    passphrase:
    +
    The passphrase.
    +
    +
    +
    +
    +

    MagickSharpenImage

    +
    +

    Synopsis

    +
    +unsigned int MagickSharpenImage( MagickWand *wand, const double radius, const double sigma );
    +
    +
    +
    +

    Description

    +

    MagickSharpenImage() sharpens 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 SharpenImage() selects a suitable radius for you.

    +

    The format of the MagickSharpenImage method is:

    +
    +unsigned int MagickSharpenImage( MagickWand *wand, const double radius, const double sigma );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    +
    +
    +
    +

    MagickShaveImage

    +
    +

    Synopsis

    +
    +unsigned int MagickShaveImage( MagickWand *wand, const unsigned long columns,
    +                               const unsigned long rows );
    +
    +
    +
    +

    Description

    +

    MagickShaveImage() shaves pixels from the image edges. It allocates the +memory necessary for the new Image structure and returns a pointer to the +new image.

    +

    The format of the MagickShaveImage method is:

    +
    +unsigned int MagickShaveImage( MagickWand *wand, const unsigned long columns,
    +                               const unsigned long rows );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    columns:
    +
    The number of columns in the scaled image.
    +
    rows:
    +
    The number of rows in the scaled image.
    +
    +
    +
    +
    +

    MagickShearImage

    +
    +

    Synopsis

    +
    +unsigned int MagickShearImage( MagickWand *wand, const PixelWand *background,
    +                               const double x_shear, onst double y_shear );
    +
    +
    +
    +

    Description

    +

    MagickShearImage() slides one edge of an image along the X or Y axis, +creating a parallelogram. An X direction shear slides an edge along the X +axis, while a Y direction shear slides an edge along the Y axis. The amount +of the shear is controlled by a shear angle. For X direction shears, x_shear +is measured relative to the Y axis, and similarly, for Y direction shears +y_shear is measured relative to the X axis. Empty triangles left over from +shearing the image are filled with the background color.

    +

    The format of the MagickShearImage method is:

    +
    +unsigned int MagickShearImage( MagickWand *wand, const PixelWand *background,
    +                               const double x_shear, onst double y_shear );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    background:
    +
    The background pixel wand.
    +
    x_shear:
    +
    The number of degrees to shear the image.
    +
    y_shear:
    +
    The number of degrees to shear the image.
    +
    +
    +
    +
    +

    MagickSolarizeImage

    +
    +

    Synopsis

    +
    +unsigned int MagickSolarizeImage( MagickWand *wand, const double threshold );
    +
    +
    +
    +

    Description

    +

    MagickSolarizeImage() applies a special effect to the image, similar to the +effect achieved in a photo darkroom by selectively exposing areas of photo +sensitive paper to light. Threshold ranges from 0 to MaxRGB and is a +measure of the extent of the solarization.

    +

    The format of the MagickSolarizeImage method is:

    +
    +unsigned int MagickSolarizeImage( MagickWand *wand, const double threshold );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    threshold:
    +
    Define the extent of the solarization.
    +
    +
    +
    +
    +

    MagickSpreadImage

    +
    +

    Synopsis

    +
    +unsigned int MagickSpreadImage( MagickWand *wand, const double radius );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the MagickSpreadImage method is:

    +
    +unsigned int MagickSpreadImage( MagickWand *wand, const double radius );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    radius:
    +
    Choose a random pixel in a neighborhood of this extent.
    +
    +
    +
    +
    +

    MagickSteganoImage

    +
    +

    Synopsis

    +
    +MagickWand *MagickSteganoImage( MagickWand *wand, const MagickWand *watermark_wand,
    +                                const long offset );
    +
    +
    +
    +

    Description

    +

    Use MagickSteganoImage() to hide a digital watermark within the image. +Recover the hidden watermark later to prove that the authenticity of +an image. Offset defines the start position within the image to hide +the watermark.

    +

    The format of the MagickSteganoImage method is:

    +
    +MagickWand *MagickSteganoImage( MagickWand *wand, const MagickWand *watermark_wand,
    +                                const long offset );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    watermark_wand:
    +
    The watermark wand.
    +
    offset:
    +
    Start hiding at this offset into the image.
    +
    +
    +
    +
    +

    MagickStereoImage

    +
    +

    Synopsis

    +
    +MagickWand *MagickStereoImage( MagickWand *wand, const MagickWand *offset_wand );
    +
    +
    +
    +

    Description

    +

    MagickStereoImage() composites two images and produces a single image that +is the composite of a left and right image of a stereo pair

    +

    The format of the MagickStereoImage method is:

    +
    +MagickWand *MagickStereoImage( MagickWand *wand, const MagickWand *offset_wand );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    offset_wand:
    +
    Another image wand.
    +
    +
    +
    +
    +

    MagickStripImage

    +
    +

    Synopsis

    +
    +unsigned int MagickStripImage( MagickWand *wand );
    +
    +
    +
    +

    Description

    +

    MagickStripImage() removes all profiles and text attributes from the image.

    +

    The format of the MagickStripImage method is:

    +
    +unsigned int MagickStripImage( MagickWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    +
    +
    +
    +

    MagickSwirlImage

    +
    +

    Synopsis

    +
    +unsigned int MagickSwirlImage( MagickWand *wand, const double degrees );
    +
    +
    +
    +

    Description

    +

    MagickSwirlImage() swirls the pixels about the center of the image, where +degrees indicates the sweep of the arc through which each pixel is moved. +You get a more dramatic effect as the degrees move from 1 to 360.

    +

    The format of the MagickSwirlImage method is:

    +
    +unsigned int MagickSwirlImage( MagickWand *wand, const double degrees );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    degrees:
    +
    Define the tightness of the swirling effect.
    +
    +
    +
    +
    +

    MagickTextureImage

    +
    +

    Synopsis

    +
    +MagickWand *MagickTextureImage( MagickWand *wand, const MagickWand *texture_wand );
    +
    +
    +
    +

    Description

    +

    MagickTextureImage() repeatedly tiles the texture image across and down the +image canvas.

    +

    The format of the MagickTextureImage method is:

    +
    +MagickWand *MagickTextureImage( MagickWand *wand, const MagickWand *texture_wand );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    texture_wand:
    +
    The texture wand
    +
    +
    +
    +
    +

    MagickThresholdImage

    +
    +

    Synopsis

    +
    +unsigned int MagickThresholdImage( MagickWand *wand, const double threshold );
    +
    +
    +
    +

    Description

    +

    MagickThresholdImage() changes the value of individual pixels based on +the intensity of each pixel compared to threshold. The result is a +high-contrast, two color image.

    +

    The format of the MagickThresholdImage method is:

    +
    +unsigned int MagickThresholdImage( MagickWand *wand, const double threshold );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    threshold:
    +
    Define the threshold value.
    +
    +
    +
    +
    +

    MagickThresholdImageChannel

    +
    +

    Synopsis

    +
    +unsigned int MagickThresholdImageChannel( MagickWand *wand, const ChannelType channel,
    +                                          const double threshold );
    +
    +
    +
    +

    Description

    +

    MagickThresholdImageChannel() changes the value of individual pixel +component based on the intensity of each pixel compared to threshold. The +result is a high-contrast, two color image.

    +

    The format of the MagickThresholdImage method is:

    +
    +unsigned int MagickThresholdImageChannel( MagickWand *wand, const ChannelType channel,
    +                                          const double threshold );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    channel:
    +
    The channel.
    +
    threshold:
    +
    Define the threshold value.
    +
    +
    +
    +
    +

    MagickTintImage

    +
    +

    Synopsis

    +
    +unsigned int MagickTintImage( MagickWand *wand, const PixelWand *tint,
    +                              const PixelWand *opacity );
    +
    +
    +
    +

    Description

    +

    MagickTintImage() applies a color vector to each pixel in the image. The +length of the vector is 0 for black and white and at its maximum for the +midtones. The vector weighting function is +f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).

    +

    The format of the MagickTintImage method is:

    +
    +unsigned int MagickTintImage( MagickWand *wand, const PixelWand *tint,
    +                              const PixelWand *opacity );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    tint:
    +
    The tint pixel wand.
    +
    opacity:
    +
    The opacity pixel wand.
    +
    +
    +
    +
    +

    MagickTransformImage

    +
    +

    Synopsis

    +
    +MagickWand *MagickTransformImage( MagickWand *wand, const char *crop,
    +                                  const char *geometry );
    +
    +
    +
    +

    Description

    +

    MagickTransformImage() is a convenience method that behaves like +MagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping +information as a region geometry specification. If the operation fails, the +original image handle is returned.

    +

    The format of the MagickTransformImage method is:

    +
    +MagickWand *MagickTransformImage( MagickWand *wand, const char *crop,
    +                                  const char *geometry );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    crop:
    +
    A crop geometry string. This geometry defines a subregion of the +image to crop.
    +
    geometry:
    +
    An image geometry string. This geometry defines the final +size of the image.
    +
    +
    +
    +
    +

    MagickTransparentImage

    +
    +

    Synopsis

    +
    +unsigned int MagickTransparentImage( MagickWand *wand, const PixelWand *target,
    +                                     const unsigned int opacity, const double fuzz );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the MagickTransparentImage method is:

    +
    +unsigned int MagickTransparentImage( MagickWand *wand, const PixelWand *target,
    +                                     const unsigned int opacity, const double fuzz );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    target:
    +
    Change this target color to specified opacity value within +the image.
    +
    opacity:
    +
    The replacement opacity value.
    +
    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.
    +
    +
    +
    +
    +

    MagickTrimImage

    +
    +

    Synopsis

    +
    +unsigned int MagickTrimImage( MagickWand *wand, const double fuzz );
    +
    +
    +
    +

    Description

    +

    MagickTrimImage() remove edges that are the background color from the image.

    +

    The format of the MagickTrimImage method is:

    +
    +unsigned int MagickTrimImage( MagickWand *wand, const double fuzz );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick 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.
    +
    +
    +
    +
    +

    MagickUnsharpMaskImage

    +
    +

    Synopsis

    +
    +unsigned int MagickUnsharpMaskImage( MagickWand *wand, const double radius, const double sigma,
    +                                     const double amount, const double threshold );
    +
    +
    +
    +

    Description

    +

    MagickUnsharpMaskImage() sharpens an 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 UnsharpMaskImage() selects a suitable radius for you.

    +

    The format of the MagickUnsharpMaskImage method is:

    +
    +unsigned int MagickUnsharpMaskImage( MagickWand *wand, const double radius, const double sigma,
    +                                     const double amount, const double threshold );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    radius:
    +
    The radius of the Gaussian, in pixels, not counting the center +pixel.
    +
    sigma:
    +
    The standard deviation of the Gaussian, in pixels.
    +
    amount:
    +
    The percentage of the difference between the original and the +blur image that is added back into the original.
    +
    threshold:
    +
    The threshold in pixels needed to apply the diffence amount.
    +
    +
    +
    +
    +

    MagickWaveImage

    +
    +

    Synopsis

    +
    +unsigned int MagickWaveImage( MagickWand *wand, const double amplitude,
    +                              const double wave_length );
    +
    +
    +
    +

    Description

    +

    MagickWaveImage() creates a "ripple" effect in the image by shifting +the pixels vertically along a sine wave whose amplitude and wavelength +is specified by the given parameters.

    +

    The format of the MagickWaveImage method is:

    +
    +unsigned int MagickWaveImage( MagickWand *wand, const double amplitude,
    +                              const double wave_length );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    amplitude, wave_length:
    +
    Define the amplitude and wave length of the +sine wave.
    +
    +
    +
    +
    +

    MagickWhiteThresholdImage

    +
    +

    Synopsis

    +
    +unsigned int MagickWhiteThresholdImage( MagickWand *wand, const PixelWand *threshold );
    +
    +
    +
    +

    Description

    +

    MagickWhiteThresholdImage() is like ThresholdImage() but forces all pixels +above the threshold into white while leaving all pixels below the threshold +unchanged.

    +

    The format of the MagickWhiteThresholdImage method is:

    +
    +unsigned int MagickWhiteThresholdImage( MagickWand *wand, const PixelWand *threshold );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    threshold:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    MagickWriteImage

    +
    +

    Synopsis

    +
    +unsigned int MagickWriteImage( MagickWand *wand, const char *filename );
    +
    +
    +
    +

    Description

    +

    MagickWriteImage() writes an image.

    +

    The format of the MagickWriteImage method is:

    +
    +unsigned int MagickWriteImage( MagickWand *wand, const char *filename );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    filename:
    +
    The image filename.
    +
    +
    +
    +
    +

    MagickWriteImagesFile

    +
    +

    Synopsis

    +
    +unsigned int MagickWriteImagesFile( MagickWand *wand, FILE *file, const unsigned int adjoin );
    +
    +
    +
    +

    Description

    +

    MagickWriteImagesFile() writes an image or image sequence to a stdio +FILE handle. This may be used to append an encoded image to an already +existing appended image sequence if the file seek position is at the end +of an existing file.

    +

    The format of the MagickWriteImages method is:

    +
    +unsigned int MagickWriteImagesFile( MagickWand *wand, FILE *file, const unsigned int adjoin );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    file:
    +
    The open (and positioned) file handle.
    +
    adjoin:
    +
    join images into a single multi-image file.
    +
    +
    +
    +
    +

    MagickWriteImageBlob

    +
    +

    Synopsis

    +
    +unsigned char *MagickWriteImageBlob( MagickWand *wand, size_t *length );
    +
    +
    +
    +

    Description

    +

    MagickWriteImageBlob() implements direct to memory image formats. It +returns the image as a blob (a formatted "file" in memory) and its +length, starting from the current position in the image sequence. +Use MagickSetImageFormat() to set the format to write to the blob +(GIF, JPEG, PNG, etc.).

    +

    Use MagickResetIterator() on the wand if it is desired to write +a sequence from the beginning and the iterator is not currently +at the beginning.

    +

    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.
    +
    +
    +
    +
    +

    MagickWriteImageFile

    +
    +

    Synopsis

    +
    +unsigned int MagickWriteImageFile( MagickWand *wand, FILE *file );
    +
    +
    +
    +

    Description

    +

    MagickWriteImageFile() writes an image to an open file descriptor.

    +

    The format of the MagickWandToFile method is:

    +
    +unsigned int MagickWriteImageFile( MagickWand *wand, FILE *file );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The magick wand.
    +
    file:
    +
    The file descriptor.
    +
    +
    +
    +
    +

    MagickWriteImages

    +
    +

    Synopsis

    +
    +unsigned int MagickWriteImages( MagickWand *wand, const char *filename,
    +                                const unsigned int adjoin );
    +
    +
    +
    +

    Description

    +

    MagickWriteImages() writes an image or image sequence. If the wand +represents an image sequence, then it is written starting at the first +frame in the sequence.

    +

    The format of the MagickWriteImages method is:

    +
    +unsigned int MagickWriteImages( MagickWand *wand, const char *filename,
    +                                const unsigned int adjoin );
    +
    +
    +
    wand:
    +
    The magick wand.
    +
    filename:
    +
    The image filename.
    +
    adjoin:
    +
    join images into a single multi-image file.
    +
    +
    +
    +
    +

    NewMagickWand

    +
    +

    Synopsis

    +
    +MagickWand NewMagickWand( void );
    +
    +
    +
    +

    Description

    +

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

    +

    The format of the NewMagickWand method is:

    +
    +MagickWand NewMagickWand( void );
    +
    +
    +
    +
    + + diff --git a/www/wand/pixel_wand.html b/www/wand/pixel_wand.html index ae59544..6cd065e 100644 --- a/www/wand/pixel_wand.html +++ b/www/wand/pixel_wand.html @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -1083,5 +1083,10 @@ unsigned int PixelSetYellowQuantum( PixelWand *wand, const +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    +
    diff --git a/www/wand/pixel_wand.html.orig b/www/wand/pixel_wand.html.orig new file mode 100644 index 0000000..05ae709 --- /dev/null +++ b/www/wand/pixel_wand.html.orig @@ -0,0 +1,1087 @@ + + + + + + +pixel_wand + + + + + + + +
    +

    pixel_wand

    +

    Wand pixel access interfaces

    + + +
    +

    ClonePixelWand

    +
    +

    Synopsis

    +
    +PixelWand *ClonePixelWand( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    ClonePixelWand() creates an exact copy of a PixelWand. PixelWand may not be +a null pointer.

    +

    The format of the ClonePixelWand method is:

    +
    +PixelWand *ClonePixelWand( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand to clone.
    +
    +
    +
    +
    +

    ClonePixelWands

    +
    +

    Synopsis

    +
    +PixelWand ** ClonePixelWands( const PixelWand ** wands, const unsigned long number_wands );
    +
    +
    +
    +

    Description

    +

    ClonePixelWands creates a deep-copy an array of PixelWands.

    +

    The format of the ClonePixelWands method is:

    +
    +PixelWand ** ClonePixelWands( const PixelWand ** wands, const unsigned long number_wands );
    +
    +
    +
    wands:
    +
    The pixel wands to clone.
    +
    number_wands:
    +
    The number of wands in the array
    +
    +
    +
    +
    +

    DestroyPixelWand

    +
    +

    Synopsis

    +
    +unsigned int DestroyPixelWand( PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    DestroyPixelWand() deallocates resources associated with a PixelWand.

    +

    The format of the DestroyPixelWand method is:

    +
    +unsigned int DestroyPixelWand( PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    NewPixelWand

    +
    +

    Synopsis

    +
    +PixelWand NewPixelWand( void );
    +
    +
    +
    +

    Description

    +

    NewPixelWand() returns a new pixel wand.

    +

    The format of the NewPixelWand method is:

    +
    +PixelWand NewPixelWand( void );
    +
    +
    +
    +
    +

    NewPixelWands

    +
    +

    Synopsis

    +
    +PixelWand NewPixelWands( const unsigned long number_wands );
    +
    +
    +
    +

    Description

    +

    NewPixelWands() returns an array of pixel wands.

    +

    The format of the NewPixelWand method is:

    +
    +PixelWand NewPixelWands( const unsigned long number_wands );
    +
    +

    A description of each parameter follows:

    +
    +
    number_wands:
    +
    The number of wands.
    +
    +
    +
    +
    +

    PixelGetException

    +
    +

    Synopsis

    +
    +unsigned int PixelGetException( PixelWand *wand, char ** description );
    +
    +
    +
    +

    Description

    +

    PixelGetException() returns the severity, reason, and description of any +error that occurs when using the pixel wand methods.

    +

    The format of the PixelGetException method is:

    +
    +unsigned int PixelGetException( PixelWand *wand, char ** description );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    description:
    +
    A description of the error.
    +
    +
    +
    +
    +

    PixelGetBlack

    +
    +

    Synopsis

    +
    +double PixelGetBlack( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetBlack() returns the normalized black color of the pixel wand.

    +

    The format of the PixelGetBlack method is:

    +
    +double PixelGetBlack( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetBlackQuantum

    +
    +

    Synopsis

    +
    +Quantum PixelGetBlackQuantum( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetBlackQuantum() returns the black color of the pixel wand. The +color is in the range of [0..MaxRGB]

    +

    The format of the PixelGetBlackQuantum method is:

    +
    +Quantum PixelGetBlackQuantum( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetBlue

    +
    +

    Synopsis

    +
    +double PixelGetBlue( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetBlue(const) returns the normalized blue color of the pixel wand.

    +

    The format of the PixelGetBlue method is:

    +
    +double PixelGetBlue( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetBlueQuantum

    +
    +

    Synopsis

    +
    +Quantum PixelGetBlueQuantum( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetBlueQuantum(const ) returns the blue color of the pixel wand. The +color is in the range of [0..MaxRGB]

    +

    The format of the PixelGetBlueQuantum method is:

    +
    +Quantum PixelGetBlueQuantum( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetColorAsString

    +
    +

    Synopsis

    +
    +char *PixelGetColorAsString( PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetColorAsString() gets the color of the pixel wand.

    +

    The format of the PixelGetColorAsString method is:

    +
    +char *PixelGetColorAsString( PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetColorCount

    +
    +

    Synopsis

    +
    +unsigned long PixelGetColorCount( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetColorCount() returns the color count associated with this color.

    +

    The format of the PixelGetColorCount method is:

    +
    +unsigned long PixelGetColorCount( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetCyan

    +
    +

    Synopsis

    +
    +double PixelGetCyan( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetCyan() returns the normalized cyan color of the pixel wand.

    +

    The format of the PixelGetCyan method is:

    +
    +double PixelGetCyan( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetCyanQuantum

    +
    +

    Synopsis

    +
    +Quantum PixelGetCyanQuantum( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetCyanQuantum() returns the cyan color of the pixel wand. The color +is in the range of [0..MaxRGB]

    +

    The format of the PixelGetCyanQuantum method is:

    +
    +Quantum PixelGetCyanQuantum( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetGreen

    +
    +

    Synopsis

    +
    +double PixelGetGreen( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetGreen(const ) returns the normalized green color of the pixel wand.

    +

    The format of the PixelGetGreen method is:

    +
    +double PixelGetGreen( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetGreenQuantum

    +
    +

    Synopsis

    +
    +Quantum PixelGetGreenQuantum( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetGreenQuantum(const ) returns the green color of the pixel wand. The +color is in the range of [0..MaxRGB]

    +

    The format of the PixelGetGreenQuantum method is:

    +
    +Quantum PixelGetGreenQuantum( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetMagenta

    +
    +

    Synopsis

    +
    +double PixelGetMagenta( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetMagenta() returns the normalized magenta color of the pixel wand.

    +

    The format of the PixelGetMagenta method is:

    +
    +double PixelGetMagenta( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetMagentaQuantum

    +
    +

    Synopsis

    +
    +Quantum PixelGetMagentaQuantum( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetMagentaQuantum() returns the magenta color of the pixel wand. The +color is in the range of [0..MaxRGB]

    +

    The format of the PixelGetMagentaQuantum method is:

    +
    +Quantum PixelGetMagentaQuantum( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetOpacity

    +
    +

    Synopsis

    +
    +double PixelGetOpacity( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetOpacity(const ) returns the normalized opacity color of the pixel +wand.

    +

    The format of the PixelGetOpacity method is:

    +
    +double PixelGetOpacity( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetOpacityQuantum

    +
    +

    Synopsis

    +
    +Quantum PixelGetOpacityQuantum( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetOpacityQuantum(const ) returns the opacity color of the pixel wand. +The color is in the range of [0..MaxRGB]

    +

    The format of the PixelGetOpacityQuantum method is:

    +
    +Quantum PixelGetOpacityQuantum( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetRed

    +
    +

    Synopsis

    +
    +double PixelGetRed( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetRed(const ) returns the normalized red color of the pixel wand.

    +

    The format of the PixelGetRed method is:

    +
    +double PixelGetRed( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetRedQuantum

    +
    +

    Synopsis

    +
    +Quantum PixelGetRedQuantum( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetRedQuantum(const ) returns the red color of the pixel wand. The +color is in the range of [0..MaxRGB]

    +

    The format of the PixelGetRedQuantum method is:

    +
    +Quantum PixelGetRedQuantum( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetYellow

    +
    +

    Synopsis

    +
    +double PixelGetYellow( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetYellow() returns the normalized yellow color of the pixel wand.

    +

    The format of the PixelGetYellow method is:

    +
    +double PixelGetYellow( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelGetYellowQuantum

    +
    +

    Synopsis

    +
    +Quantum PixelGetYellowQuantum( const PixelWand *wand );
    +
    +
    +
    +

    Description

    +

    PixelGetYellowQuantum() returns the yellow color of the pixel wand. The +color is in the range of [0..MaxRGB]

    +

    The format of the PixelGetYellowQuantum method is:

    +
    +Quantum PixelGetYellowQuantum( const PixelWand *wand );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    +
    +
    +
    +

    PixelSetBlack

    +
    +

    Synopsis

    +
    +unsigned int PixelSetBlack( PixelWand *wand, const double black );
    +
    +
    +
    +

    Description

    +

    PixelSetBlack() sets the normalized black color of the pixel wand.

    +

    The format of the PixelSetBlack method is:

    +
    +unsigned int PixelSetBlack( PixelWand *wand, const double black );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    black:
    +
    The black color.
    +
    +
    +
    +
    +

    PixelSetBlackQuantum

    +
    +

    Synopsis

    +
    +unsigned int PixelSetBlackQuantum( PixelWand *wand, const Quantum black );
    +
    +
    +
    +

    Description

    +

    PixelSetBlackQuantum() sets the black color of the pixel wand. The color +must be in the range of [0..MaxRGB]

    +

    The format of the PixelSetBlackQuantum method is:

    +
    +unsigned int PixelSetBlackQuantum( PixelWand *wand, const Quantum black );
    +
    +
    +
    wand:
    +
    The pixel wand.
    +
    black:
    +
    The black color.
    +
    +
    +
    +
    +

    PixelSetBlue

    +
    +

    Synopsis

    +
    +unsigned int PixelSetBlue( PixelWand *wand, const double blue );
    +
    +
    +
    +

    Description

    +

    PixelSetBlue() sets the normalized blue color of the pixel wand.

    +

    The format of the PixelSetBlue method is:

    +
    +unsigned int PixelSetBlue( PixelWand *wand, const double blue );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    blue:
    +
    The blue color.
    +
    +
    +
    +
    +

    PixelSetBlueQuantum

    +
    +

    Synopsis

    +
    +unsigned int PixelSetBlueQuantum( PixelWand *wand, const Quantum blue );
    +
    +
    +
    +

    Description

    +

    PixelSetBlueQuantum() sets the blue color of the pixel wand. The color must +be in the range of [0..MaxRGB]

    +

    The format of the PixelSetBlueQuantum method is:

    +
    +unsigned int PixelSetBlueQuantum( PixelWand *wand, const Quantum blue );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    blue:
    +
    The blue color.
    +
    +
    +
    +
    +

    PixelSetColor

    +
    +

    Synopsis

    +
    +unsigned int PixelSetColor( PixelWand *wand, const char *color );
    +
    +
    +
    +

    Description

    +

    PixelSetColor() sets the color of the pixel wand with a string (e.g. +"blue", "#0000ff", "rgb(0,0,255)", etc.).

    +

    The format of the PixelSetColor method is:

    +
    +unsigned int PixelSetColor( PixelWand *wand, const char *color );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    color:
    +
    The pixel wand color.
    +
    +
    +
    +
    +

    PixelSetColorCount

    +
    +

    Synopsis

    +
    +unsigned int PixelSetColorCount( PixelWand *wand, const unsigned long count );
    +
    +
    +
    +

    Description

    +

    PixelSetColorCount() sets the color count of the pixel wand.

    +

    The format of the PixelSetColorCount method is:

    +
    +unsigned int PixelSetColorCount( PixelWand *wand, const unsigned long count );
    +
    +
    +
    wand:
    +
    The pixel wand.
    +
    count:
    +
    The number of this particular color.
    +
    +
    +
    +
    +

    PixelSetCyan

    +
    +

    Synopsis

    +
    +unsigned int PixelSetCyan( PixelWand *wand, const double cyan );
    +
    +
    +
    +

    Description

    +

    PixelSetCyan() sets the normalized cyan color of the pixel wand.

    +

    The format of the PixelSetCyan method is:

    +
    +unsigned int PixelSetCyan( PixelWand *wand, const double cyan );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    cyan:
    +
    The cyan color.
    +
    +
    +
    +
    +

    PixelSetCyanQuantum

    +
    +

    Synopsis

    +
    +unsigned int PixelSetCyanQuantum( PixelWand *wand, const Quantum cyan );
    +
    +
    +
    +

    Description

    +

    PixelSetCyanQuantum() sets the cyan color of the pixel wand. The color must +be in the range of [0..MaxRGB]

    +

    The format of the PixelSetCyanQuantum method is:

    +
    +unsigned int PixelSetCyanQuantum( PixelWand *wand, const Quantum cyan );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    cyan:
    +
    The cyan color.
    +
    +
    +
    +
    +

    PixelSetGreen

    +
    +

    Synopsis

    +
    +unsigned int PixelSetGreen( PixelWand *wand, const double green );
    +
    +
    +
    +

    Description

    +

    PixelSetGreen() sets the normalized green color of the pixel wand.

    +

    The format of the PixelSetGreen method is:

    +
    +unsigned int PixelSetGreen( PixelWand *wand, const double green );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    green:
    +
    The green color.
    +
    +
    +
    +
    +

    PixelSetGreenQuantum

    +
    +

    Synopsis

    +
    +unsigned int PixelSetGreenQuantum( PixelWand *wand, const Quantum green );
    +
    +
    +
    +

    Description

    +

    PixelSetGreenQuantum() sets the green color of the pixel wand. The color must +be in the range of [0..MaxRGB]

    +

    The format of the PixelSetGreenQuantum method is:

    +
    +unsigned int PixelSetGreenQuantum( PixelWand *wand, const Quantum green );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    green:
    +
    The green color.
    +
    +
    +
    +
    +

    PixelSetMagenta

    +
    +

    Synopsis

    +
    +unsigned int PixelSetMagenta( PixelWand *wand, const double magenta );
    +
    +
    +
    +

    Description

    +

    PixelSetMagenta() sets the normalized magenta color of the pixel wand.

    +

    The format of the PixelSetMagenta method is:

    +
    +unsigned int PixelSetMagenta( PixelWand *wand, const double magenta );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    magenta:
    +
    The magenta color.
    +
    +
    +
    +
    +

    PixelSetMagentaQuantum

    +
    +

    Synopsis

    +
    +unsigned int PixelSetMagentaQuantum( PixelWand *wand, const Quantum magenta );
    +
    +
    +
    +

    Description

    +

    PixelSetMagentaQuantum() sets the magenta color of the pixel wand. The +color must be in the range of [0..MaxRGB]

    +

    The format of the PixelSetMagentaQuantum method is:

    +
    +unsigned int PixelSetMagentaQuantum( PixelWand *wand, const Quantum magenta );
    +
    +
    +
    wand:
    +
    The pixel wand.
    +
    magenta:
    +
    The magenta color.
    +
    +
    +
    +
    +

    PixelSetOpacity

    +
    +

    Synopsis

    +
    +unsigned int PixelSetOpacity( PixelWand *wand, const double opacity );
    +
    +
    +
    +

    Description

    +

    PixelSetOpacity() sets the normalized opacity color of the pixel wand.

    +

    The format of the PixelSetOpacity method is:

    +
    +unsigned int PixelSetOpacity( PixelWand *wand, const double opacity );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    opacity:
    +
    The opacity value.
    +
    +
    +
    +
    +

    PixelSetOpacityQuantum

    +
    +

    Synopsis

    +
    +unsigned int PixelSetOpacityQuantum( PixelWand *wand, const Quantum opacity );
    +
    +
    +
    +

    Description

    +

    PixelSetOpacityQuantum() sets the opacity color of the pixel wand. The +color must be in the range of [0..MaxRGB]

    +

    The format of the PixelSetOpacityQuantum method is:

    +
    +unsigned int PixelSetOpacityQuantum( PixelWand *wand, const Quantum opacity );
    +
    +
    +
    wand:
    +
    The pixel wand.
    +
    opacity:
    +
    The opacity value.
    +
    +
    +
    +
    +

    PixelSetQuantumColor

    +
    +

    Synopsis

    +
    +PixelSetQuantumColor( PixelWand *wand, PixelPacket *color );
    +
    +
    +
    +

    Description

    +

    PixelSetQuantumColor() sets the color of the pixel wand.

    +

    The format of the PixelSetQuantumColor method is:

    +
    +PixelSetQuantumColor( PixelWand *wand, PixelPacket *color );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    color:
    +
    The pixel wand color (expressed as a PixelPacket).
    +
    +
    +
    +
    +

    PixelSetRed

    +
    +

    Synopsis

    +
    +unsigned int PixelSetRed( PixelWand *wand, const double red );
    +
    +
    +
    +

    Description

    +

    PixelSetRed() sets the normalized red color of the pixel wand.

    +

    The format of the PixelSetRed method is:

    +
    +unsigned int PixelSetRed( PixelWand *wand, const double red );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    red:
    +
    The red color.
    +
    +
    +
    +
    +

    PixelSetRedQuantum

    +
    +

    Synopsis

    +
    +unsigned int PixelSetRedQuantum( PixelWand *wand, const Quantum red );
    +
    +
    +
    +

    Description

    +

    PixelSetRedQuantum() sets the red color of the pixel wand. The color must +be in the range of [0..MaxRGB]

    +

    The format of the PixelSetRedQuantum method is:

    +
    +unsigned int PixelSetRedQuantum( PixelWand *wand, const Quantum red );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    red:
    +
    The red color.
    +
    +
    +
    +
    +

    PixelSetYellow

    +
    +

    Synopsis

    +
    +unsigned int PixelSetYellow( PixelWand *wand, const double yellow );
    +
    +
    +
    +

    Description

    +

    PixelSetYellow() sets the normalized yellow color of the pixel wand.

    +

    The format of the PixelSetYellow method is:

    +
    +unsigned int PixelSetYellow( PixelWand *wand, const double yellow );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    yellow:
    +
    The yellow color.
    +
    +
    +
    +
    +

    PixelSetYellowQuantum

    +
    +

    Synopsis

    +
    +unsigned int PixelSetYellowQuantum( PixelWand *wand, const Quantum yellow );
    +
    +
    +
    +

    Description

    +

    PixelSetYellowQuantum() sets the yellow color of the pixel wand. The color +must be in the range of [0..MaxRGB]

    +

    The format of the PixelSetYellowQuantum method is:

    +
    +unsigned int PixelSetYellowQuantum( PixelWand *wand, const Quantum yellow );
    +
    +

    A description of each parameter follows:

    +
    +
    wand:
    +
    The pixel wand.
    +
    yellow:
    +
    The yellow color.
    +
    +
    +
    +
    + + diff --git a/www/wand/wand.html b/www/wand/wand.html index 1526a84..5064b37 100644 --- a/www/wand/wand.html +++ b/www/wand/wand.html @@ -3,7 +3,7 @@ - + GraphicsMagick Wand C API @@ -13,23 +13,23 @@ GraphicMagick logo GraphicsMagick
    - - -   + + + 
    @@ -133,8 +133,11 @@ gcc -o demo demo.c -O `GraphicsMagickWand-config --cppflags --ldflags --libs`

    The GraphicsMagickWand-config script reproduces the options which were used to compile the GraphicsMagick wand library. Using compatible options ensures that your program will compile and run.

    -
    -

    Copyright © GraphicsMagick Group 2009 - 2020

    +
    + +
    +
    +

    Copyright © GraphicsMagick Group 2002 - 2020

    diff --git a/www/wand/wand.html.orig b/www/wand/wand.html.orig new file mode 100644 index 0000000..dfa0cd5 --- /dev/null +++ b/www/wand/wand.html.orig @@ -0,0 +1,140 @@ + + + + + + +GraphicsMagick Wand C API + + + + + + + +
    +

    GraphicsMagick Wand C API

    + + + + +

    The GraphicsMagick Wand C library provides a mid-level abstract C +language programming interface for GraphicsMagick. It is originally +based on the Wand API provided in ImageMagick as of August 2003. +After August 2003, ImageMagick changed its license to one unusable by +GraphicsMagick so this version of the Wand library is not completely +in sync with the current ImageMagick version.

    +

    The API is divided into a number of categories. While reading this +documentation, please reference the types documentation as required:

    +
    +
      +
    • Drawing: Wand vector drawing interfaces.
    • +
    • Magick: Wand image processing interfaces
    • +
    • Pixel: Wand pixel access/update interfaces
    • +
    +
    +

    The following is a simple example program which (assuming the program +name is rotate) is executed similar to rotate infile outfile. It +reads from file infile, rotates the image 30 degrees using a black +background, and writes the result to file outfile:

    +
    +#include <stdlib.h>
    +#include <stdio.h>
    +#include <string.h>
    +#include <wand/magick_wand.h>
    +
    +int main(int argc,char **argv)
    +{
    +  MagickWand *magick_wand;
    +  MagickPassFail status = MagickPass;
    +  const char *infile, *outfile;
    +
    +  if (argc != 3)
    +    {
    +      fprintf(stderr,"Usage: %s: infile outfile\n",argv[0]);
    +      return 1;
    +    }
    +
    +  infile=argv[1];
    +  outfile=argv[2];
    +
    +  // Initialize GraphicsMagick API
    +  InitializeMagick(*argv);
    +
    +  // Allocate Wand handle
    +  magick_wand=NewMagickWand();
    +
    +  // Read input image file
    +  if (status == MagickPass)
    +    {
    +      status = MagickReadImage(magick_wand,infile);
    +    }
    +
    +  // Rotate image clockwise 30 degrees with black background
    +  if (status == MagickPass)
    +    {
    +      PixelWand *background;
    +      background=NewPixelWand();
    +      PixelSetColor(background,"#000000");
    +      status = MagickRotateImage(magick_wand,background,30);
    +      DestroyPixelWand(background);
    +    }
    +
    +  // Write output file
    +  if (status == MagickPass)
    +    {
    +      status = MagickWriteImage(magick_wand,outfile);
    +    }
    +
    +  // Diagnose any error
    +  if (status != MagickPass)
    +    {
    +      char *description;
    +      ExceptionType severity;
    +
    +      description=MagickGetException(magick_wand,&severity);
    +      (void) fprintf(stderr,"%.1024s (severity %d)\n",
    +                     description,severity);
    +    }
    +
    +  // Release Wand handle
    +  DestroyMagickWand(magick_wand);
    +
    +  // Destroy GraphicsMagick API
    +  DestroyMagick();
    +
    +  return (status == MagickPass ? 0 : 1);
    +}
    +
    +

    To compile on Unix, the command looks something like this:

    +
    +gcc -o demo demo.c -O `GraphicsMagickWand-config --cppflags --ldflags --libs`
    +
    +

    The GraphicsMagickWand-config script reproduces the options which were used to +compile the GraphicsMagick wand library. Using compatible options ensures that +your program will compile and run.

    +
    +

    Copyright © GraphicsMagick Group 2009 - 2020

    +
    + + diff --git a/www/wand/wand.rst b/www/wand/wand.rst index 906a8c5..dc7e0c3 100644 --- a/www/wand/wand.rst +++ b/www/wand/wand.rst @@ -106,9 +106,3 @@ To compile on Unix, the command looks something like this:: The GraphicsMagickWand-config script reproduces the options which were used to compile the GraphicsMagick wand library. Using compatible options ensures that your program will compile and run. - -------------------------------------------------------------------------------- - -.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN - -Copyright |copy| GraphicsMagick Group 2009 - 2020